Skip to content

Commit 0fb9262

Browse files
committed
Dataset Creation / Edit / Data Structure: Accessibility Improvements #2271
1 parent 0157948 commit 0fb9262

File tree

8 files changed

+71
-37
lines changed

8 files changed

+71
-37
lines changed

Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI.Svelte/src/lib/components/datadescription/Generate.svelte

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
import { goTo } from '../../../services/BaseCaller';
33
import { MultiSelect, Spinner } from '@bexis2/bexis2-core-ui';
44
import type { listItemType } from '@bexis2/bexis2-core-ui';
5-
import { onMount, createEventDispatcher } from 'svelte';
5+
import { onMount, createEventDispatcher} from 'svelte';
66
77
import { availableStructues, setStructure } from '$services/DataDescriptionCaller';
88
import { getHookStart } from '$services/HookCaller';
99
1010
import type { DataDescriptionModel } from '$models/DataDescription';
1111
1212
import { latestFileUploadDate, latestDataDescriptionDate } from '../../../routes/edit/stores';
13-
13+
1414
const dispatch = createEventDispatcher();
1515
1616
function goToGenerate(file, id) {
@@ -38,6 +38,9 @@
3838
let structures = [];
3939
$: structures;
4040
41+
let selected;
42+
$: selected;
43+
4144
onMount(async () => {
4245
reload();
4346
setList(model.readableFiles, structures);
@@ -63,41 +66,69 @@
6366
}
6467
6568
// after select a value from the dropdown
66-
// it will go to the generator or selet a exiting structure
69+
// it will go to the generator or select a exiting structure
6770
async function change(e) {
6871
let item = e.detail;
6972
//console.log("select item",item)
7073
71-
if (item.group === 'options') {
74+
if (item.group === 'other options') {
7275
//console.log("go to create a datastructure")
7376
goToCreate();
74-
} else if (item.group === 'file') {
77+
} else if (item.group === 'create new based on file') {
78+
if (item.text === 'upload first a file to create a new data structure based on it') {
79+
// do nothing
80+
// trigger clear selection
81+
selected = null;
82+
return;
83+
}
7584
loading = true;
7685
goToGenerate(e.detail.text, model.id);
77-
} else if (item.group === 'structure') {
86+
} else if (item.group === 'data structures') {
7887
console.log('select a structure', id, item.id);
7988
loading = true;
8089
await setStructure(model.id, item.id);
8190
dispatch('selected');
8291
}
8392
}
8493
85-
// list is a comibnation of options, already existing datastructures and files
94+
// list is a combination of options, already existing data structures and files
8695
function setList(files, structureList) {
8796
list = [];
8897
89-
if (model.isRestricted == false) {
90-
// if user is not restricted by selection of the structures, then add option to vcreate a new one
91-
list.push({ id: 0, text: 'create new', group: 'options' });
92-
}
93-
9498
if (files && model.isRestricted == false) {
9599
// if user is not restricted by selection of the structures, then add option to create from file
96-
files.forEach((i) => list.push({ id: i.name, text: i.name, group: 'file' }));
100+
if (files.length > 0){
101+
files.forEach((i) => list.push({
102+
id: i.name, text: i.name, group: 'create new based on file',
103+
description: ''
104+
}));
105+
}
106+
else{
107+
// if no files are available, we can not create from file
108+
list.push({
109+
id: 0, text: 'upload first a file to create a new data structure based on it', group: 'create new based on file',
110+
description: ''
111+
});
112+
}
113+
}
114+
115+
if (model.isRestricted == false) {
116+
// if user is not restricted by selection of the structures, then add option to vcreate a new one
117+
// get max id to avoid id conflict
118+
let maxId = 0;
119+
list.forEach((i) => {
120+
if (i.id > maxId) maxId = i.id;
121+
});
122+
list.push({
123+
id: maxId + 1, text: 'create a new data structure manually', group: 'other options',
124+
description: '',
125+
});
97126
}
98127
99128
if (structureList) {
100129
//structureList!== null && structureList != undefined)
130+
// change group from structure to existing structure
131+
structureList.forEach((s) => (s.group = 'data structures'));
101132
list = [...list, ...structureList];
102133
}
103134
}
@@ -107,7 +138,8 @@
107138
<div class="flex">
108139
<MultiSelect
109140
id="SelectDataStructure"
110-
title="Generate based on an uploaded file, select an existing one, or create a new"
141+
title="Create new (uploaded file or manually) or select an existing data structure"
142+
placeholder="Select data structure option"
111143
itemId="id"
112144
itemLabel="text"
113145
itemGroup="group"
@@ -117,6 +149,8 @@
117149
complexTarget={true}
118150
isMulti={false}
119151
{loading}
152+
bind:target={selected}
153+
120154
/>
121155
</div>
122156
{/if}

Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI.Svelte/src/lib/components/datadescription/ShowHeader.svelte

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import type { fileInfoType } from '@bexis2/bexis2-core-ui';
44
55
import Fa from 'svelte-fa';
6-
import { faTrash, faEdit, faDownload } from '@fortawesome/free-solid-svg-icons';
6+
import { faTrash, faPencil, faDownload } from '@fortawesome/free-solid-svg-icons';
77
88
import { removeStructure } from '$services/DataDescriptionCaller';
99
import { latestDataDescriptionDate } from '../../../routes/edit/stores';
@@ -28,8 +28,8 @@
2828
2929
const modal: ModalSettings = {
3030
type: 'confirm',
31-
title: 'Copy',
32-
body: 'Are you sure you wish to remove the structure?',
31+
title: 'Remove Data Structure',
32+
body: 'Are you sure you want to remove this data structure?',
3333
// TRUE if confirm pressed, FALSE if cancel pressed
3434
response: (r: boolean) => {
3535
if (r === true) {
@@ -87,20 +87,20 @@
8787
</div>
8888
<div>
8989
<div class="flex gap-2 text-end flex-auto">
90-
<button title="download" class="chip variant-filled-secondary" on:click={downloadFn}
91-
><Fa icon={faDownload} /></button
90+
<button title="Download data structure template as excel file" class="chip variant-filled-secondary" on:click={downloadFn}
91+
><Fa icon={faDownload} /><span class="pl-1">Download</span></button
9292
>
9393
{#if enableEdit}
94-
<button title="edit" class="chip variant-filled-secondary" on:click={goToEditFn}
95-
><Fa icon={faEdit} /></button
94+
<button title="Edit data structure" class="chip variant-filled-secondary" on:click={goToEditFn}
95+
><Fa icon={faPencil} /><span class="pl-1">Edit</span></button
9696
>
9797
{/if}
9898

9999
{#if hasData === false}
100100
<button
101-
title="remove"
101+
title="Remove data structure"
102102
class="chip variant-filled-error"
103-
on:click={() => modalStore.trigger(modal)}><Fa icon={faTrash} /></button
103+
on:click={() => modalStore.trigger(modal)}><Fa icon={faTrash} /><span class="pl-1">Remove</span></button
104104
>
105105
{/if}
106106
</div>

Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI.Svelte/src/lib/components/fileupload/FileOverviewItem.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
{#if loading}
7777
<Spinner textCss="text-surface-500" />
7878
{:else}
79-
<button class="btn" on:click={(e) => handleRemoveFile(e)}><Fa icon={faIcon} /></button>
79+
<button title="Remove file" class="btn" on:click={(e) => handleRemoveFile(e)}><Fa icon={faIcon} /></button>
8080
{/if}
8181
</div>
8282
</div>

Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI.Svelte/src/lib/hooks/Metadata.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@
6161

6262
<div class="flex-col space-y-1">
6363
<div class="flex gap-3 justify-left">
64-
<button class="chip variant-filled-secondary flex-none" on:click={editFn}
65-
><Fa icon={faPen} /></button
64+
<button class="btn btn-sm variant-filled-secondary flex-none" on:click={editFn}
65+
><Fa icon={faPen} /><span class="pl-1">Edit</span></button
6666
>
6767
</div>
6868
</div>
6969
{#if open}
7070
<MetadataDrawer {id} url={model.externalMetadataFormUrl} on:close={() => (open = false)}
7171
></MetadataDrawer>
72-
{/if}
72+
{/if}

Console/BExIS.Web.Shell/Areas/DCM/BExIS.Modules.Dcm.UI.Svelte/src/routes/create/Form.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,14 @@
159159
{/if}
160160
</div>
161161
<button
162-
title="cancel"
162+
title="Cancel creating a new dataset"
163163
type="button"
164164
class="btn variant-filled-warning"
165-
on:click={onCancel}><Fa icon={faXmark} /></button
165+
on:click={onCancel}><Fa icon={faXmark} /><span class="pl-1">Cancel</span></button
166166
>
167167

168-
<button title="create" type="submit" class="btn variant-filled-primary" {disabled}
169-
><Fa icon={faAdd} /></button
168+
<button title="Create a new dataset and continue editing" type="submit" class="btn variant-filled-primary" {disabled}
169+
><Fa icon={faAdd} /><span class="pl-1">Create and Continue</span></button
170170
>
171171
</div>
172172
</form>

Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/src/lib/components/datastructure/structure/EditStructure.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
on:mouseover={() => helpStore.show('check')}
127127
on:focus={() => helpStore.show('check')}
128128
on:click={onCheckPKHandler}
129-
on:keypress={onCheckPKHandler}><Fa icon={faBinoculars} /></button
129+
on:keypress={onCheckPKHandler}><Fa icon={faBinoculars} /><span class="pl-1">Check Primary Key</span></button
130130
>
131131
{/if}
132132
<button
@@ -137,7 +137,7 @@
137137
disabled={!areVariablesValid ||
138138
!areAttributesValid ||
139139
!((enforcePrimaryKey && isPKSet) || !enforcePrimaryKey) ||
140-
(pksHasChanged && !pksValid)}><Fa icon={faSave} /></button
140+
(pksHasChanged && !pksValid)}><Fa icon={faSave} /><span class="pl-1">Save</span></button
141141
>
142142
</div>
143143
</div>

Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/src/lib/components/datastructure/structure/variable/Header.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
<div class="flex-none flex-col text-right w-1/4">
5959
<div class="flex gap-2 pb-2 justify-end">
60-
<div>Mark as part of primary key</div>
60+
<div>{isKey ? 'Part of primary key' : 'Not part of primary key'}</div>
6161
<SlideToggle
6262
size="sm"
6363
name="isKey"
@@ -68,11 +68,11 @@
6868
></SlideToggle>
6969
</div>
7070
<div class="flex gap-2 pb-2 justify-end">
71-
<div>Value can be optional</div>
71+
<div>{isOptional ? 'Value is optional' : 'Value is required'}</div>
7272
<SlideToggle
7373
size="sm"
7474
name="isOptional"
75-
title={isOptional ? 'Value can be optional' : 'Value is required'}
75+
title={isOptional ? 'Value is optional' : 'Value is required'}
7676
active="bg-primary-500"
7777
bind:checked={isOptional}
7878
disabled={blockDataRelevant}

Console/BExIS.Web.Shell/Areas/RPM/BExIS.Modules.Rpm.UI.Svelte/src/lib/components/datastructure/structure/variable/Variable.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ import { faTable } from '@fortawesome/free-solid-svg-icons';
374374

375375
<div slot="template">
376376
<div class="flex w-full gap-1 py-1">
377-
<div class="grow">Template (data is copy and changeable!)</div>
377+
<div class="grow">Template (data is copied and changeable!)</div>
378378
{#each suggestedTemplates.slice(0, 3) as t}
379379
<button
380380
title="Click to select"

0 commit comments

Comments
 (0)