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(proposal): edit badge recurring assignments (#DEV-917) #2417

Merged
merged 1 commit into from
Sep 6, 2023
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
4 changes: 2 additions & 2 deletions src/pages/proposals/ProposalDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1336,8 +1336,8 @@ export default {
// this.$store.commit('proposals/setMinDeferred', this.proposal?.role[0]?.details_minDeferredX100_i)
}

if (this.proposal.__typename === PROPOSAL_TYPE.ABILITY) { // Badge Assignment
this.$store.commit('proposals/setBadge', this?.proposal.badge)
if (this.proposal.__typename === PROPOSAL_TYPE.ABILITY || this.proposal.__typename === PROPOSAL_TYPE.ASSIGNBADGE) { // Badge Assignment
this.$store.commit('proposals/setBadge', this?.proposal.badge?.[0])
this.$store.commit('proposals/setStartPeriod', this.proposal?.start[0])
this.$store.commit('proposals/setPeriodCount', this.proposal?.details_periodCount_i)
}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/proposals/create/StepDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ widget
section.q-mt-xl
.col.q-mt-sm(v-if="fields.title")
label.h-label {{ fields.title.label }}
q-input.q-mt-xs.rounded-border(:disable="isEditing || isProposalType(PROPOSAL_TYPE.ABILITY)" :placeholder="fields.title.placeholder" :rules="[val => !!val || $t('pages.proposals.create.stepdetails.titleIsRequired'), val => (val.length <= TITLE_MAX_LENGTH) || $t('pages.proposals.create.stepdetails.proposalTitleLengthHasToBeLess', { TITLE_MAX_LENGTH: TITLE_MAX_LENGTH, length: title.length })]" dense outlined v-model="title")
q-input.q-mt-xs.rounded-border(:disable="isEditing || isProposalType(PROPOSAL_TYPE.ABILITY) || isProposalType(PROPOSAL_TYPE.ASSIGNBADGE)" :placeholder="fields.title.placeholder" :rules="[val => !!val || $t('pages.proposals.create.stepdetails.titleIsRequired'), val => (val.length <= TITLE_MAX_LENGTH) || $t('pages.proposals.create.stepdetails.proposalTitleLengthHasToBeLess', { TITLE_MAX_LENGTH: TITLE_MAX_LENGTH, length: title.length })]" dense outlined v-model="title")
.col.q-mt-sm(v-if="fields.description")
label.h-label {{ fields.description.label }}
q-field.q-mt-xs.rounded-border(:rules="[rules.required, val => this.$sanitize(val, { allowedTags: [] }).length < DESCRIPTION_MAX_LENGTH || $t('pages.proposals.create.stepdetails.theDescriptionMustContainLess', { DESCRIPTION_MAX_LENGTH: DESCRIPTION_MAX_LENGTH, length: this.$sanitize(description, { allowedTags: [] }).length })]" dense maxlength="4000" outlined ref="bio" stack-label v-model="description" :disable="isProposalType(PROPOSAL_TYPE.ABILITY)")
q-field.q-mt-xs.rounded-border(:rules="[rules.required, val => this.$sanitize(val, { allowedTags: [] }).length < DESCRIPTION_MAX_LENGTH || $t('pages.proposals.create.stepdetails.theDescriptionMustContainLess', { DESCRIPTION_MAX_LENGTH: DESCRIPTION_MAX_LENGTH, length: this.$sanitize(description, { allowedTags: [] }).length })]" dense maxlength="4000" outlined ref="bio" stack-label v-model="description" :disable="isProposalType(PROPOSAL_TYPE.ABILITY) || isProposalType(PROPOSAL_TYPE.ASSIGNBADGE)")
input-editor.full-width(:placeholder="fields.description.placeholder" :toolbar="[['bold', 'italic', /*'strike', 'underline'*/],['token', 'hr', 'link', 'custom_btn'],['quote', 'unordered', 'ordered']]" flat ref="editorRef" v-model="description")
.col.q-mt-sm(v-if="fields.circle")
label.h-label {{ fields.circle.label }}
Expand Down
12 changes: 12 additions & 0 deletions src/store/proposals/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,18 @@ export default {
]
break

case PROPOSAL_TYPE.ASSIGNBADGE:
content = [
{ label: 'content_group_label', value: ['string', 'details'] },
{ label: 'assignee', value: ['name', rootState.accounts.account] },
{ label: 'title', value: ['string', draft.title] },
{ label: 'description', value: ['string', draft.description] },
{ label: 'badge', value: ['int64', draft.badge.docId] },
{ label: 'start_period', value: ['int64', draft.startPeriod.docId] },
{ label: 'period_count', value: ['int64', draft.periodCount] }
]
break

case PROPOSAL_TYPE.ARCHETYPE:
content = [
{ label: 'content_group_label', value: ['string', 'details'] },
Expand Down