Skip to content

Commit

Permalink
Merge pull request #248 from biothings/guide-update
Browse files Browse the repository at this point in the history
fix: 🔨 local dev settings, broken image imports, identifier
  • Loading branch information
marcodarko authored Jan 22, 2024
2 parents 03f14ca + 8fab4bc commit 0835d0c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
31 changes: 18 additions & 13 deletions nuxt-app/components/SchemaViewerForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ import woohoo from "@/assets/img/woohoo-01.svg";
import oh_no from "@/assets/img/oh_no-01.svg";
import dde_logo from "@/assets/img/dde-logo-o.svg";
import not_right from "@/assets/img/not_right-01.svg";
import broken from "@/assets/img/broken_root-01.svg"
import check_validation from "@/assets/img/check_validation-01.svg"
import check_range from "@/assets/img/check_range-01.svg"
import check_definition from "@/assets/img/check_definition-01.svg"
import check_label from "@/assets/img/label_issue-01.svg"
export default {
data: function () {
return {
Expand Down Expand Up @@ -158,45 +163,45 @@ export default {
let msg_html = "<div>";
switch (type) {
case "no_path_to_root":
msg_html += `<img src="@/assets/img/broken_root-01.svg" height="50px" alt="broken path to root"/>
msg_html += `<img src="` + broken +`" height="50px" alt="No path to root class"/>
<small class="text-primary d-block">Tip: A broken path can generate more errors,
we recommend fixing this first and see if this fixes other issues.</small>`;
break;
case "invalid_validation_schema":
msg_html += `<img src="@/assets/img/check_validation-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_validation + `" height="50px" alt="check validation"/>`;
break;
case "undefined_rangeincludes":
msg_html += `<img src="@/assets/img/check_range-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_range +`" height="50px" alt="check rangeIncludes"/>`;
break;
case "non_class_or_property_@type":
msg_html += `<img src="@/assets/img/check_range-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_range + `" height="50px" alt="check rangeIncludes"/>`;
break;
case "invalid_property":
msg_html += `<img src="@/assets/img/check_definition-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_definition + `" height="50px" alt="check definition"/>`;
break;
case "invalid_class":
msg_html += `<img src="@/assets/img/check_definition-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_definition + `" height="50px" alt="check definition"/>`;
break;
case "dup_label":
msg_html += `<img src="@/assets/img/label_issue-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_label + `" height="50px" alt="check labels"/>`;
break;
case "unmatched_label":
msg_html += `<img src="@/assets/img/label_issue-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_label + `" height="50px" alt="check labels"/>`;
break;
case "missing_rangeincludes":
msg_html += `<img src="@/assets/img/check_range-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_range + `" height="50px" alt="check ranges"/>`;
break;
case "undefined_domainincludes_class":
msg_html += `<img src="@/assets/img/check_definition-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_definition + `" height="50px" alt="check definition"/>`;
break;
case "invalid_property_label":
msg_html += `<img src="@/assets/img/label_issue-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_label + `" height="50px" alt="check label"/>`;
break;
case "invalid_class_label":
msg_html += `<img src="@/assets/img/label_issue-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + check_label + `" height="50px" alt="check labels"/>`;
break;
default:
msg_html += `<img src="@/assets/img/not_right-01.svg" height="50px" alt="broken path to root"/>`;
msg_html += `<img src="` + not_right + `" height="50px" alt="oh no"/>`;
break;
}
msg_html +=
Expand Down
2 changes: 1 addition & 1 deletion nuxt-app/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default defineNuxtConfig({
// to test CRUD operations you must use a proxy server, a localhost will only work
//with GET calls, for prod a proxy server/handler must be used.
apiUrl:
process.env.NODE_ENV == "development" ? "http://localhost:8000" : "",
process.env.NODE_ENV == "development" ? "http://localhost" : "",
},
},
// https://github.com/nuxt/framework/discussions/3823
Expand Down
9 changes: 9 additions & 0 deletions nuxt-app/store/modules/guide.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ export const guide = {
if (state.schema.validation.properties.hasOwnProperty(selection.name)) {
state.schema.validation.properties[selection.name]["value"] =
selection.value;
//prefill identifier with URL field if available
if (
selection.name == 'url' &&
'identifier' in state.schema.validation.properties &&
!state.schema.validation.properties['identifier']["value"] &&
!state.schema.validation?.required?.includes('identifier')
){
state.schema.validation.properties['identifier']["value"] = selection.value;
}
//check for duplicate keys or plural names
if (
selection.name + "s" in state.schema.validation.properties &&
Expand Down

0 comments on commit 0835d0c

Please sign in to comment.