Skip to content

Commit 081ef58

Browse files
authored
Merge pull request #18 from madetech/load-different-files
Use multiple files
2 parents 7ee14dc + c58b855 commit 081ef58

File tree

5 files changed

+99
-7
lines changed

5 files changed

+99
-7
lines changed

src/components/RadarProvider.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
22
import { ChartData } from "../utils/Data";
3+
import { roles } from "../utils/data/roles";
34

45
const RadarContext = React.createContext();
56

@@ -31,16 +32,23 @@ function radarReducer(state, action) {
3132
}
3233

3334
function RadarProvider({ children }) {
34-
const defaultData = ChartData();
35-
36-
const [state, dispatch] = React.useReducer(radarReducer, {
35+
const defaultData = ChartData(roles.madeTech);
36+
const defaultState = {
3737
previousData: {
3838
[defaultData.title]: {
3939
data: defaultData,
4040
},
4141
},
4242
data: defaultData,
43+
};
44+
45+
roles.others.map(ChartData).forEach((roles) => {
46+
defaultState.previousData[roles.title] = {
47+
data: roles,
48+
};
4349
});
50+
51+
const [state, dispatch] = React.useReducer(radarReducer, { ...defaultState });
4452
const value = { state, dispatch };
4553
return (
4654
<RadarContext.Provider value={value}>{children}</RadarContext.Provider>

src/components/SkillsSelector.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const SkillsSelector = () => {
1616
marginBottom: "25px",
1717
}}
1818
>
19-
{console.log({ ...state })}
2019
<Box sx={{ minWidth: 350 }}>
2120
<FormControl fullWidth>
2221
<InputLabel id="json-selector-label">Skills</InputLabel>

src/utils/Data.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import defaultRoles from "./data/TechArchAttributes.json";
2-
31
const defaultTemplate = {
42
label: "Job Title",
53
data: [],
@@ -52,7 +50,7 @@ const parsedRoles = (rolesFromJson) => {
5250
export const calculateNumOfAttributes = (roleData) =>
5351
Object.keys(Object.entries(roleData)[0][1]).length;
5452

55-
export const ChartData = (roles = defaultRoles) => {
53+
export const ChartData = (roles) => {
5654
const datasets = parsedRoles(roles.RoleLevels);
5755

5856
return {

src/utils/data/OneLogin.json

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"title": "1Login",
3+
"RoleData": {
4+
"OAuth/OIDC/DID": {
5+
"Follow": "Follows the team processes, delivering a consistent flow of features to production",
6+
"Apply": "Enforces the team processes, making sure everybody understands the benefits and tradeoffs",
7+
"Contribute": "Contributes as an active participant",
8+
"Define": "Works with stakeholders to define and set strategic direction",
9+
"Inspire": "Inspires others to do all the things"
10+
},
11+
"Multi-tenant systems": {
12+
"Follow": "Follows the team processes, delivering a consistent flow of features to production",
13+
"Apply": "Enforces the team processes, making sure everybody understands the benefits and tradeoffs",
14+
"Contribute": "Contributes as an active participant",
15+
"Define": "Works with stakeholders to define and set strategic direction",
16+
"Inspire": "Inspires others to do all the things"
17+
},
18+
"Object oriented paradigms": {
19+
"Follow": "Follows the team processes, delivering a consistent flow of features to production",
20+
"Apply": "Enforces the team processes, making sure everybody understands the benefits and tradeoffs",
21+
"Contribute": "Contributes as an active participant",
22+
"Define": "Works with stakeholders to define and set strategic direction",
23+
"Inspire": "Inspires others to do all the things"
24+
},
25+
"Modular code": {
26+
"Follow": "Follows the team processes, delivering a consistent flow of features to production",
27+
"Apply": "Enforces the team processes, making sure everybody understands the benefits and tradeoffs",
28+
"Contribute": "Contributes as an active participant",
29+
"Define": "Works with stakeholders to define and set strategic direction",
30+
"Inspire": "Inspires others to do all the things"
31+
},
32+
"AWS & Serverless": {
33+
"Follow": "Follows the team processes, delivering a consistent flow of features to production",
34+
"Apply": "Enforces the team processes, making sure everybody understands the benefits and tradeoffs",
35+
"Contribute": "Contributes as an active participant",
36+
"Define": "Works with stakeholders to define and set strategic direction",
37+
"Inspire": "Inspires others to do all the things"
38+
},
39+
"Secure By Design & CAF": {
40+
"Follow": "Follows the team processes, delivering a consistent flow of features to production",
41+
"Apply": "Enforces the team processes, making sure everybody understands the benefits and tradeoffs",
42+
"Contribute": "Contributes as an active participant",
43+
"Define": "Works with stakeholders to define and set strategic direction",
44+
"Inspire": "Inspires others to do all the things"
45+
},
46+
"Sustainability / Green IT": {
47+
"Follow": "Follows the team processes, delivering a consistent flow of features to production",
48+
"Apply": "Enforces the team processes, making sure everybody understands the benefits and tradeoffs",
49+
"Contribute": "Contributes as an active participant",
50+
"Define": "Works with stakeholders to define and set strategic direction",
51+
"Inspire": "Inspires others to do all the things"
52+
},
53+
"Design for availability": {
54+
"Follow": "Follows the team processes, delivering a consistent flow of features to production",
55+
"Apply": "Enforces the team processes, making sure everybody understands the benefits and tradeoffs",
56+
"Contribute": "Contributes as an active participant",
57+
"Define": "Works with stakeholders to define and set strategic direction",
58+
"Inspire": "Inspires others to do all the things"
59+
},
60+
"Cryptography": {
61+
"Follow": "Follows the team processes, delivering a consistent flow of features to production",
62+
"Apply": "Enforces the team processes, making sure everybody understands the benefits and tradeoffs",
63+
"Contribute": "Contributes as an active participant",
64+
"Define": "Works with stakeholders to define and set strategic direction",
65+
"Inspire": "Inspires others to do all the things"
66+
}
67+
},
68+
"RoleLevels": {
69+
"Senior": {
70+
"data": [3, 2, 3, 2, 2, 2, 3, 2, 2],
71+
"backgroundColor": "rgba(255, 99, 132, 0.2)",
72+
"color": "rgb(255, 99, 132)"
73+
},
74+
"Lead": {
75+
"data": [3, 4, 4, 3, 3, 3, 3, 2, 3],
76+
"backgroundColor": "rgba(54, 162, 235, 0.2)",
77+
"color": "rgb(54, 162, 235)"
78+
}
79+
}
80+
}

src/utils/data/roles.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import oneLoginRoles from "./OneLogin.json";
2+
import madeTech from "./TechArchAttributes.json";
3+
4+
export const roles = {
5+
madeTech,
6+
others: [oneLoginRoles],
7+
};

0 commit comments

Comments
 (0)