-
Notifications
You must be signed in to change notification settings - Fork 8
UI: Refactor Create Wizard Cards in Platform UI and Add Step 4 in CreateWiki.vue #1105
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,26 +28,37 @@ | |
| :inFlight="inFlight" | ||
| :error="error" | ||
| :dismissable="false" | ||
| submitButtonText="Create Wiki" | ||
| v-model="stepThree" | ||
| @previous-step="goToStep(2)" | ||
| @submit="createWiki" | ||
| /> | ||
| <step-four-card | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't want to include this Step Four in this PR. Implementing a new card isn't due until a later ticket: T419210 and it should be called |
||
| v-show="step === 4" | ||
| :title="title" | ||
| :inFlight="inFlight" | ||
| :error="error" | ||
| :dismissable="false" | ||
| v-model="stepThree" | ||
| @previous-step="goToStep(3)" | ||
| @submit="createWiki" | ||
| /> | ||
| </v-form> | ||
| </template> | ||
|
|
||
| <script> | ||
| import config from '~/config' | ||
| import StepOneCard from './CreateWikiWizardStepOne.vue' | ||
| import StepTwoCard from './CreateWikiWizardStepTwo.vue' | ||
| import StepThreeCard from './CreateWikiWizardStepThree.vue' | ||
| import SiteDetailsCreateWikiWizardStep from './SiteDetailsCreateWikiWizardStep.vue' | ||
| import AudienceAndPurposeWizardStep from './AudienceAndPurposeWizardStep.vue' | ||
| import TemporalityProfileEditWizardStep from './TemporalityProfileEditWizardStep.vue' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We only need |
||
| import TemporalityCreateWikiWizardStep from '@/components/Cards/TemporalityCreateWikiWizardStep.vue' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this |
||
|
|
||
| export default { | ||
| name: 'CreateWiki', | ||
| components: { | ||
| StepOneCard, | ||
| StepTwoCard, | ||
| StepThreeCard | ||
| StepOneCard: SiteDetailsCreateWikiWizardStep, | ||
| StepTwoCard: AudienceAndPurposeWizardStep, | ||
| StepThreeCard: TemporalityProfileEditWizardStep, | ||
| StepFourCard: TemporalityCreateWikiWizardStep | ||
| }, | ||
| props: [ | ||
| 'title', | ||
|
|
@@ -77,6 +88,10 @@ export default { | |
| temporality: '', | ||
| otherTemporality: '' | ||
| }, | ||
| stepFour: { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above we don't need a step four yet :) |
||
| selectedOption: '', | ||
| freeTextResponse: '' | ||
| }, | ||
| hasError: false, | ||
| error: [], | ||
| inFlight: false, | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let us also change the exported name to match the filename here |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| <template> | ||
| <v-card class="elevation-12"> | ||
| <v-toolbar dark color="primary"> | ||
| <v-toolbar-title>{{ title }}</v-toolbar-title> | ||
| <v-spacer></v-spacer> | ||
| <v-btn v-if="dismissable" icon @click="$emit('close-dialog')"> | ||
| <v-icon>mdi-close</v-icon> | ||
| </v-btn> | ||
| </v-toolbar> | ||
|
|
||
| <v-card-text> | ||
| <v-form ref="inputForm" v-on:submit.prevent> | ||
| <h3>How long do you plan to use this Wikibase?</h3> | ||
|
|
||
| <v-radio-group | ||
| v-model="value.temporality" | ||
| :error-messages=error | ||
| :rules="[() => !!value.temporality || 'Please select an option.']" | ||
| > | ||
| <v-radio value="permanent" ref="test"> | ||
| <template v-slot:label> | ||
| I would prefer to keep it on a permanent basis | ||
| </template> | ||
| </v-radio> | ||
| <v-radio value="temporary"> | ||
| <template v-slot:label> | ||
| It is temporary/disposable. I will no longer need it after it served its purpose | ||
| </template> | ||
| </v-radio> | ||
|
|
||
| <v-radio value="other"> | ||
| <template v-slot:label> | ||
| Other: <v-text-field | ||
| dense | ||
| counter="200" | ||
| class="pl-1 mt-n1 mb-n2" | ||
| v-model="value.otherTemporality" | ||
| :rules=" | ||
| [ | ||
| () => value.temporality !== 'other' | ||
| || !! value.otherTemporality | ||
| || 'Please provide a response.', | ||
|
|
||
| () => value.temporality !== 'other' | ||
| || !! (value.otherTemporality && value.otherTemporality.length < 201) | ||
| || 'Text must be 200 characters or less.' | ||
| ]" | ||
| ></v-text-field> | ||
| </template> | ||
| </v-radio> | ||
| <v-radio value="decide_later"> | ||
| <template v-slot:label> | ||
| I will decide later | ||
| </template> | ||
| </v-radio> | ||
| </v-radio-group> | ||
| <h3 class="mt-6">Terms of Use</h3> | ||
| <div class="body-2"> | ||
| Previously accepted | ||
| <v-tooltip top> | ||
| <template v-slot:activator="{ on }"> | ||
| <a | ||
| target="_blank" | ||
| href="/terms-of-use" | ||
| @click.stop | ||
| v-on="on" | ||
| > | ||
| Terms of Use</a> | ||
| </template> | ||
| Opens in new window | ||
| </v-tooltip> still apply. | ||
| </div> | ||
| </v-form> | ||
| </v-card-text> | ||
| <v-card-actions> | ||
| <v-btn | ||
| type="button" | ||
| :disabled="inFlight" | ||
| @click="previousStep" | ||
| > | ||
| < Previous | ||
| </v-btn> | ||
|
|
||
| <v-btn | ||
| type="button" | ||
| color="primary" | ||
| :disabled="inFlight" | ||
| @click="submitWholeForm" | ||
| > | ||
| Create Wiki | ||
| </v-btn> | ||
| </v-card-actions> | ||
| </v-card> | ||
| </template> | ||
|
|
||
| <script> | ||
| export default { | ||
| name: 'StepFourCard', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let us also change the name to match the filename here |
||
| props: { | ||
| title: String, | ||
| inFlight: Boolean, | ||
| value: Object, | ||
| error: Array, | ||
| dismissable: Boolean | ||
| }, | ||
| methods: { | ||
| previousStep () { | ||
| if (this.value.temporality !== 'other') { | ||
| this.value.otherTemporality = undefined | ||
| } | ||
|
|
||
| this.$emit('previous-step') | ||
| }, | ||
| submitWholeForm () { | ||
| if (this.value.temporality !== 'other') { | ||
| this.value.otherTemporality = undefined | ||
| } | ||
|
|
||
| this.$refs.inputForm.validate() | ||
| if (this.$refs.inputForm.validate() === true) { | ||
| this.$emit('submit') | ||
| } | ||
| } | ||
| } | ||
|
|
||
| } | ||
| </script> | ||
|
|
||
| <style lang="css" scoped> | ||
| .v-card__actions { | ||
| flex-wrap: wrap; | ||
| justify-content: flex-end; | ||
| gap: 8px; | ||
| } | ||
| </style> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,7 +87,7 @@ | |
| :disabled="inFlight" | ||
| @click="submitWholeForm" | ||
| > | ||
| {{ submitButtonText }} | ||
| Create Wiki | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This now needs to have a different value hardcoded because this component is now designed to be used in the ProfileEdit context. It should have "Set intended use" from https://github.com/wbstack/ui/pull/1105/changes#diff-65f4e79e86b49a3110f6196179d7d13de0b9d84e8cc5b8f42a42de0dbcb98273L24 |
||
| </v-btn> | ||
| </v-card-actions> | ||
| </v-card> | ||
|
|
@@ -101,8 +101,7 @@ export default { | |
| inFlight: Boolean, | ||
| value: Object, | ||
| error: Array, | ||
| dismissable: Boolean, | ||
| submitButtonText: String | ||
| dismissable: Boolean | ||
| }, | ||
| methods: { | ||
| previousStep () { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us also change the exported name to match the filename here