|
107 | 107 |
|
108 | 108 | <script lang="ts"> |
109 | 109 |
|
| 110 | +import { |
| 111 | + byError, |
| 112 | + instancePathStartsWithMatcher, |
| 113 | + screenAuthorQueries, |
| 114 | + screenIdentifiersQueries, |
| 115 | + screenKeywordsQueries, |
| 116 | + screenRelatedResourcesQueries, |
| 117 | + screenStartQueries, |
| 118 | + screenVersionSpecificQueries |
| 119 | +} from 'src/error-filtering' |
| 120 | +import { computed } from 'vue' |
110 | 121 | import { useApp } from 'src/store/app' |
111 | | -import { useStepperErrors } from 'src/store/stepper-errors' |
| 122 | +import { useValidation } from 'src/store/validation' |
112 | 123 |
|
113 | 124 | export default { |
114 | 125 | setup () { |
115 | 126 | const { showAdvanced, stepName, setStepName } = useApp() |
116 | | - const { |
117 | | - errorStateScreenAuthors, |
118 | | - errorStateScreenIdentifiers, |
119 | | - errorStateScreenKeywords, |
120 | | - errorStateScreenRelatedResources, |
121 | | - errorStateScreenStart, |
122 | | - errorStateScreenVersionSpecific |
123 | | - } = useStepperErrors() |
| 127 | + const { errors } = useValidation() |
124 | 128 | return { |
125 | | - errorStateScreenAuthors, |
126 | | - errorStateScreenIdentifiers, |
127 | | - errorStateScreenKeywords, |
128 | | - errorStateScreenRelatedResources, |
129 | | - errorStateScreenStart, |
130 | | - errorStateScreenVersionSpecific, |
| 129 | + errorStateScreenAuthors: computed(() => { |
| 130 | + return screenAuthorQueries |
| 131 | + .filter(byError(errors.value, instancePathStartsWithMatcher)) |
| 132 | + .length > 0 |
| 133 | + }), |
| 134 | + errorStateScreenIdentifiers: computed(() => { |
| 135 | + return screenIdentifiersQueries |
| 136 | + .filter(byError(errors.value, instancePathStartsWithMatcher)) |
| 137 | + .length > 0 |
| 138 | + }), |
| 139 | + errorStateScreenKeywords: computed(() => { |
| 140 | + return screenKeywordsQueries |
| 141 | + .filter(byError(errors.value, instancePathStartsWithMatcher)) |
| 142 | + .length > 0 |
| 143 | + }), |
| 144 | + errorStateScreenRelatedResources: computed(() => { |
| 145 | + return screenRelatedResourcesQueries |
| 146 | + .filter(byError(errors.value, instancePathStartsWithMatcher)) |
| 147 | + .length > 0 |
| 148 | + }), |
| 149 | + errorStateScreenStart: computed(() => { |
| 150 | + return screenStartQueries |
| 151 | + .filter(byError(errors.value)) // One of the possible errors is instancePath == '', so we use a traditional approach here |
| 152 | + .length > 0 |
| 153 | + }), |
| 154 | + errorStateScreenVersionSpecific: computed(() => { |
| 155 | + return screenVersionSpecificQueries |
| 156 | + .filter(byError(errors.value, instancePathStartsWithMatcher)) |
| 157 | + .length > 0 |
| 158 | + }), |
131 | 159 | setStepName, |
132 | 160 | showAdvanced, |
133 | 161 | stepName |
|
0 commit comments