@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/Users.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 User.factory())}
|
|
11
|
-
color="primary"
|
|
12
|
-
mini
|
|
13
|
-
class="solo-fab"
|
|
14
|
-
title="New User"
|
|
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="User 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="User list" style="width: 100%;">
|
|
57
|
-
<Head>
|
|
58
|
-
<Row>
|
|
59
|
-
{#if !clientConfig.emailUsernames}
|
|
60
|
-
<Cell>Username</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.username}</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
|
-
<UserEdit
|
|
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
|
-
AdminUserData,
|
|
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, User, Group } from './nymph';
|
|
112
|
-
import UserEdit from './UserEdit.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: (UserClass & AdminUserData) | 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: (UserClass & AdminUserData)[] | undefined = undefined;
|
|
130
|
-
async function searchEntities() {
|
|
131
|
-
entitiesSearching = true;
|
|
132
|
-
failureMessage = undefined;
|
|
133
|
-
try {
|
|
134
|
-
const query = queryParser({
|
|
135
|
-
query: entitySearch,
|
|
136
|
-
entityClass: User,
|
|
137
|
-
defaultFields: ['username', '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>
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2016 Google Inc.
|
|
4
|
-
*
|
|
5
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
* in the Software without restriction, including without limitation the rights
|
|
8
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
* furnished to do so, subject to the following conditions:
|
|
11
|
-
*
|
|
12
|
-
* The above copyright notice and this permission notice shall be included in
|
|
13
|
-
* all copies or substantial portions of the Software.
|
|
14
|
-
*
|
|
15
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
* THE SOFTWARE.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2017 Google Inc.
|
|
27
|
-
*
|
|
28
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
29
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
30
|
-
* in the Software without restriction, including without limitation the rights
|
|
31
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
32
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
33
|
-
* furnished to do so, subject to the following conditions:
|
|
34
|
-
*
|
|
35
|
-
* The above copyright notice and this permission notice shall be included in
|
|
36
|
-
* all copies or substantial portions of the Software.
|
|
37
|
-
*
|
|
38
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
39
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
40
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
41
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
42
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
44
|
-
* THE SOFTWARE.
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* @license
|
|
49
|
-
* Copyright 2018 Google Inc.
|
|
50
|
-
*
|
|
51
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
52
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
53
|
-
* in the Software without restriction, including without limitation the rights
|
|
54
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
55
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
56
|
-
* furnished to do so, subject to the following conditions:
|
|
57
|
-
*
|
|
58
|
-
* The above copyright notice and this permission notice shall be included in
|
|
59
|
-
* all copies or substantial portions of the Software.
|
|
60
|
-
*
|
|
61
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
62
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
63
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
64
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
65
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
66
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
67
|
-
* THE SOFTWARE.
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* @license
|
|
72
|
-
* Copyright 2019 Google Inc.
|
|
73
|
-
*
|
|
74
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
75
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
76
|
-
* in the Software without restriction, including without limitation the rights
|
|
77
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
78
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
79
|
-
* furnished to do so, subject to the following conditions:
|
|
80
|
-
*
|
|
81
|
-
* The above copyright notice and this permission notice shall be included in
|
|
82
|
-
* all copies or substantial portions of the Software.
|
|
83
|
-
*
|
|
84
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
85
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
86
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
87
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
88
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
89
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
90
|
-
* THE SOFTWARE.
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @license
|
|
95
|
-
* Copyright 2020 Google Inc.
|
|
96
|
-
*
|
|
97
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
98
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
99
|
-
* in the Software without restriction, including without limitation the rights
|
|
100
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
101
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
102
|
-
* furnished to do so, subject to the following conditions:
|
|
103
|
-
*
|
|
104
|
-
* The above copyright notice and this permission notice shall be included in
|
|
105
|
-
* all copies or substantial portions of the Software.
|
|
106
|
-
*
|
|
107
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
108
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
109
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
110
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
111
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
112
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
113
|
-
* THE SOFTWARE.
|
|
114
|
-
*/
|