Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<v-card-text>
<h3>What best describes how you intend to use this Wikibase?</h3>
<v-form ref="inputForm" v-on:submit.prevent>
<v-radio-group v-model="value.purpose" :rules="[() => !!value.purpose || 'Please select an option.']">

Check warning on line 14 in src/components/Cards/AudienceAndPurposeWizardStep.vue

View workflow job for this annotation

GitHub Actions / build (22)

Unexpected mutation of "value" prop
<v-radio value="data_hub" ref="test">
<template v-slot:label>
<div>To <b>publish potentially useful data</b></div>
Expand Down Expand Up @@ -40,7 +40,7 @@
counter="200"
dense class="pl-1
mt-n1 mb-n2"
v-model="value.otherPurpose"

Check warning on line 43 in src/components/Cards/AudienceAndPurposeWizardStep.vue

View workflow job for this annotation

GitHub Actions / build (22)

Unexpected mutation of "value" prop
:rules="
[
() => value.purpose !== 'other'
Expand All @@ -64,7 +64,7 @@
<div v-if="value.purpose==='data_hub'" class="pt-3">
<h3>Who is the intended audience for this data?</h3>

<v-radio-group v-model="value.audience" :rules="

Check warning on line 67 in src/components/Cards/AudienceAndPurposeWizardStep.vue

View workflow job for this annotation

GitHub Actions / build (22)

Unexpected mutation of "value" prop
[
value.purpose !== 'data_hub'
|| !! value.audience
Expand All @@ -82,7 +82,7 @@
</v-radio>
<v-radio value="other" class="mt-n3">
<template v-slot:label>
Other: <v-text-field counter="200" dense class="pl-1" v-model="value.otherAudience"

Check warning on line 85 in src/components/Cards/AudienceAndPurposeWizardStep.vue

View workflow job for this annotation

GitHub Actions / build (22)

Unexpected mutation of "value" prop
:rules="
[
() => value.purpose !== 'data_hub'
Expand Down Expand Up @@ -115,7 +115,7 @@

<script>
export default {
name: 'StepTwoCard',
name: 'AudienceAndPurposeWizardStep',
props: {
title: String,
inFlight: Boolean,
Expand All @@ -133,10 +133,10 @@
methods: {
nextStep () {
if (this.value.purpose !== 'data_hub') {
this.value.audience = undefined

Check warning on line 136 in src/components/Cards/AudienceAndPurposeWizardStep.vue

View workflow job for this annotation

GitHub Actions / build (22)

Unexpected mutation of "value" prop
}
if (this.value.purpose !== 'other') {
this.value.otherPurpose = undefined

Check warning on line 139 in src/components/Cards/AudienceAndPurposeWizardStep.vue

View workflow job for this annotation

GitHub Actions / build (22)

Unexpected mutation of "value" prop
}
if (this.value.audience !== 'other') {
this.value.otherAudience = undefined
Expand Down
24 changes: 10 additions & 14 deletions src/components/Cards/CreateWiki.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-form @submit="createWiki">
<step-one-card
<SiteDetailsCreateWikiWizardStep
v-show="step === 1"
:title="title"
:inFlight="inFlight"
Expand All @@ -12,7 +12,7 @@
@next-step="goToStep(2)"
/>

<step-two-card
<AudienceAndPurposeWizardStep
v-show="step === 2"
:title="title"
:inFlight="inFlight"
Expand All @@ -22,13 +22,12 @@
@next-step="goToStep(3)"
/>

<step-three-card
<TemporalityCreateWikiWizardStep
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per the task description, this is the name of step 4 and not step 3. I was also a little confused when looking at this. Perhaps, this is what we want and the task description needs to be corrected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does the task description say that?
I could only see:

Rename the "StepThree" card to TemporalityCreateWikiWizardStep

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the task description after this comment :) .

v-show="step === 3"
:title="title"
:inFlight="inFlight"
:error="error"
:dismissable="false"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line should also go because we have now removed the dismissable logic from this card

Suggested change
:dismissable="false"

submitButtonText="Create Wiki"
v-model="stepThree"
@previous-step="goToStep(2)"
@submit="createWiki"
Expand All @@ -38,20 +37,19 @@

<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 TemporalityCreateWikiWizardStep from './TemporalityCreateWikiWizardStep.vue'
export default {
name: 'CreateWiki',
components: {
StepOneCard,
StepTwoCard,
StepThreeCard
SiteDetailsCreateWikiWizardStep,
AudienceAndPurposeWizardStep,
TemporalityCreateWikiWizardStep
},
props: [
'title',
'buttonText'
'title'
],
computed: {
currentUser: function () {
Expand Down Expand Up @@ -90,8 +88,6 @@ export default {
}
},
created () {
// what's this for?
// this.buttonText = this.buttonTexts.next;
this.checkCurrentLogin()
},
updated () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

<script>
export default {
name: 'StepOneCard',
name: 'SiteDetailsCreateWikiWizardStep',
props: {
title: String,
inFlight: Boolean,
Expand Down
130 changes: 130 additions & 0 deletions src/components/Cards/TemporalityCreateWikiWizardStep.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<template>
<v-card class="elevation-12">
<v-toolbar dark color="primary">
<v-toolbar-title>{{ title }}</v-toolbar-title>
</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"
>
&lt; 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: 'TemporalityCreateWikiWizardStep',
props: {
title: String,
inFlight: Boolean,
value: Object,
error: Array
},
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>
2 changes: 1 addition & 1 deletion src/components/Pages/CreateWiki.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<v-container class="fill-height" fluid >
<v-row align="center" justify="center">
<v-col class="card-column">
<CreateWikiCard title="Create a wiki" buttonText="Next >"/>
<CreateWikiCard title="Create a wiki"/>
</v-col>
</v-row>
</v-container>
Expand Down
14 changes: 6 additions & 8 deletions src/components/Pages/ManageWiki/Cards/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
content-class="update-wiki-profile-dialog"
v-model="dialog.show"
>
<step-two-card
<AudienceAndPurposeWizardStep
v-show="dialog.step === 1"
:title="dialog.title"
:inFlight="inFlight"
Expand All @@ -14,14 +14,12 @@
@close-dialog="dialog.show = false"
@next-step="goToStep(2)"
/>
<step-three-card
<TemporalityProfileEditWizardStep
v-show="dialog.step === 2"
:title="dialog.title"
:inFlight="inFlight"
:error="dialog.error"
:dismissable="true"
:showTerms="false"
submitButtonText="Set intended use"
v-model="dialog.data.stepTwo"
@close-dialog="dialog.show = false"
@previous-step="goToStep(1)"
Expand Down Expand Up @@ -78,8 +76,8 @@

<script>
import Message from '../Features/Message.vue'
import StepTwoCard from '~/components/Cards/CreateWikiWizardStepTwo'
import StepThreeCard from '~/components/Cards/CreateWikiWizardStepThree'
import AudienceAndPurposeWizardStep from '../../../Cards/AudienceAndPurposeWizardStep.vue'
import TemporalityProfileEditWizardStep from './TemporalityProfileEditWizardStep.vue'
const providedResponses = {
purpose: {
Expand All @@ -104,8 +102,8 @@ export default {
name: 'Profile',
components: {
Message,
StepTwoCard,
StepThreeCard
AudienceAndPurposeWizardStep,
TemporalityProfileEditWizardStep
},
props: [
'wikiId'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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-btn icon @click="$emit('close-dialog')">
<v-icon>mdi-close</v-icon>
</v-btn>
</v-toolbar>
Expand Down Expand Up @@ -87,22 +87,20 @@
:disabled="inFlight"
@click="submitWholeForm"
>
{{ submitButtonText }}
Set intended use
</v-btn>
</v-card-actions>
</v-card>
</template>

<script>
export default {
name: 'StepThreeCard',
name: 'TemporalityProfileEditWizardStep',
props: {
title: String,
inFlight: Boolean,
value: Object,
error: Array,
dismissable: Boolean,
submitButtonText: String
error: Array
},
methods: {
previousStep () {
Expand Down
Loading