Skip to content

Commit 94070c0

Browse files
committed
Represent status with dot in tables but not in select view
1 parent 96b000a commit 94070c0

File tree

3 files changed

+92
-6
lines changed

3 files changed

+92
-6
lines changed

webapp/src/components/DynamicDataTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@
239239
>
240240
<template #option="slotProps">
241241
<div class="flex items-center">
242-
<FormattedItemStatus :status="slotProps.option.status" />
242+
<FormattedItemStatus :status="slotProps.option.status" :dot-only="false" />
243243
</div>
244244
</template>
245245
<template #value="slotProps">
@@ -250,7 +250,7 @@
250250
:key="index"
251251
class="inline-flex items-center mr-2"
252252
>
253-
<FormattedItemStatus :status="option.status" />
253+
<FormattedItemStatus :status="option.status" :dot-only="false" />
254254
</span>
255255
</template>
256256
<span v-else class="text-gray-400">Any</span>

webapp/src/components/FormattedItemStatus.vue

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<template>
2-
<span v-if="alt" class="dot" :title="status" :class="'badge-' + badgeClass"></span>
2+
<span
3+
v-if="dotOnly"
4+
class="dot"
5+
:title="status.toUpperCase()"
6+
:class="'badge-' + badgeClass"
7+
></span>
38
<span v-else class="badge badge-pill text-uppercase" :class="'badge-' + badgeClass">
49
{{ status }}
510
</span>
@@ -8,8 +13,8 @@
813
<script>
914
export default {
1015
props: {
11-
status: { type: String, required: false },
12-
alt: { type: Boolean, default: false },
16+
dotOnly: { type: Boolean, default: true },
17+
status: { type: String, required: false, default: "" },
1318
},
1419
computed: {
1520
badgeClass() {
@@ -56,5 +61,81 @@ export default {
5661
display: inline-block;
5762
margin-left: auto;
5863
margin-right: auto;
64+
position: relative;
65+
}
66+
67+
.dot.badge-success {
68+
border-color: #28a745;
69+
background-color: transparent !important;
70+
box-shadow:
71+
0 0 2px #28a745,
72+
0 0 4px #28a745,
73+
0 0 6px #28a745;
74+
}
75+
76+
.dot.badge-danger {
77+
border-color: #dc3545;
78+
background: repeating-linear-gradient(
79+
45deg,
80+
transparent,
81+
transparent 1.5px,
82+
#dc3545 1.5px,
83+
#dc3545 2px
84+
) !important;
85+
}
86+
87+
.dot.badge-warning {
88+
border-color: #ffc107;
89+
background: repeating-linear-gradient(
90+
45deg,
91+
transparent,
92+
transparent 1.5px,
93+
#ffc107 1.5px,
94+
#ffc107 2px
95+
) !important;
96+
}
97+
98+
.dot.badge-primary {
99+
border-color: #007bff;
100+
background: repeating-linear-gradient(
101+
45deg,
102+
transparent,
103+
transparent 1.5px,
104+
#007bff 1.5px,
105+
#007bff 2px
106+
) !important;
107+
}
108+
109+
.dot.badge-secondary {
110+
border-color: #6c757d;
111+
background: repeating-linear-gradient(
112+
45deg,
113+
transparent,
114+
transparent 1.5px,
115+
#6c757d 1.5px,
116+
#6c757d 2px
117+
) !important;
118+
}
119+
120+
.dot.badge-info {
121+
border-color: #17a2b8;
122+
background: repeating-linear-gradient(
123+
45deg,
124+
transparent,
125+
transparent 1.5px,
126+
#17a2b8 1.5px,
127+
#17a2b8 2px
128+
) !important;
129+
}
130+
131+
.dot.badge-dark {
132+
border-color: #343a40;
133+
background: repeating-linear-gradient(
134+
45deg,
135+
transparent,
136+
transparent 1.5px,
137+
#343a40 1.5px,
138+
#343a40 2px
139+
) !important;
59140
}
60141
</style>

webapp/src/components/ToggleableItemStatusFormGroup.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
<font-awesome-icon id="edit-icon" class="pl-1" icon="pen" size="xs" :fade="isEditingStatus" />
1010
</label>
1111
<div>
12-
<FormattedItemStatus v-if="!isEditingStatus" :status="value" aria-labelledby="status" />
12+
<FormattedItemStatus
13+
v-if="!isEditingStatus"
14+
:dot-only="false"
15+
:status="value"
16+
aria-labelledby="status"
17+
/>
1318
<OnClickOutside
1419
v-if="isEditingStatus"
1520
:options="{ ignore: [outerDivRef] }"

0 commit comments

Comments
 (0)