Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/components/Global/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
<div class="search-global">
<BFormGroup
:label="$t('global.form.search')"
:label-for="`searchInput-${_uid}`"
:aria-label="`search-bar-${label}`"
:label-for="`searchInput-${label}`"
label-class="invisible"
class="mb-2"
>
<BInputGroup size="md" class="align-items-center">
<BInputGroup
:aria-label="`${$t('global.form.search')}-${label}`"
size="md"
class="align-items-center"
>
<BInputGroupText class="group-text">
<icon-search class="search-icon" />
</BInputGroupText>
<BFormInput
:id="`searchInput-${_uid}`"
:id="`searchInput-${label}`"
ref="searchInput"
v-model="filter"
class="search-input"
Expand Down Expand Up @@ -55,6 +60,10 @@ defineProps({
type: Boolean,
default: false,
},
label: {
type: String,
default: '',
},
});

const filter = ref('');
Expand Down
6 changes: 4 additions & 2 deletions src/components/Global/TableDateFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
:label="$t('global.table.fromDate')"
label-for="input-from-date"
class="mr-3 my-0 w-100"
aria-label="from-date"
>
<BInputGroup>
<BInputGroup aria-label="from-date-input">
<BFormInput
id="input-from-date"
v-model="fromDate"
Expand All @@ -25,8 +26,9 @@
:label="$t('global.table.toDate')"
label-for="input-to-date"
class="my-0 w-100"
aria-label="to-date"
>
<BInputGroup>
<BInputGroup aria-label="to-date-input">
<BFormInput
id="input-to-date"
v-model="toDate"
Expand Down
9 changes: 9 additions & 0 deletions src/components/Global/UtilitiesFunction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const utilitiesFunctions = () => {
const spaceFilter = (value) => {
return value.toLowerCase().replace(/\s+/g, '-');
};

return { spaceFilter };
};

export default utilitiesFunctions;
30 changes: 28 additions & 2 deletions src/views/HardwareStatus/Inventory/InventoryFabricAdapters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<b-form-checkbox
v-if="hasIdentifyLed(row.item.identifyLed)"
v-model="row.item.identifyLed"
name="switch"
:name="'switch-' + row.item.id"
switch
:disabled="serverStatus"
@change="toggleIdentifyLedValue(row.item)"
Expand Down Expand Up @@ -158,7 +158,7 @@ import useTableRowExpandComposable from '../../../components/Composables/useTabl
import useDataFormatterGlobal from '../../../components/Composables/useDataFormatterGlobal';
import useSearchFilterComposable from '../../../components/Composables/useSearchFilterComposable';
import { useI18n } from 'vue-i18n';
import { reactive, ref, computed, watch, onBeforeMount } from 'vue';
import { reactive, ref, computed, watch, onBeforeMount, nextTick } from 'vue';
import stores from '../../../store';
import eventBus from '@/eventBus';
import useToast from '@/components/Composables/useToastComposable';
Expand Down Expand Up @@ -188,37 +188,49 @@ const fields = reactive([
label: '',
tdClass: 'table-row-expand',
sortable: false,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'name',
label: t('pageInventory.table.name'),
formatter: dataFormatter,
sortable: true,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'health',
label: t('pageInventory.table.health'),
formatter: dataFormatter,
sortable: true,
tdClass: 'text-nowrap',
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'status',
label: t('pageUserManagement.table.status'),
formatter: dataFormatter,
sortable: true,
tdClass: 'text-nowrap',
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'locationNumber',
label: t('pageInventory.table.locationNumber'),
formatter: dataFormatter,
sortable: true,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'identifyLed',
label: t('pageInventory.table.identifyLed'),
formatter: dataFormatter,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
]);

Expand Down Expand Up @@ -282,6 +294,20 @@ watch(
},
);

watch(
() => fabricAdapters,
() => {
nextTick(() => {
document
.querySelectorAll('.b-table-sortable-column svg')
.forEach((svg) => {
svg.setAttribute('aria-hidden', 'true');
});
});
},
{ deep: true },
);

