diff --git a/.eslintrc b/.eslintrc index 8c66a254..8589fe92 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,7 +1,13 @@ { - "extends": ["airbnb", "plugin:prettier/recommended"], + "extends": [ + "airbnb", + "plugin:prettier/recommended" + ], "parser": "babel-eslint", - "plugins": ["cypress"], + "plugins": [ + "cypress", + "spellcheck" + ], "parserOptions": { "sourceType": "module", "ecmaFeatures": { @@ -21,21 +27,63 @@ "import/resolver": { "alias": { "map": [ - ["@", "./src"], - ["src", "./src"], - ["image", "./src/asset/image"], - ["components", "./src/components"], - ["utils", "./src/utils"], - ["stores", "./src/stores"], - ["pages", "./src/pages"], - ["containers", "./src/containers"], - ["layouts", "./src/layouts"], - ["client", "./src/client"], - ["resources", "./src/resources"], - ["core", "./src/core"], - ["asset", "./src/asset"] + [ + "@", + "./src" + ], + [ + "src", + "./src" + ], + [ + "image", + "./src/asset/image" + ], + [ + "components", + "./src/components" + ], + [ + "utils", + "./src/utils" + ], + [ + "stores", + "./src/stores" + ], + [ + "pages", + "./src/pages" + ], + [ + "containers", + "./src/containers" + ], + [ + "layouts", + "./src/layouts" + ], + [ + "client", + "./src/client" + ], + [ + "resources", + "./src/resources" + ], + [ + "core", + "./src/core" + ], + [ + "asset", + "./src/asset" + ] ], - "extensions": [".js", ".jsx"] + "extensions": [ + ".js", + ".jsx" + ] } } }, @@ -69,7 +117,21 @@ "import/prefer-default-export": "off", "no-nested-ternary": "warn", "import/no-named-as-default": "warn", - "global-require": "off" + "global-require": "off", + "spellcheck/spell-checker": [ + "warn", + { + "comments": true, + "strings": true, + "identifiers": true, + "templates": true, + "lang": "en_US", + "skipWords": [], + "skipIfMatch": [], + "skipWordIfMatch": [], + "minLength": 3 + } + ] }, "globals": { "t": true, @@ -77,4 +139,4 @@ "request": true, "METRICDICT": true } -} +} \ No newline at end of file diff --git a/docs/en/develop/2-catalog-introduction.md b/docs/en/develop/2-catalog-introduction.md index e229222c..c2a60b18 100644 --- a/docs/en/develop/2-catalog-introduction.md +++ b/docs/en/develop/2-catalog-introduction.md @@ -187,7 +187,7 @@ English | [Chinese](../../zh/develop/2-catalog-introduction.md) │ │ │ │ │ ├── Hypervisor (Hypervisor manager) │ │ │ │ │ └── index.jsx │ │ │ │ ├── Image (Image) -│ │ │ │ ├── Instance (Intance) +│ │ │ │ ├── Instance (Instance) │ │ │ │ │ ├── Detail (Detail page) │ │ │ │ │ │ ├── BaseDetail (Base info) │ │ │ │ │ │ ├── SecurityGroup (Security group) @@ -279,7 +279,7 @@ English | [Chinese](../../zh/develop/2-catalog-introduction.md) │ │ ├── identity (Identity management) │ │ │ ├── App.jsx │ │ │ ├── containers -│ │ │ │ ├── Domain (Domian) +│ │ │ │ ├── Domain (Domain) │ │ │ │ ├── Project (Project) │ │ │ │ ├── Role (Role) │ │ │ │ ├── User (User) diff --git a/docs/en/develop/3-10-FormItem-introduction.md b/docs/en/develop/3-10-FormItem-introduction.md index 582f1bcb..0fdbe835 100644 --- a/docs/en/develop/3-10-FormItem-introduction.md +++ b/docs/en/develop/3-10-FormItem-introduction.md @@ -5,7 +5,7 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) - Configuration of each form item in the form - Generally only need to configure a little amount of parameters such as `type` - `Form` component will verify the input value base on `formItem` configuration -- When verify faild, `Form` will not allowed to click `confirm` or `next` +- When verify failed, `Form` will not allowed to click `confirm` or `next` # How to use @@ -199,7 +199,7 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) }; ``` - - Take attach volumn as an example `src/pages/compute/containers/Instance/actions/AttachVolume.jsx` : + - Take attach volume as an example `src/pages/compute/containers/Instance/actions/AttachVolume.jsx` : ```javascript { @@ -392,7 +392,7 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) ![select-table](../../zh/develop/images/form/select-table.png) - - Take create volumn as an example `src/pages/storage/containers/Volume/actions/Create/index.jsx` : + - Take create volume as an example `src/pages/storage/containers/Volume/actions/Create/index.jsx` : - This is a table with tab, default to show the first tab, when switching tab, data source will change - Data is acquired by the front end paging, just directly configure the `data` - Not multi selected @@ -464,8 +464,8 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) - `instance-volume` - Insatnce volume configuration component - - `options`, volumn types options - - `minSize`, volumn size input min + - `options`, volume types options + - `minSize`, volume size input min - Take configure system disk when create instance as an example `src/pages/compute/containers/Instance/actions/StepCreate/BaseStep/index.jsx` : ```javascript @@ -517,8 +517,8 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) - `isFile`, verify name in file format - `isKeypair`, verify name with key-pair support - `isStack`, verify name with stack supported - - `isImage`, verify name with image suppport - - `isInstance`, verify name with instance suppport + - `isImage`, verify name with image support + - `isInstance`, verify name with instance support - Take set name when create instance as an example `src/pages/compute/containers/Instance/actions/StepCreate/SystemStep/index.jsx` : ```javascript @@ -566,7 +566,7 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) - `textarea` - textarea - - Take set description when edit volumn as an example `src/pages/storage/containers/Volume/actions/Edit.jsx` : + - Take set description when edit volume as an example `src/pages/storage/containers/Volume/actions/Edit.jsx` : ```javascript { @@ -602,7 +602,7 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) - `addText`, the text on the right side of add item button component - `addTextTips`, if has `maxCount`, the text will update with count - Take set data disk when create instance as an example `src/pages/compute/containers/Instance/actions/StepCreate/BaseStep/index.jsx` : - - can set unlimit number of data disk + - can set unlimited number of data disk ```javascript { @@ -719,7 +719,7 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) - `min`, min value - `max`, max value - `description`, description under slider - - Take set size when create volumn as an example `src/pages/storage/containers/Volume/actions/Create/index.jsx` : + - Take set size when create volume as an example `src/pages/storage/containers/Volume/actions/Create/index.jsx` : ```javascript { @@ -775,7 +775,7 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) - `check` - checkbox - `content`, words on the right side of the box - - Take whether to force shutodown instancen when resizing instance as an example `src/pages/compute/containers/Instance/actions/Resize.jsx` : + - Take whether to force shutdown instance when resizing instance as an example `src/pages/compute/containers/Instance/actions/Resize.jsx` : ```javascript { @@ -796,7 +796,7 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) - `dataSource`, data source for choose - `showSearch`, whether to show search input - `oriTargetKeys`, default selected - - `disabled`, whether to disable selecte data in left table, default is `false` + - `disabled`, whether to disable select data in left table, default is `false` - Take edit system role as an example `src/pages/identity/containers/User/actions/SystemRole.jsx` : - Left is the project name list - Right is the project name and role list of project @@ -897,7 +897,7 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) - `network-select-table` - network selector - - Display current project network, shared networ, admin network(if is admin) in tabs. + - Display current project network, shared network, admin network(if is admin) in tabs. - Take set network when create port as an example `src/pages/network/containers/VirtualAdapter/actions/Create.jsx` : ```javascript @@ -916,7 +916,7 @@ English | [简体中文](../../zh/develop/3-10-FormItem-introduction.md) - volume selector - Display volumes that can be used or is shared in tabs. - `disabledFunc`, which volume can not be selected - - Take attach volumn as an example `src/pages/compute/containers/Instance/actions/AttachVolume.jsx` : + - Take attach volume as an example `src/pages/compute/containers/Instance/actions/AttachVolume.jsx` : ```javascript { diff --git a/docs/en/develop/3-13-Route-introduction.md b/docs/en/develop/3-13-Route-introduction.md index ca52f31d..87e5cd58 100644 --- a/docs/en/develop/3-13-Route-introduction.md +++ b/docs/en/develop/3-13-Route-introduction.md @@ -26,7 +26,7 @@ English | [简体中文](../../zh/develop/3-13-Route-introduction.md) - `component`, layout components - Pages about `auth`, for example `login`, use `src/layouts/User/index.jsx` - Pages show after login, for example `instance`, use `src/layouts/Base/index.jsx` - - The layout automatically handles the display of the `menu item`, the right side of the content `header`, `breadcrumber`, etc. + - The layout automatically handles the display of the `menu item`, the right side of the content `header`, `breadcrumb`, etc. - `routes`, The main content of the configuration is an array. - Take compute route as an example `src/pages/compute/routes/index.js` : @@ -38,7 +38,7 @@ English | [简体中文](../../zh/develop/3-13-Route-introduction.md) - `component`, the component corresponding to page, such as component under `containers` - For resource-type pages, generally configured - - List page, details page, complex creat page in console platform (simple creation generally uses modal) + - List page, details page, complex create page in console platform (simple creation generally uses modal) - List page, detail page in management platform (with `-admin`/`_admin` in path) - For detail page, we recommend using `id` - Take instance as an example `src/pages/compute/routes/index.js` diff --git a/docs/en/develop/3-14-I18n-introduction.md b/docs/en/develop/3-14-I18n-introduction.md index e193a773..57d7e7cf 100644 --- a/docs/en/develop/3-14-I18n-introduction.md +++ b/docs/en/develop/3-14-I18n-introduction.md @@ -36,7 +36,7 @@ English | [简体中文](../../zh/develop/3-14-I18n-introduction.md) yarn run i18n ``` - - After colleced, `en.json` and `zh.json` will automatically update. + - After collect, `en.json` and `zh.json` will automatically update. - Update Chinese - - After colleced, just update directly in `zh.json`. + - After collect, just update directly in `zh.json`. diff --git a/docs/en/develop/3-7-ModalAction-introduction.md b/docs/en/develop/3-7-ModalAction-introduction.md index d5d3c6a5..f410e766 100644 --- a/docs/en/develop/3-7-ModalAction-introduction.md +++ b/docs/en/develop/3-7-ModalAction-introduction.md @@ -6,7 +6,7 @@ English | [简体中文](../../zh/develop/3-7-ModalAction-introduction.md) - After click the action button, the form modal will display. - After click the `Confirm` button, the `loading` status will be displayed according to the status of request. -- After click the `Cancle` button, the modal form will disappear. +- After click the `Cancel` button, the modal form will disappear. - If the request is sent successfully, a prompt message of successful action will be displayed in the upper right corner, and it will automatically disappear after a few seconds. - If the request fails, an error message will be displayed in the upper right corner of the form page, which can only disappear after clicking the close button. - Support batch action, after selecting multiple items in the table, you can click the action button above the table to perform batch action. @@ -214,7 +214,7 @@ English | [简体中文](../../zh/develop/3-7-ModalAction-introduction.md) - Such as the `required` attribute change of some form items - By default, the change of form item which `type` is `radio` or `more` will automaticly save to `this.state` - Take attach interface to instance as an example `src/pages/compute/containers/Instance/actions/AttachInterface.jsx` : - - After selecte network in the form, the content of the subnet list will be updated + - After select network in the form, the content of the subnet list will be updated - However, after select the subnet in the form, the judgment of the input IP will be updated, etc. ```javascript diff --git a/docs/en/develop/3-8-ConfirmAction-introduction.md b/docs/en/develop/3-8-ConfirmAction-introduction.md index 7a0ced59..7eeef794 100644 --- a/docs/en/develop/3-8-ConfirmAction-introduction.md +++ b/docs/en/develop/3-8-ConfirmAction-introduction.md @@ -6,7 +6,7 @@ English | [简体中文](../../zh/develop/3-8-ConfirmAction-introduction.md) - After click the action button, the confirm modal will display. - After click the `Confirm` button, the `loading` status will be displayed according to the status of request. -- After click the `Cancle` button, the modal form will disappear. +- After click the `Cancel` button, the modal form will disappear. - If the request is sent successfully, a prompt message of successful action will be displayed in the upper right corner, and it will automatically disappear after a few seconds. - If the request fails, an error message will be displayed in the upper right corner of the form page, which can only disappear after clicking the close button. - Support batch action, after selecting multiple items in the table, you can click the action button above the table to perform batch action. diff --git a/docs/en/develop/3-9-StepAction-introduction.md b/docs/en/develop/3-9-StepAction-introduction.md index 11954094..a1d3a46f 100644 --- a/docs/en/develop/3-9-StepAction-introduction.md +++ b/docs/en/develop/3-9-StepAction-introduction.md @@ -8,7 +8,7 @@ English | [简体中文](../../zh/develop/3-9-StepAction-introduction.md) - Has it own route to visit - Generally used to create resources, or form with lots of form items - Support `Next Step`, `Previous Step` action button -- After click the `Cancle` button, will automatically jump to the corresponding resource list page +- After click the `Cancel` button, will automatically jump to the corresponding resource list page - If the request is sent successfully, a prompt message of successful action will be displayed in the upper right corner, and it will automatically disappear after a few seconds. ![FormOneStep](../../zh/develop/images/form/create-success.png) diff --git a/docs/en/test/2-catalog-introduction.md b/docs/en/test/2-catalog-introduction.md index 1cb643c9..6fabac4e 100644 --- a/docs/en/test/2-catalog-introduction.md +++ b/docs/en/test/2-catalog-introduction.md @@ -24,7 +24,7 @@ test │ │ │ ├── keypair.spec.js (keypair) │ │ │ └── server-group.spec.js (server group) │ │ ├── configuration (Platform configuration) -│ │ │ ├── metadata.spec.js (metedata) +│ │ │ ├── metadata.spec.js (metadata) │ │ │ └── system.spec.js (system info) │ │ ├── error.spec.js (error page) │ │ ├── heat (heat) diff --git a/docs/en/test/3-0-how-to-edit-e2e-case.md b/docs/en/test/3-0-how-to-edit-e2e-case.md index 41b15146..2dad6ec0 100644 --- a/docs/en/test/3-0-how-to-edit-e2e-case.md +++ b/docs/en/test/3-0-how-to-edit-e2e-case.md @@ -48,13 +48,13 @@ Generally, when testing the corresponding functions of a resource, follow the fo cy.createRouter({ name: routerName, network: networkName }); ``` - - Create floating ip`cy.createFip`,Used to test associat floating ip + - Create floating ip`cy.createFip`,Used to test associate floating ip ```javascript cy.createFip(); ``` - - Create volumr `cy.createVolume`(Used to test attach volume) + - Create volume `cy.createVolume`(Used to test attach volume) ```javascript cy.createVolume(volumeName); diff --git a/docs/en/test/3-1-E2E-form-operation.md b/docs/en/test/3-1-E2E-form-operation.md index f0c8f1d1..2bca0222 100644 --- a/docs/en/test/3-1-E2E-form-operation.md +++ b/docs/en/test/3-1-E2E-form-operation.md @@ -24,7 +24,7 @@ Because of the consistency of the front-end framework, when we write related use ![click-form-submit](images/e2e/form/click-form-submit.png) - `clickModalActionSubmitButton` - - Click the confirma button in the pop-up form and wait for the request to complete + - Click the confirm button in the pop-up form and wait for the request to complete ![click-modal-submit](images/e2e/form/click-modal-submit.png) @@ -170,7 +170,7 @@ Looking at the structure and style of the elements through the page, I found tha - check `checkbox` in form - Parameter `formItemName`, which is the `name` value of `formItem` in the development code - Parameter `index`, default `0` - - Take instance resize `test/e2e/integration/pages/compute/instance.spec.js` as an enample + - Take instance resize `test/e2e/integration/pages/compute/instance.spec.js` as an example ```javascript it('successfully resize', () => { @@ -248,7 +248,7 @@ Looking at the structure and style of the elements through the page, I found tha ```javascript it('successfully attach volume', () => { - // prepair volume + // prepare volume cy.visitPage(listUrl) .tableSearchText(name) .clickActionInMoreSub('Attach Volume', 'Related Resources') @@ -279,7 +279,7 @@ Looking at the structure and style of the elements through the page, I found tha - Select Volume that status is in used ```javascript - it('successfully create full bakcup', () => { + it('successfully create full backup', () => { cy.clickHeaderButton(1, 5000) .formInput('name', name) .formTableSelectBySearch('volume', volumeName) @@ -397,7 +397,7 @@ Looking at the structure and style of the elements through the page, I found tha - `formAddSelectAdd` - Operations on form item of AddSelect type - Parameter `formItemName`, which is the `name` value of `formItem` in the development code - - Take the Host Aggregates management metedata add custom metadata as an example: `test/e2e/integration/pages/compute/aggregate.spec.js` + - Take the Host Aggregates management metadata add custom metadata as an example: `test/e2e/integration/pages/compute/aggregate.spec.js` ```javascript it('successfully manage metadata', () => { @@ -521,7 +521,7 @@ Looking at the structure and style of the elements through the page, I found tha - Parameter `formItemName`, which is the `name` value of `formItem` in the development code - Parameter `key`, the content of input on the left - Parameter `value`, the content of input on the right - - Take the Host Aggregates management metedata add custom metadata as an example: `test/e2e/integration/pages/compute/aggregate.spec.js` + - Take the Host Aggregates management metadata add custom metadata as an example: `test/e2e/integration/pages/compute/aggregate.spec.js` ```javascript it('successfully manage metadata', () => { @@ -543,7 +543,7 @@ Looking at the structure and style of the elements through the page, I found tha 2. Click the direction button in the middle of the transfer to make the selected content enter the transfer on the right - Parameter `formItemName`, which is the `name` value of `formItem` in the development code - Parameter `index`, the index of the node - - Take the Host Aggregates management metedata add custom metadata as an example: `test/e2e/integration/pages/compute/aggregate.spec.js` + - Take the Host Aggregates management metadata add custom metadata as an example: `test/e2e/integration/pages/compute/aggregate.spec.js` ```javascript it('successfully manage metadata', () => { @@ -560,8 +560,8 @@ Looking at the structure and style of the elements through the page, I found tha ![transfer-left-click](images/e2e/form/transfer-left-click.png) - `formTransferRightCheck` - - Operation of the transfer on the rigth - 1. Select the specified item in the transfer on the rigth + - Operation of the transfer on the right + 1. Select the specified item in the transfer on the right 2. Click the direction button in the middle of the transfer to make the selected content enter the transfer on the left - Parameter `formItemName`, which is the `name` value of `formItem` in the development code - Parameter `index`, the index of the transfer table item diff --git a/docs/en/test/3-2-E2E-table-operation.md b/docs/en/test/3-2-E2E-table-operation.md index 621856de..85fbdc8c 100644 --- a/docs/en/test/3-2-E2E-table-operation.md +++ b/docs/en/test/3-2-E2E-table-operation.md @@ -296,7 +296,7 @@ The buttons above the table generally include: refresh, create, batch operation - Parameter `buttonIndex`, the subscript of the button above the table - Parameter `waitTime`, the waiting time after clicking, the default is 2 seconds - Generally, the subscript of the created button is 1 - - Take the creat key pair as an example: `test/e2e/integration/pages/compute/keypair.spec.js` + - Take the create key pair as an example: `test/e2e/integration/pages/compute/keypair.spec.js` ```javascript it('successfully create', () => { @@ -517,7 +517,7 @@ The buttons above the table generally include: refresh, create, batch operation 2. Click the `Confirm` button, and wait for the request to complete, close the prompt message that the request is successful - Parameter `title`, specify the name of the operation - Parameter `waitTime`, the waiting time after closing the operation prompt successfully - - Take delet VPN IPsec policy `test/e2e/integration/pages/compute/server-group.spec.js` as an example + - Take delete VPN IPsec policy `test/e2e/integration/pages/compute/server-group.spec.js` as an example ```javascript it('successfully delete ipsec policy', () => { diff --git a/docs/en/test/3-4-E2E-resource-operation.md b/docs/en/test/3-4-E2E-resource-operation.md index 392f812d..84fa1e5f 100644 --- a/docs/en/test/3-4-E2E-resource-operation.md +++ b/docs/en/test/3-4-E2E-resource-operation.md @@ -7,13 +7,13 @@ In the E2E process, when creating a resource, it is often necessary to create th - Parameter `name`, the name of the instance - Parameter `networkName`, the network name selected when the instance was created - Take the floating IP associated instance as an example: `test/e2e/integration/pages/network/floatingip.spec.js` - - In order to successfully associate with the instance, the router connected to the subnet where the instance's interfae is located must have a public network gateway turned on + - In order to successfully associate with the instance, the router connected to the subnet where the instance's interface is located must have a public network gateway turned on 1. Create a network `networkName` with subnet 2. Create a router `routerName` with the public network gateway turned on and connected to the network `networkName` subnet - 3. Create a instance `instanceName` with a interfae on the network `networkName` + 3. Create a instance `instanceName` with a interface on the network `networkName` ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createNetwork({ name: networkName }); cy.createRouter({ name: routerName, network: networkName }); cy.createInstance({ name: instanceName, networkName }); @@ -28,7 +28,7 @@ In the E2E process, when creating a resource, it is often necessary to create th - Created a network named `networkName` in preparation for connecting to subnets ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createNetwork({ name: networkName }); }); ``` @@ -40,7 +40,7 @@ In the E2E process, when creating a resource, it is often necessary to create th - Created a policy named `policyName` in preparation for modifying QoS ```javascript - it('successfully prepair resource by admin', () => { + it('successfully prepare resource by admin', () => { cy.loginAdmin().wait(5000).createNetworkPolicy({ name: policyName }); }); ``` @@ -51,13 +51,13 @@ In the E2E process, when creating a resource, it is often necessary to create th - Parameter `network` - If set, the router will connect to the subnet of the `network` network - Take the floating IP associated instance as an example: `test/e2e/integration/pages/network/floatingip.spec.js` - - In order to successfully associate with the instance, the router connected to the subnet where the instance's interfae is located must have a public network gateway turned on + - In order to successfully associate with the instance, the router connected to the subnet where the instance's interface is located must have a public network gateway turned on 1. Create a network `networkName` with subnets 2. Create a router `routerName` with the public network gateway turned on and connected to the network `networkName` subnet - 3. Create a instance `instanceName` with a interfae on the network `networkName` + 3. Create a instance `instanceName` with a interface on the network `networkName` ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createNetwork({ name: networkName }); cy.createRouter({ name: routerName, network: networkName }); cy.createInstance({ name: instanceName, networkName }); @@ -71,7 +71,7 @@ In the E2E process, when creating a resource, it is often necessary to create th - Parameter `name`, the name of the router - Take the floating IP to delete the associated resource as an example: `test/e2e/integration/pages/network/floatingip.spec.js` - - In order to successfully associate with the instance, the router connected to the subnet where the instance's interfae is located must have a public network gateway turned on + - In order to successfully associate with the instance, the router connected to the subnet where the instance's interface is located must have a public network gateway turned on ```javascript it('successfully delete related resources', () => { @@ -109,23 +109,23 @@ In the E2E process, when creating a resource, it is often necessary to create th - To create a volume backup, you need to prepare the volume first ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createVolume(volumeName); cy.createNetwork({ name: networkName }); cy.createInstance({ name: instanceName, networkName }); }); ``` -- `createSecurityGrouop` +- `createSecurityGroup` - Create a security group - Parameter `name`, the name of the security group - Take the virtual adapter card as an example: `test/e2e/integration/pages/network/virtual-adapter.spec.js` -To test management security group, you need to prepare the security group first ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createFip(); - cy.createSecurityGrouop({ name: securityGroupName }); + cy.createSecurityGroup({ name: securityGroupName }); cy.createNetwork({ name: networkName }); cy.createRouter({ name: routerName, network: networkName }); cy.createInstance({ name: instanceName, networkName }); @@ -138,7 +138,7 @@ In the E2E process, when creating a resource, it is often necessary to create th - Test associate floating IP, you need to prepare reachable floating IP ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createNetwork({ name: networkName }); cy.createRouter({ name: routerName, network: networkName }); cy.createFip(); @@ -153,7 +153,7 @@ In the E2E process, when creating a resource, it is often necessary to create th - To test management user group, you need to prepare the user group ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createUser({ name: username }); cy.createUserGroup({ name: userGroupName }); }); @@ -166,7 +166,7 @@ In the E2E process, when creating a resource, it is often necessary to create th - To test management user, you need to prepare user ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createUser({ name: username }); cy.createUserGroup({ name: userGroupName }); }); @@ -180,7 +180,7 @@ In the E2E process, when creating a resource, it is often necessary to create th - To test management project permission, need to prepare project ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createProject({ name: projectName }); cy.createProject({ name: projectName2 }); cy.createUserGroup({ name: userGroupName }); @@ -194,7 +194,7 @@ In the E2E process, when creating a resource, it is often necessary to create th - Create a ironic, image need to be able to create a ironic ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createNetwork({ name: networkName }); cy.createRouter({ name: routerName, network: networkName }); cy.createFip(); @@ -232,7 +232,7 @@ In the E2E process, when creating a resource, it is often necessary to create th - Delete qualified resources - Parameter `resourceName`, resource name - ```javacript + ```javascript export default { // compute instance: instanceListUrl, diff --git a/docs/zh/test/3-1-E2E-form-operation.md b/docs/zh/test/3-1-E2E-form-operation.md index e69736ec..4e68e95c 100644 --- a/docs/zh/test/3-1-E2E-form-operation.md +++ b/docs/zh/test/3-1-E2E-form-operation.md @@ -248,7 +248,7 @@ ```javascript it('successfully attach volume', () => { - // prepair volume + // prepare volume cy.visitPage(listUrl) .tableSearchText(name) .clickActionInMoreSub('Attach Volume', 'Related Resources') @@ -279,7 +279,7 @@ - 选择状态为使用中的云硬盘 ```javascript - it('successfully create full bakcup', () => { + it('successfully create full backup', () => { cy.clickHeaderButton(1, 5000) .formInput('name', name) .formTableSelectBySearch('volume', volumeName) diff --git a/docs/zh/test/3-4-E2E-resource-operation.md b/docs/zh/test/3-4-E2E-resource-operation.md index da88fc32..9165599b 100644 --- a/docs/zh/test/3-4-E2E-resource-operation.md +++ b/docs/zh/test/3-4-E2E-resource-operation.md @@ -13,7 +13,7 @@ 3. 创建挂载了网络`networkName`上的网卡的云主机`instanceName` ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createNetwork({ name: networkName }); cy.createRouter({ name: routerName, network: networkName }); cy.createInstance({ name: instanceName, networkName }); @@ -28,7 +28,7 @@ - 创建了名称为`networkName`的网络,为连接子网做准备 ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createNetwork({ name: networkName }); }); ``` @@ -40,7 +40,7 @@ - 创建了名称为`policyName`的策略,为修改QoS做准备 ```javascript - it('successfully prepair resource by admin', () => { + it('successfully prepare resource by admin', () => { cy.loginAdmin().wait(5000).createNetworkPolicy({ name: policyName }); }); ``` @@ -57,7 +57,7 @@ 3. 创建挂载了网络`networkName`上的网卡的云主机`instanceName` ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createNetwork({ name: networkName }); cy.createRouter({ name: routerName, network: networkName }); cy.createInstance({ name: instanceName, networkName }); @@ -109,23 +109,23 @@ - 创建云硬盘的备份,需要先准备好云硬盘 ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createVolume(volumeName); cy.createNetwork({ name: networkName }); cy.createInstance({ name: instanceName, networkName }); }); ``` -- `createSecurityGrouop` +- `createSecurityGroup` - 创建安全组 - 参数`name`,安全组的名称 - 以虚拟网卡`test/e2e/integration/pages/network/virtual-adapter.spec.js`为例 - 测试管理安全组,需要先准备好安全组 ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createFip(); - cy.createSecurityGrouop({ name: securityGroupName }); + cy.createSecurityGroup({ name: securityGroupName }); cy.createNetwork({ name: networkName }); cy.createRouter({ name: routerName, network: networkName }); cy.createInstance({ name: instanceName, networkName }); @@ -138,7 +138,7 @@ - 测试绑定浮动IP,需要准备好可达的浮动IP ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createNetwork({ name: networkName }); cy.createRouter({ name: routerName, network: networkName }); cy.createFip(); @@ -153,7 +153,7 @@ - 测试管理用户组操作,需要准备好用户组 ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createUser({ name: username }); cy.createUserGroup({ name: userGroupName }); }); @@ -166,7 +166,7 @@ - 测试管理用户操作,需要准备好用户 ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createUser({ name: username }); cy.createUserGroup({ name: userGroupName }); }); @@ -180,7 +180,7 @@ - 测试管理项目权限,需要准备项目 ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createProject({ name: projectName }); cy.createProject({ name: projectName2 }); cy.createUserGroup({ name: userGroupName }); @@ -194,7 +194,7 @@ - 创建裸机,需要能创建裸机的镜像 ```javascript - it('successfully prepair resource', () => { + it('successfully prepare resource', () => { cy.createNetwork({ name: networkName }); cy.createRouter({ name: routerName, network: networkName }); cy.createFip(); @@ -232,7 +232,7 @@ - 删除符合条件的资源 - 参数`resourceName`,资源名称,支持 - ```javacript + ```javascript export default { // compute instance: instanceListUrl, diff --git a/package.json b/package.json index 5409d816..1167226e 100644 --- a/package.json +++ b/package.json @@ -119,6 +119,7 @@ "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-prettier": "^3.4.0", "eslint-plugin-react": "^7.23.2", + "eslint-plugin-spellcheck": "^0.0.19", "file-loader": "^6.0.0", "grunt": "^1.2.1", "happypack": "^5.0.1", diff --git a/playbooks/devstack/storage/run-e2etests.yaml b/playbooks/devstack/storage/run-e2etests.yaml index f5dbd0b6..1b3f7cd9 100644 --- a/playbooks/devstack/storage/run-e2etests.yaml +++ b/playbooks/devstack/storage/run-e2etests.yaml @@ -14,7 +14,7 @@ config_file="test/e2e/config/local_config.yaml" cp test/e2e/config/config-storage.yaml $config_file sed -i "s#baseUrl.*#baseUrl: https://127.0.0.1:9999#" $config_file - sed -i "s/- cinder::buckup/# - cinder::buckup/" $config_file + sed -i "s/- cinder::backup/# - cinder::backup/" $config_file sed -i "s/- swift/# - swift/" $config_file sed -i "s#username:.*#username: admin#" $config_file sed -i "s#password:.*#password: secretadmin#" $config_file diff --git a/src/asset/image/animnbus.png b/src/asset/image/animbus.png similarity index 100% rename from src/asset/image/animnbus.png rename to src/asset/image/animbus.png diff --git a/src/client/client/base.js b/src/client/client/base.js index 49eddcf2..1a26d882 100644 --- a/src/client/client/base.js +++ b/src/client/client/base.js @@ -246,7 +246,7 @@ export default class BaseClient { generateSubSonResource = ( resourceName, subResourceName, - subSubResonseName, + subSubResourceName, responseKey ) => ({ list: (id, subId, params, ...args) => @@ -254,7 +254,7 @@ export default class BaseClient { this.getSubSubResourceListUrl( resourceName, subResourceName, - subSubResonseName, + subSubResourceName, id, subId ), @@ -266,7 +266,7 @@ export default class BaseClient { this.getSubSubResourceDetailUrl( resourceName, subResourceName, - subSubResonseName, + subSubResourceName, id, subId, subSubId @@ -279,7 +279,7 @@ export default class BaseClient { this.getSubSubResourceListUrl( resourceName, subResourceName, - subSubResonseName, + subSubResourceName, id, subId ), @@ -291,7 +291,7 @@ export default class BaseClient { this.getSubSubResourceDetailUrl( resourceName, subResourceName, - subSubResonseName, + subSubResourceName, id, subId, subSubId @@ -304,7 +304,7 @@ export default class BaseClient { this.getSubSubResourceDetailUrl( resourceName, subResourceName, - subSubResonseName, + subSubResourceName, id, subId, subSubId @@ -317,7 +317,7 @@ export default class BaseClient { this.getSubSubResourceDetailUrl( resourceName, subResourceName, - subSubResonseName, + subSubResourceName, id, subId, subSubId @@ -329,7 +329,7 @@ export default class BaseClient { this.getSubSubResourceDetailUrl( resourceName, subResourceName, - subSubResonseName, + subSubResourceName, id, subId, subSubId diff --git a/src/client/client/request.js b/src/client/client/request.js index f4780aca..41647d1b 100644 --- a/src/client/client/request.js +++ b/src/client/client/request.js @@ -28,9 +28,9 @@ export class HttpRequest { this.request = {}; } - gotoLoginPage(path) { + goToLoginPage(path) { const globalRootStore = require('stores/root').default; - globalRootStore.gotoLoginPage(path); + globalRootStore.goToLoginPage(path); } /** @@ -102,7 +102,7 @@ export class HttpRequest { if (status === 401) { const currentPath = window.location.pathname; if (currentPath.indexOf('login') < 0) { - this.gotoLoginPage(currentPath); + this.goToLoginPage(currentPath); } } } diff --git a/src/client/swift/index.js b/src/client/swift/index.js index 7342bd04..dd5519a8 100644 --- a/src/client/swift/index.js +++ b/src/client/swift/index.js @@ -89,8 +89,8 @@ class SwiftClient extends Base { }, { key: 'copy', - generate: (fromContaier, fromName, toContainer, toName) => { - const url = `${fromContaier}/${fromName}`; + generate: (fromContainer, fromName, toContainer, toName) => { + const url = `${fromContainer}/${fromName}`; const headers = { Destination: this.getEncodeUrl(`${toContainer}/${toName}`), }; diff --git a/src/components/Form/index.jsx b/src/components/Form/index.jsx index 7c9aede7..87aa1aa8 100644 --- a/src/components/Form/index.jsx +++ b/src/components/Form/index.jsx @@ -269,7 +269,7 @@ export default class BaseForm extends React.Component { // eslint-disable-next-line no-unused-vars onSubmit = (values) => Promise.resolve(); - updateSumbitting = (value) => { + updateSubmitting = (value) => { this.setState({ isSubmitting: value || false, }); @@ -282,14 +282,14 @@ export default class BaseForm extends React.Component { if (this.codeError) { return; } - this.updateSumbitting(true); + this.updateSubmitting(true); if (!this.onSubmit) { return callback(true, false); } const submitData = this.getSubmitData(values); return this.onSubmit(submitData, containerProps).then( (response) => { - this.updateSumbitting(false); + this.updateSubmitting(false); !this.isModal && this.routing.push(this.listUrl); this.response = response; if (callback && isFunction(callback)) { @@ -330,7 +330,7 @@ export default class BaseForm extends React.Component { } }, (err = {}) => { - this.updateSumbitting(false); + this.updateSubmitting(false); this.responseError = err; const { response: { data } = {} } = err; this.showNotice && Notify.errorWithDetail(data, this.errorText); diff --git a/src/components/FormItem/AddSelect/index.jsx b/src/components/FormItem/AddSelect/index.jsx index 87bd083c..e9cc5d7e 100644 --- a/src/components/FormItem/AddSelect/index.jsx +++ b/src/components/FormItem/AddSelect/index.jsx @@ -93,15 +93,15 @@ export default class index extends Component { this.updateItems([...items, newItem]); }; - updateItems = (newIems) => { + updateItems = (newItems) => { this.setState( { - items: newIems, + items: newItems, }, () => { const { onChange } = this.props; if (onChange) { - onChange(newIems); + onChange(newItems); } } ); diff --git a/src/components/FormItem/IPDistributer/IPAddress.jsx b/src/components/FormItem/IPDistributor/IPAddress.jsx similarity index 100% rename from src/components/FormItem/IPDistributer/IPAddress.jsx rename to src/components/FormItem/IPDistributor/IPAddress.jsx diff --git a/src/components/FormItem/IPDistributer/Item.jsx b/src/components/FormItem/IPDistributor/Item.jsx similarity index 97% rename from src/components/FormItem/IPDistributer/Item.jsx rename to src/components/FormItem/IPDistributor/Item.jsx index 7249c7f6..20c7d850 100644 --- a/src/components/FormItem/IPDistributer/Item.jsx +++ b/src/components/FormItem/IPDistributor/Item.jsx @@ -14,7 +14,7 @@ import React, { useState } from 'react'; import { Col, Row, Select } from 'antd'; -import IPAddress from 'components/FormItem/IPDistributer/IPAddress'; +import IPAddress from 'components/FormItem/IPDistributor/IPAddress'; const Item = ({ subnetsAvailable, onChange, value }) => { value = value || { diff --git a/src/components/FormItem/IPDistributer/index.jsx b/src/components/FormItem/IPDistributor/index.jsx similarity index 95% rename from src/components/FormItem/IPDistributer/index.jsx rename to src/components/FormItem/IPDistributor/index.jsx index 9e688f1a..dd69680a 100644 --- a/src/components/FormItem/IPDistributer/index.jsx +++ b/src/components/FormItem/IPDistributor/index.jsx @@ -15,12 +15,12 @@ import React from 'react'; import { Form, Button, Row, Col } from 'antd'; import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'; -import Item from 'components/FormItem/IPDistributer/Item'; +import Item from 'components/FormItem/IPDistributor/Item'; import { ipValidate } from 'utils/validate'; const { isIPv4, isIpv6 } = ipValidate; -const IPDistributer = ({ componentProps, formItemProps }) => { +const IPDistributor = ({ componentProps, formItemProps }) => { const { subnets, maxNumber = 10, formRef } = componentProps; const { name, value = [], onChange } = formItemProps; const subnetsAvailable = subnets @@ -116,6 +116,6 @@ const IPDistributer = ({ componentProps, formItemProps }) => { ); }; -IPDistributer.isFormItem = true; +IPDistributor.isFormItem = true; -export default IPDistributer; +export default IPDistributor; diff --git a/src/components/FormItem/InstanceVolume/index.jsx b/src/components/FormItem/InstanceVolume/index.jsx index 4c52d6d3..382df453 100644 --- a/src/components/FormItem/InstanceVolume/index.jsx +++ b/src/components/FormItem/InstanceVolume/index.jsx @@ -67,7 +67,7 @@ export default class InstanceVolume extends React.Component { if (!type) { this.setState( { - errorMsg: t('Pleasse select a type!'), + errorMsg: t('Please select a type!'), validateStatus: 'error', }, callback diff --git a/src/components/FormItem/InternationalPhoneNumberInput/index.jsx b/src/components/FormItem/InternationalPhoneNumberInput/index.jsx index 26e9c71c..55f74877 100644 --- a/src/components/FormItem/InternationalPhoneNumberInput/index.jsx +++ b/src/components/FormItem/InternationalPhoneNumberInput/index.jsx @@ -3,7 +3,7 @@ import { Input, Select } from 'antd'; import { defaultCountries } from './countries'; -export default function InternationPhoneNumberInput({ +export default function InternationalPhoneNumberInput({ value, options, onChange, @@ -57,7 +57,7 @@ export default function InternationPhoneNumberInput({ ); } -InternationPhoneNumberInput.defaultProps = { +InternationalPhoneNumberInput.defaultProps = { value: '+86 ', options: defaultCountries, }; diff --git a/src/components/FormItem/IpInput/index.jsx b/src/components/FormItem/IpInput/index.jsx index 97f35ede..56850406 100644 --- a/src/components/FormItem/IpInput/index.jsx +++ b/src/components/FormItem/IpInput/index.jsx @@ -147,7 +147,7 @@ export default class index extends Component { } // eslint-disable-next-line no-shadow const inputs = value.map((it, index) => ( -