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 99cad4fbb59..5be6f63bd44 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 @@ -58,5 +58,10 @@ "No" : "No", "No.Platform.Tags" : "No Platform Tags", "Create.Platform" : "Create Platform", - "Optional": "Optional" + "Optional": "Optional", + "Identifier": "Identifier", + "Next": "Next", + "Platform.Enable": "Enable Platform", + "Share.with.Tenants": "Share between all tenants", + "Platform.Properties": "Platform Properties" } 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 8fd1ebfd71b..32cb3c22b99 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 @@ -121,6 +121,7 @@ body { width: 100%; font-family: "Roboto-Regular" !important; + font-size: 14px !important; background-color: #e8e8e8 !important; } @@ -822,7 +823,29 @@ div.tab button.active { -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.08) !important; } -.platform-content:hover { +.platform-property-container { + padding-top: 20px; + font-family: Roboto-Regular; + font-size: 14px; +} + +.platform-property-row { + align-items: center; +} + +.circle-btn-clear { + background-color: white !important; + color: rgba(0, 0, 0, 0.50) !important; +} + +.circle-btn-clear:hover { + background-color: white !important; + color: rgba(0, 0, 0, 0.38) !important; +} + +.circle-btn-clear:focus { + background-color: white !important; + color: rgba(0, 0, 0, 0.60) !important; } .data-table-row-cell { @@ -849,6 +872,20 @@ div.tab button.active { color: #9e9e9e; } +.circle-btn-add { + background-color: #bababa !important; + border-radius: 50% !important; + height: 30px !important; + width: 30px; + text-align: -webkit-center; + font-size: 18px; + padding: 6px !important; +} + +.circle-btn-add:hover { + background-color: #828282 !important; +} + /** 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. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/helpers/appMgtApiHelpers.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/helpers/appMgtApiHelpers.js index a617b13e7dc..5f694fc7074 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/helpers/appMgtApiHelpers.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/helpers/appMgtApiHelpers.js @@ -57,4 +57,28 @@ export default class Helper { return tmpTags; } + /** + * Generates Platform data object. + * @param general: Platform general information. + * @param config: Platform configurations. + * @param properties: Platform properties. + * + * @return {{platform: *, icon}} data object and the icon image. + * */ + static buildPlatform(general, config, properties) { + let platform = Object.assign({}, general, config, properties); + + let icon = platform.icon[0]; + delete platform.icon; + + platform.tags = Helper.stringifyTags(platform.tags); + + let tempData = { + "platform": platform, + "icon": icon + }; + + return tempData; + } + } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/platformMgtApi.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/platformMgtApi.js index 709343b3d34..17bb32b394e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/platformMgtApi.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/api/platformMgtApi.js @@ -20,6 +20,7 @@ import Axios from 'axios'; import AuthHandler from './authHandler'; import Constants from '../common/constants'; +import Helper from './helpers/appMgtApiHelpers'; /** * Api definitions for Platform management. @@ -27,17 +28,19 @@ import Constants from '../common/constants'; export default class PlatformMgtApi{ /** * Create a new Platform - * @param platformData: The platform data object. + * @param general: Platform general information. + * @param config: Platform configurations. + * @param prop: Platform properties. * */ - static createPlatform(platformData) { - const headers = AuthHandler.createAuthenticationHeaders("application/json"); - Axios.post(Constants.platformManagerEndpoints.CREATE_PLATFORM, platformData, {headers: headers}).then( - function (response) { - console.log(response); - } - ).catch(function (err) { - console.log(err); - }); + static createPlatform(general, config, prop) { + const headers = AuthHandler.createAuthenticationHeaders("multipart/form-data"); + let platform = Helper.buildPlatform(general, config, prop); + + let platformData = new FormData(); + platformData.append("platform", platform.platform); + platformData.append("icon", platform.icon); + + return Axios.post(Constants.platformManagerEndpoints.CREATE_PLATFORM, platformData, {headers: headers}); } /** diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx index 464300be20f..d05fe2f8ae9 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx @@ -95,6 +95,8 @@ class BaseLayout extends Component { return "Applications"; } else if (href.indexOf("platforms") !== -1) { return "Platforms"; + } else { + return ""; } } @@ -163,23 +165,19 @@ class BaseLayout extends Component { : - + : this.getCurrentPageTitle() === "" ?
: + }
-
- - - {this.props.children} - - -
+ + {this.props.children} +
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/Configure.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/Configure.jsx new file mode 100644 index 00000000000..71f89d67a11 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/Configure.jsx @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React, {Component} from 'react'; +import {Button, FormFeedback, FormGroup, Input, Label, ModalBody, ModalFooter} from "reactstrap"; +import {FormattedMessage} from "react-intl"; +import Switch from "../../../UIComponents/Switch/Switch"; +import Chip from "../../../UIComponents/Chip/Chip"; + + +/** + * Enable : switch + * Share between tenants: switch + * Tags: input + * */ +class Configure extends Component { + constructor() { + super(); + this.onCancelClick = this.onCancelClick.bind(this); + this.onBackClick = this.onBackClick.bind(this); + this.setStepData = this.setStepData.bind(this); + this.state = { + defValue: "", + tags: [], + enabled: false, + shared: false, + defaultTenantMapping: true, + errors: {} + } + } + + + /** + * Create a tag on Enter key press and set it to the state. + * Clears the tags text field. + * Chip gets two parameters: Key and value. + * */ + addTags(event) { + let tags = this.state.tags; + if (event.charCode === 13) { + event.preventDefault(); + tags.push({key: Math.floor(Math.random() * 1000), value: event.target.value}); + this.setState({tags, defValue: ""}, console.log(tags)); + } + } + + /** + * Set the value for tag. + * */ + handleTagChange(event) { + let defaultValue = this.state.defValue; + defaultValue = event.target.value; + this.setState({defValue: defaultValue}) + } + + /** + * Handles Chip delete function. + * Removes the tag from state.tags + * */ + handleRequestDelete(key) { + let chipData = this.state.tags; + const chipToDelete = chipData.map((chip) => chip.key).indexOf(key); + chipData.splice(chipToDelete, 1); + this.setState({tags: chipData}); + }; + + onCancelClick() { + this.props.close(); + } + + onBackClick() { + this.props.handlePrev(); + } + + setStepData() { + const {shared, enabled, tags, defaultTenantMapping} = this.state; + + let config = { + shared: shared, + enabled: enabled, + defaultTenantMapping: defaultTenantMapping, + tags: tags + }; + + this.props.setStepData("configure", config); + } + + onEnabledChanged() { + let enabled = this.state.enabled; + this.setState({enabled: !enabled}); + } + + onAllTenantsChanged() { + let allTenants = this.state.allTenants; + this.setState({allTenants: !allTenants}); + } + + render() { + return ( +
+ + +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+ + + +
+ {this.state.tags.map(tag => { + return ( + + ) + } + )} +
+ {this.state.errors.tags} +
+
+ +
+ +
+
+ + +
+
+
+ ) + } + +} + +export default Configure; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/General.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/General.jsx new file mode 100644 index 00000000000..b6895188902 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/General.jsx @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React, {Component} from 'react'; +import {Button, FormFeedback, FormGroup, Input, Label, ModalBody, ModalFooter} from "reactstrap"; +import {FormattedMessage} from "react-intl"; +import * as validator from '../../../../common/validator'; +import Dropzone from "react-dropzone"; + +/** + * Name + * Description + * Identifier + * Icon + * */ +class General extends Component { + constructor() { + super(); + this.onTextFieldChange = this.onTextFieldChange.bind(this); + this.onNextClick = this.onNextClick.bind(this); + this.onCancelClick = this.onCancelClick.bind(this); + this.state = { + name: "", + description: "", + identifier: "", + errors: {}, + icon: [] + } + + } + + onNextClick() { + const {name, description, identifier, icon} = this.state; + + console.log("Next") + + let general = { + name: name, + description: description, + identifier: identifier, + icon: icon + }; + + let {errorCount, errors} = this.validate(); + + if (errorCount !== 0) { + this.setState({errors: errors}); + } else { + this.props.setStepData("general", general); + } + + } + + onCancelClick() { + this.props.close(); + } + + onTextFieldChange(event) { + let field = event.target.name; + let value = event.target.value; + + console.log(field, value) + + switch (field) { + case("platformName") : { + this.setState({name: value}); + break; + } + case("platformDescription") : { + this.setState({description: value}); + break; + } + case("platformId") : { + this.setState({identifier: value}); + break; + } + } + } + + validate() { + + const {name, identifier, description} = this.state; + let errorCount = 0; + let errors = {}; + + if (validator.validateNull(name)) { + errorCount++; + errors.name = "Platform Name is Required!" + } + + if (validator.validateNull(identifier)) { + errorCount++; + errors.identifier = "Platform Identifier is Required!" + } + + if (validator.validateNull(description)) { + errorCount++; + errors.description = "Platform Desciption is Required!" + } + + return {errorCount, errors}; + } + + render() { + return ( +
+ + + + + {this.state.errors.name} + + + + + {this.state.errors.description} + + + + + {this.state.errors.identifier} + + + + (512 X 512 32 bit PNG) +
+ {this.state.icon.map((tile) => ( +
+ +
+ ))} + + {this.state.icon.length === 0 ? + { + this.setState({icon, rejected}); + }} + > + + :
} +
+ {this.state.errors.icon} + + + + + + +
+ ) + } + +} + +export default General; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/Properties.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/Properties.jsx new file mode 100644 index 00000000000..89b0d972f32 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/Properties.jsx @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React, {Component} from 'react'; +import {Button, Col, FormGroup, Input, Label, ModalBody, ModalFooter, Row} from "reactstrap"; +import {FormattedMessage} from "react-intl"; + +/** + * key : value + + * */ +class Properties extends Component { + constructor() { + super(); + this.onCancelClick = this.onCancelClick.bind(this); + this.onBackClick = this.onBackClick.bind(this); + this.submitForm = this.submitForm.bind(this); + this.onAddPropertyClick = this.onAddPropertyClick.bind(this); + this.onKeyFieldChange = this.onKeyFieldChange.bind(this); + this.onValueFieldChange = this.onValueFieldChange.bind(this); + this.onPropertyDelete = this.onPropertyDelete.bind(this); + this.state = { + key: "", + value: "", + properties: [] + } + } + + onCancelClick() { + this.props.close(); + } + + onBackClick() { + this.props.handlePrev(); + } + + submitForm() { + let platformProps = { + "properties": this.state.properties + }; + this.props.onSubmit(platformProps); + } + + onAddPropertyClick() { + let {key, value, properties} = this.state; + let property = { + name: key, + defaultValue: value, + optional: false + }; + + properties.push(property); + + this.setState({property: properties, key: "", value: ""}) + } + + onKeyFieldChange(event) { + this.setState({key: event.target.value}); + } + + onValueFieldChange(event) { + this.setState({value: event.target.value}); + } + + onPropertyDelete(key) { + let properties = this.state.properties; + const propertyToDelete = properties.map((property) => property.name).indexOf(key); + properties.splice(propertyToDelete, 1); + this.setState({properties: properties}); + } + + render() { + return ( +
+ + + + + + + + + + + + + + +
+ {this.state.properties.map( + property => { + return ( + + + {property.name} + + + {property.defaultValue} + + + + + + ) + } + )} +
+
+
+ +
+ +
+
+ + +
+
+
+ ) + } + +} + +export default Properties; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/index.js new file mode 100644 index 00000000000..0aa48c2d6a0 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/CreateSteps/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import Configure from './Configure'; +import General from './General'; +import Properties from './Properties'; + +export {Configure, General, Properties} diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/PlatformCreate.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/PlatformCreate.jsx new file mode 100644 index 00000000000..38e0ecf4cbe --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/Create/PlatformCreate.jsx @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React, {Component} from 'react'; +import {Modal, ModalHeader} from "reactstrap"; +import {FormattedMessage} from "react-intl"; +import Stepper from "../../UIComponents/StepprHeader/Stepper"; +import PlatformMgtApi from "../../../api/platformMgtApi"; +import AuthHandler from "../../../api/authHandler"; +import {General, Configure, Properties} from "./CreateSteps"; + +/** + * Platform view component. + * */ +class PlatformCreate extends Component { + + constructor() { + super(); + this.onClose = this.onClose.bind(this); + this.setStepData = this.setStepData.bind(this); + this.onSubmit = this.onSubmit.bind(this); + this.onPrevClick = this.onPrevClick.bind(this); + this.onNextClick = this.onNextClick.bind(this); + this.state = { + finished: false, + stepIndex: 0, + stepData: [], + general: {}, + configure: {}, + platformProps: {}, + open: false + } + } + + + componentWillReceiveProps(props, nextprops) { + this.setState({open: props.open}) + } + + componentWillMount() { + this.setState({open: this.props.open}); + } + + onClose() { + this.setState({open: false, stepIndex: 0, general: {}, configure: {}, platformProps: {}}) + } + + /** + * Handles next button click event. + * */ + onNextClick() { + // console.log(this.state); //TODO: Remove this + const {stepIndex} = this.state; + + if (stepIndex + 1 > 2) { + console.log(this.state); + this.onSubmit(); + } else { + this.setState({ + stepIndex: stepIndex + 1, + finished: stepIndex + 1 > 1 + }); + } + + + }; + + /** + * Handles form submit. + * platform.identifier = this.state.identifier; + platform.name = this.state.name; + platform.description = this.state.description; + platform.tags = this.state.tags; + platform.properties = this.state.platformProperties; + platform.icon = this.state.icon; + platform.enabled = this.state.enabled; + platform.allTenants = this.state.allTenants; + platform.defaultTenantMapping = true; + + * + * + * */ + onSubmit(platformProps) { + let {general, configure} = this.state; + + console.log(general); + + let platformCreatePromise = PlatformMgtApi.createPlatform(general, configure, platformProps); + platformCreatePromise.then(response => { + console.log(response.data) + } + ).catch( + function (err) { + AuthHandler.unauthorizedErrorHandler(err); + } + ); + }; + + /** + * Saves form data in each step in to the state. + * @param step: The step number of the step data. + * @param data: The form data of the step. + * */ + setStepData(step, data) { + console.log(data); //TODO: Remove this + switch (step) { + case "general": { + this.setState({general: data}, this.onNextClick()); + break; + } + case "configure": { + this.setState({configure: data}, this.onNextClick()); + break; + } + case "platformProps": { + this.setState({platformProps: data}, this.onNextClick()); + break; + } + } + }; + + /** + * Handled [ < Prev ] button click. + * This clears the data in the current step and returns to the previous step. + * */ + onPrevClick() { + console.log(this.state.stepIndex); + const {stepIndex} = this.state; + if (stepIndex > 0) { + this.setState({stepIndex: stepIndex - 1, finished: false}); + } + }; + + + /** + * Defines all the Steps in the stepper. (Wizard) + * + * Extension Point: If any extra steps needed, follow the instructions below. + * 1. Create the required form ./Forms directory. + * 2. Add defined case statements. + * 3. Define the Step in render function. + * + * */ + getStepContent(stepIndex) { + switch (stepIndex) { + case 0: + return ( + + ); + case 1: + return ( + + ); + case 2: + return ( + + ); + default: + return
; + } + } + + + getStepperHeaders() { + return ( + [{index: 1, text: "General"}, + {index: 2, text: "Configure"}, + {index: 3, text: "Properties"}, + ] + ) + } + + render() { + const {stepIndex} = this.state; + return ( +
+ + + + + + {this.getStepContent(stepIndex)} + +
+ ); + } +} + +export default PlatformCreate; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/PlatformCreate.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/PlatformCreate.jsx deleted file mode 100644 index 984cb05d66c..00000000000 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/PlatformCreate.jsx +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import React, {Component} from 'react'; -import {Button, FormGroup, Input, Label, Modal, ModalBody, ModalFooter, ModalHeader} from "reactstrap"; -import {FormattedMessage} from "react-intl"; - -/** - * Platform view component. - * */ -class PlatformCreate extends Component { - - constructor() { - super(); - this.onCancelClick = this.onCancelClick.bind(this); - this.state = { - open: false - } - } - - - componentWillReceiveProps(props, nextprops) { - this.setState({open: props.open}) - } - - componentWillMount() { - this.setState({open: this.props.open}); - } - - onCancelClick() { - this.setState({open: false}) - } - - render() { - return ( -
- - - - - - - - - - - - - - - - - - - -
- ); - } -} - -export default PlatformCreate; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/PlatformListing.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/PlatformListing.jsx index e016f002ad5..516768d03c3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/PlatformListing.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/PlatformListing.jsx @@ -16,11 +16,11 @@ * under the License. */ import React, {Component} from 'react'; -import {Button, Col, Row} from "reactstrap"; +import {Button, Row} from "reactstrap"; import Platform from "./Platform"; import PlatformMgtApi from "../../api/platformMgtApi"; import AuthHandler from "../../api/authHandler"; -import PlatformCreate from "./PlatformCreate"; +import PlatformCreate from "./Create/PlatformCreate"; /** * Platform view component. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/index.js new file mode 100644 index 00000000000..97ce9d7a4a6 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/Platform/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import PlatformCreate from './Create/PlatformCreate'; +import Platform from './Platform'; +import PlatformListing from './PlatformListing'; + +export {PlatformListing, PlatformCreate, Platform}; \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/Chip/chip.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/Chip/chip.css index fcb4a8a5265..84c2ba9ae50 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/Chip/chip.css +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/Chip/chip.css @@ -48,6 +48,7 @@ } .chip-close-btn { + font-size: 16px !important; align-content: center; padding-left: 4px; padding-top: 1px; 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 5ddc1954498..640a44d97e6 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 ( -
+
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/Switch/switch.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/Switch/switch.css index b873104bbd1..67a553afb01 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/Switch/switch.css +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/UIComponents/Switch/switch.css @@ -20,8 +20,9 @@ .switch { position: relative; display: inline-block; - width: 40px; - height: 24px; + width: 36px; + height: 14px; + margin: 0 0 0 10px !important; } /* Hide default HTML checkbox */ @@ -35,7 +36,7 @@ left: 0; right: 0; bottom: 0; - background-color: #ccc; + background-color: #a0a0a0; -webkit-transition: .4s; transition: .4s; } @@ -43,17 +44,17 @@ .slider:before { position: absolute; content: ""; - height: 16px; - width: 16px; - left: 4px; - bottom: 4px; + top: -3px; + height: 20px; + width: 20px; background-color: white; -webkit-transition: .4s; transition: .4s; + box-shadow: rgba(0, 0, 0, 0.117647) 0px 1px 6px, rgba(0, 0, 0, 0.117647) 0px 1px 4px; } input:checked + .slider { - background-color: #2196F3; + background-color: rgba(33, 150, 243, 0.51); } input:focus + .slider { @@ -61,9 +62,10 @@ input:focus + .slider { } input:checked + .slider:before { - -webkit-transform: translateX(16px); - -ms-transform: translateX(16px); - transform: translateX(16px); + -webkit-transform: translateX(20px); + -ms-transform: translateX(20px); + transform: translateX(20px); + background-color: #2196F3; } /* Rounded sliders */ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/index.js index d4731483f44..ac0af319e90 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/index.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/index.js @@ -19,8 +19,7 @@ import Login from './User/Login/Login'; import NotFound from './Error/NotFound'; import BaseLayout from './AppPublisherBase/BaseLayout'; -import PlatformCreate from './Platform/PlatformCreate'; -import PlatformListing from './Platform/PlatformListing'; +import {PlatformCreate, PlatformListing} from './Platform'; import ApplicationCreate from './Application/Create/ApplicationCreate'; import ApplicationListing from './Application/ApplicationListing'; import ApplicationEdit from './Application/Edit/Base/ApplicationEditBaseLayout';