function onFiltered(filteredItems) {
searchTotalFilteredRows.value = filteredItems.length;
}
Expand Down
32 changes: 30 additions & 2 deletions src/views/HardwareStatus/Inventory/InventoryTableAssembly.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
<b-form-checkbox
v-if="hasIdentifyLed(row.item.identifyLed)"
v-model="row.item.identifyLed"
name="switch"
:name="'switch-' + row.item.id"
:disabled="serverStatus"
switch
@change="toggleIdentifyLedValue(row.item)"
Expand Down Expand Up @@ -156,7 +156,7 @@ import PageSection from '@/components/Global/PageSection.vue';
import TableCellCount from '@/components/Global/TableCellCount.vue';
import InfoTooltip from '@/components/Global/InfoTooltip.vue';
import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
import { reactive, ref, computed, watch, onBeforeMount } from 'vue';
import { reactive, ref, computed, watch, onBeforeMount, nextTick } from 'vue';
import { useI18n } from 'vue-i18n';
import useDataFormatterGlobal from '../../../components/Composables/useDataFormatterGlobal';
import useTableRowExpandComposable from '../../../components/Composables/useTableRowExpandComposable';
Expand Down Expand Up @@ -190,37 +190,49 @@ const fields = reactive([
key: 'expandRow',
label: '',
tdClass: 'table-row-expand',
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'name',
label: t('pageInventory.table.name'),
formatter: dataFormatter,
sortable: true,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'health',
label: t('pageInventory.table.health'),
formatter: dataFormatter,
sortable: true,
tdClass: 'text-nowrap',
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'status',
label: t('pageUserManagement.table.status'),
formatter: dataFormatter,
sortable: true,
tdClass: 'text-nowrap',
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'locationNumber',
label: t('pageInventory.table.locationNumber'),
formatter: dataFormatter,
sortable: true,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'identifyLed',
label: t('pageInventory.table.identifyLed'),
formatter: dataFormatter,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
]);

Expand Down Expand Up @@ -285,6 +297,8 @@ const tableHeaders = computed(() => {
label: t('pageInventory.table.partNumber'),
formatter: dataFormatter,
sortable: true,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
});
}
return tempFields;
Expand All @@ -302,6 +316,20 @@ watch(
},
);

watch(
() => items,
() => {
nextTick(() => {
document
.querySelectorAll('.b-table-sortable-column svg')
.forEach((svg) => {
svg.setAttribute('aria-hidden', 'true');
});
});
},
{ deep: true },
);

function onFiltered(filteredItems) {
searchTotalFilteredRows.value = filteredItems.length;
}
Expand Down
30 changes: 28 additions & 2 deletions src/views/HardwareStatus/Inventory/InventoryTableBmcManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<b-form-checkbox
v-if="hasIdentifyLed(row.item.identifyLed)"
v-model="row.item.identifyLed"
name="switch"
:name="'switch-' + row.item.id"
switch
@change="toggleIdentifyLedValue(row.item)"
>
Expand Down Expand Up @@ -133,7 +133,7 @@
import PageSection from '@/components/Global/PageSection.vue';
import InfoTooltip from '@/components/Global/InfoTooltip.vue';
import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
import { reactive, ref, computed, onBeforeMount } from 'vue';
import { reactive, ref, computed, onBeforeMount, watch, nextTick } from 'vue';
import useDataFormatterGlobal from '../../../components/Composables/useDataFormatterGlobal';
import useTableRowExpandComposable from '../../../components/Composables/useTableRowExpandComposable';
import stores from '../../../store';
Expand All @@ -155,32 +155,44 @@ const fields = reactive([
key: 'expandRow',
label: '',
tdClass: 'table-row-expand',
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'name',
label: t('pageInventory.table.name'),
formatter: dataFormatter,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'health',
label: t('pageInventory.table.health'),
formatter: dataFormatter,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'status',
label: t('pageUserManagement.table.status'),
formatter: dataFormatter,
tdClass: 'text-nowrap',
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'locationNumber',
label: t('pageInventory.table.locationNumber'),
formatter: dataFormatter,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
{
key: 'identifyLed',
label: t('pageInventory.table.identifyLed'),
formatter: dataFormatter,
thAttr: { scope: 'col' },
tdAttr: { scope: null },
},
]);

Expand All @@ -205,6 +217,20 @@ const items = computed(() => {
}
});

watch(
() => items,
() => {
nextTick(() => {
document
.querySelectorAll('.b-table-sortable-column svg')
.forEach((svg) => {
svg.setAttribute('aria-hidden', 'true');
});
});
},
{ deep: true },
);

function toggleIdentifyLedValue(row) {
bmcStore
.updateIdentifyLedValue({ uri: row.uri, identifyLed: row.identifyLed })
Expand Down
Loading