Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • coscine/frontend/libraries/form-generator
1 result
Select Git revision
Show changes
Commits on Source (4)
{
"name": "@coscine/form-generator",
"version": "3.2.0",
"version": "3.2.1",
"main": "dist/index.umd.js",
"module": "dist/index.mjs",
"browser": "dist/index.js",
......
......@@ -7,9 +7,15 @@ import Multiselect from '@/plugins/deprecated/Multiselect.vue';
/* Tested Component */
import FormGenerator from '@/FormGenerator.vue';
import { listApplicationProfile } from '@/data/example/applicationProfile';
import {
dropShapeAnalysis,
listApplicationProfile,
} from '@/data/example/applicationProfile';
import { listFixedValues } from '@/data/example/fixedValues';
import { listMetadata } from '@/data/example/metadata';
import {
dropShapeAnalysisMetadata,
listMetadata,
} from '@/data/example/metadata';
import factory from 'rdf-ext';
function sleep(ms: number) {
......@@ -140,6 +146,38 @@ describe('FormGenerator.vue', () => {
);
});
/* Checks for correct functionality of metadata display */
test('complexWithMetadata', async () => {
const wrapper = mount(FormGenerator, {
propsData: {
formData: dropShapeAnalysisMetadata,
formDataMimeType: 'text/turtle',
selectedShape: 'https://purl.org/coscine/ap/sfb985/dropShapeAnalysis/',
shapes: dropShapeAnalysis,
shapesMimeType: 'text/turtle',
},
});
await wrapper.vm.$nextTick();
// Wait for 1 second until everything is set up
await sleep(1000);
expect(wrapper.emitted('isValid')).toBeTruthy();
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
expect(wrapper.emitted('isValid')!.length).toBe(1);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
expect(wrapper.emitted('isValid')![0][0].conforms).toBeTruthy();
const allTextFields = wrapper.findAllComponents({ name: 'InputTextField' });
// Metadata value has been set
const defaultUserField = allTextFields.wrappers.filter(
(entry) => entry.vm?.$data?.object?.value === 'Tester'
);
expect(defaultUserField.length).toBe(2);
});
/* Checks for correct functionality of empty metadatasets */
test('listWithEmptyMetadataFixedValues', async () => {
const wrapper = mount(FormGenerator, {
......
......@@ -69,3 +69,193 @@ export const listApplicationProfile = `@prefix dcterms: <http://purl.org/dc/term
sh:message "This column needs a valid email address."@en ;
] ;
sh:targetClass foaf:Agent .`;
export const dropShapeAnalysis = `@base <https://purl.org/coscine/ap/sfb985/dropShapeAnalysis/> .
@prefix dash: <http://datashapes.org/dash#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix qudt: <http://qudt.org/schema/qudt/> .
@prefix unit: <http://qudt.org/vocab/unit/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ipc: <http://purl.org/coscine/terms/IPC#> .
@prefix afr: <http://purl.allotrope.org/ontologies/result#> .
@prefix afm: <http://purl.allotrope.org/ontologies/material#> .
@prefix obo: <http://purl.obolibrary.org/obo/> .
@prefix repr: <https://w3id.org/reproduceme#> .
@prefix om2: <http://www.ontology-of-units-of-measure.org/resource/om-2/> .
@prefix ebucore: <http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#> .
@prefix coscinedropShapeAnalysis: <https://purl.org/coscine/ap/sfb985/dropShapeAnalysis#> .
<https://purl.org/coscine/ap/sfb985/dropShapeAnalysis/>
dcterms:license <http://spdx.org/licenses/MIT> ;
dcterms:publisher <https://itc.rwth-aachen.de/> ;
dcterms:rights "Copyright © 2022 IT Center, RWTH Aachen University" ;
dcterms:title "Drop Shape Analysis"@en, "Drop Shape Analysis"@de ;
a sh:NodeShape ;
sh:targetClass <https://purl.org/coscine/ap/sfb985/dropShapeAnalysis/> ;
sh:closed true ;
sh:property [
sh:path rdf:type ;
] ;
sh:property coscinedropShapeAnalysis:personResponsible ;
sh:property coscinedropShapeAnalysis:operator ;
sh:property coscinedropShapeAnalysis:sampleID ;
sh:property coscinedropShapeAnalysis:samplePID;
sh:property coscinedropShapeAnalysis:measurementDate ;
sh:property coscinedropShapeAnalysis:measurementType ;
sh:property coscinedropShapeAnalysis:oscillatingDropMeasurementType ;
sh:property coscinedropShapeAnalysis:interface ;
sh:property coscinedropShapeAnalysis:oilType ;
sh:property coscinedropShapeAnalysis:instrument ;
sh:property coscinedropShapeAnalysis:accessoriesUsed ;
sh:property coscinedropShapeAnalysis:capillaryTipType ;
sh:property coscinedropShapeAnalysis:softwareVersion ;
sh:property coscinedropShapeAnalysis:comment ;
sh:property coscinedropShapeAnalysis:sampleConcentration;
sh:property coscinedropShapeAnalysis:elabID;
.
coscinedropShapeAnalysis:personResponsible
sh:path dcterms:creator ;
sh:order 0 ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:minLength 1 ;
sh:datatype xsd:string ;
sh:name "Person Responsible"@en, "Ersteller"@de ;
.
coscinedropShapeAnalysis:operator
sh:path dcterms:contributor ;
sh:order 1 ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:string ;
sh:name "Operator"@en, "Operator"@de;
.
coscinedropShapeAnalysis:sampleID
sh:path afr:AFR_0001118 ;
sh:order 2 ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:string ;
sh:name "Sample ID"@en, "Proben ID"@de ;
.
coscinedropShapeAnalysis:samplePID
sh:path dcterms:identifier ;
sh:order 3 ;
sh:maxCount 1 ;
sh:datatype xsd:string ;
sh:name "SFB 985 Sample Management PID"@en, "SFB 985 Probenmanagement PID"@de ;
.
coscinedropShapeAnalysis:measurementDate
sh:path dcterms:created ;
sh:order 4 ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:date ;
sh:name "Date of Measurement"@en, "Messdatum"@de ;
.
coscinedropShapeAnalysis:instrument
sh:path obo:OBI_0000968 ;
sh:order 5 ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:name "Instrument"@en, "Instrument"@de ;
sh:class <http://purl.org/coscine/vocabularies/sfb985/instrument> ;
.
coscinedropShapeAnalysis:accessoriesUsed
sh:path obo:RO_0002180 ;
sh:order 6 ;
sh:name "Accessories"@en, "Accesoires"@de ;
sh:class <http://purl.org/coscine/vocabularies/sfb985/accessories> ;
.
coscinedropShapeAnalysis:capillaryTipType
sh:path obo:BFO_0000051 ;
sh:order 7 ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:name "Type of capillary tip"@en, "Typ Kapillarspitze"@de ;
sh:class <http://purl.org/coscine/vocabularies/sfb985/capillaryTipType> ;
.
coscinedropShapeAnalysis:measurementType
sh:path obo:CHMO_0001163 ;
sh:order 8 ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:name "Measurement Type"@en, "Art der Messung"@de ;
sh:class <http://purl.org/coscine/vocabularies/sfb985/measurementType> ;
.
coscinedropShapeAnalysis:oscillatingDropMeasurementType
sh:path obo:OBI:0000070 ;
sh:order 9 ;
sh:maxCount 1 ;
sh:name "Oscillating drop measurement type"@en, "Oscillating Drop Messart"@de ;
sh:class <http://purl.org/coscine/vocabularies/sfb985/oscillatingDropMeasurementType> ;
.
coscinedropShapeAnalysis:sampleConcentration
sh:path obo:CHMO_0002820 ;
sh:order 10 ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:decimal ;
sh:name "Sample Concentration [wt%]"@en, "Probenkonzentration [Massen-%]"@de ;
qudt:Unit unit:PERCENT;
.
coscinedropShapeAnalysis:interface
sh:path obo:ENVO_01001684 ;
sh:order 11 ;
sh:maxCount 1 ;
sh:name "Interface type"@en, "Grenzfläche"@de ;
sh:class <http://purl.org/coscine/vocabularies/sfb985/interface> ;
.
coscinedropShapeAnalysis:oilType
sh:path afm:AFM_0000403 ;
sh:order 12 ;
sh:maxCount 1 ;
sh:name "Type of oil"@en, "Öl"@de ;
sh:class <http://purl.org/coscine/vocabularies/sfb985/oilType> ;
.
coscinedropShapeAnalysis:softwareVersion
sh:path obo:IAO_0000129 ;
sh:order 13 ;
sh:minCount 1 ;
sh:maxCount 1 ;
sh:datatype xsd:string ;
sh:name "ADVANCE software version"@en, "ADVANCE Softwareversion"@de ;
.
coscinedropShapeAnalysis:comment
sh:path rdfs:comment ;
sh:order 14 ;
sh:datatype xsd:string ;
dash:singleLine false ;
sh:name "Additional notes"@en, "weitere Anmerkungen"@de
.
coscinedropShapeAnalysis:elabID
sh:path obo:IAO_0020000 ;
sh:order 15 ;
sh:datatype xsd:string ;
sh:name "Experiment ID (eLabFTW)"@en, "Experiment-ID (eLabFTW)"@de
.`;
......@@ -8,3 +8,20 @@ _:b3 a foaf:Person ;
foaf:title "Dr." ;
<http://w3id.org/nfdi4ing/metadata4ing#orcidId> "1234" ;
<http://example.org/fruits> "Banana" .`;
export const dropShapeAnalysisMetadata = `@prefix dc: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ns0: <http://purl.obolibrary.org/obo/> .
@prefix ns1: <http://purl.allotrope.org/ontologies/result#> .
<https://hdl.handle.net/21.11102/0526503b-68c2-4793-8cf4-50e8ecadb15b@path=%2FImage20220912151316.png>
a <https://purl.org/coscine/ap/sfb985/dropShapeAnalysis/> ;
dc:created "2022-12-22"^^xsd:date ;
dc:contributor "Tester"^^xsd:string ;
dc:creator "Tester"^^xsd:string ;
ns0:CHMO_0001163 <http://purl.org/coscine/vocabularies/sfb985/measurementType#1> ;
ns0:CHMO_0002820 2.0 ;
ns1:AFR_0001118 "23"^^xsd:string ;
ns0:BFO_0000051 <http://purl.org/coscine/vocabularies/sfb985/capillaryTipType#1> ;
ns0:IAO_0000129 "ert"^^xsd:string ;
ns0:OBI_0000968 <http://purl.org/coscine/vocabularies/sfb985/instrument#0> .`;