Skip to content

Commit

Permalink
fix(proposal): edit badge requrring assignments (#DEV-917) (#2417)
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenibir authored Sep 6, 2023
1 parent be63af8 commit 182a504
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
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

0 comments on commit 182a504

Please sign in to comment.