Skip to content

Commit fecc525

Browse files
author
Hoang Nguyen
authored
ui: fixes style ui issues (apache#6261)
This PR for fixes some UI Bugs The project selected color is not displayed after switching project Project view, the cards are not separated but stick together Dashboard: The color of the selected zone is not displayed Dark mode: Hover through row tables that are discolored
1 parent aa0197c commit fecc525

4 files changed

Lines changed: 30 additions & 10 deletions

File tree

ui/src/components/header/ProjectMenu.vue

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@
2020
<a-select
2121
v-if="!isDisabled()"
2222
class="project-select"
23-
:defaultValue="$t('label.default.view')"
2423
:loading="loading"
25-
:value="($store.getters.project && 'id' in $store.getters.project) ? ($store.getters.project.displaytext || $store.getters.project.name) : $t('label.default.view')"
24+
v-model:value="projectSelected"
2625
:filterOption="filterProject"
2726
@change="changeProject"
2827
@focus="fetchData"
@@ -40,7 +39,10 @@
4039
</a-tooltip>
4140
</template>
4241

43-
<a-select-option v-for="(project, index) in projects" :key="index" :label="project.displaytext || project.name">
42+
<a-select-option
43+
v-for="(project, index) in projects"
44+
:key="index"
45+
:label="project.displaytext || project.name">
4446
<span>
4547
<resource-icon v-if="project.icon && project.icon.base64image" :image="project.icon.base64image" size="1x" style="margin-right: 5px"/>
4648
<project-outlined v-else style="margin-right: 5px" />
@@ -71,6 +73,16 @@ export default {
7173
created () {
7274
this.fetchData()
7375
},
76+
computed: {
77+
projectSelected () {
78+
let projectIndex = 0
79+
if (this.$store.getters?.project?.id) {
80+
projectIndex = this.projects.findIndex(project => project.id === this.$store.getters.project.id)
81+
}
82+
83+
return projectIndex
84+
}
85+
},
7486
methods: {
7587
fetchData () {
7688
if (this.isDisabled()) {
@@ -135,6 +147,6 @@ export default {
135147
position: absolute;
136148
top: 0;
137149
right: 1px;
138-
margin-top: -3px;
150+
margin-top: -5px;
139151
}
140152
</style>

ui/src/style/dark-mode.less

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
& > tr:hover.ant-table-row-selected > td,
284284
& > tr.ant-table-row-hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td,
285285
& > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td {
286-
background-color: @table-body-hover-bgColor;
286+
background-color: @table-body-hover-bgColor !important;
287287
}
288288

289289
& > tr > th.ant-table-column-sort {
@@ -551,7 +551,7 @@
551551
&-option-active:not(.ant-select-item-option-disabled),
552552
&:hover:not(.ant-select-item-disabled),
553553
&-active:hover:not(.ant-select-item-disabled) {
554-
background-color: @dropdown-hover-bgColor;
554+
background-color: @dropdown-hover-bgColor !important;
555555
}
556556
}
557557
}
@@ -714,7 +714,7 @@
714714

715715
&-item:not(.ant-dropdown-menu-item-selected):hover,
716716
&-submenu-title:not(.ant-dropdown-menu-item-selected):hover {
717-
background-color: @dropdown-hover-bgColor;
717+
background-color: @dropdown-hover-bgColor !important;
718718
}
719719

720720
&-title-content > a,

ui/src/views/dashboard/CapacityDashboard.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
<div class="capacity-dashboard-wrapper">
2222
<div class="capacity-dashboard-select">
2323
<a-select
24-
:defaultValue="zoneSelected.name"
2524
:placeholder="$t('label.select.a.zone')"
26-
:value="zoneSelected.name"
25+
v-model:value="zoneSelectedKey"
2726
@change="changeZone"
2827
showSearch
2928
optionFilterProp="label"
@@ -164,6 +163,15 @@ export default {
164163
}
165164
}
166165
},
166+
computed: {
167+
zoneSelectedKey () {
168+
if (this.zones.length === 0) {
169+
return this.zoneSelected.name
170+
}
171+
const zoneIndex = this.zones.findIndex(zone => zone.id === this.zoneSelected.id)
172+
return zoneIndex
173+
}
174+
},
167175
created () {
168176
this.fetchData()
169177
},

ui/src/views/dashboard/UsageDashboard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export default {
252252
</script>
253253

254254
<style lang="less" scoped>
255-
.usage-dashboard {
255+
:deep(.usage-dashboard) {
256256
257257
&-chart-tile {
258258
margin-bottom: 12px;

0 commit comments

Comments
 (0)