Skip to content

Commit f4399d9

Browse files
committed
chore(web-app-admin-settings, web-app-files, design-system): [OCISDEV-391] ui improvements
1 parent 29e6fc2 commit f4399d9

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

packages/design-system/src/components/OcTable/OcTable.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@
5252
<span
5353
v-else
5454
class="oc-table-thead-content header-text"
55-
v-text="extractFieldTitle(field)"
55+
:class="{ 'oc-invisible-sr': !extractFieldTitle(field) }"
56+
:aria-hidden="extractFieldTitle(field) ? 'false' : 'true'"
57+
v-text="
58+
extractFieldTitle(field) || hasIconsColumn
59+
? $pgettext('Table component header', 'icons')
60+
: ''
61+
"
5662
/>
5763
</div>
5864
</oc-th>
@@ -159,6 +165,7 @@ import { useGettext } from 'vue3-gettext'
159165
* @prop {String} sortDir - Current sort direction ('asc' or 'desc').
160166
* @prop {String} sortBy - Current sort column name.
161167
* @prop {Object} groupingSettings - Grouping configuration (CERN-specific).
168+
* @prop {Boolean} hasIconsColumn - To show table header for columns with no value but icons.
162169
*
163170
* @event item-dropped - Emitted when an item is dropped during drag and drop.
164171
* @event item-dragged - Emitted when an item starts being dragged.
@@ -222,6 +229,7 @@ interface Props {
222229
sortBy?: string
223230
caption?: string
224231
captionVisible?: boolean
232+
hasIconsColumn?: boolean
225233
}
226234
227235
interface Emits {
@@ -258,7 +266,8 @@ const {
258266
sortDir = undefined,
259267
sortBy = undefined,
260268
caption = '',
261-
captionVisible = true
269+
captionVisible = true,
270+
hasIconsColumn = false
262271
} = defineProps<Props>()
263272
264273
const emit = defineEmits<Emits>()

packages/web-app-admin-settings/tests/unit/components/Spaces/__snapshots__/SpacesList.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports[`SpacesList > should render all spaces in a table 1`] = `
2020
<div><span class="oc-table-thead-content"><oc-checkbox-stub id="oc-checkbox-1" modelvalue="false" disabled="false" label="Select all spaces" labelhidden="true" labelclasses="" size="large" class="oc-ml-s"></oc-checkbox-stub></span></div>
2121
</th>
2222
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-icon" style="top: 0px;">
23-
<div><span class="oc-table-thead-content header-text"></span></div>
23+
<div><span class="oc-table-thead-content header-text oc-invisible-sr" aria-hidden="true"></span></div>
2424
</th>
2525
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-name" style="top: 0px;" aria-sort="ascending"><button type="button" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-button-sort oc-width-1-1">
2626
<!--v-if-->
@@ -31,7 +31,7 @@ exports[`SpacesList > should render all spaces in a table 1`] = `
3131
<!-- @slot Content of the button --> <span class="oc-table-thead-content header-text">Status</span> <span class="oc-icon oc-icon-s oc-icon-passive oc-invisible-sr"><!----></span>
3232
</button></th>
3333
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-manager" style="top: 0px;">
34-
<div><span class="oc-table-thead-content header-text">Manager</span></div>
34+
<div><span class="oc-table-thead-content header-text" aria-hidden="false">icons</span></div>
3535
</th>
3636
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-members" style="top: 0px;"><button type="button" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-button-sort oc-width-1-1">
3737
<!--v-if-->
@@ -54,7 +54,7 @@ exports[`SpacesList > should render all spaces in a table 1`] = `
5454
<!-- @slot Content of the button --> <span class="oc-table-thead-content header-text">Modified</span> <span class="oc-icon oc-icon-s oc-icon-passive oc-invisible-sr"><!----></span>
5555
</button></th>
5656
<th class="oc-table-cell oc-table-cell-align-right oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-actions oc-pr-s" style="top: 0px;">
57-
<div><span class="oc-table-thead-content header-text">Actions</span></div>
57+
<div><span class="oc-table-thead-content header-text" aria-hidden="false">icons</span></div>
5858
</th>
5959
</tr>
6060
</thead>

packages/web-app-admin-settings/tests/unit/views/__snapshots__/Users.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ exports[`Users view > list view > renders list initially 1`] = `
9999
<div><span class="oc-table-thead-content"><!-- TODO: check whether we really need the click here --> <!-- eslint-disable vuejs-accessibility/no-static-element-interactions --> <!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events --> <span><!-- eslint-enable vuejs-accessibility/no-static-element-interactions --> <input id="oc-checkbox-1" type="checkbox" name="checkbox" class="oc-checkbox oc-rounded oc-checkbox-l"> <label for="oc-checkbox-1" class="oc-cursor-pointer oc-invisible-sr">Select all users</label></span></span></div>
100100
</th>
101101
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-avatar" style="top: 0px;">
102-
<div><span class="oc-table-thead-content header-text"></span></div>
102+
<div><span class="oc-table-thead-content header-text oc-invisible-sr" aria-hidden="true"></span></div>
103103
</th>
104104
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-onPremisesSamAccountName" style="top: 0px;" aria-sort="ascending">
105105
<oc-button-stub type="button" disabled="false" size="medium" submit="button" variation="passive" appearance="raw" justifycontent="center" gapsize="medium" showspinner="false" class="oc-button-sort oc-width-1-1"></oc-button-stub>
@@ -117,7 +117,7 @@ exports[`Users view > list view > renders list initially 1`] = `
117117
<oc-button-stub type="button" disabled="false" size="medium" submit="button" variation="passive" appearance="raw" justifycontent="center" gapsize="medium" showspinner="false" class="oc-button-sort oc-width-1-1"></oc-button-stub>
118118
</th>
119119
<th class="oc-table-cell oc-table-cell-align-right oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-actions oc-pr-s" style="top: 0px;">
120-
<div><span class="oc-table-thead-content header-text">Actions</span></div>
120+
<div><span class="oc-table-thead-content header-text" aria-hidden="false">icons</span></div>
121121
</th>
122122
</tr>
123123
</thead>

packages/web-app-files/src/views/spaces/DriveResolver.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<script lang="ts" setup>
1212
import DriveRedirect from './DriveRedirect.vue'
1313
import GenericSpace from './GenericSpace.vue'
14-
import GenericTrash from './GenericTrash.vue'
1514
1615
import { computed, onMounted, ref, unref, useAttrs } from 'vue'
1716
import {

packages/web-app-files/src/views/trash/Overview.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
:header-position="fileListHeaderY"
3737
:sticky="true"
3838
:hover="true"
39+
:has-icons-column="true"
3940
@sort="handleSort"
4041
>
4142
<template #icon="{ item }">

packages/web-app-files/tests/unit/views/trash/__snapshots__/Overview.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports[`TrashOverview > view states > should render spaces list 1`] = `
2020
<thead class="oc-thead">
2121
<tr class="oc-table-header-row">
2222
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-shrink oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-icon oc-pl-s" style="top: 0px;">
23-
<div><span class="oc-table-thead-content header-text"></span></div>
23+
<div><span class="oc-table-thead-content header-text oc-invisible-sr" aria-hidden="true">icons</span></div>
2424
</th>
2525
<th class="oc-table-cell oc-table-cell-align-left oc-table-cell-align-middle oc-table-cell-width-auto oc-text-nowrap oc-th oc-table-header-cell oc-table-header-cell-name oc-pr-s" style="top: 0px;" aria-sort="ascending"><button type="button" class="oc-button oc-rounded oc-button-m oc-button-justify-content-center oc-button-gap-m oc-button-passive oc-button-passive-raw oc-button-sort oc-width-1-1">
2626
<!--v-if-->

0 commit comments

Comments
 (0)