From 7cbed46d61a58f702a617b7fd83e109b41a333f8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 14:50:42 +0000 Subject: [PATCH 01/15] chore(develop): release 2.11.0 --- CHANGELOG.md | 30 +++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f71bdabff..66da25c19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ # Changelog +## [2.11.0](https://github.com/hypha-dao/dho-web-client/compare/v2.10.0...v2.11.0) (2022-09-05) + + +### Features + +* add cash claims flag ([#1490](https://github.com/hypha-dao/dho-web-client/issues/1490)) ([962e104](https://github.com/hypha-dao/dho-web-client/commit/962e104bd59e86bca749aa2c764498655f40c3db)) +* added "delete proposal" button to staging proposals ([#1520](https://github.com/hypha-dao/dho-web-client/issues/1520)) ([#1538](https://github.com/hypha-dao/dho-web-client/issues/1538)) ([7d48d6f](https://github.com/hypha-dao/dho-web-client/commit/7d48d6fcb94fb5f0d904f4bd2755d89167f91e55)) +* disabled cash claims for hypha ([#1531](https://github.com/hypha-dao/dho-web-client/issues/1531)) ([61f1261](https://github.com/hypha-dao/dho-web-client/commit/61f12619d0bfd45066b29db51bd1c15f8768baa0)) +* **explore page:** show dao creation wizard to hypha members only ([#1514](https://github.com/hypha-dao/dho-web-client/issues/1514)) ([925cf02](https://github.com/hypha-dao/dho-web-client/commit/925cf020b4c3c95b7a1e4eb2cda56d6a8682fc3e)) +* **proposals:** add pull interval to auto refresh ([#1529](https://github.com/hypha-dao/dho-web-client/issues/1529)) ([7163dad](https://github.com/hypha-dao/dho-web-client/commit/7163dada7cc512ceb9de80a3b79cdecf573a9bdc)) + + +### Bug Fixes + +* badge proposal details and formatting issues ([#1551](https://github.com/hypha-dao/dho-web-client/issues/1551)) ([33b755e](https://github.com/hypha-dao/dho-web-client/commit/33b755e035cc17202fbfdf9f52bcd130587dff14)) +* **changelog:** change relase notes for 2.10 ([#1546](https://github.com/hypha-dao/dho-web-client/issues/1546)) ([6eccb13](https://github.com/hypha-dao/dho-web-client/commit/6eccb13e7c86030e9bd41afbdb45468dc3d44c3a)) +* **configuration page:** remove pattern slip and disable announcement edit for non admins ([#1530](https://github.com/hypha-dao/dho-web-client/issues/1530)) ([2ec524f](https://github.com/hypha-dao/dho-web-client/commit/2ec524f53217dffa05a90c63ae293f14be643c83)) +* current dao in left menu (dao switcher) has been hidden ([#1544](https://github.com/hypha-dao/dho-web-client/issues/1544)) ([#1565](https://github.com/hypha-dao/dho-web-client/issues/1565)) ([04dca98](https://github.com/hypha-dao/dho-web-client/commit/04dca98e9cfa64934f790b474e13f3f13fb5e46d)) +* enable deferred button for archived assignments [#1489](https://github.com/hypha-dao/dho-web-client/issues/1489) ([#1534](https://github.com/hypha-dao/dho-web-client/issues/1534)) ([a29b231](https://github.com/hypha-dao/dho-web-client/commit/a29b231aba7097fa69f65013ffb070d033dbe31b)) +* fix wrong titles and salary tag for search items ([#1513](https://github.com/hypha-dao/dho-web-client/issues/1513)) ([#1540](https://github.com/hypha-dao/dho-web-client/issues/1540)) ([c32b3aa](https://github.com/hypha-dao/dho-web-client/commit/c32b3aa0c19a24c1da10a961bd961fdec485c137)) +* fixed color for CTA buttons ([#1522](https://github.com/hypha-dao/dho-web-client/issues/1522)) ([#1560](https://github.com/hypha-dao/dho-web-client/issues/1560)) ([3f29e32](https://github.com/hypha-dao/dho-web-client/commit/3f29e32fa7183d20659844eb8efb4e25ae9b2bcc)) +* fixed filter on the search page, added missing filter types ([#1415](https://github.com/hypha-dao/dho-web-client/issues/1415)) ([#1537](https://github.com/hypha-dao/dho-web-client/issues/1537)) ([7ad7515](https://github.com/hypha-dao/dho-web-client/commit/7ad751570faea7797f4d1a477c68e80c2d7db75e)) +* fixed widgets links in home and organisation pages ([#1550](https://github.com/hypha-dao/dho-web-client/issues/1550)) ([#1564](https://github.com/hypha-dao/dho-web-client/issues/1564)) ([c600166](https://github.com/hypha-dao/dho-web-client/commit/c600166b8334046b9fd84333d018e779019c770f)) +* hide badge multiplier ([#1476](https://github.com/hypha-dao/dho-web-client/issues/1476)) ([#1535](https://github.com/hypha-dao/dho-web-client/issues/1535)) ([c498dbb](https://github.com/hypha-dao/dho-web-client/commit/c498dbb76549621b3a0afb36b47a5d93bd090560)) +* proposal description max length ([#1496](https://github.com/hypha-dao/dho-web-client/issues/1496)) ([20f0d46](https://github.com/hypha-dao/dho-web-client/commit/20f0d46bc11f8b5469e9db914e0ed81ee0bcbff6)) +* revert to claim all with multiple transaction ([#1509](https://github.com/hypha-dao/dho-web-client/issues/1509)) ([2e1ed55](https://github.com/hypha-dao/dho-web-client/commit/2e1ed55fb7f21c3b35f56ca418ba40d3e7499710)) +* warning about character max from description has been removed ([#1555](https://github.com/hypha-dao/dho-web-client/issues/1555)) ([#1563](https://github.com/hypha-dao/dho-web-client/issues/1563)) ([571f374](https://github.com/hypha-dao/dho-web-client/commit/571f37485c15985e0e5564af0a4bcebe16923f76)) + ## [2.10.1](https://github.com/hypha-dao/dho-web-client/compare/v2.10.0...v2.10.1) (2022-08-30) @@ -23,4 +51,4 @@ ### Bug Fixes -* **configuration page:** remove pattern slip and disable announcement edit for non admins ([#1530](https://github.com/hypha-dao/dho-web-client/issues/1530)) ([2ec524f](https://github.com/hypha-dao/dho-web-client/commit/2ec524f53217dffa05a90c63ae293f14be643c83)) \ No newline at end of file +* **configuration page:** remove pattern slip and disable announcement edit for non admins ([#1530](https://github.com/hypha-dao/dho-web-client/issues/1530)) ([2ec524f](https://github.com/hypha-dao/dho-web-client/commit/2ec524f53217dffa05a90c63ae293f14be643c83)) diff --git a/package.json b/package.json index 5f2661768..7ce45c57f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dho-web-client", - "version": "2.10.1", + "version": "2.11.0", "description": "Governance, payroll and treasury tools for distributed HUMAN organizations (DHO)", "productName": "Hypha DHO", "author": "Max ", From 974ac67773f61584128a9a45c2efecfd852e27bf Mon Sep 17 00:00:00 2001 From: Arsenije Savic Date: Tue, 6 Sep 2022 08:58:39 -0500 Subject: [PATCH 02/15] test(cypress): update cypress to version 10 (#1576) --- cypress.config.js | 18 ++++++++ cypress.json | 1 - .../assignment.js => e2e/assignment.cy.js} | 0 .../{integration/roles.js => e2e/roles.cy.js} | 0 cypress/support/component-index.html | 12 +++++ cypress/support/{index.js => component.js} | 9 +++- cypress/support/e2e.js | 28 ++++++++++++ package.json | 2 +- yarn.lock | 45 ++++++++++--------- 9 files changed, 90 insertions(+), 25 deletions(-) create mode 100644 cypress.config.js delete mode 100644 cypress.json rename cypress/{integration/assignment.js => e2e/assignment.cy.js} (100%) rename cypress/{integration/roles.js => e2e/roles.cy.js} (100%) create mode 100644 cypress/support/component-index.html rename cypress/support/{index.js => component.js} (78%) create mode 100644 cypress/support/e2e.js diff --git a/cypress.config.js b/cypress.config.js new file mode 100644 index 000000000..c4c02afcb --- /dev/null +++ b/cypress.config.js @@ -0,0 +1,18 @@ +const { defineConfig } = require('cypress') + +module.exports = defineConfig({ + e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + setupNodeEvents (on, config) { + return require('./cypress/plugins/index.js')(on, config) + } + }, + + component: { + devServer: { + framework: 'vue', + bundler: 'webpack' + } + } +}) diff --git a/cypress.json b/cypress.json deleted file mode 100644 index 0967ef424..000000000 --- a/cypress.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/cypress/integration/assignment.js b/cypress/e2e/assignment.cy.js similarity index 100% rename from cypress/integration/assignment.js rename to cypress/e2e/assignment.cy.js diff --git a/cypress/integration/roles.js b/cypress/e2e/roles.cy.js similarity index 100% rename from cypress/integration/roles.js rename to cypress/e2e/roles.cy.js diff --git a/cypress/support/component-index.html b/cypress/support/component-index.html new file mode 100644 index 000000000..ac6e79fd8 --- /dev/null +++ b/cypress/support/component-index.html @@ -0,0 +1,12 @@ + + + + + + + Components App + + +
+ + \ No newline at end of file diff --git a/cypress/support/index.js b/cypress/support/component.js similarity index 78% rename from cypress/support/index.js rename to cypress/support/component.js index d68db96df..53d9d15a2 100644 --- a/cypress/support/index.js +++ b/cypress/support/component.js @@ -1,5 +1,5 @@ // *********************************************************** -// This example support/index.js is processed and +// This example support/component.js is processed and // loaded automatically before your test files. // // This is a great place to put global configuration and @@ -18,3 +18,10 @@ import './commands' // Alternatively you can use CommonJS syntax: // require('./commands') + +import { mount } from 'cypress/vue2' + +Cypress.Commands.add('mount', mount) + +// Example use: +// cy.mount(MyComponent) \ No newline at end of file diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js new file mode 100644 index 000000000..bfb896688 --- /dev/null +++ b/cypress/support/e2e.js @@ -0,0 +1,28 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') + +Cypress.on('uncaught:exception', (err) => { + // returning false here prevents Cypress from + // failing the test +// cy.log('Cypress detected uncaught exception: ', err) +// console.log('Cypress detected uncaught ex/ception: ', err) + return false +}) diff --git a/package.json b/package.json index 7ce45c57f..3487fb839 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "chromatic": "^5.8.2", "commitizen": "^4.2.5", "cross-fetch": "^3.1.4", - "cypress": "^7.3.0", + "cypress": "^10.7.0", "cz-conventional-changelog": "^3.3.0", "eslint": "7.24.0", "eslint-loader": "4.0.2", diff --git a/yarn.lock b/yarn.lock index 9be4f680e..a5828fc45 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1518,7 +1518,7 @@ dependencies: "@jridgewell/trace-mapping" "0.3.9" -"@cypress/request@^2.88.5": +"@cypress/request@^2.88.10": version "2.88.10" resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.10.tgz#b66d76b07f860d3a4b8d7a0604d020c662752cce" integrity sha512-Zp7F+R93N0yZyG34GutyTNr+okam7s/Fzc1+i3kcqOP8vk6OuajuE9qZJ6Rs+10/1JFtXFYMdyarnU1rZuJesg== @@ -3340,10 +3340,10 @@ "@types/mime" "^1" "@types/node" "*" -"@types/sinonjs__fake-timers@^6.0.2": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.4.tgz#0ecc1b9259b76598ef01942f547904ce61a6a77d" - integrity sha512-IFQTJARgMUBF+xVd2b+hIgXWrZEjND3vJtRCvIelcFB5SIXfjV4bOHbHJ0eXKh+0COrBRc8MqteKAz/j88rE0A== +"@types/sinonjs__fake-timers@8.1.1": + version "8.1.1" + resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz#b49c2c70150141a15e0fa7e79cf1f92a72934ce3" + integrity sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g== "@types/sizzle@^2.3.2": version "2.3.3" @@ -5114,7 +5114,7 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -buffer@^5.5.0: +buffer@^5.5.0, buffer@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== @@ -5612,7 +5612,7 @@ cli-spinners@^2.5.0: resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== -cli-table3@^0.6.1, cli-table3@~0.6.0: +cli-table3@^0.6.1, cli-table3@~0.6.1: version "0.6.2" resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.2.tgz#aaf5df9d8b5bf12634dc8b3040806a0c07120d2a" integrity sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw== @@ -6494,24 +6494,25 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha512-NJGVKPS81XejHcLhaLJS7plab0fK3slPh11mESeeDq2W4ZI5kUKK/LRRdVDvjJseojbPB7ZwjnyOybg3Igea/A== -cypress@^7.3.0: - version "7.7.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-7.7.0.tgz#0839ae28e5520536f9667d6c9ae81496b3836e64" - integrity sha512-uYBYXNoI5ym0UxROwhQXWTi8JbUEjpC6l/bzoGZNxoKGsLrC1SDPgIDJMgLX/MeEdPL0UInXLDUWN/rSyZUCjQ== +cypress@^10.7.0: + version "10.7.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-10.7.0.tgz#2d37f8b9751c6de33ee48639cb7e67a2ce593231" + integrity sha512-gTFvjrUoBnqPPOu9Vl5SBHuFlzx/Wxg/ZXIz2H4lzoOLFelKeF7mbwYUOzgzgF0oieU2WhJAestQdkgwJMMTvQ== dependencies: - "@cypress/request" "^2.88.5" + "@cypress/request" "^2.88.10" "@cypress/xvfb" "^1.2.4" "@types/node" "^14.14.31" - "@types/sinonjs__fake-timers" "^6.0.2" + "@types/sinonjs__fake-timers" "8.1.1" "@types/sizzle" "^2.3.2" arch "^2.2.0" blob-util "^2.0.2" bluebird "^3.7.2" + buffer "^5.6.0" cachedir "^2.3.0" chalk "^4.1.0" check-more-types "^2.24.0" cli-cursor "^3.1.0" - cli-table3 "~0.6.0" + cli-table3 "~0.6.1" commander "^5.1.0" common-tags "^1.8.0" dayjs "^1.10.4" @@ -6530,15 +6531,15 @@ cypress@^7.3.0: listr2 "^3.8.3" lodash "^4.17.21" log-symbols "^4.0.0" - minimist "^1.2.5" + minimist "^1.2.6" ospath "^1.2.2" pretty-bytes "^5.6.0" - ramda "~0.27.1" + proxy-from-env "1.0.0" request-progress "^3.0.0" + semver "^7.3.2" supports-color "^8.1.1" tmp "~0.2.1" untildify "^4.0.0" - url "^0.11.0" yauzl "^2.10.0" cz-conventional-changelog@3.3.0, cz-conventional-changelog@^3.3.0: @@ -13352,6 +13353,11 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" +proxy-from-env@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" + integrity sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A== + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" @@ -13616,11 +13622,6 @@ ramda@^0.28.0: resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.28.0.tgz#acd785690100337e8b063cab3470019be427cc97" integrity sha512-9QnLuG/kPVgWvMQ4aODhsBUFKOUmnbUnsSXACv+NCQZcHbeb+v8Lodp8OVxtRULN1/xOyYLLaL6npE6dMq5QTA== -ramda@~0.27.1: - version "0.27.2" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.2.tgz#84463226f7f36dc33592f6f4ed6374c48306c3f1" - integrity sha512-SbiLPU40JuJniHexQSAgad32hfwd+DRUdwF2PlVuI5RZD0/vahUco7R8vD86J/tcEKKF9vZrUVwgtmGCqlCKyA== - randombytes@2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.5.tgz#dc009a246b8d09a177b4b7a0ae77bc570f4b1b79" From 6c881e8541fce64b4232226968870e467c3863f1 Mon Sep 17 00:00:00 2001 From: Evgeni B Date: Tue, 6 Sep 2022 17:01:01 +0300 Subject: [PATCH 03/15] fix: character max length in creating description for proposal (#1555) (#1573) --- src/pages/proposals/create/StepDescription.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/proposals/create/StepDescription.vue b/src/pages/proposals/create/StepDescription.vue index a06001cbb..78c41e2b5 100644 --- a/src/pages/proposals/create/StepDescription.vue +++ b/src/pages/proposals/create/StepDescription.vue @@ -4,7 +4,7 @@ import { validation } from '~/mixins/validation' import { toHTML, toMarkdown } from '~/utils/turndown' const TITLE_MAX_LENGTH = 50 -const DESCRIPTION_MAX_LENGTH = 2000 +const DESCRIPTION_MAX_LENGTH = 4000 export default { name: 'step-description', @@ -28,7 +28,7 @@ export default { computed: { nextDisabled () { - if (this.title.length > 0 && this.title.length <= TITLE_MAX_LENGTH) { + if (this.title.length > 0 && this.description.length < DESCRIPTION_MAX_LENGTH && this.title.length <= TITLE_MAX_LENGTH) { // if (this.url && isURL(this.url, { require_protocol: true })) { // return false // } @@ -144,6 +144,7 @@ widget .col(v-if="fields.description").q-mt-md label.h-label {{ fields.description.label }} q-field.full-width.q-mt-xs.rounded-border( + :rules="[rules.required, val => val.length < DESCRIPTION_MAX_LENGTH || `The description must contain less than ${DESCRIPTION_MAX_LENGTH} characters (your description contain ${description.length} characters)`]" dense maxlength="2000" outlined From 697ba462592d2e66850ba613dd0a0715f1b7ee43 Mon Sep 17 00:00:00 2001 From: Evgeni B Date: Tue, 6 Sep 2022 17:02:00 +0300 Subject: [PATCH 04/15] fix(proposal): voting widget pagination (#1541) (#1577) --- src/pages/proposals/ProposalDetail.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/proposals/ProposalDetail.vue b/src/pages/proposals/ProposalDetail.vue index 347235d6f..ef5b13cdf 100644 --- a/src/pages/proposals/ProposalDetail.vue +++ b/src/pages/proposals/ProposalDetail.vue @@ -239,7 +239,6 @@ export default { this.pagination.more = false return previousResult } - const data = { getDocument: { ...previousResult.getDocument, @@ -249,7 +248,7 @@ export default { ] } } - return data + this.votesList = data.getDocument.vote } }) } From d895d7020ef78919de618efb197062a80d0495fd Mon Sep 17 00:00:00 2001 From: Irving Puga Date: Wed, 7 Sep 2022 16:32:27 -0700 Subject: [PATCH 05/15] fix: show dynamic deferred on active and archived proposals (#1578) --- src/components/proposals/proposal-view.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/proposals/proposal-view.vue b/src/components/proposals/proposal-view.vue index fe70469bc..e2d0de631 100644 --- a/src/components/proposals/proposal-view.vue +++ b/src/components/proposals/proposal-view.vue @@ -224,7 +224,7 @@ widget.proposal-view.q-mb-sm flat round size="sm" icon="fas fa-pen" color="primary" - v-if="ownAssignment && status === 'approved' || 'archived'" + v-if="ownAssignment && status === 'approved' || status === 'archived'" @click="showDefferredPopup = true; showCommitPopup = false") q-tooltip Edit .col.bg-internal-bg.rounded-border.q-mr-xs(v-if="icon") From 62ac33975300f5fdbd56348145302bdbf2a7456e Mon Sep 17 00:00:00 2001 From: Arsenije Savic Date: Wed, 7 Sep 2022 18:32:50 -0500 Subject: [PATCH 06/15] feat(proposals): add pull interval for the published proposals (#1575) * feat(proposal): add waiting state on publish error * feat(proposal): add proposal to the router state after publish * style(proposals): rename order by vote to the proposals * feat(proposals): add pull interval for the published proposals --- src/pages/proposals/ProposalDetail.vue | 25 ++++++++++++++----------- src/pages/proposals/ProposalList.vue | 22 +++++++++++++++++++--- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/pages/proposals/ProposalDetail.vue b/src/pages/proposals/ProposalDetail.vue index ef5b13cdf..b45ba6420 100644 --- a/src/pages/proposals/ProposalDetail.vue +++ b/src/pages/proposals/ProposalDetail.vue @@ -348,7 +348,9 @@ export default { try { this.state = 'PUBLISHING' await this.publishProposal(proposal.docId) + this.$router.replace({ params: { data: proposal, isPublishing: true }, query: { refetch: true } }) } catch (e) { + this.state = 'WAITING' const message = e.message || e.cause.message this.showNotification({ message, color: 'red' }) } @@ -428,6 +430,18 @@ export default { this.$router.push({ name: 'proposal-create', params: { draftId } }) }, + async onDelete (proposal) { + try { + this.state = 'DELETING' + await this.deleteProposal(proposal.docId) + this.$router.push({ name: 'proposals', params: { data: proposal, isDeleting: true }, query: { refetch: true } }) + } catch (e) { + this.state = 'WAITING' + const message = e.message || e.cause.message + this.showNotification({ message, color: 'red' }) + } + }, + async loadVoiceTokenPercentage (username, voice) { const voiceToken = await this.getVoiceToken(username) const supplyHVoice = parseFloat(this.supplyTokens[voiceToken.token]) @@ -515,17 +529,6 @@ export default { const message = e.message || e.cause.message this.showNotification({ message, color: 'red' }) } - }, - async onDelete (proposal) { - try { - this.state = 'DELETING' - await this.deleteProposal(proposal.docId) - this.$router.push({ name: 'proposals', params: { data: proposal, isDeleting: true }, query: { refetch: true } }) - } catch (e) { - this.state = 'WAITING' - const message = e.message || e.cause.message - this.showNotification({ message, color: 'red' }) - } } } } diff --git a/src/pages/proposals/ProposalList.vue b/src/pages/proposals/ProposalList.vue index 53997b5a0..c693f1785 100644 --- a/src/pages/proposals/ProposalList.vue +++ b/src/pages/proposals/ProposalList.vue @@ -143,7 +143,7 @@ export default { } }, - orderByVote () { + proposals () { const daos = this.dao if (!(daos && daos.length && Array.isArray(daos[0].proposal))) return [] @@ -164,7 +164,7 @@ export default { }, filteredProposals () { - const proposalOrder = this.orderByVote + const proposalOrder = this.proposals if (proposalOrder.length === 0) return proposalOrder @@ -219,21 +219,37 @@ export default { }, watch: { '$route.query.refetch': { - handler: function (refetch) { + handler: function (_refetch) { + const refetch = true const proposal = this.$route.params.data + if (refetch && proposal) { this.state = 'RUNNING' const isDeleting = this.$route.params.isDeleting + const isPublishing = this.$route.params.isPublishing + const pullStagedProposals = setInterval(() => { if (isDeleting) { const deletedProposal = this.stagedProposals.find(_ => _.docId === proposal.docId ) + if (!deletedProposal) { this.state = 'DELETED' this.$router.replace({ params: { data: null }, query: {} }) clearInterval(pullStagedProposals) } + } else if (isPublishing) { + const isPublished = this.proposals.find(_ => + _.docId === proposal.docId + ) + + this.$apollo.queries.dao.refetch() + if (isPublished) { + this.state = 'PUBLISHED' + this.$router.replace({ params: { data: null }, query: {} }) + clearInterval(pullStagedProposals) + } } else { const isCreated = this.stagedProposals.find(_ => _.details_title_s === proposal.title && From 8ad31b491beef548068096711f6785ef905aa482 Mon Sep 17 00:00:00 2001 From: Arsenije Savic Date: Thu, 8 Sep 2022 06:18:59 -0500 Subject: [PATCH 07/15] refactor(input-field): swap input-field with q-input (#1579) * refactor(input-field): delete input-field component * refactor(input-field): swap input-field with q-input --- .../assignments/assignment-suspend.vue | 5 +- .../assignments/assignment-withdraw.vue | 5 +- src/components/common/input-field.stories.js | 25 --------- src/components/common/input-field.vue | 23 -------- .../contributions/token-multipliers.vue | 11 ++-- src/components/filters/filter-widget.vue | 5 +- src/components/form/custom-period-input.vue | 4 +- src/components/form/period-select.vue | 4 +- src/components/form/phone-number.vue | 6 +-- src/components/form/text-input-toggle.vue | 4 +- src/components/login/login-view.vue | 8 +-- src/components/login/register-user-view.vue | 16 +++--- src/components/profiles/edit-dialog.vue | 4 +- src/components/profiles/profile-card.vue | 6 +-- src/components/profiles/wallet-adresses.vue | 6 +-- src/components/profiles/wallet-base.vue | 6 +-- src/components/proposals/comment-input.vue | 6 +-- src/layouts/MultiDhoLayout.vue | 5 +- src/pages/dho/Treasury.vue | 10 ++-- src/pages/onboarding/create.vue | 54 +++++++++---------- src/pages/profiles/profile-creation.vue | 7 ++- .../proposals/create/OptionsArchetypes.vue | 6 +-- src/pages/proposals/create/OptionsBadges.vue | 6 +-- .../proposals/create/StepCompensation.vue | 34 ++++++------ .../proposals/create/StepDateDuration.vue | 6 +-- .../proposals/create/StepDescription.vue | 7 ++- src/pages/proposals/create/StepIcon.vue | 6 +-- 27 files changed, 112 insertions(+), 173 deletions(-) delete mode 100644 src/components/common/input-field.stories.js delete mode 100644 src/components/common/input-field.vue diff --git a/src/components/assignments/assignment-suspend.vue b/src/components/assignments/assignment-suspend.vue index cc2dcc81b..6c8d22641 100644 --- a/src/components/assignments/assignment-suspend.vue +++ b/src/components/assignments/assignment-suspend.vue @@ -1,9 +1,6 @@ - - diff --git a/src/components/contributions/token-multipliers.vue b/src/components/contributions/token-multipliers.vue index bd97e89b5..e2e2711bb 100644 --- a/src/components/contributions/token-multipliers.vue +++ b/src/components/contributions/token-multipliers.vue @@ -6,9 +6,6 @@ export default { husd: Number, hvoice: Number, hypha: Number - }, - components: { - InputField: () => import('~/components/common/input-field.vue') } } @@ -16,7 +13,7 @@ export default {