Skip to content

Commit

Permalink
Merge remote-tracking branch 'internal/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
jvallexm committed Feb 23, 2024
2 parents f14544e + fbe9ba9 commit 419af4b
Show file tree
Hide file tree
Showing 46 changed files with 4,043 additions and 1,926 deletions.
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,35 @@

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

## 1.11.2

### Upgrade Notes

- SAP Hana Template now uses RHEL VSI images

### Features

- When attempting to create a resource that requires an SSH Key using the V2 pages, users will now be directed to first create an SSH key instead of viewing the form
- CRAIG deploy script now creates an ICR namespace in the user provided region and resource group
- CRAIG deploy script now generates a unique ICR namespace value if the `-n` flag is not provided to avoid existing namespace conflicts within the selected region

### Fixes

- Fixed an issue causing Power VS Workspace deploy scripts to fail in schematics
- Fixed an issue causing CIDR blocks and IP addresses to be incorrectly marked as invalid
- Fixed an issue causing SSH Keys to incorrectly display as invalid on V2 pages when using the same public key for VPC, Power, or Classic
- Fixed an issue causing invalid VPC VSI images to persist after removing references when importing a project
- Fixed an issue casing TCP and UDP networking rules with no specified port to be rendered incorrectly when using the data view
- Fixed an issue causing some large craig.json files to not be able to generate Terraform files

## 1.11.1

### Upgrade Notes

- CRAIG Terraform no longer uses the depricated field `pi_network_jumbo`. Existing networks with `pi_network_jumbo` selected will be converted to use `pi_network_mtu`.
- CRAIG Terraform no longer uses the depricated field `pi_network_jumbo`. Existing networks with `pi_network_jumbo` selected will be converted to use `pi_network_mtu`
- CRAIG no longer supports variable `validation` block within Terraform. This was causing some issues when importing into schematics
- Default VPC Security Group and Network ACLs now are secure by default and include no networking rules
- Updated the Power VS PoC template and documentation for successful Power VS and on-prem networking

### Features

