diff options
Diffstat (limited to 'app/assets/javascripts/clusters_list/components/install_agent_modal.vue')
-rw-r--r-- | app/assets/javascripts/clusters_list/components/install_agent_modal.vue | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/app/assets/javascripts/clusters_list/components/install_agent_modal.vue b/app/assets/javascripts/clusters_list/components/install_agent_modal.vue index 5eef76252bd..8fc0a66cd7e 100644 --- a/app/assets/javascripts/clusters_list/components/install_agent_modal.vue +++ b/app/assets/javascripts/clusters_list/components/install_agent_modal.vue @@ -111,6 +111,9 @@ export default { canCancel() { return !this.registered && !this.registering && this.isAgentRegistrationModal; }, + canRegister() { + return !this.registered && this.isAgentRegistrationModal; + }, agentRegistrationCommand() { return generateAgentRegistrationCommand(this.agentToken, this.kasAddress); }, @@ -142,6 +145,9 @@ export default { isAgentRegistrationModal() { return this.modalType === MODAL_TYPE_REGISTER; }, + isKasEnabledInEmptyStateModal() { + return this.isEmptyStateModal && !this.kasDisabled; + }, }, methods: { setAgentName(name) { @@ -350,18 +356,18 @@ export default { <img :alt="i18n.altText" :src="emptyStateImage" height="100" /> </div> - <p> - <gl-sprintf :message="i18n.modalBody"> + <p v-if="kasDisabled"> + <gl-sprintf :message="i18n.enableKasText"> <template #link="{ content }"> - <gl-link :href="$options.installAgentPath"> {{ content }}</gl-link> + <gl-link :href="$options.enableKasPath">{{ content }}</gl-link> </template> </gl-sprintf> </p> - <p v-if="kasDisabled"> - <gl-sprintf :message="i18n.enableKasText"> + <p v-else> + <gl-sprintf :message="i18n.modalBody"> <template #link="{ content }"> - <gl-link :href="$options.enableKasPath"> {{ content }}</gl-link> + <gl-link :href="$options.installAgentPath">{{ content }}</gl-link> </template> </gl-sprintf> </p> @@ -380,7 +386,16 @@ export default { </gl-button> <gl-button - v-else-if="isAgentRegistrationModal" + v-if="canCancel" + :data-track-action="$options.EVENT_ACTIONS_CLICK" + :data-track-label="$options.EVENT_LABEL_MODAL" + data-track-property="cancel" + @click="closeModal" + >{{ i18n.cancel }} + </gl-button> + + <gl-button + v-if="canRegister" :disabled="!nextButtonDisabled" variant="confirm" category="primary" @@ -392,32 +407,21 @@ export default { </gl-button> <gl-button - v-if="canCancel" + v-if="isEmptyStateModal" :data-track-action="$options.EVENT_ACTIONS_CLICK" :data-track-label="$options.EVENT_LABEL_MODAL" - data-track-property="cancel" + data-track-property="done" @click="closeModal" - >{{ i18n.cancel }} + >{{ i18n.done }} </gl-button> <gl-button - v-if="isEmptyStateModal" + v-if="isKasEnabledInEmptyStateModal" :href="repositoryPath" variant="confirm" - category="secondary" - data-testid="agent-secondary-button" - >{{ i18n.secondaryButton }} - </gl-button> - - <gl-button - v-if="isEmptyStateModal" - variant="confirm" category="primary" - :data-track-action="$options.EVENT_ACTIONS_CLICK" - :data-track-label="$options.EVENT_LABEL_MODAL" - data-track-property="done" - @click="closeModal" - >{{ i18n.done }} + data-testid="agent-primary-button" + >{{ i18n.primaryButton }} </gl-button> </template> </gl-modal> |