From 3e8a6e322c2bb9691f9ab80471db75c86b33de14 Mon Sep 17 00:00:00 2001
From: Alvin Sebastian
- Select a predefined profile or load one from your computer. + Select a predefined mode or load one from your computer.
diff --git a/src/app/utils/profiles.js b/src/app/utils/profiles.js index 953c2cb..f1f3568 100644 --- a/src/app/utils/profiles.js +++ b/src/app/utils/profiles.js @@ -1,8 +1,8 @@ const profileUrls = [ - 'https://language-research-technology.github.io/ro-crate-editor-profiles/profiles/base-profile.json', - 'https://language-research-technology.github.io/ro-crate-editor-profiles/profiles/schema.json', - 'https://language-research-technology.github.io/ro-crate-editor-profiles/profiles/language-data-commons-collection-profile.json', - 'https://language-research-technology.github.io/ro-crate-editor-profiles/profiles/software-profile.json' + 'https://language-research-technology.github.io/ro-crate-modes/modes/base.json', + 'https://language-research-technology.github.io/ro-crate-modes/modes/schema.json', + 'https://language-research-technology.github.io/ro-crate-modes/modes/language-data-commons-collection.json', + 'https://language-research-technology.github.io/ro-crate-modes/modes/software.json' ]; export const profiles = profileUrls.map(p => null); const p = profileUrls.map((url, i) => fetch(url).then(r => r.ok ? r.json().then(json => profiles[i] = json) : null)); diff --git a/src/app/views/CrateoView.vue b/src/app/views/CrateoView.vue index fe6069b..8dec578 100644 --- a/src/app/views/CrateoView.vue +++ b/src/app/views/CrateoView.vue @@ -6,7 +6,8 @@ import Help from "../components/Help.vue"; import SpreadSheet from "../components/SpreadSheet.vue"; import { Validator } from "../utils/profileValidator.js"; import { ROCrate } from "ro-crate"; -import { ElRow, ElCol, ElMenu, ElMenuItem, ElDivider, ElSelect, ElOption, ElDialog, ElButton } from 'element-plus'; +import { ElRow, ElCol, ElMenu, ElMenuItem, ElDivider, ElSelect, ElOption, + ElDialog, ElButton, ElCollapse, ElCollapseItem, ElAlert } from 'element-plus'; import { handleRoute } from '../../lib/DefaultRouteHandler.js' import { CrateEditor } from '../../lib' @@ -78,8 +79,6 @@ const commands = { console.log('open'); try { data.dirHandle = await window.showDirectoryPicker(); - // reset crate - resetData(); data.loading = true; try { data.metadataHandle = await data.dirHandle.getFileHandle('ro-crate-metadata.json'); @@ -100,12 +99,13 @@ const commands = { data.crate = crate; //navigate(); //data.loading = false; - console.log('end open') + // reset crate + resetData(); } catch (error) { console.error(error); window.alert(error); - resetData(); } + console.log('end open') }, async addFiles() { @@ -115,6 +115,7 @@ const commands = { }, async save() { + console.log('save!!!!!!!!!!!'); if (data.dirHandle) { // create new crate metadata data.metadataHandle = await data.dirHandle.getFileHandle('ro-crate-metadata.json', { create: true }); @@ -136,9 +137,9 @@ const commands = { const content = JSON.stringify(crate, null, 2); await writable.write(content); await writable.close(); - data.crate = crate; - data.entityId = ''; - data.validationResult = validate(data.crate, profile.value); + //data.crate = crate; + //data.entityId = ''; + data.validationResult = validate(crate, profile.value); data.validationResultDialog = !!data.validationResult; } }, @@ -304,7 +305,7 @@ function selectProfile(v) { data.selectedProfile = v; } } - +const activeNames = ref(['1']); @@ -326,22 +327,23 @@ function selectProfile(v) {Load and add a new mode from your computer ...
{{ profile.metadata.name }}
{{ profile.metadata.description }}
@@ -353,26 +355,32 @@ function selectProfile(v) {Entity:
-
-
Entity:
+
+
{{ layout.help }}
+There are no properties available in the mode for this type +
+