Skip to content

Commit 6bc6e32

Browse files
Merge pull request #841 from actiontech/dms-ui/feat-2983
feat: strengthen environment tag color display (dms-ui)
2 parents 6fdc83c + 6069324 commit 6bc6e32

158 files changed

Lines changed: 4274 additions & 2271 deletions

File tree

Some content is hidden

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"checker": "concurrently \"pnpm ts-check\" \"pnpm eslint\" \"pnpm stylelint\" \"pnpm prettier:c\"",
2424
"test": "sh ./scripts/jest/run.sh",
2525
"test:c": "sh ./scripts/jest/run-coverage.sh",
26-
"test:ci": "sh ./scripts/jest/run-ci.sh 1 1 && node ./scripts/jest/merge-report-json.js",
26+
"test:ci": "sh ./scripts/jest/run-ci.sh 1 1 && SHARD_COUNT=1 node ./scripts/jest/merge-report-json.js",
2727
"test:clean": "jest --clearCache",
2828
"icon:g": "pnpm --filter @actiontech/icons icon:g",
2929
"icon:docs:g": "pnpm --filter @actiontech/icons docs:g",
@@ -149,4 +149,4 @@
149149
"@babel/core": "^7.22.0",
150150
"@ant-design/cssinjs": "1.17.0"
151151
}
152-
}
152+
}

packages/base/src/__snapshots__/App.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ exports[`App render App when "checkPageAction" is false 1`] = `
229229
</div>
230230
</div>
231231
<div
232-
class="ant-select ant-select-lg ant-select-borderless basic-select-wrapper custom-select-namespace custom-project-selector css-1jmxnk5 ant-select-single ant-select-show-arrow"
232+
class="ant-select ant-select-lg ant-select-borderless basic-select-wrapper custom-select-namespace custom-project-selector css-8xciap ant-select-single ant-select-show-arrow"
233233
searchinputref="[object Object]"
234234
>
235235
<div
@@ -1442,7 +1442,7 @@ exports[`App render App when token is existed 1`] = `
14421442
</div>
14431443
</div>
14441444
<div
1445-
class="ant-select ant-select-lg ant-select-borderless basic-select-wrapper custom-select-namespace custom-project-selector css-1jmxnk5 ant-select-single ant-select-show-arrow"
1445+
class="ant-select ant-select-lg ant-select-borderless basic-select-wrapper custom-select-namespace custom-project-selector css-8xciap ant-select-single ant-select-show-arrow"
14461446
searchinputref="[object Object]"
14471447
>
14481448
<div

packages/base/src/hooks/useDbService/__snapshots__/index.test.tsx.snap

