iconograph-ui 1.7.19 → 2.0.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/example/src/routes/{+page.svelte → basic/+page.svelte} +3 -1
- package/example/src/routes/{user → basic/user}/+page.svelte +12 -2
- package/example/src/routes/parabole/+layout.svelte +111 -0
- package/example/src/routes/parabole/+page.svelte +112 -0
- package/example/static/css/testapp.css +8 -3
- package/example/static/icons/discord-logo-icon.svg +22 -0
- package/example/static/icons/icon-add-w.svg +38 -0
- package/example/static/icons/icon-archive-black.svg +1 -0
- package/example/static/icons/icon-archive-grey.svg +38 -0
- package/example/static/icons/icon-beneficiaire-small.svg +50 -0
- package/example/static/icons/icon-beneficiaire.svg +48 -0
- package/example/static/icons/icon-cardlist-black.svg +56 -0
- package/example/static/icons/icon-cardlist-grey.svg +56 -0
- package/example/static/icons/icon-client.png +0 -0
- package/example/static/icons/icon-dashboard.svg +40 -0
- package/example/static/icons/icon-doc.svg +39 -0
- package/example/static/icons/icon-done.svg +1 -0
- package/example/static/icons/icon-edit-g.svg +61 -0
- package/example/static/icons/icon-edit-w.svg +1 -0
- package/example/static/icons/icon-info-100.svg +54 -0
- package/example/static/icons/icon-info-w.svg +39 -0
- package/example/static/icons/icon-kanban-black.svg +65 -0
- package/example/static/icons/icon-kanban-grey.svg +65 -0
- package/example/static/icons/icon-link.svg +47 -0
- package/example/static/icons/icon-list-black.svg +76 -0
- package/example/static/icons/icon-list-grey.svg +76 -0
- package/example/static/icons/icon-member.png +0 -0
- package/example/static/icons/icon-next-w.svg +42 -0
- package/example/static/icons/icon-note.svg +44 -0
- package/example/static/icons/icon-order.svg +61 -0
- package/example/static/icons/icon-out.svg +38 -0
- package/example/static/icons/icon-project.svg +39 -0
- package/example/static/icons/icon-red-star.svg +53 -0
- package/example/static/icons/icon-save-b.png +0 -0
- package/example/static/icons/icon-save-w.png +0 -0
- package/example/static/icons/icon-task.svg +40 -0
- package/example/static/icons/icon-timeline-black.svg +68 -0
- package/example/static/icons/icon-timeline-grey.svg +68 -0
- package/example/static/icons/icon-user-add.svg +41 -0
- package/example/static/icons/icon-user.png +0 -0
- package/example/static/icons/icon-user.svg +39 -0
- package/example/static/icons/loader-ring-w.svg +1 -0
- package/lib/{display → components/display}/Portal.svelte +3 -3
- package/lib/{form → components/form}/ActionButton.svelte +53 -18
- package/lib/{layout → components/layout}/Card.svelte +2 -1
- package/lib/{navigation → components/navigation}/Button.svelte +10 -2
- package/lib/{navigation → components/navigation}/MainMenu.svelte +26 -33
- package/lib/{navigation → components/navigation}/MenuItem.svelte +8 -7
- package/lib/{navigation → components/navigation}/NavBar.svelte +8 -7
- package/lib/network/APIErrors.js +51 -0
- package/lib/network/action.js +21 -0
- package/lib/network/clientFetch.js +50 -0
- package/lib/network/index.js +1 -0
- package/lib/network/requestApi.js +127 -0
- package/lib/network/requestn8n.js +52 -0
- package/lib/utils/flattenType.js +8 -0
- package/lib/utils/transformers/entityTransformer.js +28 -0
- package/lib/utils/transformers/index.js +1 -0
- package/lib/utils/transformers/projectTransformer.js +17 -0
- package/lib/utils/transformers/userTransformer.js +36 -0
- package/package.json +11 -3
- /package/example/src/routes/{+layout.svelte → basic/+layout.svelte} +0 -0
- /package/example/src/routes/{example → basic/example}/+server.js +0 -0
- /package/example/src/routes/{user → basic/user}/+server.js +0 -0
- /package/lib/{display → components/display}/DateStr.svelte +0 -0
- /package/lib/{display → components/display}/Field.svelte +0 -0
- /package/lib/{display → components/display}/Link.svelte +0 -0
- /package/lib/{form → components/form}/Checkbox.svelte +0 -0
- /package/lib/{form → components/form}/FlexForm.svelte +0 -0
- /package/lib/{form → components/form}/Form.svelte +0 -0
- /package/lib/{form → components/form}/FormButton.svelte +0 -0
- /package/lib/{form → components/form}/Input.svelte +0 -0
- /package/lib/{form → components/form}/MultiSelect.svelte +0 -0
- /package/lib/{form → components/form}/SegmentedSwitchInput.svelte +0 -0
- /package/lib/{form → components/form}/SexeChoiceInput.svelte +0 -0
- /package/lib/{inputs → components/form/inputs}/Editor.svelte +0 -0
- /package/lib/{inputs → components/form/inputs}/PasswordInput.svelte +0 -0
- /package/lib/{inputs → components/form/inputs}/SearchSelect.svelte +0 -0
- /package/lib/{layout → components/layout}/BodySection.svelte +0 -0
- /package/lib/{layout → components/layout}/HeadSection.svelte +0 -0
- /package/lib/{layout → components/layout}/Modal.svelte +0 -0
- /package/lib/{layout → components/layout}/SectionContent.svelte +0 -0
- /package/lib/{notification → components/notification}/Notification.svelte +0 -0
- /package/lib/{notification → components/notification}/NotificationWrapper.svelte +0 -0
- /package/lib/{table → components/table}/CellLink.svelte +0 -0
- /package/lib/{table → components/table}/Table.svelte +0 -0
- /package/lib/{table → components/table}/TableColumnFilter.svelte +0 -0
- /package/lib/{table → components/table}/TableFilter.svelte +0 -0
- /package/lib/{table → components/table}/TablePagination.svelte +0 -0
- /package/lib/{table → components/table}/TableRow.svelte +0 -0
- /package/lib/{user → components/user}/SelectUserInput.svelte +0 -0
- /package/lib/{user → components/user}/UserPicture.svelte +0 -0
- /package/lib/utils/{clickOutside.js → ui/clickOutside.js} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { env } from '$env/dynamic/private';
|
|
3
|
+
import { error, isHttpError, redirect } from '@sveltejs/kit';
|
|
4
|
+
import { APIError } from './APIErrors';
|
|
5
|
+
|
|
6
|
+
let N8N_HOST = env.N8N_HOST || 'http://localhost:5678';
|
|
7
|
+
|
|
8
|
+
const dev = (!env.NODE_ENV) || env.NODE_ENV === 'development';
|
|
9
|
+
|
|
10
|
+
let headers = {
|
|
11
|
+
'Accept': 'application/json',
|
|
12
|
+
'Content-Type': 'application/json',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
export async function requestn8n(method, url, body, session = null) {
|
|
17
|
+
try {
|
|
18
|
+
let response = await fetch(N8N_HOST + url, {
|
|
19
|
+
method: method,
|
|
20
|
+
body: (method == 'GET' || method == 'HEAD') ? undefined : JSON.stringify(body),
|
|
21
|
+
headers: headers,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const data = await response.json();
|
|
25
|
+
console.log(data);
|
|
26
|
+
|
|
27
|
+
if (!response.ok) {
|
|
28
|
+
const err = new APIError(data.message, data.code, url, session);
|
|
29
|
+
err.logError();
|
|
30
|
+
|
|
31
|
+
error(data.code, { message: data.message })
|
|
32
|
+
return { error: true, data: data }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return { error: false, data: data }
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
if (e.message == "fetch failed") {
|
|
39
|
+
const err = new APIError(" 🚨 n8n instance is DOWN ! 🚨", 501, url, session);
|
|
40
|
+
err.logError();
|
|
41
|
+
error(501, { message: "Certains services sont indisponibles, nos équipes travaillent au rétablissement, merci de réessayer ultérieurement" })
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
if (e.status == 404)
|
|
45
|
+
error(e.status, { message: e.body.message })
|
|
46
|
+
|
|
47
|
+
const err = new APIError(e.message, e.statusCode, url, session);
|
|
48
|
+
err.logError();
|
|
49
|
+
error(e.statusCode, { message: e.message })
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
export function EntityTransformer(entity) {
|
|
3
|
+
let org = {
|
|
4
|
+
id: entity.id,
|
|
5
|
+
name: entity.name,
|
|
6
|
+
type: entity.type,
|
|
7
|
+
subEntities: entity.subEntities,
|
|
8
|
+
users: entity.users
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (entity.fields) {
|
|
12
|
+
entity.fields.forEach(f => {
|
|
13
|
+
org[f.key] = f.value;
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (entity.subEntities)
|
|
18
|
+
org.subEntities = entity.subEntities.map((s) => EntityToOrgTransformer(s));
|
|
19
|
+
|
|
20
|
+
if (entity.parentEntities)
|
|
21
|
+
org.parentEntities = entity.parentEntities.map((s) => EntityToOrgTransformer(s));
|
|
22
|
+
|
|
23
|
+
if (entity.users) {
|
|
24
|
+
org.users
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return org;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as transformers from "./"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
export function ProjectTransformer(project) {
|
|
3
|
+
let seance = {
|
|
4
|
+
id: project.id,
|
|
5
|
+
name: project.name,
|
|
6
|
+
type: project.type,
|
|
7
|
+
description: project.description
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (project.fields) {
|
|
11
|
+
project.fields.forEach(f => {
|
|
12
|
+
seance[f.key] = f.value;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return seance;
|
|
17
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { EntityTransformer } from "./entityTransformer";
|
|
3
|
+
|
|
4
|
+
export function UserTransformer(user) {
|
|
5
|
+
let u = {
|
|
6
|
+
id: user.id,
|
|
7
|
+
firstname: user.firstname,
|
|
8
|
+
lastname: user.lastname,
|
|
9
|
+
email: user.email,
|
|
10
|
+
type: user.type,
|
|
11
|
+
status: user.status,
|
|
12
|
+
Relation: user.Relation,
|
|
13
|
+
memberOf: []
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (user.fields) {
|
|
17
|
+
user.fields.forEach(f => {
|
|
18
|
+
u[f.key] = f.value;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (user.authMethods) {
|
|
23
|
+
u.authMethods = user.authMethods
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (user.memberOf) {
|
|
27
|
+
user.memberOf.forEach(e => {
|
|
28
|
+
u.memberOf.push({
|
|
29
|
+
role: e.role,
|
|
30
|
+
entity: EntityTransformer(e.entity)
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return u;
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iconograph-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A Svelte Kit components library",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"svelte": "./index.js",
|
|
@@ -20,6 +20,16 @@
|
|
|
20
20
|
"import": "./index.js",
|
|
21
21
|
"require": "./index.js",
|
|
22
22
|
"svelte": "./index.js"
|
|
23
|
+
},
|
|
24
|
+
"./network": {
|
|
25
|
+
"import": "./network/index.js",
|
|
26
|
+
"require": "./network/index.js",
|
|
27
|
+
"svelte": "./network/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./transformers": {
|
|
30
|
+
"import": "./utils/transformers/index.js",
|
|
31
|
+
"require": "./utils/transformers/index.js",
|
|
32
|
+
"svelte": "./utils/transformers/index.js"
|
|
23
33
|
}
|
|
24
34
|
},
|
|
25
35
|
"bugs": {
|
|
@@ -30,8 +40,6 @@
|
|
|
30
40
|
"svelte": "^5.38.1"
|
|
31
41
|
},
|
|
32
42
|
"peerDependencies": {
|
|
33
|
-
"quill": "2.0.3",
|
|
34
|
-
"quill-better-table": "1.2.10",
|
|
35
43
|
"svelte-portal": "2.2.1"
|
|
36
44
|
}
|
|
37
45
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|