Skip to content

Commit

Permalink
chore: sync develop and master
Browse files Browse the repository at this point in the history
chore: sync develop and master
  • Loading branch information
arsenijesavic authored Nov 3, 2023
2 parents fe050cd + 4b60953 commit 0f6cc0d
Show file tree
Hide file tree
Showing 16 changed files with 209 additions and 85 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@graphql-codegen/typescript-operations": "^3.0.3",
"@hypha-dao/hypha-token-sales-util": "^1.0.1",
"@hypha-dao/ppp-client-api": "1.0.3",
"@hypha-dao/ual-hypha": "^1.0.12",
"@hypha-dao/ual-hypha": "^1.0.13",
"@quasar/extras": "1.10.4",
"@sentry/browser": "6.3.1",
"@sentry/integrations": "6.3.1",
Expand Down
9 changes: 1 addition & 8 deletions src/boot/api.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { Api, JsonRpc } from 'eosjs'
import axios from 'axios'
import { Screen } from 'quasar'
import I18n from '~/utils/i18n'

const DEFAULT_OPTIONS = {
title: Screen.gt.md ? I18n.t('hypha-wallet-pop-up.signTransaction.desktop.title') : I18n.t('hypha-wallet-pop-up.signTransaction.mobile.title'),
text: Screen.gt.md ? I18n.t('hypha-wallet-pop-up.signTransaction.desktop.text') : I18n.t('hypha-wallet-pop-up.signTransaction.mobile.text'),
actionText: Screen.gt.md ? I18n.t('hypha-wallet-pop-up.signTransaction.desktop.actionText') : I18n.t('hypha-wallet-pop-up.signTransaction.mobile.actionText')
}
const signTransaction = async function (actions, options = DEFAULT_OPTIONS) {
const signTransaction = async function (actions, options = {}) {
actions.forEach((action) => {
if (!action.authorization || !action.authorization.length) {
action.authorization = [
Expand Down
21 changes: 20 additions & 1 deletion src/boot/ual.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@ import { UAL } from 'universal-authenticator-library'
import { Anchor } from 'ual-anchor'
import { HyphaAuthenticator } from '@hypha-dao/ual-hypha'
import { SeedsAuthenticator } from 'ual-seeds'
import { Screen } from 'quasar'
import I18n from '~/utils/i18n'

const DEFAULT_LOGIN_OPTIONS = {
title: Screen.gt.md ? I18n.t('hypha-wallet-pop-up.signTransaction.desktop.login') : I18n.t('hypha-wallet-pop-up.signTransaction.mobile.login'),
text: Screen.gt.md ? I18n.t('hypha-wallet-pop-up.signTransaction.desktop.text') : I18n.t('hypha-wallet-pop-up.signTransaction.mobile.text'),
actionText: Screen.gt.md ? I18n.t('hypha-wallet-pop-up.signTransaction.desktop.actionText') : I18n.t('hypha-wallet-pop-up.signTransaction.mobile.actionText')
}
const DEFAULT_SIGN_TRANSACTION_OPTIONS = {
title: Screen.gt.md ? I18n.t('hypha-wallet-pop-up.signTransaction.desktop.title') : I18n.t('hypha-wallet-pop-up.signTransaction.mobile.title'),
text: Screen.gt.md ? I18n.t('hypha-wallet-pop-up.signTransaction.desktop.text') : I18n.t('hypha-wallet-pop-up.signTransaction.mobile.text'),
actionText: Screen.gt.md ? I18n.t('hypha-wallet-pop-up.signTransaction.desktop.actionText') : I18n.t('hypha-wallet-pop-up.signTransaction.mobile.actionText')
}

const UAL_HYPHA_TRANSLATIONS = {
login: DEFAULT_LOGIN_OPTIONS,
signTransaction: DEFAULT_SIGN_TRANSACTION_OPTIONS
}

export default async ({ Vue, store }) => {
const mainChain = {
Expand All @@ -16,7 +34,8 @@ export default async ({ Vue, store }) => {
}
const hyphaWallet = new HyphaAuthenticator([mainChain], {
appName: process.env.APP_NAME,
loginContract: process.env.LOGIN_CONTRACT
loginContract: process.env.LOGIN_CONTRACT,
translation: UAL_HYPHA_TRANSLATIONS
})
const lw = new SeedsAuthenticator([mainChain], { appName: process.env.APP_NAME })
const anchor = new Anchor([mainChain], { appName: process.env.APP_NAME })
Expand Down
98 changes: 71 additions & 27 deletions src/components/login/register-user-with-captcha-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ export default {
},
create: {
name: 'create-your-dao',
index: 4
index: 4,
insideSteps: {
identity: true,
publish: false
}
},
loading: {
name: 'loading',
Expand Down Expand Up @@ -105,7 +109,9 @@ export default {
logo: '',
primaryColor: '#242f5d',
secondaryColor: '#3f64ee',
textColor: '#ffffff'
textColor: '#ffffff',
email: '',
affiliate: ''
},
showLoadingModal: false,
progress: 0,
Expand All @@ -125,6 +131,12 @@ export default {
isImageSelected: {
cache: false,
get () { return this.$refs.ipfsInput?.imageURI }
},
canNextStep() {
return this.form.title && this.form.description && this.form.logo
},
canPublish() {
return this.canNextStep && this.form.email && this.form.affiliate
}
},
watch: {
Expand Down Expand Up @@ -274,6 +286,14 @@ export default {
},
enterDao() {
this.$router.push({ name: 'dashboard' })
},
nextCreateStep() {
this.steps.create.insideSteps.identity = false
this.steps.create.insideSteps.publish = true
},
backCreateStep() {
this.steps.create.insideSteps.identity = true
this.steps.create.insideSteps.publish = false
}
}
}
Expand Down Expand Up @@ -337,31 +357,55 @@ export default {
.row.flex.justify-center.items-center.q-mt-xl
.text-primary.text-bold.cursor-pointer.text-underline(@click="goToDocumentation()") {{ $t('login.register-user-with-captcha-view.needHelp') }}
#form4.flex.column.justify-between.no-wrap.full-height(v-show="step === this.steps.create.name")
div.full-height.column.justify-end
.font-lato.text-heading.text-bold(:class="{ 'desktop-line-height desktop-font-size': $q.screen.gt.md }" :style="{ 'font-size': '38px' }") {{ $t('login.register-user-with-captcha-view.createYourDao') }}
.q-mt-md {{ $t('login.register-user-with-captcha-view.goAheadAndAddYour') }}
div
div.full-width.justify-between(:class="{ 'col': !$q.screen.gt.md, 'row': $q.screen.gt.md, 'q-mt-xl': $q.screen.gt.md, 'q-mt-xs': !$q.screen.gt.md }")
.col(:class="{ 'full-width q-pt-md': !$q.screen.gt.md }")
.row.justify-center.items-end
.col-auto.q-mb-xxxs
loading-spinner.q-mb-xxs(v-if="$refs.ipfsInput?.isUploading" color="primary" size="2em")
q-avatar.flex.justify-center.items-center(v-else size="40px" color="primary" text-color="white")
q-btn(v-if="!isImageSelected" @click="$refs.ipfsInput.chooseFile()" icon="fa fa-image" color="white" flat round size="12px" unelevated)
img(v-if="isImageSelected" :src="$refs.ipfsInput.imageURI")
.col.q-ml-md
label.h-label {{ $t('pages.onboarding.logoIcon') }}
q-btn.full-width.rounded-border.text-bold.q-mt-xs(:class="{ 'q-px-xl': $q.screen.gt.md }" @click="$refs.ipfsInput.chooseFile()" color="primary" :label="$t('pages.onboarding.uploadAnImage')" no-caps outline rounded unelevated)
input-file-ipfs(@uploadedFile="form.logo = arguments[0] " image="image" ref="ipfsInput" v-show="false")
.col.q-ml-md(:class="{ 'full-width q-mt-md': !$q.screen.gt.md, 'q-pr-md': $q.screen.gt.md }")
label.h-label {{ $t('pages.onboarding.name') }}
q-input.q-mt-xs.rounded-border(:rules="[rules.required, rules.min(3)]" dense lazy-rules="ondemand" maxlength="50" outlined :placeholder="$t('pages.onboarding.theDisplayNameOfYourDao')" ref="title" v-model="form.title")
.row.full-width.justify-between(:class="{ 'bottom-padding': !$q.screen.gt.md }")
.col-12(:class="{ 'full-width': !$q.screen.gt.md, 'q-mt-md': $q.screen.gt.md }")
label.h-label {{ $t('pages.onboarding.purpose') }}
q-input.q-mt-xs.rounded-border(:input-style="{ 'resize': 'none' }" :rules="[rules.required]" dense lazy-rules="ondemand" maxlength="300" outlined :placeholder="$t('pages.onboarding.brieflyExplainWhatYourDao')" ref="description" rows="4" type="textarea" v-model="form.description")
nav.row.justify-end.q-mt-xl.q-gutter-xs
q-btn.q-px-xl(v-if="$q.screen.gt.md" @click="onSubmit" color="primary" :label="$t('login.register-user-with-captcha-view.publishYourDao')" no-caps rounded unelevated)
template(v-if="this.steps.create.insideSteps.identity")
div.full-height.column.justify-end
.font-lato.text-heading.text-bold(:class="{ 'desktop-line-height desktop-font-size': $q.screen.gt.md }" :style="{ 'font-size': '38px' }") {{ $t('login.register-user-with-captcha-view.daoIndentity') }}
.q-mt-md {{ $t('login.register-user-with-captcha-view.goAheadAndAddYour') }}
div
div.full-width.justify-between(:class="{ 'col': !$q.screen.gt.md, 'row': $q.screen.gt.md, 'q-mt-xl': $q.screen.gt.md, 'q-mt-xs': !$q.screen.gt.md }")
.col(:class="{ 'full-width q-pt-md': !$q.screen.gt.md }")
.row.justify-center.items-end
.col-auto.q-mb-xxxs
loading-spinner.q-mb-xxs(v-if="$refs.ipfsInput?.isUploading" color="primary" size="2em")
q-avatar.flex.justify-center.items-center(v-else size="40px" color="primary" text-color="white")
q-btn(v-if="!isImageSelected" @click="$refs.ipfsInput.chooseFile()" icon="fa fa-image" color="white" flat round size="12px" unelevated)
img(v-if="isImageSelected" :src="$refs.ipfsInput.imageURI")
.col.q-ml-md
label.h-label {{ $t('pages.onboarding.logoIcon') }}
q-btn.full-width.rounded-border.text-bold.q-mt-xs(:class="{ 'q-px-xl': $q.screen.gt.md }" @click="$refs.ipfsInput.chooseFile()" color="primary" :label="$t('pages.onboarding.uploadAnImage')" no-caps outline rounded unelevated)
input-file-ipfs(@uploadedFile="form.logo = arguments[0] " image="image" ref="ipfsInput" v-show="false")
.col.q-ml-md(:class="{ 'full-width q-mt-md': !$q.screen.gt.md, 'q-pr-md': $q.screen.gt.md }")
label.h-label {{ $t('pages.onboarding.name') }}
q-input.q-mt-xs.rounded-border(:rules="[rules.required, rules.min(3)]" dense lazy-rules="ondemand" maxlength="50" outlined :placeholder="$t('pages.onboarding.theDisplayNameOfYourDao')" ref="title" v-model="form.title")
.row.full-width.justify-between(:class="{ 'bottom-padding': !$q.screen.gt.md }")
.col-12(:class="{ 'full-width': !$q.screen.gt.md, 'q-mt-md': $q.screen.gt.md }")
label.h-label {{ $t('pages.onboarding.purpose') }}
q-input.q-mt-xs.rounded-border(:input-style="{ 'resize': 'none' }" :rules="[rules.required]" dense lazy-rules="ondemand" maxlength="300" outlined :placeholder="$t('pages.onboarding.brieflyExplainWhatYourDao')" ref="description" rows="4" type="textarea" v-model="form.description")
nav.row.justify-end.q-mt-xl.q-gutter-xs
q-btn.q-px-xl(v-if="$q.screen.gt.md" :disable="!canNextStep" @click="nextCreateStep()" color="primary" :label="$t('login.register-user-with-captcha-view.next')" no-caps rounded unelevated)
template(v-else-if="this.steps.create.insideSteps.publish")
div.full-height.column.justify-end
.row.flex.items-center.cursor-pointer(@click="backCreateStep()")
q-icon.q-mr-xxs(name="fas fa-chevron-left" color="primary" size="14px")
.text-bold.text-primary {{ $t('login.login-view.back') }}
.font-lato.text-heading.text-bold(:class="{ 'desktop-line-height desktop-font-size': $q.screen.gt.md }" :style="{ 'font-size': '38px' }") {{ $t('login.register-user-with-captcha-view.publishYourDao') }}
.h-h5.q-mt-md {{ $t('login.register-user-with-captcha-view.connectWithUs') }}
.q-mt-md {{ $t('login.register-user-with-captcha-view.toBeThere') }}
div
div.full-width.justify-between(:class="{ 'col': !$q.screen.gt.md, 'row': $q.screen.gt.md, 'q-mt-xl': $q.screen.gt.md, 'q-mt-xs': !$q.screen.gt.md }")
.col.q-mr-sm(:class="{ 'full-width q-mt-md': !$q.screen.gt.md }")
label.h-label {{ $t('pages.onboarding.email') }}
q-input.q-mt-xs.rounded-border(:rules="[rules.required, rules.min(3)]" dense lazy-rules="ondemand" outlined :placeholder="$t('pages.onboarding.email')" ref="email" v-model="form.email")
.col(:class="{ 'full-width q-mt-md': !$q.screen.gt.md }")
label.h-label {{ $t('pages.onboarding.affiliate') }}
q-input.q-mt-xs.rounded-border(:rules="[rules.required, rules.min(3)]" dense lazy-rules="ondemand" outlined :placeholder="$t('pages.onboarding.affiliate')" ref="affiliate" v-model="form.affiliate")
.row.full-width.justify-between(:class="{ 'bottom-padding': !$q.screen.gt.md }")
.col.q-mr-sm
q-input.rounded-border.bg-internal-bg(dense disable outlined v-model="account")
.col
q-input.rounded-border.bg-internal-bg(dense disable outlined v-model="form.title")
nav.row.justify-end.q-mt-xl.q-gutter-xs
q-btn.q-px-xl(:disable="canPublish" v-if="$q.screen.gt.md" @click="onSubmit" color="primary" :label="$t('login.register-user-with-captcha-view.publishYourDao')" no-caps rounded unelevated)
#form5.flex.items-center.justify-center.no-wrap(v-show="step === this.steps.loading.name")
q-dialog(v-if="$q.screen.gt.md" :value="showLoadingModal" persistent)
widget.bg-white.q-pa-xxxl.width-auto.col-auto.full-width(:style="'border-radius: 25px; box-shadow: 0px 0px 26px 0px rgba(0, 0, 41, 0.2); max-width: 1180px;'")
Expand Down
8 changes: 4 additions & 4 deletions src/components/proposals/proposal-card-chips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ export default {
break
case 'Assignbadge' || 'Assignment Badge':
result.push(...[
{ color: 'primary', label: this.$t('proposals.proposal-card-chips.ability') },
{ color: 'primary', outline: true, label: this.$t('proposals.proposal-card-chips.assignment') }
])
{ color: 'primary', label: this.$t('proposals.proposal-card-chips.badge') },
{ color: 'primary', outline: true, label: this.$t('proposals.proposal-card-chips.application') }])
break
case 'Role':
result.push(...[
Expand All @@ -130,7 +129,8 @@ export default {
}
if (this.type === PROPOSAL_TYPE.ABILITY || this.type === PROPOSAL_TYPE.ASSIGNBADGE) {
result.push(...[
{ color: 'primary', label: this.$t('proposals.proposal-card-chips.ability') }
{ color: 'primary', label: this.$t('proposals.proposal-card-chips.badge') },
{ color: 'primary', outline: true, label: this.$t('proposals.proposal-card-chips.application') }
])
}
Expand Down
36 changes: 30 additions & 6 deletions src/components/proposals/proposal-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ export default {
},
showDefferedValue () {
return this.$store.state.dao.settings.pegToken && this.$store.state.dao.settings.rewardToken
},
isBadgeAssignment () {
return this.type === PROPOSAL_TYPE.ASSIGNBADGE
},
getBadgeAssignmentIcon () {
return this.proposal?.badge?.[0]?.details_icon_s
}
},
Expand Down Expand Up @@ -185,6 +191,9 @@ export default {
if (await this.adjustDeferred({ docId: this.docId, deferred: value })) {
this.$emit('change-deferred', value)
}
},
goToBadge () {
this.$router.push({ name: 'organization/assets/badge', params: { docId: this.proposal?.badge?.[0]?.docId } })
}
},
apollo: {
Expand Down Expand Up @@ -212,11 +221,18 @@ widget.proposal-view.q-mb-sm
.col.justify-end.flex.items-center(v-if="periodCount")
.text-grey.text-italic(:style="{ 'font-size': '12px' }") {{ `Starting ${start} | Duration: ${periodCount} period${periodCount > 1 ? 's' : ''}` }}
q-tooltip(anchor="center end") {{ $t('proposals.proposal-view.1MoonPeriod') }}
.text-grey.text-italic.q-mt-sm(:style="{ 'font-size': '12px' }") {{ $t('proposals.proposal-view.title') }}
.row.q-mb-sm
.column
.text-h5.text-bold {{ title }}
.text-italic.text-body {{ subtitle }}
.col.justify-end.flex.items-center(v-if="isBadgeAssignment")
.text-grey.text-italic(:style="{ 'font-size': '12px' }") {{ `Badge validity: ${this.proposal.details_periodCount_i} period${this.proposal.details_periodCount_i > 1 ? 's' : ''}` }}
.row.q-my-sm
.col-1.flex.items-center(v-if="isBadgeAssignment")
img.icon-img(:src="getBadgeAssignmentIcon")
.col
.text-grey.text-italic(v-if="isBadgeAssignment" :style="{ 'font-size': '12px' }") {{ $t('proposals.proposal-view.badgeName') }}
.text-grey.text-italic(v-else :style="{ 'font-size': '12px' }") {{ $t('proposals.proposal-view.title') }}
.row
.column
.text-h5.text-bold {{ title }}
.text-italic.text-body {{ subtitle }}
version-history(v-if="type === PROPOSAL_TYPE.POLICY && !hidePolicyHistory" :proposalId="proposal?.docId ? proposal?.docId : docId")
quest-progression(v-if="type === PROPOSAL_TYPE.QUEST_START && status === PROPOSAL_STATE.APPROVED" :proposalId="proposal?.docId ? proposal?.docId : docId")
.q-my-sm(:class="{ 'row':$q.screen.gt.md }" v-if="type === PROPOSAL_TYPE.ROLE || type === PROPOSAL_TYPE.EDIT || type === PROPOSAL_TYPE.PAYOUT || type === PROPOSAL_TYPE.ABILITY || type === PROPOSAL_TYPE.BADGE")
Expand Down Expand Up @@ -296,15 +312,23 @@ widget.proposal-view.q-mb-sm
template(v-if="masterPolicy")
.text-xs.text-grey.text-italic {{ $t('proposals.proposal-view.parentPolicy') }}
.row.q-mb-lg {{ masterPolicy.label }}
.text-grey.text-italic(v-if="descriptionWithoutSpecialCharacters" :style="{ 'font-size': '12px' }" :class="{ 'q-mt-lg': !purpose }") {{ $t('proposals.proposal-view.description') }}
.text-grey.text-italic(v-if="isBadgeAssignment" :style="{ 'font-size': '12px' }") {{ $t('proposals.proposal-view.applicantMessage') }}
.text-grey.text-italic(v-else-if="descriptionWithoutSpecialCharacters" :style="{ 'font-size': '12px' }") {{ $t('proposals.proposal-view.description') }}
.row
q-markdown(:style="'width: -webkit-fill-available;'" :src="descriptionWithoutSpecialCharacters")
template(v-if="isBadgeAssignment")
.text-grey.text-italic(:style="{ 'font-size': '12px' }") {{ $t('proposals.proposal-view.badgeDescription') }}
.row
q-markdown(:style="'width: -webkit-fill-available;'" :src="this.proposal.badge?.[0].details_description_s")
.text-grey.text-italic.q-mb-sm(v-if="url" :style="{ 'font-size': '12px' }") {{ $t('proposals.proposal-view.attachedDocuments') }}
.row.items-center.q-mb-md.bg-internal-bg.relative(v-if="url" :style="{ 'padding': '7px 10px', 'border-radius': '15px' }")
q-icon(name="far fa-file" size="xs" color="primary")
ipfs-file-viewer(v-if="isIpfsFile" size="lg" :ipfsCid="url")
a.on-right(v-else :href="url") {{ url }}
q-icon.absolute(name="fas fa-chevron-right" :style="{ 'right': '10px' }")
.row.flex.items-center.q-mb-md(v-if="isBadgeAssignment")
.text-primary.text-underline.cursor-pointer(@click="goToBadge()" :style="'font-size: 12px; font-weight: 600;'") See Badge Details
q-icon(size="10px" name="fas fa-chevron-right")
template(v-if="!preview && !isBadge")
.text-grey.text-italic.top-border.q-pt-sm(:style="{ 'font-size': '12px' }") {{ $t('proposals.proposal-view.createdBy') }}
.row.q-pt-md.justify-between
Expand Down
Loading

0 comments on commit 0f6cc0d

Please sign in to comment.