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
  • Experimental/Bugfixes
  • Hotfix/1129-fixValidation
  • Hotfix/1140-fixFixedValues
  • Hotfix/1142-fixFixedValues
  • Hotfix/1197-Datepicker
  • Hotfix/1216-fixDateDesign
  • Hotfix/2233-fixMe
  • Hotfix/2258-saveButtonWorksAsExpected
  • Hotfix/2296-selectedValuesNotReturned
  • Hotfix/2417-emptyMetadataValidation
  • Hotfix/2504-formGen
  • Hotfix/2504-formGenerator
  • Hotfix/2681-validationErrors
  • Hotfix/2955-storingFail
  • Hotfix/2957-styleAndUpgrade
  • Hotfix/845-someUIChanges
  • Hotfix/920-multiSelect
  • Hotfix/xxxx-infiniteLoops
  • Hotfix/xxxx-nodePath
  • Hotfix/xxxx-notEmptyFields
  • Issue/1607-dateTimeOffset
  • Issue/1607-newDateTimeOffset
  • Issue/1804-fixedValueFix
  • Issue/1804-fixedValueFixOld
  • Issue/1826-versioning
  • Issue/1938-internalHandling
  • Issue/1987-shIn
  • Issue/2002-migrateResourceCreate
  • Issue/2035-rcv
  • Issue/2117-ProjectandResourceCreateInfoIcons
  • Issue/2139-detailViewing
  • Issue/2262-frontendWorkspace
  • Issue/2309-docs
  • Issue/2318-fixedValuesFix
  • Issue/2341-description
  • Issue/2345-dealWithWeirdLists
  • Issue/2353-dropShapeFix
  • Issue/2408-hasValue
  • Issue/2435-userApi
  • Issue/2516-validationUpdate
  • Issue/2525-fixedFixValues
  • Issue/2551-enhanceSymbolDescriptionsInApplicationProfile
  • Issue/2598-vue3
  • Issue/2703-vocabularyList
  • Issue/2729-fixSlowLoadingOfInstances
  • Issue/2759-showMissingField
  • Issue/2804-templateUI
  • Issue/2805-ignoreTemplatingValues
  • Issue/2851-fixBooleanInFormGenerator
  • Issue/2920-fixRemovingValues
  • Issue/2943-uiFeedback
  • Issue/2960-fixValidationForAP
  • Issue/2960-infiniteLoop
  • Issue/43-saveButton
  • Issue/xxxx-correctTargetClass
  • Issue/xxxx-extensions
  • Issue/xxxx-infiniteLoop
  • Issue/xxxx-instances
  • Issue/xxxx-optimizedBuild
  • Issue/xxxx-reduceBootstrapVueBundle
  • Product/1107-frontendPerformance
  • Product/1210-inheritance
  • Product/1215-gitlabCleanUp
  • Product/1532-formGeneratorFeatures
  • Product/1573-ReadOnlyResources
  • Product/1576-formGeneratorMultiselect
  • Product/510-niceProjectUrl
  • Product/619-clientValidation
  • Product/791-uiAdaptions
  • Product/801-refactorFileMetadata
  • Product/815-cleanupApplicationProfiles
  • Sprint/2020-09
  • Sprint/2020-10
  • Sprint/2020-11
  • Sprint/2020-12
  • Sprint/2020-13
  • Sprint/2020-14
  • Sprint/2020-18
  • Sprint/2020-19
  • Sprint/2021-12
  • Sprint/2021-13
  • Sprint/2021-14
  • Sprint/2021-15
  • Sprint/2021-2022
  • Sprint/2021-22
  • Sprint/2022-01
  • Test/vue-demi
  • Topic/1065-clientValidation
  • Topic/1227-frontendPerformance
  • Topic/1229-inheritance
  • Topic/1533-formGeneratorCleanup
  • Topic/1535-formGeneratorMultiselect
  • Topic/1535-linting
  • Topic/795-uiAdaptions
  • Topic/804-niceProjectUrl
  • Topic/846-cleanupApplicationProfiles
  • Topic/853-refactorFileMetadataFE
  • dev
  • gitkeep
  • gitpod
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.11.0
  • v1.12.0
  • v1.13.0
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.17.0
  • v1.18.0
  • v1.2.0
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.3.3
  • v1.4.0
  • v1.5.0
  • v1.6.0
  • v1.7.0
  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.8.3
  • v1.8.4
  • v1.9.0
  • v1.9.1
  • v1.9.2
  • v1.9.3
  • v2.0.0
  • v2.1.0
  • v3.0.0
  • v3.0.1
  • v3.0.10
  • v3.0.11
  • v3.0.12
  • v3.0.2
  • v3.0.3
  • v3.0.4
  • v3.0.5
  • v3.0.6
  • v3.0.7
  • v3.0.8
  • v3.0.9
  • v3.1.0
  • v3.1.1
  • v3.1.2
  • v3.1.3
  • v3.1.4
  • v3.2.0
  • v3.2.1
  • v3.2.2
  • v3.3.0
  • v3.4.0
  • v3.5.0
  • v3.5.1
  • v3.5.2
  • v3.5.3
  • v3.5.4
  • v3.5.5
  • v3.5.6
  • v3.5.7
  • v3.6.0
  • v3.6.1
  • v3.6.2
  • v3.6.3
  • v4.0.0
  • v4.0.1
  • v4.0.2
  • v4.0.3
  • v4.0.4
  • v4.0.5
