Skip to content

Commit

Permalink
fix: Keep existing labels on spaces and proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaituVR committed Oct 15, 2024
1 parent 2a69ea8 commit d75888b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/composables/useClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function useClient() {
body: payload.body,
discussion: payload.discussion,
choices: payload.choices,
labels: [],
labels: payload.labels,
plugins: JSON.stringify(plugins)
});
} else if (type === 'vote') {
Expand Down
3 changes: 3 additions & 0 deletions src/composables/useFormSpaceProposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface ProposalForm {
body: string;
discussion: string;
choices: { key: number; text: string }[];
labels: string[];
start: number;
end: number;
snapshot: number;
Expand All @@ -29,6 +30,7 @@ const EMPTY_PROPOSAL: ProposalForm = {
{ key: 0, text: '' },
{ key: 1, text: '' }
],
labels: [],
start: parseInt((Date.now() / 1e3).toFixed()),
end: 0,
snapshot: 0,
Expand Down Expand Up @@ -60,6 +62,7 @@ export function useFormSpaceProposal({ spaceType = 'default' } = {}) {
name: string;
body: string;
choices: { key: number; text: string }[];
labels: string[];
isBodySet: boolean;
}>(`snapshot.proposal.${route.params.key}`, clone(EMPTY_PROPOSAL_DRAFT));

Expand Down
1 change: 1 addition & 0 deletions src/composables/useFormSpaceSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const DEFAULT_DELEGATION = {
const EMPTY_SPACE_FORM = {
strategies: [],
categories: [],
labels: [],
treasuries: [],
admins: [],
moderators: [],
Expand Down
7 changes: 7 additions & 0 deletions src/helpers/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const PROPOSAL_QUERY = gql`
body
discussion
choices
labels
start
end
snapshot
Expand Down Expand Up @@ -460,6 +461,12 @@ export const SPACE_QUERY = gql`
moderators
members
categories
labels {
id
name
description
color
}
plugins
followersCount
template
Expand Down
1 change: 1 addition & 0 deletions src/views/SpaceCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ function setSourceProposal(proposal) {
body: proposal.body,
discussion: proposal.discussion,
choices: proposal.choices,
labels: proposal.labels,
start: proposal.start,
end: proposal.end,
snapshot: proposal.snapshot,
Expand Down

0 comments on commit d75888b

Please sign in to comment.