Skip to content

Commit bd91ae5

Browse files
authored
Merge pull request #87 from IBM/craig-25
Feat: cluster security groups
2 parents 8dfc044 + 9a43137 commit bd91ae5

File tree

395 files changed

+7269
-6724
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

395 files changed

+7269
-6724
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
## 1.17.0
66

7+
### Upgrade Notes
8+
9+
- CRAIG no longer depends on react-scripts and uses Next JS to build
10+
- Updated VPC Cluster and Worker Pool resource addressess to be more intuitive
11+
712
### Features
813

914
- When using dynamic subnets, CIDR blocks are now calculated to use the fewest total IPs within a VPC
15+
- Security and Compliance Center (SCC) has been removed as the service is no longer supported on IBM Cloud
16+
- Users can now add rules to the automatically created security group for any VPC cluster
1017

1118
## 1.16.5
1219

client/package-lock.json

Lines changed: 84 additions & 159 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

client/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class App extends Component {
3535
nav(path) {
3636
if (this.state.unsaved) {
3737
let response = confirm(
38-
"This page has unsaved changes. Are you sure you want to leave this page?"
38+
"This page has unsaved changes. Are you sure you want to leave this page?",
3939
);
4040
if (response) {
4141
this.setState({ unsaved: false }, () => {

client/src/Craig.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ class Craig extends React.Component {
168168
projectData,
169169
updateNotification(window.location.pathname, message),
170170
noProjectSave,
171-
footerToggle
172-
)
171+
footerToggle,
172+
),
173173
);
174174
}
175175

@@ -237,7 +237,7 @@ class Craig extends React.Component {
237237
projects,
238238
stateData,
239239
componentProps,
240-
Date.now()
240+
Date.now(),
241241
);
242242
}
243243

@@ -284,7 +284,7 @@ class Craig extends React.Component {
284284
() => {
285285
this.setItem("craigProjects", projects);
286286
resolve();
287-
}
287+
},
288288
);
289289
},
290290
// project reject callback
@@ -295,9 +295,9 @@ class Craig extends React.Component {
295295
workspaceAction: "create",
296296
});
297297
console.error(err);
298-
}
298+
},
299299
);
300-
}
300+
},
301301
);
302302
}
303303

@@ -312,7 +312,7 @@ class Craig extends React.Component {
312312
let projects = this.getProject(stateData, componentProps);
313313
this.saveAndSendNotification(
314314
`Successfully saved project ${stateData.name}`,
315-
true
315+
true,
316316
);
317317
window.localStorage.setItem("craigProjects", JSON.stringify(projects));
318318

@@ -324,8 +324,8 @@ class Craig extends React.Component {
324324
stateData,
325325
componentProps,
326326
setCurrentProject,
327-
callback
328-
)
327+
callback,
328+
),
329329
);
330330
}
331331

@@ -354,7 +354,7 @@ class Craig extends React.Component {
354354
stateData,
355355
componentProps,
356356
setCurrentProject,
357-
callback
357+
callback,
358358
);
359359
})
360360
.catch((err) => {
@@ -367,7 +367,7 @@ class Craig extends React.Component {
367367
() => {
368368
console.error(err);
369369
this.onError(`Create failed with error: ${err}`);
370-
}
370+
},
371371
);
372372
});
373373
}
@@ -412,7 +412,7 @@ class Craig extends React.Component {
412412
},
413413
onProjectSelectCallback(projects, this, craig, name, message, () => {
414414
if (callback) callback(invalidItems);
415-
})
415+
}),
416416
);
417417
};
418418

@@ -463,14 +463,14 @@ class Craig extends React.Component {
463463
let powerWorkspace = getObjectFromArray(
464464
craig.store.json.power,
465465
"name",
466-
workspace.name
466+
workspace.name,
467467
);
468468
powerWorkspace.images.forEach((image) => {
469469
if (
470470
!splatContains(
471471
foundImages,
472472
"imageID",
473-
image.imageID || image.pi_image_id
473+
image.imageID || image.pi_image_id,
474474
)
475475
) {
476476
invalidItems.power_images.push({
@@ -498,7 +498,7 @@ class Craig extends React.Component {
498498
!splatContains(
499499
foundImages,
500500
"imageID",
501-
image.imageID || image.pi_image_id
501+
image.imageID || image.pi_image_id,
502502
) &&
503503
!workspace.use_data &&
504504
workspace.zone === zone
@@ -647,7 +647,7 @@ class Craig extends React.Component {
647647
splatContains(
648648
this.state.invalidItems.power_images,
649649
"workspace",
650-
workspace.name
650+
workspace.name,
651651
)
652652
) {
653653
// get a list of image objects for this workspace
@@ -656,7 +656,7 @@ class Craig extends React.Component {
656656
if (image.workspace === workspace.name) {
657657
return image;
658658
}
659-
}
659+
},
660660
);
661661

662662
// set image names to filter out images
@@ -687,7 +687,7 @@ class Craig extends React.Component {
687687
? splatContains(
688688
this.state.invalidItems[item],
689689
"vsi",
690-
resource.name
690+
resource.name,
691691
)
692692
: contains(this.state.invalidItems[item], resource.name)
693693
) {
@@ -783,9 +783,9 @@ class Craig extends React.Component {
783783
this.state.projects[this.state.store.project_name]
784784
.project_name,
785785
"",
786-
this.afterValidation
786+
this.afterValidation,
787787
);
788-
}
788+
},
789789
);
790790
}}
791791
>

client/src/app.scss

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
/* text area font for import json */
5050
.cds--form-item.codeFont div.cds--text-area__wrapper {
5151
width: inherit;
52-
font-family: monospace, monospace; // workaround for some browsers with how they handle monospace
52+
font-family:
53+
monospace, monospace; // workaround for some browsers with how they handle monospace
5354
}
5455

5556
.smallerText {
@@ -820,7 +821,8 @@ div .cds--side-nav__overlay-active {
820821
background-color: rgba(22, 22, 22, 0.5);
821822
background-color: var(--cds-overlay, rgba(22, 22, 22, 0.5));
822823
opacity: 1;
823-
transition: opacity 300ms cubic-bezier(0.5, 0, 0.1, 1),
824+
transition:
825+
opacity 300ms cubic-bezier(0.5, 0, 0.1, 1),
824826
background-color 300ms cubic-bezier(0.5, 0, 0.1, 1);
825827
}
826828

@@ -1203,7 +1205,8 @@ div .sgFormTopMargin {
12031205

12041206
.serviceOpen {
12051207
color: #0f62fe;
1206-
box-shadow: 0 10px 14px 0 rgba(0, 0, 0, 0.24),
1208+
box-shadow:
1209+
0 10px 14px 0 rgba(0, 0, 0, 0.24),
12071210
0 17px 50px 0 rgba(0, 0, 0, 0.19);
12081211
}
12091212

@@ -1215,7 +1218,8 @@ div .sgFormTopMargin {
12151218
/* diagrams */
12161219

12171220
.diagramBoxSelected {
1218-
box-shadow: 0 10px 14px 0 rgba(0, 0, 100, 0.24),
1221+
box-shadow:
1222+
0 10px 14px 0 rgba(0, 0, 100, 0.24),
12191223
0 17px 50px 0 rgba(0, 0, 100, 0.19);
12201224
}
12211225

@@ -1246,7 +1250,8 @@ div .sgFormTopMargin {
12461250

12471251
.diagramIconBoxSelected {
12481252
color: blue;
1249-
text-shadow: 0 10px 14px 0 rgba(0, 0, 100, 0.24),
1253+
text-shadow:
1254+
0 10px 14px 0 rgba(0, 0, 100, 0.24),
12501255
0 17px 50px 0 rgba(0, 0, 100, 0.19);
12511256
}
12521257

@@ -1855,9 +1860,9 @@ li.cds--progress-step > button > div.cds--progress-text {
18551860
body {
18561861
margin: 0;
18571862
padding: 0;
1858-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
1859-
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
1860-
sans-serif;
1863+
font-family:
1864+
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
1865+
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
18611866
-webkit-font-smoothing: antialiased;
18621867
-moz-osx-font-smoothing: grayscale;
18631868
}

client/src/components/forms/CbrForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class CbrForm extends React.Component {
115115
name="Context Based Restrictions"
116116
about={RenderDocs(
117117
"cbr",
118-
this.props.craig.store.json._options.template
118+
this.props.craig.store.json._options.template,
119119
)()}
120120
form={
121121
<div>

client/src/components/forms/CopyRuleForm.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class CopyRuleForm extends React.Component {
6868
if (splatContains(vpc.acls, "name", value)) {
6969
nextState.destinationRuleNames = splat(
7070
getObjectFromArray(vpc.acls, "name", value).rules,
71-
"name"
71+
"name",
7272
);
7373
nextState.destinationRuleVpc = vpc.name;
7474
}
@@ -78,9 +78,9 @@ class CopyRuleForm extends React.Component {
7878
new revision(this.props.craig.store.json).child(
7979
"security_groups",
8080
value,
81-
"name"
81+
"name",
8282
).data.rules,
83-
"name"
83+
"name",
8484
);
8585
}
8686
this.setState(nextState);
@@ -93,7 +93,7 @@ class CopyRuleForm extends React.Component {
9393
getAllRuleNames() {
9494
return this.props.craig.getAllRuleNames(
9595
this.state.ruleSource,
96-
this.props.isAclForm ? this.props.data.name : null
96+
this.props.isAclForm ? this.props.data.name : null,
9797
);
9898
}
9999

@@ -117,7 +117,7 @@ class CopyRuleForm extends React.Component {
117117
return splatContains(
118118
getObjectFromArray(this.props.data.acls, "name", aclName).rules,
119119
"name",
120-
name
120+
name,
121121
)
122122
? "✘"
123123
: "✔";
@@ -131,15 +131,15 @@ class CopyRuleForm extends React.Component {
131131
getObjectFromArray(
132132
this.props.craig.store.json.vpcs,
133133
"name",
134-
this.state.destinationVpc
134+
this.state.destinationVpc,
135135
).acls,
136136
"name",
137-
this.state.source + "-copy"
137+
this.state.source + "-copy",
138138
)
139139
: splatContains(
140140
this.props.craig.store.json.security_groups,
141141
"name",
142-
this.state.source + "-copy"
142+
this.state.source + "-copy",
143143
);
144144
return isDuplicate;
145145
} catch (err) {
@@ -166,12 +166,12 @@ class CopyRuleForm extends React.Component {
166166
this.props.craig.copySgRule(
167167
this.state.ruleSource,
168168
this.state.ruleCopyName,
169-
this.state.ruleDestination
169+
this.state.ruleDestination,
170170
);
171171
} else if (this.props.isAclForm === false) {
172172
this.props.craig.copySecurityGroup(
173173
this.state.source,
174-
this.state.destinationVpc
174+
this.state.destinationVpc,
175175
);
176176
} else if (this.state.modalStyle === "addClusterRules") {
177177
let aclName = this.props.v2
@@ -183,13 +183,13 @@ class CopyRuleForm extends React.Component {
183183
this.props.data.name,
184184
this.state.ruleSource,
185185
this.state.ruleCopyName,
186-
this.state.ruleDestination
186+
this.state.ruleDestination,
187187
);
188188
} else {
189189
this.props.craig.copyNetworkAcl(
190190
this.props.data.name,
191191
this.state.source,
192-
this.state.destinationVpc
192+
this.state.destinationVpc,
193193
);
194194
}
195195
this.setState({
@@ -228,19 +228,19 @@ class CopyRuleForm extends React.Component {
228228
this.state.modalStyle === "copyRule"
229229
? "Copy Rule"
230230
: this.state.modalStyle === "addClusterRules"
231-
? "Add Cluster Rules to ACL"
232-
: this.props.isAclForm
233-
? "Copy Network ACL"
234-
: "Copy Security Group"
231+
? "Add Cluster Rules to ACL"
232+
: this.props.isAclForm
233+
? "Copy Network ACL"
234+
: "Copy Security Group"
235235
}
236236
primaryButtonText={
237237
this.state.modalStyle === "copyRule"
238238
? "Copy Rule"
239239
: this.state.modalStyle === "addClusterRules"
240-
? "Add Cluster Rules"
241-
: this.props.isAclForm
242-
? "Copy Network ACL"
243-
: "Copy Security Group"
240+
? "Add Cluster Rules"
241+
: this.props.isAclForm
242+
? "Copy Network ACL"
243+
: "Copy Security Group"
244244
}
245245
className="leftTextAlign"
246246
secondaryButtonText="Cancel"

0 commit comments

Comments
 (0)