Skip to content

Commit a4281ed

Browse files
bexsoftBenjamin Perez
and
Benjamin Perez
authored
Updated project dependencies (#3541)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net> Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent 0398c69 commit a4281ed

File tree

7 files changed

+575
-616
lines changed

7 files changed

+575
-616
lines changed

.github/workflows/jobs.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -689,23 +689,6 @@ jobs:
689689
path: |
690690
./integration/coverage/
691691
key: ${{ runner.os }}-coverage-2-${{ github.run_id }}
692-
react-tests:
693-
name: React Tests
694-
needs:
695-
- lint-job
696-
- ui-assets
697-
- semgrep-static-code-analysis
698-
runs-on: ubuntu-latest
699-
steps:
700-
- uses: actions/checkout@v3
701-
- name: Enable Corepack
702-
run: corepack enable
703-
- name: Install modules
704-
working-directory: ./web-app
705-
run: yarn install --immutable
706-
- name: Run tests
707-
working-directory: ./web-app
708-
run: yarn test
709692

710693
coverage:
711694
name: "Coverage Limit Check"

web-app/package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
"kbar": "^0.1.0-beta.46",
1212
"local-storage-fallback": "^4.1.3",
1313
"lodash": "^4.17.21",
14-
"luxon": "^3.5.0",
15-
"mds": "https://github.com/minio/mds.git#v1.1.2",
14+
"luxon": "^3.6.1",
15+
"mds": "https://github.com/minio/mds.git#v1.1.3",
1616
"react": "^18.3.1",
1717
"react-copy-to-clipboard": "^5.1.0",
1818
"react-dom": "^18.3.1",
19-
"react-dropzone": "^14.3.5",
19+
"react-dropzone": "^14.3.8",
2020
"react-markdown": "8.0.7",
2121
"react-pdf": "^9.2.1",
2222
"react-redux": "^8.1.3",
23-
"react-router-dom": "6.29.0",
23+
"react-router-dom": "6.30.0",
2424
"react-virtualized": "^9.22.6",
2525
"react-window": "^1.8.11",
2626
"react-window-infinite-loader": "^1.0.10",
@@ -59,15 +59,15 @@
5959
"proxy": "http://localhost:9090/",
6060
"devDependencies": {
6161
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
62-
"@babel/runtime": "^7.26.10",
63-
"@playwright/test": "^1.50.1",
62+
"@babel/runtime": "^7.27.1",
63+
"@playwright/test": "^1.52.0",
6464
"@types/jest": "^29.5.14",
65-
"@types/lodash": "^4.17.15",
66-
"@types/luxon": "^3.4.2",
67-
"@types/node": "20.17.19",
68-
"@types/react": "18.3.18",
65+
"@types/lodash": "^4.17.16",
66+
"@types/luxon": "^3.6.2",
67+
"@types/node": "20.17.47",
68+
"@types/react": "18.3.21",
6969
"@types/react-copy-to-clipboard": "^5.0.7",
70-
"@types/react-dom": "18.3.5",
70+
"@types/react-dom": "18.3.7",
7171
"@types/react-redux": "^7.1.34",
7272
"@types/react-virtualized": "^9.22.2",
7373
"@types/react-window": "^1.8.8",
@@ -77,16 +77,16 @@
7777
"@types/webpack-env": "^1.18.8",
7878
"babel-plugin-istanbul": "^6.1.1",
7979
"customize-cra": "^1.0.0",
80-
"knip": "^5.44.4",
81-
"minio": "^8.0.4",
80+
"knip": "^5.56.0",
81+
"minio": "^8.0.5",
8282
"nyc": "^15.1.0",
83-
"prettier": "3.5.1",
83+
"prettier": "3.5.3",
8484
"react-app-rewire-hot-loader": "^2.0.1",
8585
"react-app-rewired": "^2.2.1",
8686
"react-scripts": "5.0.1",
87-
"swagger-typescript-api": "13.0.23",
87+
"swagger-typescript-api": "13.1.3",
8888
"testcafe": "3.7.2",
89-
"typescript": "^5.5.3"
89+
"typescript": "^5.8.3"
9090
},
9191
"resolutions": {
9292
"nth-check": "^2.0.1",

web-app/src/common/__tests__/utils.test.ts

Lines changed: 0 additions & 86 deletions
This file was deleted.

web-app/src/common/types.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,6 @@
1414
// You should have received a copy of the GNU Affero General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
export interface IStorageFactors {
18-
erasureCode: string;
19-
storageFactor: number;
20-
maxCapacity: string;
21-
maxFailureTolerations: number;
22-
}
23-
24-
export interface IErasureCodeCalc {
25-
error: number;
26-
maxEC: string;
27-
erasureCodeSet: number;
28-
rawCapacity: string;
29-
defaultEC: string;
30-
storageFactors: IStorageFactors[];
31-
}
32-
3317
export interface ErrorResponseHandler {
3418
errorMessage: string;
3519
detailedError: string;

web-app/src/common/utils.ts

Lines changed: 0 additions & 168 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,11 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
import storage from "local-storage-fallback";
18-
import { IErasureCodeCalc, IStorageFactors } from "./types";
1918

2019
import get from "lodash/get";
2120

22-
const minMemReq = 2147483648; // Minimal Memory required for MinIO in bytes
23-
2421
const units = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"];
2522
const k8sUnits = ["Ki", "Mi", "Gi", "Ti", "Pi", "Ei"];
26-
const k8sCalcUnits = ["B", ...k8sUnits];
2723

2824
export const niceBytes = (x: string, showK8sUnits: boolean = false) => {
2925
let n = parseInt(x, 10) || 0;
@@ -54,170 +50,6 @@ export const clearSession = () => {
5450
deleteCookie("idp-refresh-token");
5551
};
5652

57-
//getBytes, converts from a value and a unit from units array to bytes as a string
58-
export const getBytes = (
59-
value: string,
60-
unit: string,
61-
fromk8s: boolean = false,
62-
): string => {
63-
return getBytesNumber(value, unit, fromk8s).toString(10);
64-
};
65-
66-
//getBytesNumber, converts from a value and a unit from units array to bytes
67-
const getBytesNumber = (
68-
value: string,
69-
unit: string,
70-
fromk8s: boolean = false,
71-
): number => {
72-
const vl: number = parseFloat(value);
73-
74-
const unitsTake = fromk8s ? k8sCalcUnits : units;
75-
76-
const powFactor = unitsTake.findIndex((element) => element === unit);
77-
78-
if (powFactor === -1) {
79-
return 0;
80-
}
81-
const factor = Math.pow(1024, powFactor);
82-
const total = vl * factor;
83-
84-
return total;
85-
};
86-
87-
export const setMemoryResource = (
88-
memorySize: number,
89-
capacitySize: string,
90-
maxMemorySize: number,
91-
) => {
92-
// value always comes as Gi
93-
const requestedSizeBytes = getBytes(memorySize.toString(10), "Gi", true);
94-
const memReqSize = parseInt(requestedSizeBytes, 10);
95-
if (maxMemorySize === 0) {
96-
return {
97-
error: "There is no memory available for the selected number of nodes",
98-
request: 0,
99-
limit: 0,
100-
};
101-
}
102-
103-
if (maxMemorySize < minMemReq) {
104-
return {
105-
error: "There are not enough memory resources available",
106-
request: 0,
107-
limit: 0,
108-
};
109-
}
110-
111-
if (memReqSize < minMemReq) {
112-
return {
113-
error: "The requested memory size must be greater than 2Gi",
114-
request: 0,
115-
limit: 0,
116-
};
117-
}
118-
if (memReqSize > maxMemorySize) {
119-
return {
120-
error:
121-
"The requested memory is greater than the max available memory for the selected number of nodes",
122-
request: 0,
123-
limit: 0,
124-
};
125-
}
126-
127-
const capSize = parseInt(capacitySize, 10);
128-
let memLimitSize = memReqSize;
129-
// set memory limit based on the capacitySize
130-
// if capacity size is lower than 1TiB we use the limit equal to request
131-
if (capSize >= parseInt(getBytes("1", "Pi", true), 10)) {
132-
memLimitSize = Math.max(
133-
memReqSize,
134-
parseInt(getBytes("64", "Gi", true), 10),
135-
);
136-
} else if (capSize >= parseInt(getBytes("100", "Ti"), 10)) {
137-
memLimitSize = Math.max(
138-
memReqSize,
139-
parseInt(getBytes("32", "Gi", true), 10),
140-
);
141-
} else if (capSize >= parseInt(getBytes("10", "Ti"), 10)) {
142-
memLimitSize = Math.max(
143-
memReqSize,
144-
parseInt(getBytes("16", "Gi", true), 10),
145-
);
146-
} else if (capSize >= parseInt(getBytes("1", "Ti"), 10)) {
147-
memLimitSize = Math.max(
148-
memReqSize,
149-
parseInt(getBytes("8", "Gi", true), 10),
150-
);
151-
}
152-
153-
return {
154-
error: "",
155-
request: memReqSize,
156-
limit: memLimitSize,
157-
};
158-
};
159-
160-
// Erasure Code Parity Calc
161-
export const erasureCodeCalc = (
162-
parityValidValues: string[],
163-
totalDisks: number,
164-
pvSize: number,
165-
totalNodes: number,
166-
): IErasureCodeCalc => {
167-
// Parity Values is empty
168-
if (parityValidValues.length < 1) {
169-
return {
170-
error: 1,
171-
defaultEC: "",
172-
erasureCodeSet: 0,
173-
maxEC: "",
174-
rawCapacity: "0",
175-
storageFactors: [],
176-
};
177-
}
178-
179-
const totalStorage = totalDisks * pvSize;
180-
const maxEC = parityValidValues[0];
181-
const maxParityNumber = parseInt(maxEC.split(":")[1], 10);
182-
183-
const erasureStripeSet = maxParityNumber * 2; // ESS is calculated by multiplying maximum parity by two.
184-
185-
const storageFactors: IStorageFactors[] = parityValidValues.map(
186-
(currentParity) => {
187-
const parityNumber = parseInt(currentParity.split(":")[1], 10);
188-
const storageFactor =
189-
erasureStripeSet / (erasureStripeSet - parityNumber);
190-
191-
const maxCapacity = Math.floor(totalStorage / storageFactor);
192-
const maxTolerations =
193-
totalDisks - Math.floor(totalDisks / storageFactor);
194-
return {
195-
erasureCode: currentParity,
196-
storageFactor,
197-
maxCapacity: maxCapacity.toString(10),
198-
maxFailureTolerations: maxTolerations,
199-
};
200-
},
201-
);
202-
203-
let defaultEC = maxEC;
204-
205-
const fourVar = parityValidValues.find((element) => element === "EC:4");
206-
207-
if (fourVar) {
208-
defaultEC = "EC:4";
209-
}
210-
211-
return {
212-
error: 0,
213-
storageFactors,
214-
maxEC,
215-
rawCapacity: totalStorage.toString(10),
216-
erasureCodeSet: erasureStripeSet,
217-
defaultEC,
218-
};
219-
};
220-
22153
// 92400 seconds -> 1 day, 1 hour, 40 minutes.
22254
export const niceTimeFromSeconds = (seconds: number): string => {
22355
const days = Math.floor(seconds / (3600 * 24));

web-app/src/utils/stylesUtils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export const generateOverrideTheme = (overrideVars: IEmbeddedCustomStyles) => {
4040
logoColor: "#C51B3F",
4141
logoLabelColor: overrideVars.fontColor,
4242
logoLabelInverse: "#FFF",
43+
logoContrast: "#000",
44+
logoContrastInverse: overrideVars.fontColor,
4345
loaderColor: overrideVars.loaderColor,
4446
boxBackground: overrideVars.boxBackground,
4547
mutedText: "#9c9c9c",

0 commit comments

Comments
 (0)