Skip to content

Commit f1ea7fa

Browse files
committed
Add SA step disabling when ND is selected
Signed-off-by: Olga Bulat <obulat@gmail.com>
1 parent 0ee6562 commit f1ea7fa

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

src/components/Stepper.vue

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
</header>
77
<div class="card-content">
88
<p :class="'stepper-instructions'">{{ $t('select-license-instructions') }}</p>
9-
<b-steps size="is-small">
9+
<b-steps size="is-small"
10+
v-on:input="disableSAifND"
11+
v-model="currentStep"
12+
ref="steps"
13+
>
1014
<b-step-item
1115
v-for="item in this.steps"
1216
:icon-pack="item['icon-pack']"
@@ -55,9 +59,10 @@ export default {
5559
},
5660
data() {
5761
return {
62+
currentStep: 0,
5863
steps: [
5964
{
60-
label: this.getAttributionName(),
65+
label: this.attributionName,
6166
shortName: 'BY',
6267
'icon-pack': 'fab',
6368
itemType: 'licenseAttribute'
@@ -98,18 +103,25 @@ export default {
98103
computed: {
99104
licenseAttributes() {
100105
return this.$shortToAttributes(this.$props.value.shortName)
101-
}
102-
},
103-
methods: {
104-
getAttributionIcon() {
106+
},
107+
attributionIcon() {
105108
return this.$props.value.shortName.includes('BY') ? 'creative-commons-by' : 'creative-commons-zero'
106109
},
107-
getAttributionName() {
110+
attributionName() {
108111
return this.$props.value.shortName.includes('BY') ? 'stepper-label.Attribution' : 'stepper-label.PublicDomain'
112+
}
113+
},
114+
methods: {
115+
disableSAifND(payload) {
116+
const attributionDetailsStep = 5
117+
const ndStep = 3
118+
if (payload === ndStep && this.$props.value.shortName.includes('ND')) {
119+
this.currentStep = attributionDetailsStep
120+
}
109121
},
110122
getIcon(attrName) {
111123
if (attrName === 'BY') {
112-
return this.getAttributionIcon()
124+
return this.attributionIcon
113125
} else if (attrName === 'wv') {
114126
return 'exclamation-circle'
115127
} else if (attrName === 'ad') {
@@ -155,6 +167,9 @@ export default {
155167
if (this.$props.value.shortName.includes('CC0')) {
156168
return 'is-step-selected'
157169
}
170+
if (this.$props.value.shortName.includes('ND') && attrName === 'SA') {
171+
return 'is-step-not_selected is-step-with-tooltip'
172+
}
158173
if (!this.$props.value.shortName.includes(attrName)) {
159174
return 'is-step-not_selected'
160175
} else { return 'is-step-selected' }

0 commit comments

Comments
 (0)