Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Keep existing labels on spaces and proposals #4917

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading