Skip to content

Commit 7fbd8cd

Browse files
committed
fix: cleanup
1 parent 79b952c commit 7fbd8cd

File tree

5 files changed

+25
-50
lines changed

5 files changed

+25
-50
lines changed

public/locales/en.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,12 @@
336336
"synced": "Synced",
337337
"healthy": "Healthy",
338338
"installed": "Installed",
339-
"none": "None"
339+
"none": "None",
340+
"creating": "Creating",
341+
"unhealthy": "Unhealthy",
342+
"progress": "Progress",
343+
"remaining": "Remaining",
344+
"active": "Active"
340345
},
341346
"errors": {
342347
"installError": "Install error",
@@ -378,7 +383,7 @@
378383
"noResources": "No Resources",
379384
"inactive": "Inactive",
380385
"activate": "Activate",
381-
"resources": "Resources"
386+
"healthy": "Healthy"
382387
},
383388
"GitOpsHint": {
384389
"title": "Flux",

src/components/Hints/CrossplaneHint.tsx

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

src/components/Hints/GitOpsHint.tsx

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

src/components/Hints/VaultHint.tsx

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

src/components/Hints/calculations.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const calculateCrossplaneSegments: HintSegmentCalculator = (
2828

2929
if (isLoading) {
3030
return {
31-
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: 'Loading' }],
31+
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: t('Hints.common.loading') }],
3232
label: t('Hints.common.loading'),
3333
showPercentage: false,
3434
isHealthy: false,
@@ -38,7 +38,7 @@ export const calculateCrossplaneSegments: HintSegmentCalculator = (
3838

3939
if (error) {
4040
return {
41-
segments: [{ percentage: 100, color: HINT_COLORS.unhealthy, label: 'Error' }],
41+
segments: [{ percentage: 100, color: HINT_COLORS.unhealthy, label: t('Hints.common.errorLoadingResources') }],
4242
label: t('Hints.common.errorLoadingResources'),
4343
showPercentage: false,
4444
isHealthy: false,
@@ -48,7 +48,7 @@ export const calculateCrossplaneSegments: HintSegmentCalculator = (
4848

4949
if (!enabled) {
5050
return {
51-
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: 'Inactive' }],
51+
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: t('Hints.CrossplaneHint.inactive') }],
5252
label: t('Hints.CrossplaneHint.inactive'),
5353
showPercentage: false,
5454
isHealthy: false,
@@ -60,7 +60,7 @@ export const calculateCrossplaneSegments: HintSegmentCalculator = (
6060

6161
if (totalCount === 0) {
6262
return {
63-
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: 'No Resources' }],
63+
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: t('Hints.CrossplaneHint.noResources') }],
6464
label: t('Hints.CrossplaneHint.noResources'),
6565
showPercentage: false,
6666
isHealthy: false,
@@ -90,11 +90,11 @@ export const calculateCrossplaneSegments: HintSegmentCalculator = (
9090

9191
return {
9292
segments: [
93-
{ percentage: healthyPercentage, color: HINT_COLORS.healthy, label: 'Healthy' },
94-
{ percentage: creatingPercentage, color: HINT_COLORS.creating, label: 'Creating' },
95-
{ percentage: unhealthyPercentage, color: HINT_COLORS.unhealthy, label: 'Unhealthy' },
93+
{ percentage: healthyPercentage, color: HINT_COLORS.healthy, label: t('common.healthy') },
94+
{ percentage: creatingPercentage, color: HINT_COLORS.creating, label: t('common.creating') },
95+
{ percentage: unhealthyPercentage, color: HINT_COLORS.unhealthy, label: t('common.unhealthy') },
9696
],
97-
label: 'Resources',
97+
label: t('Hints.CrossplaneHint.healthy'),
9898
showPercentage: true,
9999
isHealthy: healthyPercentage === 100 && totalCount > 0,
100100
showOnlyNonZero: true,
@@ -114,7 +114,7 @@ export const calculateGitOpsSegments: HintSegmentCalculator = (
114114

115115
if (isLoading) {
116116
return {
117-
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: 'Loading' }],
117+
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: t('Hints.common.loading') }],
118118
label: t('Hints.common.loading'),
119119
showPercentage: false,
120120
isHealthy: false,
@@ -124,7 +124,7 @@ export const calculateGitOpsSegments: HintSegmentCalculator = (
124124

125125
if (error) {
126126
return {
127-
segments: [{ percentage: 100, color: HINT_COLORS.unhealthy, label: 'Error' }],
127+
segments: [{ percentage: 100, color: HINT_COLORS.unhealthy, label: t('Hints.common.errorLoadingResources') }],
128128
label: t('Hints.common.errorLoadingResources'),
129129
showPercentage: false,
130130
isHealthy: false,
@@ -134,7 +134,7 @@ export const calculateGitOpsSegments: HintSegmentCalculator = (
134134

135135
if (!enabled) {
136136
return {
137-
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: 'Inactive' }],
137+
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: t('Hints.GitOpsHint.inactive') }],
138138
label: t('Hints.GitOpsHint.inactive'),
139139
showPercentage: false,
140140
isHealthy: false,
@@ -146,7 +146,7 @@ export const calculateGitOpsSegments: HintSegmentCalculator = (
146146

147147
if (totalCount === 0) {
148148
return {
149-
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: 'No Resources' }],
149+
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: t('Hints.GitOpsHint.noResources') }],
150150
label: t('Hints.GitOpsHint.noResources'),
151151
showPercentage: false,
152152
isHealthy: false,
@@ -167,8 +167,8 @@ export const calculateGitOpsSegments: HintSegmentCalculator = (
167167

168168
return {
169169
segments: [
170-
{ percentage: progressValue, color: progressColor, label: 'Progress' },
171-
{ percentage: restPercentage, color: HINT_COLORS.inactive, label: 'Remaining' },
170+
{ percentage: progressValue, color: progressColor, label: t('common.progress') },
171+
{ percentage: restPercentage, color: HINT_COLORS.inactive, label: t('common.remaining') },
172172
],
173173
label: t('Hints.GitOpsHint.managed'),
174174
showPercentage: true,
@@ -190,7 +190,7 @@ export const calculateVaultSegments: HintSegmentCalculator = (
190190

191191
if (isLoading) {
192192
return {
193-
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: 'Loading' }],
193+
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: t('Hints.common.loading') }],
194194
label: t('Hints.common.loading'),
195195
showPercentage: false,
196196
isHealthy: false,
@@ -200,7 +200,7 @@ export const calculateVaultSegments: HintSegmentCalculator = (
200200

201201
if (error) {
202202
return {
203-
segments: [{ percentage: 100, color: HINT_COLORS.unhealthy, label: 'Error' }],
203+
segments: [{ percentage: 100, color: HINT_COLORS.unhealthy, label: t('Hints.common.errorLoadingResources') }],
204204
label: t('Hints.common.errorLoadingResources'),
205205
showPercentage: false,
206206
isHealthy: false,
@@ -210,7 +210,7 @@ export const calculateVaultSegments: HintSegmentCalculator = (
210210

211211
if (!enabled) {
212212
return {
213-
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: 'Inactive' }],
213+
segments: [{ percentage: 100, color: HINT_COLORS.inactive, label: t('Hints.VaultHint.inactive') }],
214214
label: t('Hints.VaultHint.inactive'),
215215
showPercentage: false,
216216
isHealthy: false,
@@ -225,7 +225,7 @@ export const calculateVaultSegments: HintSegmentCalculator = (
225225
const color = hasResources ? HINT_COLORS.healthy : HINT_COLORS.inactive;
226226

227227
return {
228-
segments: [{ percentage: 100, color, label: 'Active' }],
228+
segments: [{ percentage: 100, color, label: t('common.active') }],
229229
label,
230230
showPercentage: true,
231231
isHealthy: hasResources,

0 commit comments

Comments
 (0)