3838
3939 <b-popover
4040 v-if =" stacUrl" id =" popover-link" target =" popover-link-btn" triggers =" focus"
41- placement =" bottom" container =" stac-browser" :title =" $t('source.title')"
42- @show =" validate"
41+ placement =" bottom" container =" stac-browser" :title =" $t('source.title')"
4342 >
4443 <template v-if =" stac " >
4544 <b-row v-if =" stacId" class =" stac-id" >
5352 <b-col cols =" 4" >{{ $t('source.stacVersion') }}</b-col >
5453 <b-col >{{ stacVersion }}</b-col >
5554 </b-row >
56- <b-row v-if = " canValidate " class =" validation " >
55+ <b-row class =" stac-valid " >
5756 <b-col cols =" 4" >{{ $t('source.valid') }}</b-col >
5857 <b-col >
59- <b-spinner v-if =" valid === null" :label =" $t('source.validating')" small />
60- <template v-else-if =" valid === true " >✔️</template >
61- <template v-else-if =" valid === false " >❌</template >
62- <template v-else >{{ $t('source.validationNA') }}</template >
58+ <Validation :data =" stac" />
6359 </b-col >
6460 </b-row >
6561 <hr >
@@ -84,7 +80,6 @@ import { mapActions, mapGetters, mapState } from 'vuex';
8480
8581import Url from ' ./Url.vue' ;
8682
87- import URI from ' urijs' ;
8883import Utils from ' ../utils' ;
8984import { getBest , prepareSupported } from ' ../locale-id' ;
9085import CopyButton from ' ./CopyButton.vue' ;
@@ -109,6 +104,7 @@ export default {
109104 RootStats : () => import (' ./RootStats.vue' ),
110105 Url,
111106 CopyButton,
107+ Validation : () => import (' ./Validation.vue' )
112108 },
113109 props: {
114110 title: {
@@ -125,7 +121,7 @@ export default {
125121 }
126122 },
127123 computed: {
128- ... mapState ([' conformsTo' , ' dataLanguages' , ' locale' , ' privateQueryParameters ' , ' supportedLocales' , ' stacLint ' , ' stacProxyUrl ' , ' uiLanguage' , ' valid' ]),
124+ ... mapState ([' conformsTo' , ' dataLanguages' , ' locale' , ' supportedLocales' , ' uiLanguage' , ' valid' ]),
129125 ... mapGetters ([' supportsExtension' , ' root' ]),
130126 stacVersion () {
131127 return this .stac ? .stac_version ;
@@ -154,26 +150,6 @@ export default {
154150 return ' -' ;
155151 }
156152 },
157- canValidate () {
158- if (! this .stacLint || typeof this .stacUrl !== ' string' ) {
159- return false ;
160- }
161- else if (Utils .size (this .privateQueryParameters ) > 0 ) {
162- // Don't expose private query parameters to externals
163- return false ;
164- }
165- else if (Array .isArray (this .stacProxyUrl )) {
166- // Don't validate if a proxy has been set
167- return false ;
168- }
169- let uri = URI (this .stacUrl );
170- let host = uri .hostname ().toLowerCase ();
171- if (host === ' localhost' || host .startsWith (' 127.' ) || host === ' ::1' ) {
172- // Can't validate localhost
173- return false ;
174- }
175- return true ;
176- },
177153 message () {
178154 return this .$t (' source.share.message' , {title: this .title , url: this .browserUrl ()});
179155 },
@@ -235,12 +211,6 @@ export default {
235211 },
236212 methods: {
237213 ... mapActions ([' switchLocale' ]),
238- async validate () {
239- if (! this .canValidate ) {
240- return ;
241- }
242- await this .$store .dispatch (' validate' , this .stacUrl );
243- },
244214 browserUrl () {
245215 return window .location .toString ();
246216 }
@@ -260,7 +230,8 @@ export default {
260230 }
261231}
262232
263- #popover- link .stac - id .copy - button {
233+ #popover- link .stac - id .btn - sm,
234+ #popover- link .stac - valid .btn - sm {
264235 padding- top: 0 .1rem ;
265236 padding- bottom: 0 .1rem ;
266237 font- size: 0 .7rem ;
0 commit comments