firstly 0.0.13 → 0.0.14
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 +8 -0
- package/esm/ROUTES.d.ts +2 -0
- package/esm/ROUTES.js +1 -0
- package/esm/api/index.d.ts +8 -0
- package/esm/auth/AuthController.d.ts +12 -23
- package/esm/auth/AuthController.js +12 -31
- package/esm/auth/server/AuthController.server.d.ts +11 -11
- package/esm/auth/server/AuthController.server.js +83 -18
- package/esm/auth/server/helperFirstly.d.ts +1 -1
- package/esm/auth/server/helperFirstly.js +1 -0
- package/esm/auth/server/module.d.ts +3 -6
- package/esm/auth/server/providers/github.d.ts +2 -1
- package/esm/auth/server/providers/github.js +1 -1
- package/esm/auth/static/assets/Page-B0XXxe0N.d.ts +6 -0
- package/esm/auth/static/assets/Page-B0XXxe0N.js +1 -0
- package/esm/auth/static/assets/Page-DdKMiUZn.d.ts +6 -0
- package/esm/auth/static/assets/Page-DdKMiUZn.js +20 -0
- package/esm/auth/static/assets/Page-UV_hqY7I.d.ts +6 -0
- package/esm/auth/static/assets/Page-UV_hqY7I.js +1 -0
- package/esm/auth/static/assets/Page-mK42zGEw.css +1 -0
- package/esm/auth/static/assets/index-C9jzxOBu.d.ts +151 -0
- package/esm/auth/static/assets/index-C9jzxOBu.js +42 -0
- package/esm/auth/static/index.html +2 -2
- package/esm/auth/types.d.ts +26 -3
- package/esm/bin/cmd.js +339 -139
- package/esm/feedback/FeedbackController.js +57 -51
- package/esm/feedback/server/index.d.ts +6 -15
- package/esm/feedback/server/index.js +4 -5
- package/esm/feedback/types.d.ts +14 -0
- package/esm/feedback/types.js +4 -0
- package/esm/feedback/ui/DialogIssue.svelte +78 -62
- package/esm/feedback/ui/DialogIssue.svelte.d.ts +20 -18
- package/esm/feedback/ui/DialogIssues.svelte +37 -28
- package/esm/feedback/ui/DialogIssues.svelte.d.ts +20 -18
- package/esm/feedback/ui/DialogMilestones.svelte +18 -12
- package/esm/feedback/ui/DialogMilestones.svelte.d.ts +18 -16
- package/esm/feedback/ui/Feedback.svelte +11 -9
- package/esm/feedback/ui/Feedback.svelte.d.ts +16 -14
- package/esm/mail/server/index.d.ts +9 -2
- package/esm/mail/server/index.js +3 -1
- package/esm/mail/templates/DefaultMail.svelte +64 -44
- package/esm/mail/templates/DefaultMail.svelte.d.ts +28 -26
- package/esm/server/index.d.ts +0 -0
- package/esm/server/index.js +1 -0
- package/esm/storeItem.d.ts +1 -1
- package/esm/storeList.d.ts +1 -1
- package/esm/sveltekit/server/index.d.ts +0 -9
- package/esm/ui/Button.svelte +79 -56
- package/esm/ui/Button.svelte.d.ts +34 -24
- package/esm/ui/Clipboardable.svelte +18 -11
- package/esm/ui/Clipboardable.svelte.d.ts +34 -23
- package/esm/ui/Field.svelte +189 -136
- package/esm/ui/Field.svelte.d.ts +13 -6
- package/esm/ui/FieldGroup.svelte +74 -53
- package/esm/ui/FieldGroup.svelte.d.ts +17 -6
- package/esm/ui/Grid.svelte +110 -86
- package/esm/ui/Grid.svelte.d.ts +17 -6
- package/esm/ui/GridLoading.svelte +10 -5
- package/esm/ui/GridLoading.svelte.d.ts +19 -17
- package/esm/ui/GridPaginate.svelte +30 -23
- package/esm/ui/GridPaginate.svelte.d.ts +21 -19
- package/esm/ui/Icon.svelte +67 -32
- package/esm/ui/Icon.svelte.d.ts +52 -43
- package/esm/ui/Loading.svelte +5 -3
- package/esm/ui/Loading.svelte.d.ts +29 -18
- package/esm/ui/Tooltip.svelte +22 -19
- package/esm/ui/Tooltip.svelte.d.ts +30 -20
- package/esm/ui/dialog/DialogForm.svelte +48 -41
- package/esm/ui/dialog/DialogForm.svelte.d.ts +18 -16
- package/esm/ui/dialog/DialogManagement.svelte.d.ts +22 -21
- package/esm/ui/dialog/DialogPrimitive.svelte +32 -26
- package/esm/ui/dialog/DialogPrimitive.svelte.d.ts +35 -25
- package/esm/ui/dialog/FormEditAction.svelte +20 -12
- package/esm/ui/dialog/FormEditAction.svelte.d.ts +13 -6
- package/esm/ui/dialog/dialog.d.ts +1 -1
- package/esm/ui/internals/FieldContainer.svelte +13 -6
- package/esm/ui/internals/FieldContainer.svelte.d.ts +37 -28
- package/esm/ui/internals/Input.svelte +110 -76
- package/esm/ui/internals/Input.svelte.d.ts +34 -32
- package/esm/ui/internals/Textarea.svelte +39 -31
- package/esm/ui/internals/Textarea.svelte.d.ts +31 -28
- package/esm/ui/internals/select/MultiSelectMelt.svelte +174 -126
- package/esm/ui/internals/select/MultiSelectMelt.svelte.d.ts +29 -27
- package/esm/ui/internals/select/SelectMelt.svelte +168 -133
- package/esm/ui/internals/select/SelectMelt.svelte.d.ts +34 -32
- package/esm/ui/internals/select/SelectRadio.svelte +17 -11
- package/esm/ui/internals/select/SelectRadio.svelte.d.ts +24 -22
- package/esm/ui/link/Link.svelte +11 -6
- package/esm/ui/link/Link.svelte.d.ts +31 -22
- package/esm/ui/link/LinkPlus.svelte +19 -16
- package/esm/ui/link/LinkPlus.svelte.d.ts +20 -18
- package/esm/vite/index.d.ts +2 -3
- package/esm/vite/index.js +33 -26
- package/package.json +5 -5
- package/esm/auth/static/assets/Page-BUfjaN-D.d.ts +0 -5
- package/esm/auth/static/assets/Page-BUfjaN-D.js +0 -19
- package/esm/auth/static/assets/Page-CJ58H1vl.css +0 -1
- package/esm/auth/static/assets/Page-CaDAqmBS.d.ts +0 -5
- package/esm/auth/static/assets/Page-CaDAqmBS.js +0 -1
- package/esm/auth/static/assets/Page-DhdZddzJ.d.ts +0 -5
- package/esm/auth/static/assets/Page-DhdZddzJ.js +0 -1
- package/esm/auth/static/assets/index-D-Ztdt2o.d.ts +0 -54
- package/esm/auth/static/assets/index-D-Ztdt2o.js +0 -2
- /package/esm/auth/static/assets/{index-BDy4A_14.css → index-DKWpA6v7.css} +0 -0
|
@@ -6,32 +6,35 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { Allow, BackendMethod, EntityError, remult } from 'remult';
|
|
8
8
|
import { stry } from '@kitql/helpers';
|
|
9
|
-
import { FEEDBACK_OPTIONS } from './server';
|
|
10
|
-
const GITHUB_GRAPHQL_ENDPOINT = 'https://api.github.com/graphql';
|
|
11
9
|
async function getGitHub(query, variables) {
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
if (import.meta.env.SSR) {
|
|
11
|
+
if (!remult.context.feedbackOptions.GITHUB_API_TOKEN) {
|
|
12
|
+
console.error(`GITHUB_API_TOKEN not found in .env`);
|
|
13
|
+
throw new EntityError({ message: 'Feedback module not well configured' });
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const headers = new Headers({
|
|
17
|
+
Authorization: 'Bearer ' + remult.context.feedbackOptions.GITHUB_API_TOKEN,
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
});
|
|
20
|
+
const body = stry({ query, variables }, 0);
|
|
21
|
+
const GITHUB_GRAPHQL_ENDPOINT = 'https://api.github.com/graphql';
|
|
22
|
+
const response = await fetch(GITHUB_GRAPHQL_ENDPOINT, { method: 'POST', headers, body });
|
|
23
|
+
const result = await response.json();
|
|
24
|
+
if (result.errors) {
|
|
25
|
+
console.error(`result ERRORS`, body, stry(result));
|
|
26
|
+
}
|
|
27
|
+
return result.data;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error(`error`, error);
|
|
25
31
|
}
|
|
26
|
-
return result.data;
|
|
27
|
-
}
|
|
28
|
-
catch (error) {
|
|
29
|
-
console.error(`error`, error);
|
|
30
32
|
}
|
|
31
33
|
return null;
|
|
32
34
|
}
|
|
33
35
|
async function addMetaData(issueId, author, page) {
|
|
34
|
-
|
|
36
|
+
if (import.meta.env.SSR) {
|
|
37
|
+
const commentToMinimize = await getGitHub(`mutation AddComment($input: AddCommentInput!) {
|
|
35
38
|
addComment(input: $input) {
|
|
36
39
|
commentEdge {
|
|
37
40
|
node {
|
|
@@ -41,12 +44,12 @@ async function addMetaData(issueId, author, page) {
|
|
|
41
44
|
}
|
|
42
45
|
}
|
|
43
46
|
`, {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
input: {
|
|
48
|
+
subjectId: issueId,
|
|
49
|
+
body: `<pre>\n${JSON.stringify({ author, page }, null, 2)}\n</pre>`,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
await getGitHub(`mutation MinimizeComment($input: MinimizeCommentInput!) {
|
|
50
53
|
minimizeComment(input: $input) {
|
|
51
54
|
minimizedComment {
|
|
52
55
|
isMinimized
|
|
@@ -54,11 +57,12 @@ async function addMetaData(issueId, author, page) {
|
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
`, {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
input: {
|
|
61
|
+
subjectId: commentToMinimize.addComment.commentEdge.node.id,
|
|
62
|
+
classifier: 'OFF_TOPIC',
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
62
66
|
}
|
|
63
67
|
export class FeedbackController {
|
|
64
68
|
static async getMilestones() {
|
|
@@ -83,14 +87,16 @@ export class FeedbackController {
|
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
89
|
`, {
|
|
86
|
-
repository:
|
|
87
|
-
owner:
|
|
88
|
-
filter:
|
|
90
|
+
repository: remult.context.feedbackOptions.repo.name,
|
|
91
|
+
owner: remult.context.feedbackOptions.repo.owner,
|
|
92
|
+
filter: remult.context.feedbackOptions.milestones?.title_filter ?? '',
|
|
89
93
|
});
|
|
90
94
|
return data.repository.milestones.nodes.map((c) => {
|
|
91
95
|
return {
|
|
92
96
|
...c,
|
|
93
|
-
title: c.title
|
|
97
|
+
title: c.title
|
|
98
|
+
.replaceAll(remult.context.feedbackOptions.milestones?.title_filter ?? '', '')
|
|
99
|
+
.trim(),
|
|
94
100
|
};
|
|
95
101
|
});
|
|
96
102
|
}
|
|
@@ -126,18 +132,18 @@ export class FeedbackController {
|
|
|
126
132
|
}
|
|
127
133
|
}
|
|
128
134
|
`, {
|
|
129
|
-
repository:
|
|
130
|
-
owner:
|
|
135
|
+
repository: remult.context.feedbackOptions.repo.name,
|
|
136
|
+
owner: remult.context.feedbackOptions.repo.owner,
|
|
131
137
|
milestoneNumber,
|
|
132
138
|
filters: {
|
|
133
|
-
labels:
|
|
139
|
+
labels: remult.context.feedbackOptions.milestones?.labels_filters ?? [],
|
|
134
140
|
states: [issueState],
|
|
135
141
|
},
|
|
136
142
|
issueOrder,
|
|
137
143
|
});
|
|
138
144
|
return data.repository.milestone.issues.nodes.map((issue) => {
|
|
139
|
-
const hasWaitingForAnswerLabel =
|
|
140
|
-
? issue.labels.nodes.some((label) => label.name.includes(
|
|
145
|
+
const hasWaitingForAnswerLabel = remult.context.feedbackOptions.highlight_label
|
|
146
|
+
? issue.labels.nodes.some((label) => label.name.includes(remult.context.feedbackOptions.highlight_label))
|
|
141
147
|
: false;
|
|
142
148
|
return {
|
|
143
149
|
id: issue.id,
|
|
@@ -181,8 +187,8 @@ export class FeedbackController {
|
|
|
181
187
|
}
|
|
182
188
|
}
|
|
183
189
|
`, {
|
|
184
|
-
repository:
|
|
185
|
-
owner:
|
|
190
|
+
repository: remult.context.feedbackOptions.repo.name,
|
|
191
|
+
owner: remult.context.feedbackOptions.repo.owner,
|
|
186
192
|
issueNumber,
|
|
187
193
|
});
|
|
188
194
|
const items = [];
|
|
@@ -208,8 +214,8 @@ export class FeedbackController {
|
|
|
208
214
|
});
|
|
209
215
|
}
|
|
210
216
|
}
|
|
211
|
-
const hasWaitingForAnswerLabel =
|
|
212
|
-
? data.repository.issue.labels.nodes.some((label) => label.name.includes(
|
|
217
|
+
const hasWaitingForAnswerLabel = remult.context.feedbackOptions.highlight_label
|
|
218
|
+
? data.repository.issue.labels.nodes.some((label) => label.name.includes(remult.context.feedbackOptions.highlight_label))
|
|
213
219
|
: false;
|
|
214
220
|
const toRet = {
|
|
215
221
|
id: data.repository.issue.id,
|
|
@@ -235,11 +241,11 @@ export class FeedbackController {
|
|
|
235
241
|
}
|
|
236
242
|
}
|
|
237
243
|
}`, {
|
|
238
|
-
repository:
|
|
239
|
-
owner:
|
|
244
|
+
repository: remult.context.feedbackOptions.repo.name,
|
|
245
|
+
owner: remult.context.feedbackOptions.repo.owner,
|
|
240
246
|
});
|
|
241
247
|
const repoInfoData = repoInfo.repository;
|
|
242
|
-
const create_label = repoInfoData.labels.nodes.find((c) => c.name ===
|
|
248
|
+
const create_label = repoInfoData.labels.nodes.find((c) => c.name === remult.context.feedbackOptions.create_label);
|
|
243
249
|
const newIssue = await getGitHub(`mutation CreateIssue($input: CreateIssueInput!) {
|
|
244
250
|
createIssue(input: $input) {
|
|
245
251
|
issue {
|
|
@@ -268,8 +274,8 @@ export class FeedbackController {
|
|
|
268
274
|
};
|
|
269
275
|
const inputIssue = {
|
|
270
276
|
id: issueId,
|
|
271
|
-
labelIds: (
|
|
272
|
-
? labels.filter((c) => c.name !==
|
|
277
|
+
labelIds: (remult.context.feedbackOptions.highlight_label
|
|
278
|
+
? labels.filter((c) => c.name !== remult.context.feedbackOptions.highlight_label)
|
|
273
279
|
: labels).map((c) => c.id),
|
|
274
280
|
};
|
|
275
281
|
await getGitHub(`mutation AddComment($inputComment: AddCommentInput!, $inputIssue: UpdateIssueInput!) {
|
|
@@ -299,8 +305,8 @@ export class FeedbackController {
|
|
|
299
305
|
};
|
|
300
306
|
const inputIssue = {
|
|
301
307
|
id: issueId,
|
|
302
|
-
labelIds: (
|
|
303
|
-
? labels.filter((c) => c.name !==
|
|
308
|
+
labelIds: (remult.context.feedbackOptions.highlight_label
|
|
309
|
+
? labels.filter((c) => c.name !== remult.context.feedbackOptions.highlight_label)
|
|
304
310
|
: labels).map((c) => c.id),
|
|
305
311
|
};
|
|
306
312
|
await getGitHub(`mutation CloseIssue($inputIssue: UpdateIssueInput!, $inputClose: CloseIssueInput!) {
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { Module } from '../../api';
|
|
2
|
-
type FeedbackOptions
|
|
3
|
-
GITHUB_API_TOKEN: string;
|
|
4
|
-
repo: {
|
|
5
|
-
owner: string;
|
|
6
|
-
name: string;
|
|
7
|
-
};
|
|
8
|
-
milestones?: {
|
|
9
|
-
title_filter?: string;
|
|
10
|
-
labels_filters?: string[];
|
|
11
|
-
};
|
|
12
|
-
highlight_label?: string;
|
|
13
|
-
create_label?: string;
|
|
14
|
-
};
|
|
15
|
-
export declare let FEEDBACK_OPTIONS: FeedbackOptions;
|
|
2
|
+
import type { FeedbackOptions } from '../types';
|
|
16
3
|
export declare const feedback: (o: FeedbackOptions) => Module;
|
|
17
|
-
|
|
4
|
+
declare module 'remult' {
|
|
5
|
+
interface RemultContext {
|
|
6
|
+
feedbackOptions: FeedbackOptions;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import { remult } from 'remult';
|
|
1
2
|
import { Module } from '../../api';
|
|
2
3
|
import { FeedbackController } from '../FeedbackController';
|
|
3
|
-
export let FEEDBACK_OPTIONS = {
|
|
4
|
-
GITHUB_API_TOKEN: '',
|
|
5
|
-
repo: { owner: '', name: '' },
|
|
6
|
-
};
|
|
7
4
|
export const feedback = (o) => {
|
|
8
|
-
FEEDBACK_OPTIONS = o;
|
|
9
5
|
return new Module({
|
|
10
6
|
name: 'feedback',
|
|
11
7
|
controllers: [FeedbackController],
|
|
8
|
+
initRequest: async (kitEvent, op) => {
|
|
9
|
+
remult.context.feedbackOptions = o;
|
|
10
|
+
},
|
|
12
11
|
});
|
|
13
12
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type FeedbackOptions = {
|
|
2
|
+
GITHUB_API_TOKEN: string;
|
|
3
|
+
repo: {
|
|
4
|
+
owner: string;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
milestones?: {
|
|
8
|
+
title_filter?: string;
|
|
9
|
+
labels_filters?: string[];
|
|
10
|
+
};
|
|
11
|
+
highlight_label?: string;
|
|
12
|
+
create_label?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const FEEDBACK_OPTIONS: FeedbackOptions;
|
|
@@ -1,65 +1,81 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte'
|
|
3
|
+
|
|
4
|
+
import { repo } from 'remult'
|
|
5
|
+
|
|
6
|
+
import { page } from '$app/stores'
|
|
7
|
+
|
|
8
|
+
import { FeedbackController } from '..'
|
|
9
|
+
import { Button, cellBuildor, Field, FilterEntity, Loading, type ResolvedType } from '../..'
|
|
10
|
+
import Textarea from '../../ui/internals/Textarea.svelte'
|
|
11
|
+
|
|
12
|
+
export let dialogId: number
|
|
13
|
+
const rmvWarning = dialogId
|
|
14
|
+
|
|
15
|
+
export let milestoneId: string
|
|
16
|
+
export let issueNumber: number | null
|
|
17
|
+
|
|
18
|
+
let state: 'loading' | 'done' = 'loading'
|
|
19
|
+
|
|
20
|
+
let issue: ResolvedType<ReturnType<typeof FeedbackController.getIssue>> | undefined
|
|
21
|
+
|
|
22
|
+
const update = async () => {
|
|
23
|
+
state = 'loading'
|
|
24
|
+
if (issueNumber) {
|
|
25
|
+
issue = await FeedbackController.getIssue(issueNumber)
|
|
26
|
+
}
|
|
27
|
+
state = 'done'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
onMount(async () => {
|
|
31
|
+
await update()
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
let title: ''
|
|
35
|
+
let content: ''
|
|
36
|
+
const send = async () => {
|
|
37
|
+
state = 'loading'
|
|
38
|
+
|
|
39
|
+
const p = $page.url.pathname + $page.url.search
|
|
40
|
+
if (!issue?.id) {
|
|
41
|
+
const result = await FeedbackController.createIssue(milestoneId, title, content, p)
|
|
42
|
+
issueNumber = result.number
|
|
43
|
+
} else {
|
|
44
|
+
await FeedbackController.addCommentOnIssue(issue.id, content, p, issue.labels)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
content = ''
|
|
48
|
+
await update()
|
|
49
|
+
state = 'done'
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const close = async () => {
|
|
53
|
+
state = 'loading'
|
|
54
|
+
await FeedbackController.close(issue!.id, issue!.labels)
|
|
55
|
+
content = ''
|
|
56
|
+
await update()
|
|
57
|
+
state = 'done'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const reOpen = async () => {
|
|
61
|
+
state = 'loading'
|
|
62
|
+
await FeedbackController.reOpen(issue!.id)
|
|
63
|
+
content = ''
|
|
64
|
+
await update()
|
|
65
|
+
state = 'done'
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const disableButton = (issueNumber: number | null, title: string, content: string) => {
|
|
69
|
+
if (issueNumber) {
|
|
70
|
+
if (content?.length > 2) {
|
|
71
|
+
return false
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (title?.length > 2 && content?.length > 2) {
|
|
75
|
+
return false
|
|
76
|
+
}
|
|
77
|
+
return true
|
|
78
|
+
}
|
|
63
79
|
</script>
|
|
64
80
|
|
|
65
81
|
<div class="mb-4 grid gap-4">
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
7
11
|
};
|
|
8
|
-
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
exports?: {} | undefined;
|
|
13
|
-
bindings?: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
export type DialogIssueProps = typeof __propDef.props;
|
|
16
|
-
export type DialogIssueEvents = typeof __propDef.events;
|
|
17
|
-
export type DialogIssueSlots = typeof __propDef.slots;
|
|
18
|
-
export default class DialogIssue extends SvelteComponent<DialogIssueProps, DialogIssueEvents, DialogIssueSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
19
13
|
}
|
|
20
|
-
|
|
14
|
+
declare const DialogIssue: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
dialogId: number;
|
|
16
|
+
milestoneId: string;
|
|
17
|
+
issueNumber: number | null;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type DialogIssue = InstanceType<typeof DialogIssue>;
|
|
22
|
+
export default DialogIssue;
|
|
@@ -1,31 +1,40 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte'
|
|
3
|
+
|
|
4
|
+
import { FeedbackController } from '..'
|
|
5
|
+
import {
|
|
6
|
+
Button,
|
|
7
|
+
dialog,
|
|
8
|
+
Icon,
|
|
9
|
+
LibIcon_Add,
|
|
10
|
+
LibIcon_Check,
|
|
11
|
+
LibIcon_Search,
|
|
12
|
+
Loading,
|
|
13
|
+
type ResolvedType,
|
|
14
|
+
} from '../..'
|
|
15
|
+
import DialogIssue from './DialogIssue.svelte'
|
|
16
|
+
|
|
17
|
+
export let dialogId: number
|
|
18
|
+
const rmvWarning = dialogId
|
|
19
|
+
|
|
20
|
+
export let milestoneNumber: number
|
|
21
|
+
export let milestoneId: string
|
|
22
|
+
|
|
23
|
+
let state: 'loading' | 'done' = 'loading'
|
|
24
|
+
let issueState: 'OPEN' | 'CLOSED' = 'OPEN'
|
|
25
|
+
|
|
26
|
+
let issues: ResolvedType<ReturnType<typeof FeedbackController.getIssues>> = []
|
|
27
|
+
|
|
28
|
+
const update = async (_issueState: 'OPEN' | 'CLOSED') => {
|
|
29
|
+
issueState = _issueState
|
|
30
|
+
state = 'loading'
|
|
31
|
+
issues = await FeedbackController.getIssues(milestoneNumber, issueState)
|
|
32
|
+
state = 'done'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
onMount(async () => {
|
|
36
|
+
await update(issueState)
|
|
37
|
+
})
|
|
29
38
|
</script>
|
|
30
39
|
|
|
31
40
|
<div class="mb-4 grid gap-4">
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
7
11
|
};
|
|
8
|
-
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
exports?: {} | undefined;
|
|
13
|
-
bindings?: string | undefined;
|
|
14
|
-
};
|
|
15
|
-
export type DialogIssuesProps = typeof __propDef.props;
|
|
16
|
-
export type DialogIssuesEvents = typeof __propDef.events;
|
|
17
|
-
export type DialogIssuesSlots = typeof __propDef.slots;
|
|
18
|
-
export default class DialogIssues extends SvelteComponent<DialogIssuesProps, DialogIssuesEvents, DialogIssuesSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
19
13
|
}
|
|
20
|
-
|
|
14
|
+
declare const DialogIssues: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
dialogId: number;
|
|
16
|
+
milestoneNumber: number;
|
|
17
|
+
milestoneId: string;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type DialogIssues = InstanceType<typeof DialogIssues>;
|
|
22
|
+
export default DialogIssues;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte'
|
|
3
|
+
|
|
4
|
+
import { FeedbackController } from '..'
|
|
5
|
+
import type { ResolvedType } from '../..'
|
|
6
|
+
import { Button, dialog, Loading } from '../..'
|
|
7
|
+
import DialogIssues from './DialogIssues.svelte'
|
|
8
|
+
|
|
9
|
+
export let dialogId: number
|
|
10
|
+
const rmvWarning = dialogId
|
|
11
|
+
|
|
12
|
+
let state: 'loading' | 'done' = 'loading'
|
|
13
|
+
|
|
14
|
+
let milestones: ResolvedType<ReturnType<typeof FeedbackController.getMilestones>> = []
|
|
15
|
+
onMount(async () => {
|
|
16
|
+
milestones = await FeedbackController.getMilestones()
|
|
17
|
+
state = 'done'
|
|
18
|
+
})
|
|
13
19
|
</script>
|
|
14
20
|
|
|
15
21
|
<div class="mb-4 grid gap-4">
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
exports?: {} | undefined;
|
|
11
|
-
bindings?: string | undefined;
|
|
12
|
-
};
|
|
13
|
-
export type DialogMilestonesProps = typeof __propDef.props;
|
|
14
|
-
export type DialogMilestonesEvents = typeof __propDef.events;
|
|
15
|
-
export type DialogMilestonesSlots = typeof __propDef.slots;
|
|
16
|
-
export default class DialogMilestones extends SvelteComponent<DialogMilestonesProps, DialogMilestonesEvents, DialogMilestonesSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
17
13
|
}
|
|
18
|
-
|
|
14
|
+
declare const DialogMilestones: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
dialogId: number;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type DialogMilestones = InstanceType<typeof DialogMilestones>;
|
|
20
|
+
export default DialogMilestones;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { dialog } from '../../'
|
|
3
|
+
import DialogMilestones from './DialogMilestones.svelte'
|
|
4
|
+
|
|
5
|
+
const list = async () => {
|
|
6
|
+
await dialog.show({
|
|
7
|
+
component: DialogMilestones,
|
|
8
|
+
classes: { root: 'overflow-auto w-[90vh] h-[90vh]' },
|
|
9
|
+
detail: { caption: 'Feedback' },
|
|
10
|
+
})
|
|
11
|
+
}
|
|
10
12
|
</script>
|
|
11
13
|
|
|
12
14
|
<button class="text-secondary" on:click={list}>Feedback</button>
|