From c750aed454c99a5cd33bd14c42fbe5f073392772 Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Fri, 6 Oct 2017 19:12:10 +0530 Subject: [PATCH 01/14] Added application management apis. --- .../publisher/src/api/applicationMgtApi.js | 13 ++++++++--- .../publisher/src/common/constants.js | 23 +++++++++++++------ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/applicationMgtApi.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/applicationMgtApi.js index 8787f4190a..fa92d21c0d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/applicationMgtApi.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/applicationMgtApi.js @@ -61,8 +61,12 @@ export default class ApplicationMgtApi { /** * Method to handle application release process. * */ - static releaseApplication(appId) { - + static releaseApplication(appId, applicationRelease, file) { + let release = new FormData(); + release.append('applicationRelease', applicationRelease); + release.append('binaryFile', file); + const headers = AuthHandler.createAuthenticationHeaders("multipart/form-data"); + return Axios.post(Constants.appManagerEndpoints.APP_RELEASE + appId, release, {headers: headers}); } /** @@ -73,7 +77,8 @@ export default class ApplicationMgtApi { * URL Pattern : /application/1.0/ * */ static updateLifeCycleState(appId, nextState) { - + const headers = AuthHandler.createAuthenticationHeaders("application/json"); + return Axios.put(Constants.appManagerEndpoints.GET_ALL_APPS + appId + "/lifecycle?state=" + nextState, {headers: headers}); } /** @@ -81,6 +86,8 @@ export default class ApplicationMgtApi { * @param appId: The application uuid. */ static getNextLifeCycleState(appId) { + const headers = AuthHandler.createAuthenticationHeaders("application/json"); + return Axios.get(Constants.appManagerEndpoints.GET_ALL_APPS + appId + "/lifecycle", {headers: headers}); } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/common/constants.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/common/constants.js index 27091a166c..d458ada599 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/common/constants.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/common/constants.js @@ -32,20 +32,29 @@ class Constants { } load() { + let applicationApiContext = '/api/application-mgt/v1.0/applications/1.0.0/'; + let platformApiContext = '/api/application-mgt/v1.0/platforms/1.0.0'; + let apiBaseUrl = 'https://' + Configuration.serverConfig.hostname + ':' + Configuration.serverConfig.apiPort; let httpBaseUrl = 'https://' + Configuration.serverConfig.hostname + ':' + Configuration.serverConfig.httpsPort; this.appManagerEndpoints = { - GET_ALL_APPS: apiBaseUrl + '/api/application-mgt/v1.0/applications/1.0.0/', - CREATE_APP: apiBaseUrl + '/api/application-mgt/v1.0/applications/1.0.0/', - UPLOAD_IMAGE_ARTIFACTS: apiBaseUrl + '/api/application-mgt/v1.0/applications/1.0.0/upload-image-artifacts/', //+appId - GET_IMAGE_ARTIFACTS: apiBaseUrl + '/api/application-mgt/v1.0/applications/1.0.0/image-artifacts/' + GET_ALL_APPS: apiBaseUrl + applicationApiContext, + CREATE_APP: apiBaseUrl + applicationApiContext, + UPLOAD_IMAGE_ARTIFACTS: apiBaseUrl + applicationApiContext + 'upload-image-artifacts/', //+appId + GET_IMAGE_ARTIFACTS: apiBaseUrl + applicationApiContext + 'image-artifacts/', + APP_RELEASE: apiBaseUrl + applicationApiContext + "release/", //+uuid + GET_APP_RELEASE_ARTIFACTS: apiBaseUrl + applicationApiContext + "/release-artifacts/", //+AppId/version + GET_NEXT_LIFECYCLE_STATE: apiBaseUrl + applicationApiContext //+ [uuid]/lifecycle }; this.platformManagerEndpoints = { - CREATE_PLATFORM: apiBaseUrl + '/api/application-mgt/v1.0/platforms/1.0.0', - GET_ENABLED_PLATFORMS: apiBaseUrl + '/api/application-mgt/v1.0/platforms/1.0.0?status=ENABLED', - GET_PLATFORM: apiBaseUrl + '/api/application-mgt/v1.0/platforms/1.0.0/' + CREATE_PLATFORM: apiBaseUrl + platformApiContext, + GET_ENABLED_PLATFORMS: apiBaseUrl + platformApiContext + '?status=ENABLED', + GET_PLATFORM: apiBaseUrl + platformApiContext, //+platformId + GET_PLATFORMS: apiBaseUrl + platformApiContext, + UPDATE_STATUS: apiBaseUrl + platformApiContext + "update-status/", // + platformId + ?status= + EDIT_PLATFORM: apiBaseUrl + platformApiContext //+platformId }; this.userConstants = { From 34b35158fb27c1852ffe4dade00757c4d3d391d3 Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Fri, 6 Oct 2017 19:12:48 +0530 Subject: [PATCH 02/14] Added i18n definition. --- .../src/components/Application/Create/CreateSteps/Step1.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step1.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step1.jsx index 447c32780e..bd7de1e981 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step1.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step1.jsx @@ -254,7 +254,7 @@ class Step1 extends Component { Date: Fri, 6 Oct 2017 19:13:33 +0530 Subject: [PATCH 03/14] Modified application edit url pattern. --- .../src/main/resources/publisher/src/App.jsx | 2 +- .../publisher/src/components/Application/ApplicationListing.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx index 3128bc9d23..4a3d606eff 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/App.jsx @@ -78,7 +78,7 @@ class Base extends Component { {/**/} - + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx index 6ce6d1ad78..fbd74aefa3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx @@ -194,7 +194,7 @@ class ApplicationListing extends Component { } onAppEditClick(uuid) { - this.props.history.push("apps/edit/" + uuid); + this.props.history.push("apps/" + uuid + "/edit"); } closeDrawer() { From ba5c7eb66b7965a5c195567f2dba97cef8e1681e Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Fri, 6 Oct 2017 19:14:09 +0530 Subject: [PATCH 04/14] Added button styling in platform cards. --- .../publisher/src/components/Platform/Platform.jsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Platform.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Platform.jsx index 44479434ae..ad40ff2094 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Platform.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Platform.jsx @@ -58,11 +58,15 @@ class Platform extends Component {
- - : + } + + : } - From b630410698f690c8ecc24930ce4e3a826d114acd Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Sat, 7 Oct 2017 01:31:52 +0530 Subject: [PATCH 07/14] Changed element class names. --- .../public/themes/default/default-theme.css | 9 ++----- .../Application/ApplicationListing.jsx | 16 ++++++----- .../Edit/Base/ApplicationEditBaseLayout.jsx | 27 ++++++++++++++++--- .../components/Platform/PlatformListing.jsx | 2 +- 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/themes/default/default-theme.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/themes/default/default-theme.css index f2594edf9a..5713e6779a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/themes/default/default-theme.css +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/themes/default/default-theme.css @@ -316,10 +316,6 @@ body { background-color: #E64A19; } -#app-main-content { - margin: 0 auto; -} - #sub-title-container { height: 100px; padding: 50px 0 20px 0; @@ -332,10 +328,9 @@ body { } /* Holds the app publisher pages. */ -#application-content { +.publisher-card { height: auto; background-color: white; - width: 100%; box-shadow: 2px 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); padding: 24px; } @@ -368,7 +363,7 @@ body { margin-right: 4px; } -#application-list { +.application-list { transition: margin-right .5s; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx index fbd74aefa3..6effa9b7ea 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx @@ -182,12 +182,11 @@ class ApplicationListing extends Component { onRowClick(uuid) { let selectedApp = this.getSelectedApplication(uuid); let style = { - width: '550px', - marginLeft: '550px' + width: '35%' }; let appListStyle = { - marginRight: '550px', + marginRight: '35%', }; this.setState({drawer: style, appListStyle: appListStyle, application: selectedApp[0]}); @@ -217,15 +216,18 @@ class ApplicationListing extends Component { render() { //TODO: Move this to a data table component. + console.log(this.state.appListStyle); return ( -
+
{this.headers.map(header => { if (header.data_id === "applicationName") { return ( - {header.label}) + {header.label}) } else if (header.data_id === "image") { return ({header.label}) + } else if (header.data_id === "edit") { + return } return ({header.label}) })} @@ -242,13 +244,13 @@ class ApplicationListing extends Component { src={application.icon} /> - {application.name} + {application.name} {application.platform.name} {application.category.name} {application.currentLifecycle.lifecycleState.name} - + - + +
+ + +
); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step2.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step2.jsx index af8017d1bb..382f7f3026 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step2.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step2.jsx @@ -175,16 +175,20 @@ class Step2 extends Component { {this.state.errors.platform} - - - - + +
+ +
+
+ + +
); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step3.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step3.jsx index 74b68eb552..dc6b702875 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step3.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step3.jsx @@ -226,16 +226,20 @@ class Step3 extends Component {
- - - - + +
+ +
+
+ + +
); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step4.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step4.jsx index 392441878d..77bff62b92 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step4.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/Create/CreateSteps/Step4.jsx @@ -151,16 +151,20 @@ class Step4 extends Component {
- - - - + +
+ +
+
+ + +
); From 7ec90258d5a11f3688bec3f4776a01fe6dfce12a Mon Sep 17 00:00:00 2001 From: Menaka Jayawardena Date: Sun, 8 Oct 2017 10:47:20 +0530 Subject: [PATCH 12/14] Modified stepper based on material design specs. --- .../src/components/UIComponents/StepprHeader/Step.jsx | 8 ++++---- .../src/components/UIComponents/StepprHeader/Stepper.jsx | 2 +- .../src/components/UIComponents/StepprHeader/stepper.css | 6 ++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/StepprHeader/Step.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/StepprHeader/Step.jsx index 6ca41e42b9..5ddc195449 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/StepprHeader/Step.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/StepprHeader/Step.jsx @@ -37,7 +37,7 @@ class Step extends Component { let stepIndexContent = index === passed || index < passed ? : index; return ( -
+
@@ -46,14 +46,14 @@ class Step extends Component {
- {text} {!finalStep? : } + {text}
{optional ?
() -
:
} +
:
}
- + {!finalStep ? : }
) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/StepprHeader/Stepper.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/StepprHeader/Stepper.jsx index 75b619907f..aed929eb7d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/StepprHeader/Stepper.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/StepprHeader/Stepper.jsx @@ -26,7 +26,7 @@ class Stepper extends Component { render() { const {stepContent, activeStep, previousStep} = this.props; return ( -
+
{stepContent.map(content => { return ( Date: Sun, 8 Oct 2017 10:54:26 +0530 Subject: [PATCH 13/14] Added key field to data table columns and rows. --- .../Application/ApplicationListing.jsx | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx index 6effa9b7ea..9ec06153c7 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Application/ApplicationListing.jsx @@ -223,34 +223,46 @@ class ApplicationListing extends Component { {this.headers.map(header => { if (header.data_id === "applicationName") { return ( - {header.label}) + {header.label}) } else if (header.data_id === "image") { - return ({header.label}) + return ({header.label}) } else if (header.data_id === "edit") { - return + return } - return ({header.label}) + return ({header.label}) })}
{this.state.searchedApplications.map(application => { return ( - { + { this.onRowClick(application.uuid) }}> - + - {application.name} - {application.platform.name} - {application.category.name} {application.currentLifecycle.lifecycleState.name} + key={Math.random()} + xs="4" + className="data-table-row-cell" + > + {application.name} - + {application.platform.name} + {application.category.name} + + {application.currentLifecycle.lifecycleState.name} + +