Expand Down
12 changes: 6 additions & 6 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
@@ -1,6 +1,6 @@
{
"name": "craig",
"version": "1.10.0",
"version": "1.11.2",
"private": true,
"license": "Apache-2.0",
"scripts": {
Expand All @@ -26,7 +26,7 @@
"icse-react-assets": "1.2.37",
"json-to-tf": "^0.3.1",
"jszip": "^3.10.1",
"lazy-z": "^1.11.16",
"lazy-z": "^1.11.17",
"react": "^18.0.0",
"react-chartjs-2": "^5.2.0",
"react-dom": "^18.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ function setupRowsAndHeaders(componentProps) {
? "ALL"
: row.protocol === "icmp"
? row.icmp.code
: contains(["null", null], row[row.protocol].port_min) ||
contains(["null", null], row[row.protocol].port_max)
? "ALL"
: `${row[row.protocol].port_min}-${row[row.protocol].port_max}`;
delete row.icmp;
delete row.tcp;
Expand Down
4 changes: 4 additions & 0 deletions client/src/components/pages/about.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,7 @@ div .center {
#craig-about .cds--accordion__title {
font-size: 1.25rem;
}

.width580 {
width: 580px !important;
}
6 changes: 6 additions & 0 deletions client/src/components/pages/classic/Classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ class ClassicDiagram extends React.Component {
)}
{isNullOrEmptyString(this.state.modalService, true) ? (
<></>
) : this.state.modalService === "classic_gateways" &&
this.props.craig.store.json.classic_ssh_keys.length === 0 ? (
<CraigEmptyResourceTile
noClick
name="Classic SSH keys. To enable creation of this resource, create an SSH key"
/>
) : (
<DynamicForm
className="formInSubForm"
Expand Down
10 changes: 6 additions & 4 deletions client/src/components/pages/diagrams/DeploymentIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ function deploymentIconBoxClassName(props) {
boxClassName += " diagramIconBoxSelected";
}
if (
disableSave(props.itemName, props.item, {
craig: props.craig,
data: props.item,
})
typeof props.isInvalid === "boolean"
? props.isInvalid
: disableSave(props.itemName, props.item, {
craig: props.craig,
data: props.item,
})
) {
boxClassName += " diagramIconBoxInvalid";
} else if (props.itemName === "vpn_gateways") {
Expand Down
15 changes: 11 additions & 4 deletions client/src/components/pages/diagrams/SshKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ export const SshKeys = (props) => {
>
<DeploymentIcon
isSelected={props.isSelected}
isInvalid={disableSave("ssh_keys", sshKey, {
craig: craig,
data: sshKey,
})}
isInvalid={
props.classic
? craig.classic_ssh_keys.public_key.invalid(sshKey, {
data: sshKey,
craig: craig,
})
: disableSave("ssh_keys", sshKey, {
craig: craig,
data: sshKey,
})
}
craig={craig}
itemName="ssh_keys"
itemIndex={sshKeyIndex}
Expand Down
116 changes: 67 additions & 49 deletions client/src/components/pages/power/Power.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import { PowerMap } from "../diagrams/PowerMap";
import { PowerSshKeys } from "./PowerSshKeys";
import { PowerSubnets } from "./PowerSubnets";
import { PowerVolumes } from "./PowerVolumes";
import { NoPowerNetworkTile } from "../../forms/dynamic-form";
import {
CraigEmptyResourceTile,
NoPowerNetworkTile,
} from "../../forms/dynamic-form";
import { PowerVolumeTable } from "./PowerVolumeTable";
import { ScrollFormWrapper } from "../diagrams/ScrollFormWrapper";
import { powerInstanceTf, powerVsVolumeTf } from "../../../lib/json-to-iac";
Expand Down Expand Up @@ -286,6 +289,13 @@ class PowerDiagram extends React.Component {
{isNullOrEmptyString(this.state.modalService, true) ? (
// need to pass html element
<></>
) : craig.store.json.power[this.state.powerIndex]?.ssh_keys
?.length === 0 &&
contains(["vtl", "power_instances"], this.state.modalService) ? (
<CraigEmptyResourceTile
name="Power VS SSH keys. To enable creation of this resource, create an SSH key"
noClick
/>
) : (
<DynamicForm
className="formInSubForm"
Expand Down Expand Up @@ -452,62 +462,70 @@ class PowerDiagram extends React.Component {
</div>
<div className="displayFlex" style={{ width: "100%" }}>
<div id="left-power">
<PowerMap
craig={craig}
onClick={this.onPowerWorkspaceClick}
isSelected={(powerIndex) => {
return (
this.state.selectedItem === "power" &&
this.state.selectedIndex === powerIndex
);
}}
buttons={(powerIndex) => {
return (
<PrimaryButton
noDeleteButton
type="add"
name="Create a Deployment"
onClick={() =>
this.onWorkspaceButtonClick(powerIndex)
}
/>
);
}}
>
<PowerSshKeys
onClick={this.onPowerWorkspaceClick}
craig={craig}
{craig.store.json.power.length === 0 &&
craig.store.json._options.enable_power_vs ? (
<CraigEmptyResourceTile
name="Power VS Workspaces"
className="width580 marginTop1Rem"
/>
<PowerSubnets
) : (
<PowerMap
craig={craig}
onPowerWorkspaceClick={this.onPowerWorkspaceClick}
onPowerInstanceClick={this.onPowerInstanceClick}
onVolumeClick={this.onVolumeClick}
onVtlClick={this.onVtlClick}
isSelected={(props) => {
return (
this.state.selectedIndex === props.index &&
this.state.selectedItem === props.itemName
);
}}
volumeIsSelected={(volumeIndex) => {
onClick={this.onPowerWorkspaceClick}
isSelected={(powerIndex) => {
return (
this.state.selectedItem === "power_volumes" &&
volumeIndex === this.state.selectedIndex
this.state.selectedItem === "power" &&
this.state.selectedIndex === powerIndex
);
}}
/>
<PowerVolumes
craig={craig}
isSelected={(props) => {
buttons={(powerIndex) => {
return (
this.state.selectedIndex === props.index &&
this.state.selectedItem === props.itemName
<PrimaryButton
noDeleteButton
type="add"
name="Create a Deployment"
onClick={() =>
this.onWorkspaceButtonClick(powerIndex)
}
/>
);
}}
onVolumeClick={this.onVolumeClick}
/>
</PowerMap>
>
<PowerSshKeys
onClick={this.onPowerWorkspaceClick}
craig={craig}
/>
<PowerSubnets
craig={craig}
onPowerWorkspaceClick={this.onPowerWorkspaceClick}
onPowerInstanceClick={this.onPowerInstanceClick}
onVolumeClick={this.onVolumeClick}
onVtlClick={this.onVtlClick}
isSelected={(props) => {
return (
this.state.selectedIndex === props.index &&
this.state.selectedItem === props.itemName
);
}}
volumeIsSelected={(volumeIndex) => {
return (
this.state.selectedItem === "power_volumes" &&
volumeIndex === this.state.selectedIndex
);
}}
/>
<PowerVolumes
craig={craig}
isSelected={(props) => {
return (
this.state.selectedIndex === props.index &&
this.state.selectedItem === props.itemName
);
}}
onVolumeClick={this.onVolumeClick}
/>
</PowerMap>
)}
</div>
<div id="right-power">
{this.state.editing === true ? (
Expand Down
4 changes: 4 additions & 0 deletions client/src/components/pages/power/PowerSshKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const PowerSshKeys = (props) => {
icon={Password}
itemName="ssh_keys"
craig={props.craig}
isInvalid={props.craig.power.ssh_keys.public_key.invalid(sshKey, {
data: sshKey,
craig: props.craig,
})}
/>
))}
</div>
Expand Down
14 changes: 10 additions & 4 deletions client/src/components/pages/projects/ProjectFormModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ export class ProjectFormModal extends React.Component {
render() {
let invalidProjectNameVal = invalidProjectName(this.state, this.props);
let invalidDescription = invalidProjectDescription(this.state.description);
let invalidRegion = !this.state.workspace_region;
let invalidSchematicsName = this.state.use_schematics
? invalidNewResourceName(this.state.workspace_name)
: false;
let primaryButtonDisabled =
invalidProjectNameVal || invalidDescription || invalidSchematicsName;
invalidProjectNameVal ||
invalidDescription ||
invalidSchematicsName ||
(invalidRegion && this.state.use_schematics);
let field = {
labelText: "Choose an Initial Project Template",
className: "projectSelectMarginBottom",
Expand Down Expand Up @@ -194,6 +198,7 @@ export class ProjectFormModal extends React.Component {
invalidText={"Invalid Name"}
componentName="workspace"
field="workspace_name"
disabled={this.state.workspace_url !== undefined}
id="workspace-name"
onChange={this.handleTextInput}
value={this.state.workspace_name || ""}
Expand All @@ -208,6 +213,7 @@ export class ProjectFormModal extends React.Component {
onChange={this.handleTextInput}
value={this.state.workspace_resource_group}
placeholder={"default"}
disabled={this.state.workspace_url !== undefined}
optional={true}
tooltip={{
content: `Must correspond to an existing resource group. If not provided, the workspace will be deployed to the "default" resource group in the account.`,
Expand All @@ -225,13 +231,13 @@ export class ProjectFormModal extends React.Component {
labelText: "Workspace Region",
groups: ["us-south", "eu-de", "eu-gb"].sort(azsort),
disabled: (stateData) => {
return false;
return stateData.workspace_url !== undefined;
},
invalid: (stateData) => {
return false;
return !stateData.workspace_region;
},
invalidText: (stateData) => {
return "";
return "Select a region";
},
}}
parentProps={this.props}
Expand Down
Loading

0 comments on commit 419af4b

Please sign in to comment.