Skip to content

Commit 3564257

Browse files
authored
fix: Keep existing labels on spaces and proposals (#4917)
1 parent e255773 commit 3564257

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

src/composables/useClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function useClient() {
6868
body: payload.body,
6969
discussion: payload.discussion,
7070
choices: payload.choices,
71-
labels: [],
71+
labels: payload.labels,
7272
plugins: JSON.stringify(plugins)
7373
});
7474
} else if (type === 'vote') {

src/composables/useFormSpaceProposal.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface ProposalForm {
99
body: string;
1010
discussion: string;
1111
choices: { key: number; text: string }[];
12+
labels: string[];
1213
start: number;
1314
end: number;
1415
snapshot: number;
@@ -29,6 +30,7 @@ const EMPTY_PROPOSAL: ProposalForm = {
2930
{ key: 0, text: '' },
3031
{ key: 1, text: '' }
3132
],
33+
labels: [],
3234
start: parseInt((Date.now() / 1e3).toFixed()),
3335
end: 0,
3436
snapshot: 0,
@@ -60,6 +62,7 @@ export function useFormSpaceProposal({ spaceType = 'default' } = {}) {
6062
name: string;
6163
body: string;
6264
choices: { key: number; text: string }[];
65+
labels: string[];
6366
isBodySet: boolean;
6467
}>(`snapshot.proposal.${route.params.key}`, clone(EMPTY_PROPOSAL_DRAFT));
6568

src/composables/useFormSpaceSettings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const DEFAULT_DELEGATION = {
1616
const EMPTY_SPACE_FORM = {
1717
strategies: [],
1818
categories: [],
19+
labels: [],
1920
treasuries: [],
2021
admins: [],
2122
moderators: [],

src/helpers/queries.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const PROPOSAL_QUERY = gql`
4646
body
4747
discussion
4848
choices
49+
labels
4950
start
5051
end
5152
snapshot
@@ -460,6 +461,12 @@ export const SPACE_QUERY = gql`
460461
moderators
461462
members
462463
categories
464+
labels {
465+
id
466+
name
467+
description
468+
color
469+
}
463470
plugins
464471
followersCount
465472
template

src/views/SpaceCreate.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ function setSourceProposal(proposal) {
298298
body: proposal.body,
299299
discussion: proposal.discussion,
300300
choices: proposal.choices,
301+
labels: proposal.labels,
301302
start: proposal.start,
302303
end: proposal.end,
303304
snapshot: proposal.snapshot,

0 commit comments

Comments
 (0)