diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /app/assets/javascripts/terraform | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'app/assets/javascripts/terraform')
3 files changed, 12 insertions, 16 deletions
diff --git a/app/assets/javascripts/terraform/components/empty_state.vue b/app/assets/javascripts/terraform/components/empty_state.vue index fd9177bef3f..6dae55bac50 100644 --- a/app/assets/javascripts/terraform/components/empty_state.vue +++ b/app/assets/javascripts/terraform/components/empty_state.vue @@ -1,11 +1,16 @@ <script> -import { GlEmptyState, GlIcon, GlLink } from '@gitlab/ui'; +import { GlEmptyState, GlLink } from '@gitlab/ui'; +import { s__ } from '~/locale'; import { helpPagePath } from '~/helpers/help_page_helper'; export default { + i18n: { + title: s__("Terraform|Your project doesn't have any Terraform state files"), + description: s__('Terraform|How to use GitLab-managed Terraform state?'), + }, + docsUrl: helpPagePath('user/infrastructure/iac/terraform_state'), components: { GlEmptyState, - GlIcon, GlLink, }, props: { @@ -14,23 +19,13 @@ export default { required: true, }, }, - computed: { - docsUrl() { - return helpPagePath('user/infrastructure/iac/terraform_state'); - }, - }, }; </script> <template> - <gl-empty-state :svg-path="image" :title="s__('Terraform|Get started with Terraform')"> + <gl-empty-state :svg-path="image" :title="$options.i18n.title"> <template #description> - <p> - <gl-link :href="docsUrl" target="_blank" - >{{ s__('Terraform|How to use GitLab-managed Terraform State?') }} - <gl-icon name="external-link" - /></gl-link> - </p> + <gl-link :href="$options.docsUrl">{{ $options.i18n.description }}</gl-link> </template> </gl-empty-state> </template> diff --git a/app/assets/javascripts/terraform/components/states_table_actions.vue b/app/assets/javascripts/terraform/components/states_table_actions.vue index 817c421823c..1970d6d7949 100644 --- a/app/assets/javascripts/terraform/components/states_table_actions.vue +++ b/app/assets/javascripts/terraform/components/states_table_actions.vue @@ -11,6 +11,7 @@ import { GlModalDirective, } from '@gitlab/ui'; import { s__, sprintf } from '~/locale'; +import getStatesQuery from '../graphql/queries/get_states.query.graphql'; import addDataToState from '../graphql/mutations/add_data_to_state.mutation.graphql'; import lockState from '../graphql/mutations/lock_state.mutation.graphql'; import removeState from '../graphql/mutations/remove_state.mutation.graphql'; @@ -148,7 +149,7 @@ export default { variables: { stateID: this.state.id, }, - refetchQueries: () => ['getStates'], + refetchQueries: () => [{ query: getStatesQuery }], awaitRefetchQueries: true, notifyOnNetworkStatusChange: true, }) diff --git a/app/assets/javascripts/terraform/graphql/queries/get_states.query.graphql b/app/assets/javascripts/terraform/graphql/queries/get_states.query.graphql index 4d26ea88ddf..2ae7b7d905e 100644 --- a/app/assets/javascripts/terraform/graphql/queries/get_states.query.graphql +++ b/app/assets/javascripts/terraform/graphql/queries/get_states.query.graphql @@ -1,5 +1,5 @@ #import "../fragments/state.fragment.graphql" -#import "~/graphql_shared/fragments/pageInfo.fragment.graphql" +#import "~/graphql_shared/fragments/page_info.fragment.graphql" query getStates($projectPath: ID!, $first: Int, $last: Int, $before: String, $after: String) { project(fullPath: $projectPath) { |