175 results

Target

Select target project
  • coscine/frontend/libraries/form-generator
1 result
Select Git revision
  • Experimental/Bugfixes
  • Hotfix/1129-fixValidation
  • Hotfix/1140-fixFixedValues
  • Hotfix/1142-fixFixedValues
  • Hotfix/1197-Datepicker
  • Hotfix/1216-fixDateDesign
  • Hotfix/2233-fixMe
  • Hotfix/2258-saveButtonWorksAsExpected
  • Hotfix/2296-selectedValuesNotReturned
  • Hotfix/2417-emptyMetadataValidation
  • Hotfix/2504-formGen
  • Hotfix/2504-formGenerator
  • Hotfix/2681-validationErrors
  • Hotfix/2955-storingFail
  • Hotfix/2957-styleAndUpgrade
  • Hotfix/845-someUIChanges
  • Hotfix/920-multiSelect
  • Hotfix/xxxx-infiniteLoops
  • Hotfix/xxxx-nodePath
  • Hotfix/xxxx-notEmptyFields
  • Issue/1607-dateTimeOffset
  • Issue/1607-newDateTimeOffset
  • Issue/1804-fixedValueFix
  • Issue/1804-fixedValueFixOld
  • Issue/1826-versioning
  • Issue/1938-internalHandling
  • Issue/1987-shIn
  • Issue/2002-migrateResourceCreate
  • Issue/2035-rcv
  • Issue/2117-ProjectandResourceCreateInfoIcons
  • Issue/2139-detailViewing
  • Issue/2262-frontendWorkspace
  • Issue/2309-docs
  • Issue/2318-fixedValuesFix
  • Issue/2341-description
  • Issue/2345-dealWithWeirdLists
  • Issue/2353-dropShapeFix
  • Issue/2408-hasValue
  • Issue/2435-userApi
  • Issue/2516-validationUpdate
  • Issue/2525-fixedFixValues
  • Issue/2551-enhanceSymbolDescriptionsInApplicationProfile
  • Issue/2598-vue3
  • Issue/2703-vocabularyList
  • Issue/2729-fixSlowLoadingOfInstances
  • Issue/2759-showMissingField
  • Issue/2804-templateUI
  • Issue/2805-ignoreTemplatingValues
  • Issue/2851-fixBooleanInFormGenerator
  • Issue/2920-fixRemovingValues
  • Issue/2943-uiFeedback
  • Issue/2960-fixValidationForAP
  • Issue/2960-infiniteLoop
  • Issue/43-saveButton
  • Issue/xxxx-correctTargetClass
  • Issue/xxxx-extensions
  • Issue/xxxx-infiniteLoop
  • Issue/xxxx-instances
  • Issue/xxxx-optimizedBuild
  • Issue/xxxx-reduceBootstrapVueBundle
  • Product/1107-frontendPerformance
  • Product/1210-inheritance
  • Product/1215-gitlabCleanUp
  • Product/1532-formGeneratorFeatures
  • Product/1573-ReadOnlyResources
  • Product/1576-formGeneratorMultiselect
  • Product/510-niceProjectUrl
  • Product/619-clientValidation
  • Product/791-uiAdaptions
  • Product/801-refactorFileMetadata
  • Product/815-cleanupApplicationProfiles
  • Sprint/2020-09
  • Sprint/2020-10
  • Sprint/2020-11
  • Sprint/2020-12
  • Sprint/2020-13
  • Sprint/2020-14
  • Sprint/2020-18
  • Sprint/2020-19
  • Sprint/2021-12
  • Sprint/2021-13
  • Sprint/2021-14
  • Sprint/2021-15
  • Sprint/2021-2022
  • Sprint/2021-22
  • Sprint/2022-01
  • Test/vue-demi
  • Topic/1065-clientValidation
  • Topic/1227-frontendPerformance
  • Topic/1229-inheritance
  • Topic/1533-formGeneratorCleanup
  • Topic/1535-formGeneratorMultiselect
  • Topic/1535-linting
  • Topic/795-uiAdaptions
  • Topic/804-niceProjectUrl
  • Topic/846-cleanupApplicationProfiles
  • Topic/853-refactorFileMetadataFE
  • dev
  • gitkeep
  • gitpod
  • v1.0.0
  • v1.1.0
  • v1.10.0
  • v1.10.1
  • v1.10.2
  • v1.11.0
  • v1.12.0
  • v1.13.0
  • v1.14.0
  • v1.15.0
  • v1.15.1
  • v1.16.0
  • v1.17.0
  • v1.18.0
  • v1.2.0
  • v1.3.0
  • v1.3.1
  • v1.3.2
  • v1.3.3
  • v1.4.0
  • v1.5.0
  • v1.6.0
  • v1.7.0
  • v1.8.0
  • v1.8.1
  • v1.8.2
  • v1.8.3
  • v1.8.4
  • v1.9.0
  • v1.9.1
  • v1.9.2
  • v1.9.3
  • v2.0.0
  • v2.1.0
  • v3.0.0
  • v3.0.1
  • v3.0.10
  • v3.0.11
  • v3.0.12
  • v3.0.2
  • v3.0.3
  • v3.0.4
  • v3.0.5
  • v3.0.6
  • v3.0.7
  • v3.0.8
  • v3.0.9
  • v3.1.0
  • v3.1.1
  • v3.1.2
  • v3.1.3
  • v3.1.4
  • v3.2.0
  • v3.2.1
  • v3.2.2
  • v3.3.0
  • v3.4.0
  • v3.5.0
  • v3.5.1
  • v3.5.2
  • v3.5.3
  • v3.5.4
  • v3.5.5
  • v3.5.6
  • v3.5.7
  • v3.6.0
  • v3.6.1
  • v3.6.2
  • v3.6.3
  • v4.0.0
  • v4.0.1
  • v4.0.2
  • v4.0.3
  • v4.0.4
  • v4.0.5
