@humandialog/forms.svelte 1.3.16 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Fab.svelte +77 -46
- package/components/Floating_container.svelte +1 -1
- package/components/combo/combo.svelte +18 -15
- package/components/combo/combo.svelte.d.ts +1 -0
- package/components/contextmenu.svelte +25 -6
- package/components/date.svelte +10 -4
- package/components/date.svelte.d.ts +1 -0
- package/components/date_utils.d.ts +1 -0
- package/components/date_utils.js +10 -0
- package/components/delayed.spinner.svelte +1 -2
- package/components/document/editor.svelte +419 -46
- package/components/document/editor.svelte.d.ts +115 -0
- package/components/document/internal/palette.svelte +20 -0
- package/components/list/List.d.ts +6 -0
- package/components/list/List.js +6 -0
- package/components/list/internal/list.element.props.svelte +23 -8
- package/components/list/internal/list.element.svelte +43 -18
- package/components/list/internal/list.element.svelte.d.ts +1 -0
- package/components/list/list.combo.svelte +6 -0
- package/components/list/list.combo.svelte.d.ts +3 -0
- package/components/list/list.date.svelte +8 -0
- package/components/list/list.date.svelte.d.ts +4 -0
- package/components/list/list.static.svelte +6 -0
- package/components/list/list.static.svelte.d.ts +3 -0
- package/components/list/list.svelte +17 -17
- package/components/list/list.tags.svelte +32 -0
- package/components/list/list.tags.svelte.d.ts +24 -0
- package/components/sidebar/sidebar.item.svelte +25 -8
- package/components/tags.svelte +15 -7
- package/components/tags.svelte.d.ts +2 -0
- package/desk.svelte +9 -6
- package/index.d.ts +7 -2
- package/index.js +7 -2
- package/operations.svelte +61 -12
- package/package.json +4 -2
- package/stores.d.ts +3 -0
- package/stores.js +25 -2
- package/tenant.members.svelte +61 -59
- package/tenant.members.svelte.d.ts +2 -0
package/tenant.members.svelte
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
FaPen,
|
|
5
5
|
FaInfoCircle,
|
|
6
6
|
FaUserSlash,
|
|
7
|
-
FaChevronDown
|
|
7
|
+
FaChevronDown,
|
|
8
|
+
FaInfo} from 'svelte-icons/fa'
|
|
8
9
|
|
|
9
10
|
import Page from './page.svelte'
|
|
10
11
|
import List from './components/list/list.svelte'
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
export let nameAttrib = "Name";
|
|
33
34
|
export let emailAttrib = "login";
|
|
34
35
|
export let refAttrib = "$ref";
|
|
36
|
+
export let hrefAttrib = ''
|
|
35
37
|
export let showFiles = false;
|
|
36
38
|
//export let show_admin = true;
|
|
37
39
|
export let showAccessRoles = false;
|
|
@@ -101,7 +103,10 @@
|
|
|
101
103
|
avatar_url : "",
|
|
102
104
|
invitation_not_accepted: false,
|
|
103
105
|
removed: false,
|
|
104
|
-
membership_tag: ""
|
|
106
|
+
membership_tag: "",
|
|
107
|
+
... hrefAttrib ? {
|
|
108
|
+
[hrefAttrib]: u[hrefAttrib]
|
|
109
|
+
} : { }
|
|
105
110
|
}
|
|
106
111
|
)
|
|
107
112
|
})
|
|
@@ -110,7 +115,7 @@
|
|
|
110
115
|
//fake_users = [];
|
|
111
116
|
//add_fake_users(fake_users);
|
|
112
117
|
|
|
113
|
-
|
|
118
|
+
// await fetch_details();
|
|
114
119
|
|
|
115
120
|
}
|
|
116
121
|
|
|
@@ -136,6 +141,13 @@
|
|
|
136
141
|
|
|
137
142
|
}
|
|
138
143
|
|
|
144
|
+
async function fetch_user_details(reef_user)
|
|
145
|
+
{
|
|
146
|
+
let details = await reef.get(`/sys/user_details?email=${reef_user[emailAttrib]}`)
|
|
147
|
+
set_user_info(reef_user, details);
|
|
148
|
+
list?.reload(reef_users);
|
|
149
|
+
}
|
|
150
|
+
|
|
139
151
|
function set_user_info(user, info)
|
|
140
152
|
{
|
|
141
153
|
user.auth_group = info.auth_group ?? 0;
|
|
@@ -285,25 +297,26 @@
|
|
|
285
297
|
}
|
|
286
298
|
|
|
287
299
|
let page_operations={
|
|
288
|
-
opver:
|
|
300
|
+
opver: 2,
|
|
289
301
|
operations: [
|
|
290
302
|
{
|
|
291
303
|
caption: 'View',
|
|
292
304
|
operations: [
|
|
293
305
|
{
|
|
294
306
|
icon: FaUserPlus,
|
|
295
|
-
caption: '',
|
|
307
|
+
caption: 'Add user',
|
|
296
308
|
action: (focused) => { create_new_user(); },
|
|
297
|
-
|
|
309
|
+
// fab: 'M10',
|
|
298
310
|
tbr: 'A'
|
|
299
311
|
},
|
|
300
|
-
|
|
312
|
+
// przenieść na stronie /profile
|
|
313
|
+
/* {
|
|
301
314
|
icon: FaUserSlash,
|
|
302
|
-
caption: '',
|
|
315
|
+
caption: 'Delete application account',
|
|
303
316
|
action: (f) => {askToDeleteApplicationAccount();},
|
|
304
|
-
fab: 'S00',
|
|
317
|
+
//fab: 'S00',
|
|
305
318
|
tbr: 'C'
|
|
306
|
-
}
|
|
319
|
+
}*/
|
|
307
320
|
]
|
|
308
321
|
}
|
|
309
322
|
]
|
|
@@ -317,18 +330,14 @@
|
|
|
317
330
|
action: (focused) => { list.edit(user, nameAttrib) }
|
|
318
331
|
},
|
|
319
332
|
{
|
|
320
|
-
caption: 'Users management',
|
|
333
|
+
caption: 'Users management (auth role)',
|
|
321
334
|
action: (focused) => { list.edit(user, 'Privileges') }
|
|
322
335
|
}];
|
|
323
336
|
|
|
324
337
|
if(showAccessRoles)
|
|
325
338
|
{
|
|
326
339
|
operations.push({
|
|
327
|
-
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
operations.push({
|
|
331
|
-
caption: 'Access role',
|
|
340
|
+
caption: 'Access role (app role)',
|
|
332
341
|
action: (focused) => { list.edit(user, 'Access') }
|
|
333
342
|
});
|
|
334
343
|
}
|
|
@@ -336,7 +345,7 @@
|
|
|
336
345
|
if(showFiles)
|
|
337
346
|
{
|
|
338
347
|
operations.push({
|
|
339
|
-
caption: 'External files',
|
|
348
|
+
caption: 'External files (files role)',
|
|
340
349
|
action: (focused) => { list.edit(user, 'Files') }
|
|
341
350
|
});
|
|
342
351
|
}
|
|
@@ -346,74 +355,62 @@
|
|
|
346
355
|
|
|
347
356
|
let user_operations = (user) => {
|
|
348
357
|
|
|
349
|
-
let operations = [
|
|
358
|
+
let operations = [
|
|
359
|
+
{
|
|
360
|
+
caption: 'Fetch info',
|
|
361
|
+
icon: FaInfo,
|
|
362
|
+
action: (f) => fetch_user_details(user),
|
|
363
|
+
tbr: 'A'
|
|
364
|
+
}
|
|
365
|
+
];
|
|
350
366
|
|
|
351
367
|
if(user.removed)
|
|
352
368
|
{
|
|
353
|
-
operations = [
|
|
369
|
+
operations = [ ...operations,
|
|
354
370
|
{
|
|
355
371
|
icon: FaUserPlus,
|
|
356
|
-
caption: '',
|
|
372
|
+
caption: 'Revert removing',
|
|
357
373
|
action: (f) => askToAddAgain(user),
|
|
358
|
-
fab: 'M10',
|
|
359
|
-
tbr: '
|
|
374
|
+
// fab: 'M10',
|
|
375
|
+
tbr: 'A'
|
|
360
376
|
}
|
|
361
377
|
];
|
|
362
378
|
}
|
|
363
379
|
else
|
|
364
380
|
{
|
|
365
381
|
let edit_operations = get_edit_operations(user)
|
|
366
|
-
|
|
367
|
-
{
|
|
368
|
-
operations.push({
|
|
369
|
-
icon: FaPen,
|
|
370
|
-
caption: '',
|
|
371
|
-
action: edit_operations[0].action,
|
|
372
|
-
fab: 'M20',
|
|
373
|
-
tbr: 'B'
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
else
|
|
377
|
-
{
|
|
378
|
-
operations.push({
|
|
379
|
-
icon: FaPen,
|
|
380
|
-
caption: '',
|
|
381
|
-
grid: edit_operations,
|
|
382
|
-
fab: 'M20',
|
|
383
|
-
tbr: 'B'
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
|
|
382
|
+
|
|
387
383
|
operations.push({
|
|
388
|
-
|
|
384
|
+
icon: FaPen,
|
|
385
|
+
caption: 'Change',
|
|
386
|
+
menu: edit_operations,
|
|
387
|
+
//fab: 'M20',
|
|
388
|
+
tbr: 'A'
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
operations.push({
|
|
392
|
+
caption: 'Remove user',
|
|
389
393
|
icon: FaUserMinus,
|
|
390
394
|
action: (focused) => askToRemove(user),
|
|
391
|
-
|
|
392
|
-
tbr: '
|
|
395
|
+
// fab: 'M30',
|
|
396
|
+
tbr: 'A'
|
|
393
397
|
});
|
|
394
398
|
}
|
|
395
399
|
|
|
396
400
|
|
|
397
401
|
return {
|
|
398
|
-
opver:
|
|
402
|
+
opver: 2,
|
|
399
403
|
operations: [
|
|
400
404
|
{
|
|
401
405
|
caption: 'User',
|
|
406
|
+
// tbr: 'B',
|
|
402
407
|
operations: operations
|
|
403
408
|
}
|
|
404
409
|
]
|
|
405
410
|
}
|
|
406
411
|
}
|
|
407
412
|
|
|
408
|
-
|
|
409
|
-
if(user.removed)
|
|
410
|
-
return [];
|
|
411
|
-
|
|
412
|
-
let edit_operations = get_edit_operations(user);
|
|
413
|
-
return {
|
|
414
|
-
grid: edit_operations
|
|
415
|
-
}
|
|
416
|
-
}
|
|
413
|
+
|
|
417
414
|
|
|
418
415
|
let data_item =
|
|
419
416
|
{
|
|
@@ -695,7 +692,13 @@
|
|
|
695
692
|
create_new_user();
|
|
696
693
|
}
|
|
697
694
|
|
|
698
|
-
|
|
695
|
+
function getHRefFunc()
|
|
696
|
+
{
|
|
697
|
+
if(!hrefAttrib)
|
|
698
|
+
return undefined
|
|
699
|
+
else
|
|
700
|
+
return (user) => { return user[hrefAttrib]}
|
|
701
|
+
}
|
|
699
702
|
|
|
700
703
|
</script>
|
|
701
704
|
|
|
@@ -713,9 +716,8 @@
|
|
|
713
716
|
<List objects={reef_users}
|
|
714
717
|
title='Members'
|
|
715
718
|
toolbarOperations={user_operations}
|
|
716
|
-
contextMenu={user_context_menu}
|
|
717
719
|
bind:this={list}>
|
|
718
|
-
<ListTitle a={nameAttrib} onChange={on_name_changed}/>
|
|
720
|
+
<ListTitle a={nameAttrib} onChange={on_name_changed} hrefFunc={getHRefFunc()}/>
|
|
719
721
|
<ListSummary a={emailAttrib} readonly/>
|
|
720
722
|
|
|
721
723
|
<ListStaticProperty name="Membership" a="membership_tag"/>
|
|
@@ -6,6 +6,7 @@ export default class Tenant extends SvelteComponentTyped<{
|
|
|
6
6
|
nameAttrib?: string | undefined;
|
|
7
7
|
emailAttrib?: string | undefined;
|
|
8
8
|
refAttrib?: string | undefined;
|
|
9
|
+
hrefAttrib?: string | undefined;
|
|
9
10
|
showFiles?: boolean | undefined;
|
|
10
11
|
showAccessRoles?: boolean | undefined;
|
|
11
12
|
}, {
|
|
@@ -22,6 +23,7 @@ declare const __propDef: {
|
|
|
22
23
|
nameAttrib?: string | undefined;
|
|
23
24
|
emailAttrib?: string | undefined;
|
|
24
25
|
refAttrib?: string | undefined;
|
|
26
|
+
hrefAttrib?: string | undefined;
|
|
25
27
|
showFiles?: boolean | undefined;
|
|
26
28
|
showAccessRoles?: boolean | undefined;
|
|
27
29
|
};
|