setTrembitaClientForm()

in static/js/view-registry.js [264:317]


        setTrembitaClientForm(e) {
            this.trembitaClient.registryNameExists = false;
            this.trembitaClient.startValidation = true;
            this.trembitaClient.urlValidationFailed = false;

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

            for (let i in this.trembitaClient.data) {
                if (typeof(this.trembitaClient.data[i]) == "string" && this.trembitaClient.data[i] === "") {
                    e.preventDefault();
                    return;
                }

            }

            for (let i in this.trembitaClient.data.client) {
                if (typeof(this.trembitaClient.data.client[i]) == "string" &&
                    this.trembitaClient.data.client[i] === "") {
                    e.preventDefault();
                    return;
                }
            }

            for (let i in this.trembitaClient.data.service) {
                if (typeof(this.trembitaClient.data.service[i]) == "string" &&
                    this.trembitaClient.data.service[i] === "" && i !== "serviceCode" && i !== "serviceVersion") {
                    e.preventDefault();
                    return;
                }
            }

            if (this.trembitaClient.data.auth.type === 'AUTH_TOKEN' &&
                this.trembitaClient.data.auth['secret'] === '') {
                e.preventDefault();
            }

            if(this.trembitaClient.registryCreation) {
                e.preventDefault();
                let $this = this;

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