|
6 | 6 | </header> |
7 | 7 | <div class="card-content"> |
8 | 8 | <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 | + > |
10 | 14 | <b-step-item |
11 | 15 | v-for="item in this.steps" |
12 | 16 | :icon-pack="item['icon-pack']" |
@@ -55,9 +59,10 @@ export default { |
55 | 59 | }, |
56 | 60 | data() { |
57 | 61 | return { |
| 62 | + currentStep: 0, |
58 | 63 | steps: [ |
59 | 64 | { |
60 | | - label: this.getAttributionName(), |
| 65 | + label: this.attributionName, |
61 | 66 | shortName: 'BY', |
62 | 67 | 'icon-pack': 'fab', |
63 | 68 | itemType: 'licenseAttribute' |
@@ -98,18 +103,25 @@ export default { |
98 | 103 | computed: { |
99 | 104 | licenseAttributes() { |
100 | 105 | return this.$shortToAttributes(this.$props.value.shortName) |
101 | | - } |
102 | | - }, |
103 | | - methods: { |
104 | | - getAttributionIcon() { |
| 106 | + }, |
| 107 | + attributionIcon() { |
105 | 108 | return this.$props.value.shortName.includes('BY') ? 'creative-commons-by' : 'creative-commons-zero' |
106 | 109 | }, |
107 | | - getAttributionName() { |
| 110 | + attributionName() { |
108 | 111 | 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 | + } |
109 | 121 | }, |
110 | 122 | getIcon(attrName) { |
111 | 123 | if (attrName === 'BY') { |
112 | | - return this.getAttributionIcon() |
| 124 | + return this.attributionIcon |
113 | 125 | } else if (attrName === 'wv') { |
114 | 126 | return 'exclamation-circle' |
115 | 127 | } else if (attrName === 'ad') { |
@@ -155,6 +167,9 @@ export default { |
155 | 167 | if (this.$props.value.shortName.includes('CC0')) { |
156 | 168 | return 'is-step-selected' |
157 | 169 | } |
| 170 | + if (this.$props.value.shortName.includes('ND') && attrName === 'SA') { |
| 171 | + return 'is-step-not_selected is-step-with-tooltip' |
| 172 | + } |
158 | 173 | if (!this.$props.value.shortName.includes(attrName)) { |
159 | 174 | return 'is-step-not_selected' |
160 | 175 | } else { return 'is-step-selected' } |
|
0 commit comments