From a7fc9155ce718cdfb6f2e1aee1ea5b9f03e1d2e3 Mon Sep 17 00:00:00 2001 From: Marco Cano Date: Fri, 30 Aug 2024 09:10:02 -0700 Subject: [PATCH] fix: :hammer: viewer parent classes, dashboard badge --- nuxt-app/assets/css/styles.css | 1 + nuxt-app/pages/ns/[namespace]/[[query]].vue | 79 ++++++++++----------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/nuxt-app/assets/css/styles.css b/nuxt-app/assets/css/styles.css index ded60ab8..ba79c721 100644 --- a/nuxt-app/assets/css/styles.css +++ b/nuxt-app/assets/css/styles.css @@ -412,6 +412,7 @@ body { .source-badge div:first-child { background: #ccc; + color: #000; background: -moz-linear-gradient( top, rgba(204, 204, 204, 1) 1%, diff --git a/nuxt-app/pages/ns/[namespace]/[[query]].vue b/nuxt-app/pages/ns/[namespace]/[[query]].vue index 5f5eb57a..3a4a5d0d 100644 --- a/nuxt-app/pages/ns/[namespace]/[[query]].vue +++ b/nuxt-app/pages/ns/[namespace]/[[query]].vue @@ -942,48 +942,47 @@ export default { }, findClass(query) { let self = this; - if (self.namespace === "schema") { - console.log("SCHEMA.org case"); - axios( - self.apiUrl + - "/api/registry/" + - self.namespace + - "/" + - self.query + - "?v" - ) - .then((res) => { - var payload = {}; - payload["schema"] = res.data; - self.$store.commit("saveSchemaForViewer", payload); - this.userSchema = res.data; - for (var i = 0; i < self.userSchema["hits"].length; i++) { - if (self.userSchema["hits"][i]["name"] === query) { - // console.log("MATCH",self.userSchema['hits'][i]) - let q = self.userSchema["hits"][i]; - self.getParentsOf(q); - var payload = {}; - payload["queryContent"] = q; - self.$store.commit("checkIFValidationView", payload); - } + axios( + self.apiUrl + + "/api/registry/" + + self.namespace + + "/" + + self.query + + "?v" + ) + .then((res) => { + var payload = {}; + payload["schema"] = res.data; + self.$store.commit("saveSchemaForViewer", payload); + this.userSchema = res.data; + for (var i = 0; i < self.userSchema["hits"].length; i++) { + if (self.userSchema["hits"][i]["name"] === query) { + // console.log("MATCH",self.userSchema['hits'][i]) + let q = self.userSchema["hits"][i]; + self.getParentsOf(q); + var payload = {}; + payload["queryContent"] = q; + self.$store.commit("checkIFValidationView", payload); } - return false; - }) - .catch((err) => { - throw err; - }); - } else { - for (var i = 0; i < self.userSchema["hits"].length; i++) { - if ( - self.userSchema["hits"][i]["name"] === query || - self.userSchema["hits"][i]["label"] == query - ) { - let found = self.userSchema["hits"][i]; - return found; } - } - return false; - } + return false; + }) + .catch((err) => { + throw err; + }); + // else { + // console.log('FINDING PARENT', query) + // for (var i = 0; i < self.userSchema["hits"].length; i++) { + // if ( + // self.userSchema["hits"][i]["name"] === query || + // self.userSchema["hits"][i]["label"] == query + // ) { + // let found = self.userSchema["hits"][i]; + // return found; + // } + // } + // return false; + // } }, findProp(query) { let self = this;