175 results
Show changes

Commits on Source 6

Showing
with 524 additions and 569 deletions
/* eslint-disable no-undef */
module.exports = {
root: true,
env: {
es2021: true,
},
ignorePatterns: ['node_modules', 'build', 'coverage', 'Multiselect.vue'],
plugins: ['eslint-comments', 'functional'],
extends: [
'plugin:vue/recommended',
'eslint:recommended',
'@vue/typescript/recommended',
'@vue/eslint-config-prettier',
'@vue/eslint-config-typescript/recommended',
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
},
};
module.exports = {
root: true,
env: {
es2021: true,
},
ignorePatterns: ["node_modules", "build", "coverage", "Multiselect.vue"],
plugins: ["eslint-comments", "functional"],
extends: [
"plugin:vue/recommended",
"eslint:recommended",
"@vue/typescript/recommended",
"@vue/eslint-config-prettier",
"@vue/eslint-config-typescript/recommended",
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
"@typescript-eslint/explicit-module-boundary-types": "off",
"eslint-comments/disable-enable-pair": [
"error",
{ "allowWholeFile": true }
],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
};
...@@ -3,11 +3,17 @@ include: ...@@ -3,11 +3,17 @@ include:
file: file:
- /docker-runner.yml - /docker-runner.yml
- /nodejs.yml - /nodejs.yml
- template: Code-Quality.gitlab-ci.yml
- template: Security/SAST.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
- template: Security/License-Scanning.gitlab-ci.yml
- template: Security/Dependency-Scanning.gitlab-ci.yml
stages: stages:
- build - build
- test - test
- publish - publish
- code-analysis
build-branch: build-branch:
extends: .build-branch extends: .build-branch
...@@ -29,3 +35,33 @@ publish-gitlab: ...@@ -29,3 +35,33 @@ publish-gitlab:
publish-npm: publish-npm:
extends: .publish-npm-release extends: .publish-npm-release
code_quality:
stage: code-analysis
tags:
- runner:docker-privileged
artifacts:
paths: [gl-code-quality-report.json]
license_scanning:
stage: code-analysis
tags:
- runner:docker
sast:
stage: code-analysis
tags:
- runner:docker
artifacts:
reports:
sast: gl-sast-report.json
dependency_scanning:
stage: code-analysis
tags:
- runner:docker
secret_detection:
stage: code-analysis
tags:
- runner:docker
{ {
"name": "eslint", "name": "eslint",
"version": "8.28.0-sdk", "version": "8.43.0-sdk",
"main": "./lib/api.js", "main": "./lib/api.js",
"type": "commonjs" "type": "commonjs"
} }
{ {
"name": "prettier", "name": "prettier",
"version": "2.7.1-sdk", "version": "2.8.8-sdk",
"main": "./index.js", "main": "./index.js",
"type": "commonjs" "type": "commonjs"
} }
{ {
"name": "typescript", "name": "typescript",
"version": "4.9.3-sdk", "version": "5.1.3-sdk",
"main": "./lib/typescript.js", "main": "./lib/typescript.js",
"type": "commonjs" "type": "commonjs"
} }
...@@ -5,25 +5,22 @@ packageExtensions: ...@@ -5,25 +5,22 @@ packageExtensions:
bootstrap-vue@*: bootstrap-vue@*:
dependencies: dependencies:
jquery: "*" jquery: "*"
vue: ^2.7.8 vue: ^2.7.14
fork-ts-checker-webpack-plugin@*:
dependencies:
vue-template-compiler: ^2.7.8
local-pkg@*: local-pkg@*:
dependencies: dependencies:
"@vitest/coverage-c8": "*" "@vitest/coverage-c8": "*"
jsdom: "*" jsdom: "*"
vue-demi@*: vue-demi@*:
dependencies: dependencies:
vue: ^2.7.10 vue: ^2.7.14
vue-eslint-parser@*: vue-eslint-parser@*:
dependencies: dependencies:
"@typescript-eslint/parser": "*" "@typescript-eslint/parser": "*"
vue-i18n@*: vue-i18n@*:
dependencies: dependencies:
vue: ^2.7.8 vue: ^2.7.14
vue-material-design-icons@*: vue-material-design-icons@*:
dependencies: dependencies:
vue: ^2.7.8 vue: ^2.7.14
yarnPath: .yarn/releases/yarn-3.5.0.cjs yarnPath: .yarn/releases/yarn-3.6.0.cjs
{ {
"name": "@coscine/form-generator", "name": "@coscine/form-generator",
"version": "3.1.4", "version": "3.2.0",
"main": "dist/index.umd.js", "main": "dist/index.umd.js",
"module": "dist/index.mjs", "module": "dist/index.mjs",
"browser": "dist/index.js", "browser": "dist/index.js",
"style": "dist/style.css", "style": "dist/style.css",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"type": "module",
"directories": { "directories": {
"doc": "docs" "doc": "docs"
}, },
...@@ -26,19 +27,17 @@ ...@@ -26,19 +27,17 @@
"singleQuote": true "singleQuote": true
}, },
"dependencies": { "dependencies": {
"@coscine/api-client": "^2.9.2", "@zazuko/prefixes": "^2.0.0",
"@zazuko/rdf-vocabularies": "^2022.6.29",
"bootstrap": "4.6.1", "bootstrap": "4.6.1",
"bootstrap-vue": "^2.22.0", "bootstrap-vue": "^2.23.1",
"rdf-ext": "^2.0.1", "rdf-ext": "^2.2.0",
"rdf-parse": "^1.8.0", "rdf-parse": "^2.3.2",
"rdf-validate-shacl": "^0.4.4", "rdf-validate-shacl": "^0.4.5",
"stream-browserify": "^3.0.0",
"uuid": "^9.0.0", "uuid": "^9.0.0",
"vue-demi": "^0.13.11", "vue-demi": "^0.14.5",
"vue-i18n": "^8.22.2", "vue-i18n": "^8.22.2",
"vue-material-design-icons": "^5.1.2", "vue-material-design-icons": "^5.2.0",
"vue-multiselect": "^2.1.6" "vue-multiselect": "^2.1.7"
}, },
"peerDependencies": { "peerDependencies": {
"@vue/composition-api": "^1.0.0-rc.1", "@vue/composition-api": "^1.0.0-rc.1",
...@@ -51,54 +50,47 @@ ...@@ -51,54 +50,47 @@
}, },
"devDependencies": { "devDependencies": {
"@hutson/semantic-delivery-gitlab": "^9.1.0", "@hutson/semantic-delivery-gitlab": "^9.1.0",
"@rollup/plugin-replace": "^4.0.0", "@semantic-release/commit-analyzer": "^10.0.1",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/git": "^10.0.1", "@semantic-release/git": "^10.0.1",
"@semantic-release/gitlab": "^9.4.2", "@semantic-release/gitlab": "^12.0.3",
"@semantic-release/npm": "^9.0.1", "@semantic-release/npm": "^10.0.4",
"@semantic-release/release-notes-generator": "^10.0.3", "@semantic-release/release-notes-generator": "^11.0.3",
"@types/node": "^18.7.18", "@types/node": "^20.3.1",
"@types/rdf-ext": "^1.3.11", "@types/rdf-ext": "^2.2.0",
"@types/rdf-js": "^4.0.1", "@types/rdf-js": "^4.0.1",
"@types/rdf-validate-shacl": "^0.4.0", "@types/rdf-validate-shacl": "^0.4.2",
"@types/uuid": "^9.0.0", "@types/uuid": "^9.0.2",
"@typescript-eslint/eslint-plugin": "^5.38.0", "@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.38.0", "@typescript-eslint/parser": "^5.59.11",
"@vitejs/plugin-vue2": "^1.1.2", "@vitejs/plugin-vue2": "^2.2.0",
"@vitest/coverage-c8": "^0.25.3", "@vitest/coverage-c8": "^0.32.2",
"@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-typescript": "^11.0.1", "@vue/eslint-config-typescript": "^11.0.3",
"@vue/test-utils": "^1.3.0", "@vue/test-utils": "^1.3.0",
"conventional-changelog-eslint": "3.0.9", "conventional-changelog-eslint": "4.0.0",
"core-js": "^3.25.2", "eslint": "^8.43.0",
"eslint": "^8.23.1", "eslint-config-prettier": "^8.8.0",
"eslint-config-prettier": "^8.5.0", "eslint-import-resolver-node": "^0.3.7",
"eslint-import-resolver-node": "^0.3.6",
"eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-functional": "^4.4.0", "eslint-plugin-functional": "^5.0.8",
"eslint-plugin-import": "^2.26.0", "eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.5.1", "eslint-plugin-vue": "^9.15.0",
"jsdom": "^20.0.3", "jsdom": "^22.1.0",
"jsdom-global": "^3.0.2", "jsdom-global": "^3.0.2",
"prettier": "^2.7.1", "prettier": "^2.8.8",
"rollup-plugin-node-globals": "^1.4.0", "semantic-release": "^21.0.5",
"rollup-plugin-node-polyfills": "^0.2.1", "typescript": "^5.1.3",
"rollup-plugin-polyfill-node": "^0.10.2", "vite": "^4.3.9",
"semantic-release": "^19.0.5", "vite-plugin-node-polyfills": "^0.9.0",
"typescript": "^4.8.3", "vitest": "^0.32.2",
"vite": "^3.2.4", "vue": "^2.7.14",
"vitest": "^0.25.3", "vue-template-compiler": "^2.7.14"
"vue": "^2.7.10",
"vue-template-compiler": "^2.7.10"
},
"resolutions": {
"readable-stream": "3.6.0"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git.rwth-aachen.de/coscine/frontend/libraries/form-generator.git" "url": "https://git.rwth-aachen.de/coscine/frontend/libraries/form-generator.git"
}, },
"license": "MIT", "license": "MIT",
"packageManager": "yarn@3.5.1" "packageManager": "yarn@3.6.1"
} }
...@@ -30,42 +30,26 @@ ...@@ -30,42 +30,26 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi'; import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi'; import type { PropType } from 'vue-demi';
import locale from '@/locale'; import i18n from '@/plugins/i18n';
import VueI18n from 'vue-i18n';
import { MetadataApi, UserApi } from '@coscine/api-client';
import type { Dataset, Quad, Quad_Object, Quad_Subject } from 'rdf-js'; import type { Dataset, Quad, Quad_Object, Quad_Subject } from 'rdf-js';
import factory from 'rdf-ext'; import factory from 'rdf-ext';
import WrapperInput from '@/components/WrapperInput.vue'; import WrapperInput from '@/components/WrapperInput.vue';
import LinkedDataHandler from '@/base/LinkedDataHandler'; import LinkedDataHandler from '@/base/LinkedDataHandler';
import { prefixes } from '@zazuko/rdf-vocabularies'; import prefixes from '@zazuko/prefixes/prefixes';
import type { UserObject } from '@coscine/api-client/dist/types/Coscine.Api.User';
import type { BilingualLabels } from '@coscine/api-client/dist/types/Coscine.Api.Metadata';
import type { import type {
FixedValueObject, FixedValueObject,
FixedValues, FixedValues,
ValueType, ValueType,
} from '@/types/fixedValues'; } from '@/types/fixedValues';
import type DatasetExt from 'rdf-ext/lib/Dataset'; import type DatasetExt from 'rdf-ext/lib/Dataset';
import { retrieveChildren } from '@/util/linkedData';
if (Vue) { import type { User } from '@/types/user';
Vue.use(VueI18n);
} else {
// TODO: Deal with Vue 3
}
const i18n = new VueI18n({
locale: 'en',
messages: locale,
silentFallbackWarn: true,
});
export default defineComponent({ export default defineComponent({
name: 'FormGenerator', name: 'FormGenerator',
...@@ -124,20 +108,14 @@ export default defineComponent({ ...@@ -124,20 +108,14 @@ export default defineComponent({
type: String, type: String,
}, },
classReceiver: { classReceiver: {
default: () => async (classUrl: string) => { default: () => retrieveChildren,
const response = await MetadataApi.metadataGetClassInstances(classUrl); type: Function as PropType<typeof retrieveChildren>,
return response.data;
},
type: Function as PropType<
(classUrl: string) => Promise<BilingualLabels>
>,
}, },
userReceiver: { userReceiver: {
default: () => async () => { default: () => {
const response = await UserApi.userGetUser(); return async () => ({});
return response.data;
}, },
type: Function as PropType<() => Promise<UserObject>>, type: Function as PropType<() => Promise<User>>,
}, },
}, },
data() { data() {
...@@ -594,6 +572,9 @@ export default defineComponent({ ...@@ -594,6 +572,9 @@ export default defineComponent({
width: 60px !important; width: 60px !important;
max-width: 60px !important; max-width: 60px !important;
} }
#FormGenerator .innerButton svg {
margin: auto;
}
#FormGenerator .metadata .material-design-icon__svg { #FormGenerator .metadata .material-design-icon__svg {
margin-top: -0.1em; margin-top: -0.1em;
} }
......
...@@ -4,17 +4,9 @@ import factory from 'rdf-ext'; ...@@ -4,17 +4,9 @@ import factory from 'rdf-ext';
import SHACLValidator from 'rdf-validate-shacl'; import SHACLValidator from 'rdf-validate-shacl';
import rdfParser from 'rdf-parse'; import rdfParser from 'rdf-parse';
import { Readable } from 'stream'; import { Readable } from 'stream';
import { prefixes } from '@zazuko/rdf-vocabularies'; import prefixes from '@zazuko/prefixes/prefixes';
import type { import type { Dataset, Quad, Quad_Object, Quad_Subject } from 'rdf-js';
DataFactory, import type { ValidationType } from '@/types/validationTypes';
Dataset,
DatasetCore,
DatasetCoreFactory,
Quad,
Quad_Object,
Quad_Subject,
} from 'rdf-js';
import type ValidationReport from 'rdf-validate-shacl/src/validation-report';
export default defineComponent({ export default defineComponent({
data() { data() {
...@@ -25,20 +17,7 @@ export default defineComponent({ ...@@ -25,20 +17,7 @@ export default defineComponent({
}; };
}, },
methods: { methods: {
fillResults( fillResults(currentResults: ValidationType, results: ValidationType) {
currentResults: Array<
ValidationReport.ValidationResult<
DataFactory<Quad, Quad> &
DatasetCoreFactory<Quad, Quad, DatasetCore<Quad, Quad>>
>
>,
results: Array<
ValidationReport.ValidationResult<
DataFactory<Quad, Quad> &
DatasetCoreFactory<Quad, Quad, DatasetCore<Quad, Quad>>
>
>
) {
for (const currentResult of currentResults) { for (const currentResult of currentResults) {
results.push(currentResult); results.push(currentResult);
if (currentResult.detail) { if (currentResult.detail) {
...@@ -48,12 +27,7 @@ export default defineComponent({ ...@@ -48,12 +27,7 @@ export default defineComponent({
}, },
setErrorMessages( setErrorMessages(
metadata: Dataset, metadata: Dataset,
results: Array< results: ValidationType,
ValidationReport.ValidationResult<
DataFactory<Quad, Quad> &
DatasetCoreFactory<Quad, Quad, DatasetCore<Quad, Quad>>
>
>,
subjectNode: Quad_Subject subjectNode: Quad_Subject
) { ) {
for (const result of results) { for (const result of results) {
...@@ -148,12 +122,7 @@ export default defineComponent({ ...@@ -148,12 +122,7 @@ export default defineComponent({
this.$emit('isValid', report, clonedValidationContext); this.$emit('isValid', report, clonedValidationContext);
this.errorMessages = {}; this.errorMessages = {};
const results: Array< const results: ValidationType = [];
ValidationReport.ValidationResult<
DataFactory<Quad, Quad> &
DatasetCoreFactory<Quad, Quad, DatasetCore<Quad, Quad>>
>
> = [];
this.fillResults(report.results, results); this.fillResults(report.results, results);
this.setErrorMessages(clonedMetadata, results, subjectNode); this.setErrorMessages(clonedMetadata, results, subjectNode);
......
...@@ -15,29 +15,16 @@ ...@@ -15,29 +15,16 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi'; import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi'; import type { PropType } from 'vue-demi';
import VueI18n from 'vue-i18n';
import locale from '@/locale'; import i18n from '@/plugins/i18n';
import '@/plugins/deprecated/vue-multiselect'; import '@/plugins/deprecated/vue-multiselect';
import type { NamedNode, Quad_Object } from 'rdf-js'; import type { NamedNode, Quad_Object } from 'rdf-js';
import factory from 'rdf-ext'; import factory from 'rdf-ext';
import { prefixes } from '@zazuko/rdf-vocabularies'; import prefixes from '@zazuko/prefixes/prefixes';
import type { Label } from '@coscine/api-client/dist/types/Coscine.Api.Metadata'; import type { Label } from '@/types/labels';
if (Vue) {
Vue.use(VueI18n);
} else {
// TODO: Deal with Vue 3
}
const i18n = new VueI18n({
locale: 'en',
messages: locale,
silentFallbackWarn: true,
});
export default defineComponent({ export default defineComponent({
i18n, i18n,
......
...@@ -15,32 +15,17 @@ ...@@ -15,32 +15,17 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi'; import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi'; import type { PropType } from 'vue-demi';
import VueI18n from 'vue-i18n';
import locale from '@/locale'; import i18n from '@/plugins/i18n';
import '@/plugins/deprecated/vue-multiselect'; import '@/plugins/deprecated/vue-multiselect';
if (Vue) { import type { Label } from '@/types/labels';
Vue.use(VueI18n);
} else {
// TODO: Deal with Vue 3
}
import type {
BilingualLabels,
Label,
} from '@coscine/api-client/dist/types/Coscine.Api.Metadata';
import type { NamedNode, Quad_Object } from 'rdf-js'; import type { NamedNode, Quad_Object } from 'rdf-js';
import factory from 'rdf-ext'; import factory from 'rdf-ext';
import { retrieveChildren } from '@/util/linkedData';
const i18n = new VueI18n({
locale: 'en',
messages: locale,
silentFallbackWarn: true,
});
export default defineComponent({ export default defineComponent({
i18n, i18n,
...@@ -71,12 +56,8 @@ export default defineComponent({ ...@@ -71,12 +56,8 @@ export default defineComponent({
type: Object as PropType<NamedNode<string>>, type: Object as PropType<NamedNode<string>>,
}, },
classReceiver: { classReceiver: {
default: () => { default: () => retrieveChildren,
return async () => ({} as BilingualLabels); type: Function as PropType<typeof retrieveChildren>,
},
type: Function as PropType<
(classUrl: string) => Promise<BilingualLabels>
>,
}, },
}, },
data() { data() {
...@@ -129,10 +110,22 @@ export default defineComponent({ ...@@ -129,10 +110,22 @@ export default defineComponent({
} }
}, },
async retrieveLabels() { async retrieveLabels() {
let classReceiver:
| typeof retrieveChildren
| (() => typeof retrieveChildren) = this.classReceiver;
// Deal with weird behavior during dev builds
try { try {
const bilingualLabels = await this.classReceiver( // If the function has no arguments, it's not the retrieveChildren one
this.classObject.value if (classReceiver.length === 0) {
); classReceiver = (
classReceiver as unknown as () => typeof retrieveChildren
)();
}
} catch (e) {
// Ignore
}
try {
const bilingualLabels = await classReceiver(this.classObject.value);
if (this.languageCode === 'en' && bilingualLabels.en) { if (this.languageCode === 'en' && bilingualLabels.en) {
this.list = bilingualLabels.en; this.list = bilingualLabels.en;
} else if (this.languageCode === 'de' && bilingualLabels.de) { } else if (this.languageCode === 'de' && bilingualLabels.de) {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import { BFormDatepicker } from 'bootstrap-vue'; import { BFormDatepicker } from 'bootstrap-vue';
import type { NamedNode, Quad_Object } from 'rdf-js'; import type { NamedNode, Quad_Object } from 'rdf-js';
import factory from 'rdf-ext'; import factory from 'rdf-ext';
import { prefixes } from '@zazuko/rdf-vocabularies'; import prefixes from '@zazuko/prefixes/prefixes';
import { defineComponent } from 'vue-demi'; import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi'; import type { PropType } from 'vue-demi';
......
...@@ -15,33 +15,17 @@ ...@@ -15,33 +15,17 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi'; import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi'; import type { PropType } from 'vue-demi';
import VueI18n from 'vue-i18n';
import locale from '@/locale'; import i18n from '@/plugins/i18n';
import '@/plugins/deprecated/vue-multiselect'; import '@/plugins/deprecated/vue-multiselect';
if (Vue) { import type { Label } from '@/types/labels';
Vue.use(VueI18n);
} else {
// TODO: Deal with Vue 3
}
import type {
BilingualLabels,
Label,
} from '@coscine/api-client/dist/types/Coscine.Api.Metadata';
import type { Quad_Object } from 'rdf-js'; import type { Quad_Object } from 'rdf-js';
import factory from 'rdf-ext'; import factory from 'rdf-ext';
const i18n = new VueI18n({
locale: 'en',
messages: locale,
silentFallbackWarn: true,
});
export default defineComponent({ export default defineComponent({
i18n, i18n,
name: 'InputCombobox', name: 'InputCombobox',
...@@ -70,14 +54,6 @@ export default defineComponent({ ...@@ -70,14 +54,6 @@ export default defineComponent({
required: true, required: true,
type: Array as PropType<Array<string>>, type: Array as PropType<Array<string>>,
}, },
classReceiver: {
default: () => {
return async () => ({} as BilingualLabels);
},
type: Function as PropType<
(classUrl: string) => Promise<BilingualLabels>
>,
},
}, },
data() { data() {
return { return {
......
...@@ -18,33 +18,17 @@ ...@@ -18,33 +18,17 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi'; import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi'; import type { PropType } from 'vue-demi';
import VueI18n from 'vue-i18n';
import locale from '@/locale';
if (Vue) {
Vue.use(VueI18n);
} else {
// TODO: Deal with Vue 3
}
import type { Dataset, Quad_Object } from 'rdf-js'; import type { Dataset, Quad_Object } from 'rdf-js';
import factory from 'rdf-ext'; import factory from 'rdf-ext';
import { BCard } from 'bootstrap-vue'; import { BCard } from 'bootstrap-vue';
import { type FixedValues } from '@/types/fixedValues'; import { type FixedValues } from '@/types/fixedValues';
import { type BilingualLabels } from '@coscine/api-client/dist/types/Coscine.Api.Metadata'; import { retrieveChildren } from '@/util/linkedData';
import { type UserObject } from '@coscine/api-client/dist/types/Coscine.Api.User'; import type { User } from '@/types/user';
const i18n = new VueI18n({
locale: 'en',
messages: locale,
silentFallbackWarn: true,
});
export default defineComponent({ export default defineComponent({
i18n,
name: 'InputShape', name: 'InputShape',
components: { components: {
BCard, BCard,
...@@ -91,18 +75,14 @@ export default defineComponent({ ...@@ -91,18 +75,14 @@ export default defineComponent({
type: Boolean, type: Boolean,
}, },
classReceiver: { classReceiver: {
default: () => { default: () => retrieveChildren,
return async () => ({} as BilingualLabels); type: Function as PropType<typeof retrieveChildren>,
},
type: Function as PropType<
(classUrl: string) => Promise<BilingualLabels>
>,
}, },
userReceiver: { userReceiver: {
default: () => { default: () => {
return async () => ({} as UserObject); return async () => ({});
}, },
type: Function as PropType<() => Promise<UserObject>>, type: Function as PropType<() => Promise<User>>,
}, },
}, },
data() { data() {
...@@ -116,7 +96,6 @@ export default defineComponent({ ...@@ -116,7 +96,6 @@ export default defineComponent({
}, },
}, },
mounted() { mounted() {
i18n.locale = this.languageCode;
this.loadData(); this.loadData();
}, },
methods: { methods: {
......
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
<script lang="ts"> <script lang="ts">
import { BFormInput, BFormTextarea } from 'bootstrap-vue'; import { BFormInput, BFormTextarea } from 'bootstrap-vue';
import type { UserObject } from '@coscine/api-client/dist/types/Coscine.Api.User';
import type { NamedNode, Quad_Object } from 'rdf-js'; import type { NamedNode, Quad_Object } from 'rdf-js';
import { prefixes } from '@zazuko/rdf-vocabularies'; import prefixes from '@zazuko/prefixes/prefixes';
import factory from 'rdf-ext'; import factory from 'rdf-ext';
import { defineComponent } from 'vue-demi'; import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi'; import type { PropType } from 'vue-demi';
import type { User } from '@/types/user';
export default defineComponent({ export default defineComponent({
name: 'InputTextField', name: 'InputTextField',
...@@ -75,9 +75,9 @@ export default defineComponent({ ...@@ -75,9 +75,9 @@ export default defineComponent({
}, },
userReceiver: { userReceiver: {
default: () => { default: () => {
return async () => ({} as UserObject); return async () => ({});
}, },
type: Function as PropType<() => Promise<UserObject>>, type: Function as PropType<() => Promise<User>>,
}, },
}, },
data() { data() {
......
...@@ -122,11 +122,10 @@ ...@@ -122,11 +122,10 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi'; import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi'; import type { PropType } from 'vue-demi';
import VueI18n from 'vue-i18n';
import locale from '@/locale'; import i18n from '@/plugins/i18n';
import LockIcon from 'vue-material-design-icons/Lock.vue'; import LockIcon from 'vue-material-design-icons/Lock.vue';
import LockOpenIcon from 'vue-material-design-icons/LockOpen.vue'; import LockOpenIcon from 'vue-material-design-icons/LockOpen.vue';
...@@ -152,29 +151,20 @@ import InputBooleanCombobox from './InputBooleanCombobox.vue'; ...@@ -152,29 +151,20 @@ import InputBooleanCombobox from './InputBooleanCombobox.vue';
import InputList from './InputList.vue'; import InputList from './InputList.vue';
import InputShape from './InputShape.vue'; import InputShape from './InputShape.vue';
if (Vue) {
Vue.use(VueI18n);
} else {
// TODO: Deal with Vue 3
}
const i18n = new VueI18n({
locale: 'en',
messages: locale,
silentFallbackWarn: true,
});
import type { BilingualLabels } from '@coscine/api-client/dist/types/Coscine.Api.Metadata';
import type { UserObject } from '@coscine/api-client/dist/types/Coscine.Api.User';
import type { Dataset, NamedNode, Quad_Object, Quad_Subject } from 'rdf-js'; import type { Dataset, NamedNode, Quad_Object, Quad_Subject } from 'rdf-js';
import { prefixes } from '@zazuko/rdf-vocabularies'; import prefixes from '@zazuko/prefixes/prefixes';
import factory from 'rdf-ext'; import factory from 'rdf-ext';
import { getObject, getObjectStringList } from '@/util/linkedData'; import {
getObject,
getObjectStringList,
retrieveChildren,
} from '@/util/linkedData';
import type { import type {
FixedValueObject, FixedValueObject,
FixedValues, FixedValues,
ValueType, ValueType,
} from '@/types/fixedValues'; } from '@/types/fixedValues';
import type { User } from '@/types/user';
export default defineComponent({ export default defineComponent({
i18n, i18n,
...@@ -228,18 +218,14 @@ export default defineComponent({ ...@@ -228,18 +218,14 @@ export default defineComponent({
type: Object as PropType<{ [nodeName: string]: Quad_Object[] }>, type: Object as PropType<{ [nodeName: string]: Quad_Object[] }>,
}, },
classReceiver: { classReceiver: {
default: () => { default: () => retrieveChildren,
return async () => ({} as BilingualLabels); type: Function as PropType<typeof retrieveChildren>,
},
type: Function as PropType<
(classUrl: string) => Promise<BilingualLabels>
>,
}, },
userReceiver: { userReceiver: {
default: () => { default: () => {
return async () => ({} as UserObject); return async () => ({});
}, },
type: Function as PropType<() => Promise<UserObject>>, type: Function as PropType<() => Promise<User>>,
}, },
dataset: { dataset: {
required: true, required: true,
...@@ -311,14 +297,14 @@ export default defineComponent({ ...@@ -311,14 +297,14 @@ export default defineComponent({
} }
return 'InputTextField'; return 'InputTextField';
} else { } else {
if (this.classObject) { if (this.isNode) {
return 'InputCombobox'; return 'InputShape';
} }
if (this.isList) { if (this.isList) {
return 'InputList'; return 'InputList';
} }
if (this.isNode) { if (this.classObject) {
return 'InputShape'; return 'InputCombobox';
} }
} }
return null; return null;
......
import { Vue2 as Vue } from 'vue-demi';
import VueI18n from 'vue-i18n';
import locale from '@/locale';
if (Vue) {
Vue.use(VueI18n);
} else {
// TODO: Deal with Vue 3
}
const i18n = new VueI18n({
locale: 'en',
fallbackLocale: 'en',
messages: locale,
silentFallbackWarn: true,
});
export default i18n;
// From @coscine/api-client
/**
* Bilingual labels
* @export
* @interface BilingualLabels
*/
export interface BilingualLabels {
/**
* English labels
* @type {Array<Label>}
* @memberof BilingualLabels
*/
en?: Array<Label> | null;
/**
* German labels
* @type {Array<Label>}
* @memberof BilingualLabels
*/
de?: Array<Label> | null;
}
/**
* Label of a vocabulary entry
* @export
* @interface Label
*/
export interface Label {
/**
* Name of the application profile
* @type {string}
* @memberof Label
*/
name?: string | null;
/**
* Name of the application profile
* @type {string}
* @memberof Label
*/
value?: string | null;
}