Commit 5a1dee6a authored by pburdette's avatar pburdette

Add loading state

Add loading state if
fetching config variables.
parent 1bb1b224
...@@ -14,6 +14,7 @@ import { ...@@ -14,6 +14,7 @@ import {
GlDropdownItem, GlDropdownItem,
GlSearchBoxByType, GlSearchBoxByType,
GlSprintf, GlSprintf,
GlLoadingIcon,
} from '@gitlab/ui'; } from '@gitlab/ui';
import { s__, __, n__ } from '~/locale'; import { s__, __, n__ } from '~/locale';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -45,6 +46,7 @@ export default { ...@@ -45,6 +46,7 @@ export default {
GlDropdownItem, GlDropdownItem,
GlSearchBoxByType, GlSearchBoxByType,
GlSprintf, GlSprintf,
GlLoadingIcon,
}, },
props: { props: {
pipelinesPath: { pipelinesPath: {
...@@ -96,6 +98,7 @@ export default { ...@@ -96,6 +98,7 @@ export default {
warnings: [], warnings: [],
totalWarnings: 0, totalWarnings: 0,
isWarningDismissed: false, isWarningDismissed: false,
isLoading: false,
}; };
}, },
computed: { computed: {
...@@ -209,6 +212,8 @@ export default { ...@@ -209,6 +212,8 @@ export default {
fetchConfigVariables(refValue) { fetchConfigVariables(refValue) {
if (gon?.features?.newPipelineFormPrefilledVars) { if (gon?.features?.newPipelineFormPrefilledVars) {
this.isLoading = true;
return axios return axios
.get(this.configVariablesPath, { .get(this.configVariablesPath, {
params: { params: {
...@@ -226,6 +231,8 @@ export default { ...@@ -226,6 +231,8 @@ export default {
} }
}); });
this.isLoading = false;
return { params, descriptions }; return { params, descriptions };
}); });
} }
...@@ -324,7 +331,9 @@ export default { ...@@ -324,7 +331,9 @@ export default {
> >
</gl-form-group> </gl-form-group>
<gl-form-group :label="s__('Pipeline|Variables')"> <gl-loading-icon v-if="isLoading" class="gl-mb-5" size="lg" />
<gl-form-group v-else :label="s__('Pipeline|Variables')">
<div <div
v-for="(variable, index) in variables" v-for="(variable, index) in variables"
:key="variable.uniqueId" :key="variable.uniqueId"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment