diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/locales/en.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/locales/en.json index 3bc7a828d7..99cad4fbb5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/locales/en.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/public/locales/en.json @@ -57,5 +57,6 @@ "Yes" : "Yes", "No" : "No", "No.Platform.Tags" : "No Platform Tags", - "Create.Platform" : "Create Platform" + "Create.Platform" : "Create Platform", + "Optional": "Optional" } 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..8fd1ebfd71 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,32 +328,13 @@ 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; } -.stepper-header { - width: 100%; - color: #BaBaBa; - padding-bottom: 5px; - margin-bottom: 10px; -} - -#application-tag { - margin: 0 2px 0 2px; - background-color: blue; - height: 20px; -} - -#application-tag:hover { - cursor: pointer; - background-color: #007bff; -} - .platform-link-placeholder { color: #888888; float: right; @@ -368,7 +345,7 @@ body { margin-right: 4px; } -#application-list { +.application-list { transition: margin-right .5s; } @@ -489,14 +466,18 @@ body { #modal-body-content { max-height: 700px; + padding-left: 24px; overflow-y: auto; } -.step-index { - height: 20px; - width: 20px; - background-color: #2196F3; - border-radius: 50%; +.custom-footer { + justify-content: inherit !important; + margin: 0 !important; +} + +.footer-main-btn { + display: flex; + justify-content: flex-end; } #img-btn-screenshot { @@ -504,11 +485,20 @@ body { } #app-create-modal { - max-width: 700px; - overflow-x: auto; + max-width: 850px; border-radius: 0% !important; } +.app-create-modal-header { + background-color: #4353bd; + color: white; + padding: 24px !important; +} + +.app-create-modal-content { + padding: 0 !important; +} + #store { border: none; border-bottom: solid #BDBDBD 1px; @@ -532,7 +522,7 @@ body { float: left; } -#app-release-switch-switch { +#app-release-switch { position: absolute; right: 10px; } @@ -838,3 +828,39 @@ div.tab button.active { .data-table-row-cell { padding-top: 14px; } + +.error-code { + text-align: center; + font-family: Roboto-Medium; + font-weight: 800; + font-size: 15em; + color: #BaBaBa; +} + +.error-code p { + +} + +.error-text { + text-align: center; + font-family: Roboto-Regular; + font-size: 14px; + font-weight: 500; + color: #9e9e9e; +} + +/** + If you need to change the color of active steps in stepper, + uncomment the following and set the background color and font color as needed. +*/ +/* +.stepper-active-index { + background-color: #0a6eff !important; + color: white !important; +} + +.stepper-passed-index { + background-color: #0a6eff !important; + color: green !important; +} +*/ 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/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 = { 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..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 @@ -182,19 +182,18 @@ 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]}); } onAppEditClick(uuid) { - this.props.history.push("apps/edit/" + uuid); + this.props.history.push("apps/" + uuid + "/edit"); } closeDrawer() { @@ -217,38 +216,53 @@ 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}) + return ({header.label}) + } else if (header.data_id === "edit") { + 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} + + +
-
- - - ); 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 f40ca3c630..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 @@ -20,7 +20,7 @@ import PropTypes from 'prop-types'; import React, {Component} from 'react'; import AuthHandler from "../../../../api/authHandler"; import PlatformMgtApi from "../../../../api/platformMgtApi"; -import {Button, FormFeedback, FormGroup, Input, Label, ModalFooter} from 'reactstrap'; +import {Button, FormFeedback, FormGroup, Input, Label, ModalBody, ModalFooter} from 'reactstrap'; import {FormattedMessage} from 'react-intl'; import * as validator from '../../../../common/validator'; @@ -145,43 +145,50 @@ class Step2 extends Component { render() { return (
- - - - - - - - - - - - - {this.state.platforms.length > 0 ? this.state.platforms.map(platform => { - return ( - - ) - }) : } - - {this.state.errors.platform} - - - - - + + + + + + + + + + + + + {this.state.platforms.length > 0 ? this.state.platforms.map(platform => { + return ( + + ) + }) : } + + {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 27c9b6fb1e..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 @@ -20,7 +20,7 @@ import PropTypes from 'prop-types'; import Dropzone from 'react-dropzone'; import React, {Component} from 'react'; import * as validator from '../../../../common/validator'; -import {Button, FormFeedback, FormGroup, Label, ModalFooter} from 'reactstrap'; +import {Button, FormFeedback, FormGroup, Label, ModalBody, ModalFooter} from 'reactstrap'; import AppImage from "../../../UIComponents/AppImage/AppImage"; import {FormattedMessage} from 'react-intl'; @@ -138,102 +138,108 @@ class Step3 extends Component { render() { return (
-
- - - (600 X 800 32 bit PNG) -
- {this.state.screenshots.map((tile) => ( -
- -
- ))} - {this.state.screenshots.length < 3 ? - { - let tmpScreenshots = this.state.screenshots; - tmpScreenshots.push(screenshots); - this.setState({ - screenshots: tmpScreenshots - }); - }} - > - - :
} -
- {this.state.errors.screenshots} - -
-
-
+ +
-