@nymphjs/tilmeld-setup 1.0.0-beta.11 → 1.0.0-beta.111
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/CHANGELOG.md +442 -0
- package/README.md +6 -5
- package/app/index.ts +9 -3
- package/app/src/App.svelte +143 -71
- package/app/src/nymph.ts +1 -1
- package/app/src/routes/GroupEdit.svelte +638 -0
- package/app/src/routes/Groups.svelte +201 -0
- package/app/src/{Intro.svelte → routes/Intro.svelte} +14 -1
- package/app/src/routes/NotFound.svelte +9 -0
- package/app/src/routes/UserEdit.svelte +1202 -0
- package/app/src/routes/Users.svelte +201 -0
- package/dist/app/index.css +105 -0
- package/dist/app/index.d.ts +1 -0
- package/dist/app/index.js +41288 -3
- package/dist/app/smui.css +1 -29
- package/dist/app/src/nymph.d.ts +6 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +19 -18
- package/dist/index.js.map +1 -1
- package/jest.config.js +11 -2
- package/package.json +58 -54
- package/rollup.config.mjs +36 -0
- package/src/index.ts +28 -21
- package/src/type/locutus.d.ts +3 -0
- package/static/index.html +4 -1
- package/test.mjs +13 -12
- package/tsconfig.json +11 -1
- package/tsconfig.server.json +5 -3
- package/typedoc.json +5 -0
- package/app/src/GroupEdit.svelte +0 -570
- package/app/src/Groups.svelte +0 -159
- package/app/src/UserEdit.svelte +0 -902
- package/app/src/Users.svelte +0 -159
- package/dist/app/index.js.LICENSE.txt +0 -114
- package/dist/app/index.js.map +0 -1
- package/webpack.config.js +0 -38
package/app/src/Groups.svelte
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
{#if clientConfig == null || user == null}
|
|
2
|
-
<section>
|
|
3
|
-
<div style="display: flex; justify-content: center; align-items: center;">
|
|
4
|
-
<CircularProgress style="height: 45px; width: 45px;" indeterminate />
|
|
5
|
-
</div>
|
|
6
|
-
</section>
|
|
7
|
-
{:else if entity == null}
|
|
8
|
-
<div class="solo-search-container solo-container">
|
|
9
|
-
<Fab
|
|
10
|
-
on:click={async () => (entity = await Group.factory())}
|
|
11
|
-
color="primary"
|
|
12
|
-
mini
|
|
13
|
-
class="solo-fab"
|
|
14
|
-
title="New Group"
|
|
15
|
-
>
|
|
16
|
-
<Icon component={Svg} viewBox="0 0 24 24">
|
|
17
|
-
<path fill="currentColor" d={mdiPlus} />
|
|
18
|
-
</Icon>
|
|
19
|
-
</Fab>
|
|
20
|
-
<Paper class="solo-paper" elevation={6}>
|
|
21
|
-
<Icon class="solo-icon" component={Svg} viewBox="0 0 24 24">
|
|
22
|
-
<path fill="currentColor" d={mdiMagnify} />
|
|
23
|
-
</Icon>
|
|
24
|
-
<Input
|
|
25
|
-
bind:value={entitySearch}
|
|
26
|
-
on:keydown={entitySearchKeyDown}
|
|
27
|
-
placeholder="Group Search"
|
|
28
|
-
class="solo-input"
|
|
29
|
-
/>
|
|
30
|
-
</Paper>
|
|
31
|
-
<Fab
|
|
32
|
-
on:click={searchEntities}
|
|
33
|
-
disabled={entitySearch === ''}
|
|
34
|
-
color="primary"
|
|
35
|
-
mini
|
|
36
|
-
class="solo-fab"
|
|
37
|
-
title="Search"
|
|
38
|
-
>
|
|
39
|
-
<Icon component={Svg} viewBox="0 0 24 24">
|
|
40
|
-
<path fill="currentColor" d={mdiArrowRight} />
|
|
41
|
-
</Icon>
|
|
42
|
-
</Fab>
|
|
43
|
-
</div>
|
|
44
|
-
<section>
|
|
45
|
-
{#if failureMessage}
|
|
46
|
-
<div class="tilmeld-failure">
|
|
47
|
-
{failureMessage}
|
|
48
|
-
</div>
|
|
49
|
-
{/if}
|
|
50
|
-
|
|
51
|
-
{#if entitiesSearching}
|
|
52
|
-
<div style="display: flex; justify-content: center; align-items: center;">
|
|
53
|
-
<CircularProgress style="height: 32px; width: 32px;" indeterminate />
|
|
54
|
-
</div>
|
|
55
|
-
{:else if entities != null}
|
|
56
|
-
<DataTable table$aria-label="Group list" style="width: 100%;">
|
|
57
|
-
<Head>
|
|
58
|
-
<Row>
|
|
59
|
-
{#if !clientConfig.emailUsernames}
|
|
60
|
-
<Cell>Groupname</Cell>
|
|
61
|
-
{/if}
|
|
62
|
-
<Cell>Name</Cell>
|
|
63
|
-
<Cell>Email</Cell>
|
|
64
|
-
<Cell>Enabled</Cell>
|
|
65
|
-
</Row>
|
|
66
|
-
</Head>
|
|
67
|
-
<Body>
|
|
68
|
-
{#each entities as curEntity (curEntity.guid)}
|
|
69
|
-
<Row on:click={() => (entity = curEntity)} style="cursor: pointer;">
|
|
70
|
-
{#if !clientConfig.emailUsernames}
|
|
71
|
-
<Cell>{curEntity.groupname}</Cell>
|
|
72
|
-
{/if}
|
|
73
|
-
<Cell>{curEntity.name}</Cell>
|
|
74
|
-
<Cell>{curEntity.email}</Cell>
|
|
75
|
-
<Cell>{curEntity.enabled ? 'Yes' : 'No'}</Cell>
|
|
76
|
-
</Row>
|
|
77
|
-
{/each}
|
|
78
|
-
</Body>
|
|
79
|
-
</DataTable>
|
|
80
|
-
{/if}
|
|
81
|
-
</section>
|
|
82
|
-
{:else}
|
|
83
|
-
<GroupEdit
|
|
84
|
-
{entity}
|
|
85
|
-
on:leave={() => {
|
|
86
|
-
entity = undefined;
|
|
87
|
-
}}
|
|
88
|
-
/>
|
|
89
|
-
{/if}
|
|
90
|
-
|
|
91
|
-
<script lang="ts">
|
|
92
|
-
import { onMount } from 'svelte';
|
|
93
|
-
import queryParser from '@nymphjs/query-parser';
|
|
94
|
-
import type {
|
|
95
|
-
AdminGroupData,
|
|
96
|
-
ClientConfig,
|
|
97
|
-
CurrentUserData,
|
|
98
|
-
} from '@nymphjs/tilmeld-client';
|
|
99
|
-
import type {
|
|
100
|
-
Group as GroupClass,
|
|
101
|
-
User as UserClass,
|
|
102
|
-
} from '@nymphjs/tilmeld-client';
|
|
103
|
-
import { mdiMagnify, mdiArrowRight, mdiPlus } from '@mdi/js';
|
|
104
|
-
import CircularProgress from '@smui/circular-progress';
|
|
105
|
-
import Paper from '@smui/paper';
|
|
106
|
-
import DataTable, { Head, Body, Row, Cell } from '@smui/data-table';
|
|
107
|
-
import { Input } from '@smui/textfield';
|
|
108
|
-
import Fab from '@smui/fab';
|
|
109
|
-
import { Icon, Svg } from '@smui/common';
|
|
110
|
-
|
|
111
|
-
import { nymph, Group, User } from './nymph';
|
|
112
|
-
import GroupEdit from './GroupEdit.svelte';
|
|
113
|
-
|
|
114
|
-
let clientConfig: ClientConfig | undefined = undefined;
|
|
115
|
-
let user: (UserClass & CurrentUserData) | undefined = undefined;
|
|
116
|
-
let entitySearch = '';
|
|
117
|
-
let failureMessage: string | undefined = undefined;
|
|
118
|
-
|
|
119
|
-
let entity: (GroupClass & AdminGroupData) | undefined = undefined;
|
|
120
|
-
|
|
121
|
-
onMount(async () => {
|
|
122
|
-
user = (await User.current()) ?? undefined;
|
|
123
|
-
});
|
|
124
|
-
onMount(async () => {
|
|
125
|
-
clientConfig = await User.getClientConfig();
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
let entitiesSearching = false;
|
|
129
|
-
let entities: (GroupClass & AdminGroupData)[] | undefined = undefined;
|
|
130
|
-
async function searchEntities() {
|
|
131
|
-
entitiesSearching = true;
|
|
132
|
-
failureMessage = undefined;
|
|
133
|
-
try {
|
|
134
|
-
const query = queryParser({
|
|
135
|
-
query: entitySearch,
|
|
136
|
-
entityClass: Group,
|
|
137
|
-
defaultFields: ['groupname', 'name', 'email'],
|
|
138
|
-
qrefMap: {
|
|
139
|
-
User: {
|
|
140
|
-
class: User,
|
|
141
|
-
defaultFields: ['username', 'name', 'email'],
|
|
142
|
-
},
|
|
143
|
-
Group: {
|
|
144
|
-
class: Group,
|
|
145
|
-
defaultFields: ['groupname', 'name', 'email'],
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
entities = await nymph.getEntities(...query);
|
|
150
|
-
} catch (e: any) {
|
|
151
|
-
failureMessage = e?.message;
|
|
152
|
-
}
|
|
153
|
-
entitiesSearching = false;
|
|
154
|
-
}
|
|
155
|
-
function entitySearchKeyDown(event: CustomEvent | KeyboardEvent) {
|
|
156
|
-
event = event as KeyboardEvent;
|
|
157
|
-
if (event.key === 'Enter') searchEntities();
|
|
158
|
-
}
|
|
159
|
-
</script>
|