Lines changed: 262 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,77 @@ exports[`useDbService should render options when use generateDbServiceIDSelectOp
99
/>,
1010
"options": [
1111
{
12-
"label": "test (127.0.0.1:3306)",
12+
"label": <span
13+
className="db-service-option-label"
14+
style={
15+
{
16+
"alignItems": "center",
17+
"display": "inline-flex",
18+
"maxWidth": "none",
19+
}
20+
}
21+
>
22+
<Memo(EnvironmentTag)
23+
color="#F5222D"
24+
ellipsis={false}
25+
name="PROD"
26+
size="small"
27+
style={
28+
{
29+
"flexShrink": 0,
30+
"marginRight": 6,
31+
}
32+
}
33+
/>
34+
<span
35+
style={
36+
{
37+
"whiteSpace": "nowrap",
38+
}
39+
}
40+
>
41+
test (127.0.0.1:3306)
42+
</span>
43+
</span>,
44+
"text": "test (127.0.0.1:3306)",
45+
"title": "test (127.0.0.1:3306)",
1346
"value": "123123",
1447
},
1548
{
16-
"label": "test2 (localhost:3306)",
49+
"label": <span
50+
className="db-service-option-label"
51+
style={
52+
{
53+
"alignItems": "center",
54+
"display": "inline-flex",
55+
"maxWidth": "none",
56+
}
57+
}
58+
>
59+
<Memo(EnvironmentTag)
60+
color="#52C41A"
61+
ellipsis={false}
62+
name="TEST"
63+
size="small"
64+
style={
65+
{
66+
"flexShrink": 0,
67+
"marginRight": 6,
68+
}
69+
}
70+
/>
71+
<span
72+
style={
73+
{
74+
"whiteSpace": "nowrap",
75+
}
76+
}
77+
>
78+
test2 (localhost:3306)
79+
</span>
80+
</span>,
81+
"text": "test2 (localhost:3306)",
82+
"title": "test2 (localhost:3306)",
1783
"value": "300123",
1884
},
1985
],
@@ -57,7 +123,27 @@ exports[`useDbService should render options when use generateDbServiceIDSelectOp
57123
class="ant-select-selection-item"
58124
title="test (127.0.0.1:3306)"
59125
>
60-
test (127.0.0.1:3306)
126+
<span
127+
class="db-service-option-label"
128+
style="display: inline-flex; align-items: center; max-width: none;"
129+
>
130+
<span
131+
class="css-cf91id"
132+
color="#F5222D"
133+
style="margin-right: 6px; flex-shrink: 0;"
134+
>
135+
<span
136+
class="environment-tag-name"
137+
>
138+
PROD
139+
</span>
140+
</span>
141+
<span
142+
style="white-space: nowrap;"
143+
>
144+
test (127.0.0.1:3306)
145+
</span>
146+
</span>
61147
</span>
62148
</div>
63149
<span
@@ -127,7 +213,27 @@ exports[`useDbService should render options when use generateDbServiceIDSelectOp
127213
class="ant-select-selection-item"
128214
title="test (127.0.0.1:3306)"
129215
>
130-
test (127.0.0.1:3306)
216+
<span
217+
class="db-service-option-label"
218+
style="display: inline-flex; align-items: center; max-width: none;"
219+
>
220+
<span
221+
class="css-cf91id"
222+
color="#F5222D"
223+
style="margin-right: 6px; flex-shrink: 0;"
224+
>
225+
<span
226+
class="environment-tag-name"
227+
>
228+
PROD
229+
</span>
230+
</span>
231+
<span
232+
style="white-space: nowrap;"
233+
>
234+
test (127.0.0.1:3306)
235+
</span>
236+
</span>
131237
</span>
132238
</div>
133239
<span
@@ -175,15 +281,13 @@ exports[`useDbService should render options when use generateDbServiceIDSelectOp
175281
role="presentation"
176282
/>
177283
<div
178-
aria-label="test (127.0.0.1:3306)"
179284
aria-selected="true"
180285
id="rc_select_TEST_OR_SSR_list_1"
181286
role="option"
182287
>
183288
123123
184289
</div>
185290
<div
186-
aria-label="test2 (localhost:3306)"
187291
aria-selected="false"
188292
id="rc_select_TEST_OR_SSR_list_2"
189293
role="option"
@@ -230,7 +334,27 @@ exports[`useDbService should render options when use generateDbServiceIDSelectOp
230334
<div
231335
class="ant-select-item-option-content"
232336
>
233-
test (127.0.0.1:3306)
337+
<span
338+
class="db-service-option-label"
339+
style="display: inline-flex; align-items: center; max-width: none;"
340+
>
341+
<span
342+
class="css-cf91id"
343+
color="#F5222D"
344+
style="margin-right: 6px; flex-shrink: 0;"
345+
>
346+
<span
347+
class="environment-tag-name"
348+
>
349+
PROD
350+
</span>
351+
</span>
352+
<span
353+
style="white-space: nowrap;"
354+
>
355+
test (127.0.0.1:3306)
356+
</span>
357+
</span>
234358
</div>
235359
<span
236360
aria-hidden="true"
@@ -248,7 +372,27 @@ exports[`useDbService should render options when use generateDbServiceIDSelectOp
248372
<div
249373
class="ant-select-item-option-content"
250374
>
251-
test2 (localhost:3306)
375+
<span
376+
class="db-service-option-label"
377+
style="display: inline-flex; align-items: center; max-width: none;"
378+
>
379+
<span
380+
class="css-1wvwrtw"
381+
color="#52C41A"
382+
style="margin-right: 6px; flex-shrink: 0;"
383+
>
384+
<span
385+
class="environment-tag-name"
386+
>
387+
TEST
388+
</span>
389+
</span>
390+
<span
391+
style="white-space: nowrap;"
392+
>
393+
test2 (localhost:3306)
394+
</span>
395+
</span>
252396
</div>
253397
<span
254398
aria-hidden="true"
@@ -276,11 +420,77 @@ exports[`useDbService should render options when use generateDbServiceSelectOpti
276420
/>,
277421
"options": [
278422
{
279-
"label": "test (127.0.0.1:3306)",
423+
"label": <span
424+
className="db-service-option-label"
425+
style={
426+
{
427+
"alignItems": "center",
428+
"display": "inline-flex",
429+
"maxWidth": "none",
430+
}
431+
}
432+
>
433+
<Memo(EnvironmentTag)
434+
color="#F5222D"
435+
ellipsis={false}
436+
name="PROD"
437+
size="small"
438+
style={
439+
{
440+
"flexShrink": 0,
441+
"marginRight": 6,
442+
}
443+
}
444+
/>
445+
<span
446+
style={
447+
{
448+
"whiteSpace": "nowrap",
449+
}
450+
}
451+
>
452+
test (127.0.0.1:3306)
453+
</span>
454+
</span>,
455+
"text": "test (127.0.0.1:3306)",
456+
"title": "test (127.0.0.1:3306)",
280457
"value": "test",
281458
},
282459
{
283-
"label": "test2 (localhost:3306)",
460+
"label": <span
461+
className="db-service-option-label"
462+
style={
463+
{
464+
"alignItems": "center",
465+
"display": "inline-flex",
466+
"maxWidth": "none",
467+
}
468+
}
469+
>
470+
<Memo(EnvironmentTag)
471+
color="#52C41A"
472+
ellipsis={false}
473+
name="TEST"
474+
size="small"
475+
style={
476+
{
477+
"flexShrink": 0,
478+
"marginRight": 6,
479+
}
480+
}
481+
/>
482+
<span
483+
style={
484+
{
485+
"whiteSpace": "nowrap",
486+
}
487+
}
488+
>
489+
test2 (localhost:3306)
490+
</span>
491+
</span>,
492+
"text": "test2 (localhost:3306)",
493+
"title": "test2 (localhost:3306)",
284494
"value": "test2",
285495
},
286496
],
@@ -442,15 +652,13 @@ exports[`useDbService should render options when use generateDbServiceSelectOpti
442652
role="presentation"
443653
/>
444654
<div
445-
aria-label="test (127.0.0.1:3306)"
446655
aria-selected="false"
447656
id="rc_select_TEST_OR_SSR_list_1"
448657
role="option"
449658
>
450659
test
451660
</div>
452661
<div
453-
aria-label="test2 (localhost:3306)"
454662
aria-selected="false"
455663
id="rc_select_TEST_OR_SSR_list_2"
456664
role="option"
@@ -497,7 +705,27 @@ exports[`useDbService should render options when use generateDbServiceSelectOpti
497705
<div
498706
class="ant-select-item-option-content"
499707
>
500-
test (127.0.0.1:3306)
708+
<span
709+
class="db-service-option-label"
710+
style="display: inline-flex; align-items: center; max-width: none;"
711+
>
712+
<span
713+
class="css-cf91id"
714+
color="#F5222D"
715+
style="margin-right: 6px; flex-shrink: 0;"
716+
>
717+
<span
718+
class="environment-tag-name"
719+
>
720+
PROD
721+
</span>
722+
</span>
723+
<span
724+
style="white-space: nowrap;"
725+
>
726+
test (127.0.0.1:3306)
727+
</span>
728+
</span>
501729
</div>
502730
<span
503731
aria-hidden="true"
@@ -515,7 +743,27 @@ exports[`useDbService should render options when use generateDbServiceSelectOpti
515743
<div
516744
class="ant-select-item-option-content"
517745
>
518-
test2 (localhost:3306)
746+
<span
747+
class="db-service-option-label"
748+
style="display: inline-flex; align-items: center; max-width: none;"
749+
>
750+
<span
751+
class="css-1wvwrtw"
752+
color="#52C41A"
753+
style="margin-right: 6px; flex-shrink: 0;"
754+
>
755+
<span
756+
class="environment-tag-name"
757+
>
758+
TEST
759+
</span>
760+
</span>
761+
<span
762+
style="white-space: nowrap;"
763+
>
764+
test2 (localhost:3306)
765+
</span>
766+
</span>
519767
</div>
520768
<span
521769
aria-hidden="true"

0 commit comments

Comments
 (0)