This repository has been archived by the owner on Dec 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: front end and back end cidr update changes (#269)
* feat: front end and back end cidr update changes * fix: removing unnecessary code * doc: changing dropdown placeholder * feat: "Add My IP" for CIDR update implemented * doc: adding comment for future users of component * fix: cidr was updated to empty list while prov * feat: changes per code review * feat: added unit tests * fix: code cleanup * feat: avoid swallowing exceptions * feat: adding validation checks and unit tests cidr * feat: adding json schema validation and tests * feat: changes per code review * feat: added unit tests for envSc authz * fix: lint fixes * feat: error message on the UI for no SG - cidr * feat: adding empty ingress array test * feat: validating against additional props - cidr
- Loading branch information
Showing
25 changed files
with
2,144 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
addons/addon-base-raas-ui/packages/base-raas-ui/src/models/forms/CreateCidrFormModel.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file 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 { createFormSeparatedFormat } from '../../helpers/form'; | ||
|
||
const createCidrFormModel = ({ existingValues }) => { | ||
const fields = ['cidr', 'cidr[].fromPort', 'cidr[].toPort', 'cidr[].protocol', 'cidr[].cidrBlocks']; | ||
|
||
const labels = { | ||
'cidr': 'cidr', | ||
'cidr[].fromPort': 'From Port', | ||
'cidr[].toPort': 'To Port', | ||
'cidr[].protocol': 'Protocol', | ||
'cidr[].cidrBlocks': 'Allowed CIDR Blocks', | ||
}; | ||
|
||
const placeholders = { | ||
'cidr[].cidrBlocks': 'Enter CIDR ranges here', | ||
}; | ||
|
||
const extra = {}; | ||
|
||
const rules = { | ||
'cidr': 'required', | ||
'cidr[].fromPort': 'required|integer', | ||
'cidr[].toPort': 'required|integer', | ||
'cidr[].protocol': 'required', | ||
'cidr[].cidrBlocks': 'array', | ||
}; | ||
|
||
const values = { | ||
cidr: existingValues, | ||
}; | ||
|
||
return createFormSeparatedFormat({ fields, labels, placeholders, extra, rules, values }); | ||
}; | ||
|
||
// eslint-disable-next-line import/prefer-default-export | ||
export { createCidrFormModel }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.