setExternalSystemForm()

in static/js/view-registry.js [208:257]


        setExternalSystemForm(e) {
            this.externalSystem.registryNameExists = false;
            this.externalSystem.startValidation = true;
            this.externalSystem.urlValidationFailed = false;

            if (this.externalSystem.data.url !== '' && !this.isURL(this.externalSystem.data.url)) {
                e.preventDefault();
                this.externalSystem.urlValidationFailed = true;
                return;
            }

            if (this.externalSystem.data.url === "") {
                e.preventDefault();
                return;
            }

            if (this.externalSystem.data.auth.type !== 'NO_AUTH' &&
                (!this.externalSystem.data.auth.hasOwnProperty('secret') || this.externalSystem.data.auth['secret'] === '')) {
                e.preventDefault();
                return;
            }

            if (this.externalSystem.data.auth.type === 'BASIC' && this.externalSystem.data.auth['username'] === '') {
                e.preventDefault();
                return;
            }

            if (this.externalSystem.data.auth.type === 'AUTH_TOKEN+BEARER' &&
                (!this.externalSystem.data.auth.hasOwnProperty('auth-url') ||
                    this.externalSystem.data.auth['auth-url'] === '' ||
                    !this.externalSystem.data.auth.hasOwnProperty('access-token-json-path') ||
                    this.externalSystem.data.auth['access-token-json-path'] === '')) {
                e.preventDefault();
                return;
            }

            if (this.externalSystem.registryNameEditable) {
                e.preventDefault();
                let $this = this;

                axios.get(`/admin/registry/external-system-check/${this.registryName}`,
                    {params: {"external-system": this.externalSystem.registryName}})
                    .then(function (response) {
                        $this.externalSystem.registryNameExists = true;
                    })
                    .catch(function (error) {
                        $("#external-system-form").submit();
                    });
            }
        },