Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jvallexm committed Dec 15, 2023
2 parents ce0276c + 8c44cbc commit a7d0044
Show file tree
Hide file tree
Showing 154 changed files with 22,222 additions and 4,544 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

All notable changes to this project will be documented in this file.

## 1.8.0

### Upgrade Notes

- SCC v1 Terraform has been deprecated. SCC v1 resources can still be managed from `/form/securityComplianceCenter`
- Reafactored Routing Tables and Routing Table Routes Form
- OptionsForm has been removed and now is generated using the DynamicForm component
- Power VS Volume Attachments are no longer created in parallel to ensure that each provisions successfully

### Features

- Users can now create FalconStor VTL instances from the page `/form/vtl`
- Users can now set DNS Record Data to be the Primary IPV4 address for a VSI from the DNS Record form
- Users can now create SCC V2 Resources fomr the `/form/sccV2` page
- Users can now enable IP spoofing on the primary network interface for Virtual Servers
- Users can now create additional VPC address prefixes from the VPN Gateways page
- Users can now add VPN Gateway connections from the VPN Gateways page

### Fixes

- Fixed an issue causing Power VS Workspace save to be incorrectly disabled when changing images in that workspace
- Fixed an issue allowing users to add more than 3 subnets to a DNS custom resolver
- Fixed an issue allowing users to create DNS zones with duplicate names
- Fixed an issue causing Access Groups and Access Group Policies to have incorrect references to their parent access groups
- Fixed an issue causing Terraform output for COS authorization credentials to always have the role `Writer` regardless of selection

## 1.7.1

### Upgrade Notes
Expand Down
16 changes: 8 additions & 8 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"carbon-react-code-mirror": "^0.2.0",
"file-saver": "^2.0.5",
"graphql": "15.5.2",
"icse-react-assets": "1.2.36",
"icse-react-assets": "1.2.37",
"json-to-tf": "^0.3.1",
"jszip": "^3.10.1",
"lazy-z": "^1.11.14",
"lazy-z": "^1.11.16",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "^6.3.0",
Expand Down
2 changes: 1 addition & 1 deletion client/src/Craig.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class Craig extends React.Component {
);
},
// project reject callback
() => {
(err) => {
this.setState({ schematicsFailed: true, loadingDone: true });
console.error(err);
}
Expand Down
215 changes: 113 additions & 102 deletions client/src/components/forms/DynamicForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ import {
DynamicFormToggle,
DynamicTextArea,
DynamicMultiSelect,
} from "./dynamic-form/components";
DynamicPublicKey,
SubFormOverrideTile,
PowerInterfaces,
PerCloudConnections,
} from "./dynamic-form";
import { eachKey, isBoolean, contains } from "lazy-z";
import { propsMatchState } from "../../lib";
import {
ClassicDisabledTile,
NoClassicGatewaysTile,
NoDomainsTile,
} from "./dynamic-form/tiles";
import { disableSave, propsMatchState } from "../../lib";
import {
dynamicIcseFormGroupsProps,
dynamicIcseHeadingProps,
dynamicToolTipWrapperProps,
} from "../../lib/forms/dynamic-form-fields";
import { Network_3 } from "@carbon/icons-react";
import { edgeRouterEnabledZones } from "../../lib/constants";
import { DynamicFetchSelect } from "./dynamic-form/components";
import { Button } from "@carbon/react";
import { Rocket } from "@carbon/icons-react";

const doNotRenderFields = [
"heading",
Expand Down Expand Up @@ -55,7 +57,14 @@ class DynamicForm extends React.Component {
!isBoolean(this.state[field]) &&
!contains(doNotRenderFields, field)
)
this.state[field] = group[field].default || "";
// prevent ssh public key from causing propsMatchState to be false
// when use data is true. also prevent router_hostname from rendering as
// empty string when null
this.state[field] = isBoolean(group[field].default)
? group[field].default
: group[field].default === null && field !== "router_hostname"
? null
: group[field].default || "";
});
});

