Commit 1d6adc27 authored by Filipa Lacerda's avatar Filipa Lacerda Committed by Dmitriy Zaporozhets

Handle disabled button state in backend

parent 2ca00a36
......@@ -52,11 +52,6 @@
type: String,
required: false,
},
disableInstallButton: {
type: Boolean,
required: false,
default: false,
},
installApplicationRequestParams: {
type: Object,
required: false,
......@@ -77,7 +72,7 @@
// Avoid the potential for the real-time data to say APPLICATION_INSTALLABLE but
// we already made a request to install and are just waiting for the real-time
// to sync up.
return this.disableInstallButton || (this.status !== APPLICATION_INSTALLABLE
return (this.status !== APPLICATION_INSTALLABLE
&& this.status !== APPLICATION_ERROR) ||
this.requestStatus === REQUEST_LOADING ||
this.requestStatus === REQUEST_SUCCESS;
......
......@@ -292,7 +292,6 @@ export default {
:status-reason="applications.jupyter.statusReason"
:request-status="applications.jupyter.requestStatus"
:request-reason="applications.jupyter.requestReason"
:disable-install-button="!ingressInstalled"
:install-application-request-params="{ hostname: applications.jupyter.hostname }"
>
<div slot="description">
......@@ -304,7 +303,7 @@ export default {
or a scientific research group.`) }}
</p>
<template v-if="ingressInstalled">
<template v-if="ingressExternalIp">
<div class="form-group">
<label for="jupyter-hostname">
{{ s__('ClusterIntegration|Jupyter Hostname') }}
......
......@@ -211,16 +211,6 @@ describe('Application Row', () => {
expect(eventHub.$emit).not.toHaveBeenCalled();
});
it('is disabled when disableInstallButton prop is provided', () => {
vm = mountComponent(ApplicationRow, {
...DEFAULT_APPLICATION_STATE,
status: APPLICATION_INSTALLING,
disableInstallButton: true,
});
expect(vm.installButtonDisabled).toEqual(true);
});
});
describe('Error block', () => {
......
......@@ -114,7 +114,7 @@ describe('Applications', () => {
});
describe('Jupyter application', () => {
describe('with ingress installed & jupyter not installed', () => {
describe('with ingress installed with ip & jupyter installable', () => {
it('renders hostname active input', () => {
vm = mountComponent(Applications, {
applications: {
......@@ -122,12 +122,13 @@ describe('Applications', () => {
ingress: { title: 'Ingress', status: 'installed', externalIp: '1.1.1.1' },
runner: { title: 'GitLab Runner' },
prometheus: { title: 'Prometheus' },
jupyter: { title: 'JupyterHub', hostname: '' },
jupyter: { title: 'JupyterHub', hostname: '', status: 'installable' },
},
});
expect(vm.$el.querySelector('.js-hostname').getAttribute('readonly')).toEqual(null);
});
describe('with ingress & jupyter installed', () => {
it('renders readonly input', () => {
vm = mountComponent(Applications, {
......@@ -153,7 +154,7 @@ describe('Applications', () => {
ingress: { title: 'Ingress' },
runner: { title: 'GitLab Runner' },
prometheus: { title: 'Prometheus' },
jupyter: { title: 'JupyterHub' },
jupyter: { title: 'JupyterHub', status: 'not_installable' },
},
});
});
......
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