Skip to content

Commit b0fa093

Browse files
Merge pull request #1001 from anwesha-palit-redhat/feat/SRVKP-11123
SRVKP-11123: Upgrade dependencies and resolve TypeScript, i18n and CI job issues
2 parents 14a239b + 660064f commit b0fa093

File tree

14 files changed

+690
-666
lines changed

14 files changed

+690
-666
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.yarn/cache
3+
.git

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ ADD . /usr/src/app
1414
WORKDIR /usr/src/app
1515

1616
# Install dependencies & build
17-
RUN yarn install && yarn build
17+
RUN yarn install --immutable && \
18+
yarn build
1819

1920
# Stage 2: Serve with Nginx
2021
FROM $RUNTIME

locales/en/plugin__pipelines-console-plugin.json

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
{
22
"{{assignees}} Assigned": "{{assignees}} Assigned",
3-
"{{count}} annotation": "{{count}} annotation",
4-
"{{count}} annotation_plural": "{{count}} annotation",
5-
"{{count}} day": "{{count}} day",
6-
"{{count}} day_plural": "{{count}} day",
7-
"{{count}} event exist, but none match the current filter": "{{count}} event exist, but none match the current filter",
8-
"{{count}} event exist, but none match the current filter_plural": "{{count}} event exist, but none match the current filter",
9-
"{{count}} hour": "{{count}} hour",
10-
"{{count}} hour_plural": "{{count}} hour",
11-
"{{count}} minute": "{{count}} minute",
12-
"{{count}} minute_plural": "{{count}} minute",
13-
"{{count}} second": "{{count}} second",
14-
"{{count}} second_plural": "{{count}} second",
15-
"{{count}}+ event exist, but none match the current filter": "{{count}}+ event exist, but none match the current filter",
16-
"{{count}}+ event exist, but none match the current filter_plural": "{{count}}+ event exist, but none match the current filter",
173
"{{hr}}h": "{{hr}}h",
184
"{{min}}m": "{{min}}m",
195
"{{resourceName}} results": "{{resourceName}} results",
206
"{{sec}}s": "{{sec}}s",
217
"{{taskLabel}} details": "{{taskLabel}} details",
228
"{{taskRunLabel}} details": "{{taskRunLabel}} details",
9+
"{{value}} annotation": "{{value}} annotation",
10+
"{{value}} day": "{{value}} day",
11+
"{{value}} event exist, but none match the current filter": "{{value}} event exist, but none match the current filter",
12+
"{{value}} hour": "{{value}} hour",
13+
"{{value}} minute": "{{value}} minute",
14+
"{{value}} second": "{{value}} second",
15+
"{{value}}+ event exist, but none match the current filter": "{{value}}+ event exist, but none match the current filter",
2316
"{{version}} (latest)": "{{version}} (latest)",
2417
"<0>{{eventCount}} times in the last <3></3></0>": "<0>{{eventCount}} times in the last <3></3></0>",
2518
"<0>{{eventCount}} times</0>": "<0>{{eventCount}} times</0>",
@@ -512,10 +505,8 @@
512505
"Show variables": "Show variables",
513506
"Show VolumeClaimTemplate options": "Show VolumeClaimTemplate options",
514507
"Show YAML": "Show YAML",
515-
"Showing {{count}} event": "Showing {{count}} event",
516-
"Showing {{count}} event_plural": "Showing {{count}} event",
517-
"Showing most recent {{count}} event": "Showing most recent {{count}} event",
518-
"Showing most recent {{count}} event_plural": "Showing most recent {{count}} event",
508+
"Showing {{value}} event": "Showing {{value}} event",
509+
"Showing most recent {{value}} event": "Showing most recent {{value}} event",
519510
"Signed": "Signed",
520511
"Single user (RWO)": "Single user (RWO)",
521512
"Size": "Size",

package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"scripts": {
1212
"clean": "rm -rf dist",
1313
"webpack": "yarn exec webpack",
14-
"build": "yarn clean && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=6144 yarn webpack",
15-
"build-dev": "yarn clean && NODE_OPTIONS=--max-old-space-size=6144 yarn webpack",
14+
"build": "yarn clean && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 yarn webpack",
15+
"build-dev": "yarn clean && NODE_OPTIONS=--max-old-space-size=4096 yarn webpack",
1616
"start": "yarn webpack serve",
1717
"start-console": "./start-console.sh",
1818
"i18n": "./i18n-scripts/build-i18n.sh && node ./i18n-scripts/set-english-defaults.js",
@@ -36,14 +36,15 @@
3636
"@openshift-console/dynamic-plugin-sdk": "4.22.0-prerelease.1",
3737
"@openshift-console/dynamic-plugin-sdk-internal": "4.22.0-prerelease.1",
3838
"@openshift-console/dynamic-plugin-sdk-webpack": "4.22.0-prerelease.1",
39-
"@openshift/dynamic-plugin-sdk": "^4.0.0",
40-
"@openshift/dynamic-plugin-sdk-extensions": "^1.3.0",
41-
"@openshift/dynamic-plugin-sdk-utils": "^4.1.0",
39+
"@openshift/dynamic-plugin-sdk": "^8.1.0",
40+
"@openshift/dynamic-plugin-sdk-extensions": "^1.4.0",
41+
"@openshift/dynamic-plugin-sdk-utils": "^5.0.1",
4242
"@patternfly/react-charts": "^8.0.0",
4343
"@patternfly/react-component-groups": "^6.0.0",
4444
"@patternfly/react-core": "^6.4.0",
4545
"@patternfly/react-icons": "^6.4.0",
4646
"@patternfly/react-log-viewer": "^6.0.0",
47+
"@patternfly/react-styles": "~6.4.0",
4748
"@patternfly/react-table": "^6.4.0",
4849
"@patternfly/react-tokens": "^6.4.0",
4950
"@patternfly/react-topology": "^6.0.0",
@@ -73,12 +74,12 @@
7374
"eslint-config-prettier": "^8.5.0",
7475
"eslint-plugin-prettier": "^4.0.0",
7576
"eslint-plugin-react": "^7.29.1",
76-
"eslint-plugin-react-hooks": "4.1.2",
77+
"eslint-plugin-react-hooks": "^4.6.0",
7778
"file-saver": "1.3.x",
78-
"formik": "2.0.3",
79+
"formik": "^2.1.5",
7980
"fuzzysearch": "1.0.x",
8081
"gitlab": "10.0.1",
81-
"i18next-parser": "^3.11.0",
82+
"i18next-parser": "^9.3.0",
8283
"jest": "^30.2.0",
8384
"jest-canvas-mock": "^2.5.2",
8485
"jest-cli": "^30.2.0",
@@ -102,6 +103,7 @@
102103
"react-monaco-editor": "0.46.x",
103104
"react-redux": "8.1.3",
104105
"react-rnd": "^10.3.4",
106+
"react-router": "5.3.x",
105107
"react-router-dom": "5.3.x",
106108
"react-router-dom-v5-compat": "^6.11.2",
107109
"react-transition-group": "2.3.x",
@@ -111,7 +113,7 @@
111113
"sass-loader": "^16.0.5",
112114
"style-loader": "^3.3.1",
113115
"stylelint": "16.12.0",
114-
"stylelint-config-standard": "^31.0.0",
116+
"stylelint-config-standard": "^36.0.0",
115117
"thread-loader": "^3.0.4",
116118
"ts-jest": "^29.3.1",
117119
"ts-loader": "^9.3.1",

src/components/details-page/details-page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ export const ResourceSummary: FC<ResourceSummaryProps> = ({
134134
onClick={annotationsModalLauncher}
135135
variant="link"
136136
>
137-
{t('{{count}} annotation', {
138-
count: _.size(metadata.annotations),
137+
{t('{{value}} annotation', {
138+
value: _.size(metadata.annotations),
139139
})}
140140
</Button>
141141
) : (
142-
t('{{count}} annotation', {
143-
count: _.size(metadata.annotations),
142+
t('{{value}} annotation', {
143+
value: _.size(metadata.annotations),
144144
})
145145
)}
146146
</DetailsItem>

src/components/pipeline-builder/switch-to-form-validation-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const taskValidationYAMLSchema = (formData: PipelineBuilderFormValues) => {
3535
yup.lazy((taskObject) =>
3636
yup
3737
.object({
38-
name: nameValidationSchema((tKey) => t(tKey)),
38+
name: nameValidationSchema(t),
3939
taskRef: yup
4040
.object({
4141
name: yup.string(),

src/components/pipeline-builder/validation-utils.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TFunction } from 'i18next';
1+
import { TFunction, TOptions } from 'i18next';
22
import * as _ from 'lodash';
33
import * as yup from 'yup';
44
import {
@@ -19,7 +19,10 @@ import {
1919
import { findTaskFromFormikData, getTaskParameters } from './utils';
2020

2121
export const nameRegex = /^[a-z]([a-z0-9]-?)*[a-z0-9]$/;
22-
export const nameValidationSchema = (t: TFunction, maxLength = 263) =>
22+
export const nameValidationSchema = (
23+
t: (key: string, options?: TOptions) => string,
24+
maxLength = 263,
25+
) =>
2326
yup
2427
.string()
2528
.matches(nameRegex, {
@@ -317,7 +320,7 @@ const pipelineBuilderFormSchema = (
317320
t: TFunction,
318321
) => {
319322
return yup.object({
320-
name: nameValidationSchema((tKey) => t(tKey)).required(t('Required')),
323+
name: nameValidationSchema(t).required(t('Required')),
321324
params: yup.array().of(
322325
yup.object({
323326
name: yup.string().required(t('Required')),

src/components/pipelines-overview/dateTime.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,19 +272,19 @@ export const getDuration = (seconds: number, long?: boolean): string => {
272272
}
273273
if (hr > 0) {
274274
duration += long
275-
? t('{{count}} hour', { count: hr })
275+
? t('{{value}} hour', { value: hr })
276276
: t('{{hr}}h', { hr });
277277
duration += ' ';
278278
}
279279
if (min > 0) {
280280
duration += long
281-
? t('{{count}} minute', { count: min })
281+
? t('{{value}} minute', { value: min })
282282
: t('{{min}}m', { min });
283283
duration += ' ';
284284
}
285285
if (sec > 0) {
286286
duration += long
287-
? t('{{count}} second', { count: sec })
287+
? t('{{value}} second', { value: sec })
288288
: t('{{sec}}s', { sec });
289289
}
290290

@@ -334,12 +334,12 @@ export const fromNow = (
334334

335335
if (options?.omitSuffix) {
336336
if (days) {
337-
return t('{{count}} day', { count: days });
337+
return t('{{value}} day', { value: days });
338338
}
339339
if (hours) {
340-
return t('{{count}} hour', { count: hours });
340+
return t('{{value}} hour', { value: hours });
341341
}
342-
return t('{{count}} minute', { count: minutes });
342+
return t('{{value}} minute', { value: minutes });
343343
}
344344

345345
// Fallback to normal date/time formatting if Intl.RelativeTimeFormat is not

src/components/pipelines-overview/utils.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ export const IntervalOptions = () => {
8686
const { t } = useTranslation('plugin__pipelines-console-plugin');
8787
return {
8888
[OFF_KEY]: t('Refresh off'),
89-
'15s': t('{{count}} second', { count: 15 }),
90-
'30s': t('{{count}} second', { count: 30 }),
91-
'1m': t('{{count}} minute', { count: 1 }),
92-
'5m': t('{{count}} minute', { count: 5 }),
93-
'15m': t('{{count}} minute', { count: 15 }),
94-
'30m': t('{{count}} minute', { count: 30 }),
95-
'1h': t('{{count}} hour', { count: 1 }),
96-
'2h': t('{{count}} hour', { count: 2 }),
97-
'1d': t('{{count}} day', { count: 1 }),
89+
'15s': t('{{value}} second', { value: 15 }),
90+
'30s': t('{{value}} second', { value: 30 }),
91+
'1m': t('{{value}} minute', { value: 1 }),
92+
'5m': t('{{value}} minute', { value: 5 }),
93+
'15m': t('{{value}} minute', { value: 15 }),
94+
'30m': t('{{value}} minute', { value: 30 }),
95+
'1h': t('{{value}} hour', { value: 1 }),
96+
'2h': t('{{value}} hour', { value: 2 }),
97+
'1d': t('{{value}} day', { value: 1 }),
9898
};
9999
};
100100

src/components/pipelines-tasks/tasks-details-pages/events/events.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,11 @@ export const NoMatchingEvents = ({ allCount }) => {
199199
<div className="cos-status-box__title">{t('No matching events')}</div>
200200
<div className="cp-text-align-center cos-status-box__detail">
201201
{allCount >= maxMessages
202-
? t('{{count}}+ event exist, but none match the current filter', {
203-
count: maxMessages,
202+
? t('{{value}}+ event exist, but none match the current filter', {
203+
value: maxMessages,
204204
})
205-
: t('{{count}} event exist, but none match the current filter', {
206-
count: allCount,
205+
: t('{{value}} event exist, but none match the current filter', {
206+
value: allCount,
207207
})}
208208
</div>
209209
</Box>
@@ -374,8 +374,8 @@ const EventStream = ({
374374
});
375375
const messageCount =
376376
count < maxMessages
377-
? t('Showing {{count}} event', { count })
378-
: t('Showing most recent {{count}} event', { count });
377+
? t('Showing {{value}} event', { value: count })
378+
: t('Showing most recent {{value}} event', { value: count });
379379

380380
return (
381381
<PageSection hasBodyWrapper={false} isFilled >

0 commit comments

Comments
 (0)