Expand Down Expand Up @@ -154,10 +163,13 @@ class DynamicForm extends React.Component {
) : group.heading ? (
<IcseHeading {...dynamicIcseHeadingProps(group)} />
) : (
<IcseFormGroup {...dynamicIcseFormGroupsProps(this.props, index)}>
<IcseFormGroup
{...dynamicIcseFormGroupsProps(this.props, index, this.state)}
>
{Object.keys(group).map((key, keyIndex) => {
let field = group[key];
return (field.hideWhen && field.hideWhen(this.state)) ||
return (field.hideWhen &&
field.hideWhen(this.state, this.props)) ||
key === "hideWhen" ? (
""
) : (
Expand All @@ -178,6 +190,10 @@ class DynamicForm extends React.Component {
? DynamicTextArea
: field.type === "multiselect"
? DynamicMultiSelect
: field.type === "public-key"
? DynamicPublicKey
: field.type === "fetchSelect"
? DynamicFetchSelect
: DynamicFormTextInput,
{
name: key,
Expand All @@ -199,99 +215,94 @@ class DynamicForm extends React.Component {
</IcseFormGroup>
)
)}
{
// this is less than elegant, as we add more custom components we can
// figure out the best way to render custom components
this.props.formName === "Power Instances" && (
<div className="formInSubForm">
{this.state.network.length === 0
? "No Network Interfaces Selected"
: this.state.network.map((nw, index) => {
return (
<IcseFormGroup
key={nw.name + "-group"}
className="alignItemsCenter marginBottomSmall"
>
<Network_3 className="powerIpMargin" />
<div className="powerIpMargin fieldWidth">
<p>{nw.name}</p>
</div>
<DynamicFormTextInput
name={"ip_address_" + index}
field={this.props.craig.power_instances.ip_address}
parentState={this.state}
parentProps={this.props}
handleInputChange={this.handleInputChange}
index={index}
value={nw.ip_address}
/>
</IcseFormGroup>
);
})}
</div>
)
}
<PowerInterfaces
stateData={this.state}
componentProps={this.props}
handleInputChange={this.handleInputChange}
/>
{this.props.formName === "options" ? (
<Button
disabled={disableSave("options", this.state, this.props)}
className="marginTop"
onClick={() => {
window.location.pathname = "/form/resourceGroups";
}}
>
Begin Customizing <Rocket className="rocketIcon" />
</Button>
) : (
""
)}
{this.props.isModal === true || !this.props.form.subForms
? ""
: this.props.form.subForms.map((subForm) => (
<IcseFormTemplate
key={subForm.name}
overrideTile={
// this is currently messy, we'll need to figure out a better solution
subForm.jsonField === "dns_records" &&
this.props.data.domains.length === 0 ? (
<NoDomainsTile />
) : subForm.jsonField === "gre_tunnels" &&
!this.props.craig.store.json._options.enable_classic ? (
ClassicDisabledTile(true)
) : subForm.jsonField === "gre_tunnels" &&
this.props.craig.store.json.classic_gateways.length ===
0 ? (
<NoClassicGatewaysTile />
) : undefined
}
hideFormTitleButton={
subForm.hideFormTitleButton
? subForm.hideFormTitleButton(this.state, this.props)
: false
}
name={subForm.name}
subHeading
addText={subForm.createText}
arrayData={this.props.data[subForm.jsonField]}
innerForm={DynamicForm}
disableSave={this.props.disableSave}
onDelete={
this.props.craig[this.props.form.jsonField][subForm.jsonField]
.delete
}
onSave={
this.props.craig[this.props.form.jsonField][subForm.jsonField]
.save
}
onSubmit={
this.props.craig[this.props.form.jsonField][subForm.jsonField]
.create
}
propsMatchState={propsMatchState}
innerFormProps={{
formName: subForm.name,
craig: this.props.craig,
form: subForm.form,
disableSave: this.props.disableSave,
arrayParentName: this.props.data.name,
propsMatchState: propsMatchState,
}}
toggleFormFieldName={subForm.toggleFormFieldName}
hideAbout
toggleFormProps={{
hideName: true,
submissionFieldName: subForm.jsonField,
disableSave: this.props.disableSave,
type: "formInSubForm",
}}
/>
))}
: this.props.form.subForms.map((subForm) =>
// prevent template from rendering when edge router
subForm.jsonField === "cloud_connections" &&
contains(edgeRouterEnabledZones, this.state.zone) ? (
<PerCloudConnections />
) : subForm.hideWhen &&
// hide when hidden
subForm.hideWhen(this.state, this.props) ? (
""
) : (
<IcseFormTemplate
key={subForm.name}
tooltip={subForm.tooltip}
overrideTile={
<SubFormOverrideTile
subForm={subForm}
componentProps={this.props}
/>
}
hideFormTitleButton={
subForm.hideFormTitleButton
? subForm.hideFormTitleButton(this.state, this.props)
: false
}
name={subForm.name}
subHeading
addText={subForm.addText}
arrayData={this.props.data[subForm.jsonField]}
innerForm={DynamicForm}
disableSave={this.props.disableSave}
onDelete={
this.props.craig[this.props.form.jsonField][
subForm.jsonField
].delete
}
onSave={
this.props.craig[this.props.form.jsonField][
subForm.jsonField
].save
}
onSubmit={
this.props.craig[this.props.form.jsonField][
subForm.jsonField
].create
}
propsMatchState={propsMatchState}
innerFormProps={{
formName: subForm.name,
craig: this.props.craig,
form: subForm.form,
disableSave: this.props.disableSave,
arrayParentName: this.props.data.name,
propsMatchState: propsMatchState,
}}
toggleFormFieldName={subForm.toggleFormFieldName}
hideAbout
toggleFormProps={{
hideName: true,
submissionFieldName: subForm.jsonField,
disableSave: this.props.disableSave,
type: "formInSubForm",
noDeleteButton: subForm.noDeleteButton,
// here for testing
// hide: false,
}}
/>
)
)}
</div>
);
}
Expand Down
2 changes: 2 additions & 0 deletions client/src/components/forms/ObservabilityForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const ObservabilityForm = (props) => {
}}
craig={props.craig}
innerFormProps={{
craig: props.craig,
data: props.craig.store.json.logdna,
resourceGroups: splat(
props.craig.store.json.resource_groups,
Expand Down Expand Up @@ -73,6 +74,7 @@ const ObservabilityForm = (props) => {
}}
craig={props.craig}
innerFormProps={{
craig: props.craig,
data: props.craig.store.json.sysdig,
resourceGroups: splat(
props.craig.store.json.resource_groups,
Expand Down
Loading

0 comments on commit a7d0044

Please sign in to comment.