Skip to content

Commit

Permalink
Merge pull request #83 from michaeljyeates/56_Add-a-completion-page-a…
Browse files Browse the repository at this point in the history
…fter-creating-the-DAC

Add a completion page after creating the DAC #56
  • Loading branch information
kesar authored Dec 23, 2019
2 parents 40803df + 28c6791 commit 76127e9
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 12 deletions.
28 changes: 26 additions & 2 deletions src/components/dacCreation/DacValidation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</section>
<section v-else-if="!validationError">
<p class="validated-text">{{ $t("dac_creation.dac_was_validated") }}</p>
<q-btn to="/" color="secondary" :label="$t('dac_creation.go_to_main_page')" />
<a :href="`http://${dacId}.dacfactory.io`" class="dac-link">{{ $t("dac_creation.go_to_your_dac") }}</a>
</section>
<section v-else>
<p class="validated-text validation-fail">{{ $t("dac_creation.dac_was_not_validated") }}</p>
Expand All @@ -37,7 +37,8 @@ export default {
timeoutId: null,
isValidated: false,
validationError: null,
CONSTITUTION_TEXT
CONSTITUTION_TEXT,
dacId: this.$store.getters["factory/getDacId"]
};
},
props: {
Expand Down Expand Up @@ -83,6 +84,7 @@ export default {
try {
const hash = await encodeInSHA1();
this.$store.dispatch("ual/validateDacTransact", {
dacId: this.dacId,
hash,
afterTransact: this.afterTransact
});
Expand Down Expand Up @@ -142,4 +144,26 @@ export default {
grid-gap 30px
width fit-content
margin 0 auto
.dac-link
display flex
justify-content center
align-items center
cursor pointer
font-size 14px
font-weight 500
border-radius 3px
text-decoration none
text-transform uppercase
color #ffffff
min-height 2.572em
width fit-content
padding 4px 16px
margin 0 auto
line-height normal
background-color $secondary
transition 0.3s cubic-bezier(0.25, 0.8, 0.5, 1)
box-shadow 0 1px 5px rgba(0,0,0,0.2), 0 2px 2px rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12)
&:hover, &:focus
background-color #8d61c0 // TODO replace with real component similar to quasar button
</style>
3 changes: 1 addition & 2 deletions src/components/steps/Step1Form.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<div class="overflow-hidden">
<my-input
:value="dacName"
@input="dacName = $event.trim()"
v-model="dacName"
color="secondary"
:label="`${$t('step1.dac_name')} *`"
:hint="$t('step1.dac_name_hint')"
Expand Down
5 changes: 2 additions & 3 deletions src/components/ual/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,8 @@ export async function prepareDacTransact(storeProps, payload) {
dispatch("dacTransact", { actions, dacId, openWS, afterTransact });
}

export async function validateDacTransact({ rootState, dispatch }, payload) {
const { hash, afterTransact } = payload;
const { dacId } = rootState.factory.stepsData;
export async function validateDacTransact({ dispatch }, payload) {
const { dacId, hash, afterTransact } = payload;

const actions = [
{
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/en-us/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export default {
dac_was_validated: "Your dac was successfully validated!",
dac_was_not_validated: "Your dac wasn't validated. You can try again or contact our support.",
try_again: "try again",
constitution_preparation: "Constitution preparation"
constitution_preparation: "Constitution preparation",
go_to_your_dac: "go to your dac"
},
};
6 changes: 3 additions & 3 deletions src/pages/DacCreation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/>
</section>
<dac-validation v-else-if="isValidationStage" :setDacValidated="setDacValidated" />
<section v-else-if="trxError || wsError">
<section v-else>
<p class="title creation-fail break-text">{{ trxError || wsError }}</p>
<q-btn to="/" color="secondary" :label="$t('dac_creation.go_to_main_page')" />
</section>
Expand All @@ -25,7 +25,7 @@
import ProgressIcons from "components/dacCreation/ProgressIcons";
import DacValidation from "components/dacCreation/DacValidation";
const CLIENT_BUILD_COMPLETE = "CLIENT BUILD COMPLETE";
const CLIENT_BUILD_COMPLETE_STEP = "CLIENT BUILD COMPLETE";
export default {
components: {
Expand Down Expand Up @@ -67,7 +67,7 @@ export default {
this.ws.onmessage = msg => {
this.currentMessage = JSON.parse(msg.data).data.status.replace(/_/g, " ");
this.currentNumber++;
if (this.currentMessage === CLIENT_BUILD_COMPLETE) {
if (this.currentMessage === CLIENT_BUILD_COMPLETE_STEP) {
this.creationFinishedText = this.$t("dac_creation.dac_was_created");
this.$store.commit("factory/setDacId", dacId);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default {
.upload-json-wrapper
position relative
.upload-json-button
background-color #11b55b
background-color #0fa251
.upload-json-button-error
background-color $negative
animation shake 0.36s
Expand Down

0 comments on commit 76127e9

Please sign in to comment.