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
  • Issue/2960-infiniteLoop
  • Issue/2960-fixValidationForAP
  • dev
  • master
  • Issue/2920-fixRemovingValues
  • Hotfix/2957-styleAndUpgrade
  • Hotfix/2955-storingFail
  • Issue/2943-uiFeedback
  • Issue/2551-enhanceSymbolDescriptionsInApplicationProfile
  • Issue/2598-vue3
  • Issue/2804-templateUI
  • Issue/2805-ignoreTemplatingValues
  • Issue/2851-fixBooleanInFormGenerator
  • Issue/2759-showMissingField
  • Issue/2703-vocabularyList
  • Issue/2729-fixSlowLoadingOfInstances
  • Issue/2525-fixedFixValues
  • Hotfix/2681-validationErrors
  • testing
  • Issue/2408-hasValue
  • Issue/2353-dropShapeFix
  • Issue/2435-userApi
  • Issue/xxxx-optimizedBuild
  • Issue/2516-validationUpdate
  • Issue/xxxx-instances
  • Hotfix/2504-formGenerator
  • Hotfix/2504-formGen
  • Issue/2309-docs
  • Hotfix/2417-emptyMetadataValidation
  • Issue/2345-dealWithWeirdLists
  • Issue/2341-description
  • Issue/2318-fixedValuesFix
  • Hotfix/2296-selectedValuesNotReturned
  • Issue/2262-frontendWorkspace
  • Hotfix/xxxx-infiniteLoops
  • Hotfix/xxxx-nodePath
  • gitpod
  • Hotfix/2258-saveButtonWorksAsExpected
  • Hotfix/xxxx-notEmptyFields
  • Hotfix/2233-fixMe
  • Issue/xxxx-infiniteLoop
  • Issue/xxxx-correctTargetClass
  • Issue/2139-detailViewing
  • Issue/xxxx-extensions
  • Test/vue-demi
  • Issue/1987-shIn
  • Issue/2117-ProjectandResourceCreateInfoIcons
  • Issue/xxxx-reduceBootstrapVueBundle
  • Issue/1938-internalHandling
  • uiv2
  • Issue/2002-migrateResourceCreate
  • Issue/2035-rcv
  • Issue/1607-newDateTimeOffset
  • Issue/1826-versioning
  • Sprint/2022-01
  • Issue/1804-fixedValueFix
  • Issue/1804-fixedValueFixOld
  • Issue/1607-dateTimeOffset
  • Sprint/2021-2022
  • Sprint/2021-22
  • Experimental/Bugfixes
  • Issue/43-saveButton
  • gitkeep
  • Sprint/2021-15
  • Sprint/2021-14
  • Product/1576-formGeneratorMultiselect
  • Topic/1535-formGeneratorMultiselect
  • Topic/1535-linting
  • Sprint/2021-13
  • Sprint/2021-12
  • Product/1532-formGeneratorFeatures
  • Topic/1533-formGeneratorCleanup
  • Product/1573-ReadOnlyResources
  • Product/1107-frontendPerformance
  • Product/1210-inheritance
  • Topic/1227-frontendPerformance
  • Topic/1229-inheritance
  • Product/1215-gitlabCleanUp
  • Hotfix/1216-fixDateDesign
  • Hotfix/1197-Datepicker
  • Hotfix/1140-fixFixedValues
  • Hotfix/1142-fixFixedValues
  • Hotfix/1129-fixValidation
  • Topic/1065-clientValidation
  • Sprint/2020-19
  • Product/619-clientValidation
  • Sprint/2020-18
  • Hotfix/845-someUIChanges
  • Sprint/2020-14
  • Sprint/2020-13
  • Hotfix/920-multiSelect
  • Sprint/2020-12
  • Product/801-refactorFileMetadata
  • Topic/853-refactorFileMetadataFE
  • Sprint/2020-11
  • Product/815-cleanupApplicationProfiles
  • Topic/846-cleanupApplicationProfiles
  • Sprint/2020-10
  • Product/510-niceProjectUrl
  • Topic/804-niceProjectUrl
  • 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
  • Issue/2960-infiniteLoop
  • Issue/2960-fixValidationForAP
  • dev
  • master
  • Issue/2920-fixRemovingValues
  • Hotfix/2957-styleAndUpgrade
  • Hotfix/2955-storingFail
  • Issue/2943-uiFeedback
  • Issue/2551-enhanceSymbolDescriptionsInApplicationProfile
  • Issue/2598-vue3
  • Issue/2804-templateUI
  • Issue/2805-ignoreTemplatingValues
  • Issue/2851-fixBooleanInFormGenerator
  • Issue/2759-showMissingField
  • Issue/2703-vocabularyList
  • Issue/2729-fixSlowLoadingOfInstances
  • Issue/2525-fixedFixValues
  • Hotfix/2681-validationErrors
  • testing
  • Issue/2408-hasValue
  • Issue/2353-dropShapeFix
  • Issue/2435-userApi
  • Issue/xxxx-optimizedBuild
  • Issue/2516-validationUpdate
  • Issue/xxxx-instances
  • Hotfix/2504-formGenerator
  • Hotfix/2504-formGen
  • Issue/2309-docs
  • Hotfix/2417-emptyMetadataValidation
  • Issue/2345-dealWithWeirdLists
  • Issue/2341-description
  • Issue/2318-fixedValuesFix
  • Hotfix/2296-selectedValuesNotReturned
  • Issue/2262-frontendWorkspace
  • Hotfix/xxxx-infiniteLoops
  • Hotfix/xxxx-nodePath
  • gitpod
  • Hotfix/2258-saveButtonWorksAsExpected
  • Hotfix/xxxx-notEmptyFields
  • Hotfix/2233-fixMe
  • Issue/xxxx-infiniteLoop
  • Issue/xxxx-correctTargetClass
  • Issue/2139-detailViewing
  • Issue/xxxx-extensions
  • Test/vue-demi
  • Issue/1987-shIn
  • Issue/2117-ProjectandResourceCreateInfoIcons
  • Issue/xxxx-reduceBootstrapVueBundle
  • Issue/1938-internalHandling
  • uiv2
  • Issue/2002-migrateResourceCreate
  • Issue/2035-rcv
  • Issue/1607-newDateTimeOffset
  • Issue/1826-versioning
  • Sprint/2022-01
  • Issue/1804-fixedValueFix
  • Issue/1804-fixedValueFixOld
  • Issue/1607-dateTimeOffset
  • Sprint/2021-2022
  • Sprint/2021-22
  • Experimental/Bugfixes
  • Issue/43-saveButton
  • gitkeep
  • Sprint/2021-15
  • Sprint/2021-14
  • Product/1576-formGeneratorMultiselect
  • Topic/1535-formGeneratorMultiselect
  • Topic/1535-linting
  • Sprint/2021-13
  • Sprint/2021-12
  • Product/1532-formGeneratorFeatures
  • Topic/1533-formGeneratorCleanup
  • Product/1573-ReadOnlyResources
  • Product/1107-frontendPerformance
  • Product/1210-inheritance
  • Topic/1227-frontendPerformance
  • Topic/1229-inheritance
  • Product/1215-gitlabCleanUp
  • Hotfix/1216-fixDateDesign
  • Hotfix/1197-Datepicker
  • Hotfix/1140-fixFixedValues
  • Hotfix/1142-fixFixedValues
  • Hotfix/1129-fixValidation
  • Topic/1065-clientValidation
  • Sprint/2020-19
  • Product/619-clientValidation
  • Sprint/2020-18
  • Hotfix/845-someUIChanges
  • Sprint/2020-14
  • Sprint/2020-13
  • Hotfix/920-multiSelect
  • Sprint/2020-12
  • Product/801-refactorFileMetadata
  • Topic/853-refactorFileMetadataFE
  • Sprint/2020-11
  • Product/815-cleanupApplicationProfiles
  • Topic/846-cleanupApplicationProfiles
  • Sprint/2020-10
  • Product/510-niceProjectUrl
  • Topic/804-niceProjectUrl
  • 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
26 files
+ 5073
2559
Compare changes
  • Side-by-side
  • Inline

Files

.eslintrc.cjs

0 → 100644
+25 −0
Original line number Diff line number Diff line
/* 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',
  },
};

.eslintrc.js

deleted100644 → 0
+0 −27
Original line number Diff line number Diff line
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",
  },
};
+36 −0
Original line number Diff line number Diff line
@@ -3,11 +3,17 @@ include:
    file: 
      - /docker-runner.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:
  - build
  - test
  - publish
  - code-analysis

build-branch:
  extends: .build-branch
@@ -29,3 +35,33 @@ publish-gitlab:

publish-npm:
  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
+278 −277

File changed and moved.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
{
  "name": "eslint",
  "version": "8.28.0-sdk",
  "version": "8.43.0-sdk",
  "main": "./lib/api.js",
  "type": "commonjs"
}
+1 −1
Original line number Diff line number Diff line
{
  "name": "prettier",
  "version": "2.7.1-sdk",
  "version": "2.8.8-sdk",
  "main": "./index.js",
  "type": "commonjs"
}
+1 −1
Original line number Diff line number Diff line
{
  "name": "typescript",
  "version": "4.9.3-sdk",
  "version": "5.1.3-sdk",
  "main": "./lib/typescript.js",
  "type": "commonjs"
}
+5 −8
Original line number Diff line number Diff line
@@ -5,25 +5,22 @@ packageExtensions:
  bootstrap-vue@*:
    dependencies:
      jquery: "*"
      vue: ^2.7.8
  fork-ts-checker-webpack-plugin@*:
    dependencies:
      vue-template-compiler: ^2.7.8
      vue: ^2.7.14
  local-pkg@*:
    dependencies:
      "@vitest/coverage-c8": "*"
      jsdom: "*"
  vue-demi@*:
    dependencies:
      vue: ^2.7.10
      vue: ^2.7.14
  vue-eslint-parser@*:
    dependencies:
      "@typescript-eslint/parser": "*"
  vue-i18n@*:
    dependencies:
      vue: ^2.7.8
      vue: ^2.7.14
  vue-material-design-icons@*:
    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
+41 −49
Original line number Diff line number Diff line
{
  "name": "@coscine/form-generator",
  "version": "3.1.4",
  "version": "3.2.0",
  "main": "dist/index.umd.js",
  "module": "dist/index.mjs",
  "browser": "dist/index.js",
  "style": "dist/style.css",
  "types": "dist/index.d.ts",
  "type": "module",
  "directories": {
    "doc": "docs"
  },
@@ -26,19 +27,17 @@
    "singleQuote": true
  },
  "dependencies": {
    "@coscine/api-client": "^2.9.2",
    "@zazuko/rdf-vocabularies": "^2022.6.29",
    "@zazuko/prefixes": "^2.0.0",
    "bootstrap": "4.6.1",
    "bootstrap-vue": "^2.22.0",
    "rdf-ext": "^2.0.1",
    "rdf-parse": "^1.8.0",
    "rdf-validate-shacl": "^0.4.4",
    "stream-browserify": "^3.0.0",
    "bootstrap-vue": "^2.23.1",
    "rdf-ext": "^2.2.0",
    "rdf-parse": "^2.3.2",
    "rdf-validate-shacl": "^0.4.5",
    "uuid": "^9.0.0",
    "vue-demi": "^0.13.11",
    "vue-demi": "^0.14.5",
    "vue-i18n": "^8.22.2",
    "vue-material-design-icons": "^5.1.2",
    "vue-multiselect": "^2.1.6"
    "vue-material-design-icons": "^5.2.0",
    "vue-multiselect": "^2.1.7"
  },
  "peerDependencies": {
    "@vue/composition-api": "^1.0.0-rc.1",
@@ -51,54 +50,47 @@
  },
  "devDependencies": {
    "@hutson/semantic-delivery-gitlab": "^9.1.0",
    "@rollup/plugin-replace": "^4.0.0",
    "@semantic-release/commit-analyzer": "^9.0.2",
    "@semantic-release/commit-analyzer": "^10.0.1",
    "@semantic-release/git": "^10.0.1",
    "@semantic-release/gitlab": "^9.4.2",
    "@semantic-release/npm": "^9.0.1",
    "@semantic-release/release-notes-generator": "^10.0.3",
    "@types/node": "^18.7.18",
    "@types/rdf-ext": "^1.3.11",
    "@semantic-release/gitlab": "^12.0.3",
    "@semantic-release/npm": "^10.0.4",
    "@semantic-release/release-notes-generator": "^11.0.3",
    "@types/node": "^20.3.1",
    "@types/rdf-ext": "^2.2.0",
    "@types/rdf-js": "^4.0.1",
    "@types/rdf-validate-shacl": "^0.4.0",
    "@types/uuid": "^9.0.0",
    "@typescript-eslint/eslint-plugin": "^5.38.0",
    "@typescript-eslint/parser": "^5.38.0",
    "@vitejs/plugin-vue2": "^1.1.2",
    "@vitest/coverage-c8": "^0.25.3",
    "@vue/eslint-config-prettier": "^7.0.0",
    "@vue/eslint-config-typescript": "^11.0.1",
    "@types/rdf-validate-shacl": "^0.4.2",
    "@types/uuid": "^9.0.2",
    "@typescript-eslint/eslint-plugin": "^5.59.11",
    "@typescript-eslint/parser": "^5.59.11",
    "@vitejs/plugin-vue2": "^2.2.0",
    "@vitest/coverage-c8": "^0.32.2",
    "@vue/eslint-config-prettier": "^7.1.0",
    "@vue/eslint-config-typescript": "^11.0.3",
    "@vue/test-utils": "^1.3.0",
    "conventional-changelog-eslint": "3.0.9",
    "core-js": "^3.25.2",
    "eslint": "^8.23.1",
    "eslint-config-prettier": "^8.5.0",
    "eslint-import-resolver-node": "^0.3.6",
    "conventional-changelog-eslint": "4.0.0",
    "eslint": "^8.43.0",
    "eslint-config-prettier": "^8.8.0",
    "eslint-import-resolver-node": "^0.3.7",
    "eslint-plugin-eslint-comments": "^3.2.0",
    "eslint-plugin-functional": "^4.4.0",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-functional": "^5.0.8",
    "eslint-plugin-import": "^2.27.5",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-vue": "^9.5.1",
    "jsdom": "^20.0.3",
    "eslint-plugin-vue": "^9.15.0",
    "jsdom": "^22.1.0",
    "jsdom-global": "^3.0.2",
    "prettier": "^2.7.1",
    "rollup-plugin-node-globals": "^1.4.0",
    "rollup-plugin-node-polyfills": "^0.2.1",
    "rollup-plugin-polyfill-node": "^0.10.2",
    "semantic-release": "^19.0.5",
    "typescript": "^4.8.3",
    "vite": "^3.2.4",
    "vitest": "^0.25.3",
    "vue": "^2.7.10",
    "vue-template-compiler": "^2.7.10"
  },
  "resolutions": {
    "readable-stream": "3.6.0"
    "prettier": "^2.8.8",
    "semantic-release": "^21.0.5",
    "typescript": "^5.1.3",
    "vite": "^4.3.9",
    "vite-plugin-node-polyfills": "^0.9.0",
    "vitest": "^0.32.2",
    "vue": "^2.7.14",
    "vue-template-compiler": "^2.7.14"
  },
  "repository": {
    "type": "git",
    "url": "https://git.rwth-aachen.de/coscine/frontend/libraries/form-generator.git"
  },
  "license": "MIT",
  "packageManager": "yarn@3.5.1"
  "packageManager": "yarn@3.6.1"
}
+13 −32
Original line number Diff line number Diff line
@@ -30,42 +30,26 @@
</template>

<script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi';
import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi';

import locale from '@/locale';

import VueI18n from 'vue-i18n';

import { MetadataApi, UserApi } from '@coscine/api-client';
import i18n from '@/plugins/i18n';

import type { Dataset, Quad, Quad_Object, Quad_Subject } from 'rdf-js';
import factory from 'rdf-ext';

import WrapperInput from '@/components/WrapperInput.vue';
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 {
  FixedValueObject,
  FixedValues,
  ValueType,
} from '@/types/fixedValues';
import type DatasetExt from 'rdf-ext/lib/Dataset';

if (Vue) {
  Vue.use(VueI18n);
} else {
  // TODO: Deal with Vue 3
}

const i18n = new VueI18n({
  locale: 'en',
  messages: locale,
  silentFallbackWarn: true,
});
import { retrieveChildren } from '@/util/linkedData';
import type { User } from '@/types/user';

export default defineComponent({
  name: 'FormGenerator',
@@ -124,20 +108,14 @@ export default defineComponent({
      type: String,
    },
    classReceiver: {
      default: () => async (classUrl: string) => {
        const response = await MetadataApi.metadataGetClassInstances(classUrl);
        return response.data;
      },
      type: Function as PropType<
        (classUrl: string) => Promise<BilingualLabels>
      >,
      default: () => retrieveChildren,
      type: Function as PropType<typeof retrieveChildren>,
    },
    userReceiver: {
      default: () => async () => {
        const response = await UserApi.userGetUser();
        return response.data;
      default: () => {
        return async () => ({});
      },
      type: Function as PropType<() => Promise<UserObject>>,
      type: Function as PropType<() => Promise<User>>,
    },
  },
  data() {
@@ -594,6 +572,9 @@ export default defineComponent({
  width: 60px !important;
  max-width: 60px !important;
}
#FormGenerator .innerButton svg {
  margin: auto;
}
#FormGenerator .metadata .material-design-icon__svg {
  margin-top: -0.1em;
}
+6 −37
Original line number Diff line number Diff line
@@ -4,17 +4,9 @@ import factory from 'rdf-ext';
import SHACLValidator from 'rdf-validate-shacl';
import rdfParser from 'rdf-parse';
import { Readable } from 'stream';
import { prefixes } from '@zazuko/rdf-vocabularies';
import type {
  DataFactory,
  Dataset,
  DatasetCore,
  DatasetCoreFactory,
  Quad,
  Quad_Object,
  Quad_Subject,
} from 'rdf-js';
import type ValidationReport from 'rdf-validate-shacl/src/validation-report';
import prefixes from '@zazuko/prefixes/prefixes';
import type { Dataset, Quad, Quad_Object, Quad_Subject } from 'rdf-js';
import type { ValidationType } from '@/types/validationTypes';

export default defineComponent({
  data() {
@@ -25,20 +17,7 @@ export default defineComponent({
    };
  },
  methods: {
    fillResults(
      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>>
        >
      >
    ) {
    fillResults(currentResults: ValidationType, results: ValidationType) {
      for (const currentResult of currentResults) {
        results.push(currentResult);
        if (currentResult.detail) {
@@ -48,12 +27,7 @@ export default defineComponent({
    },
    setErrorMessages(
      metadata: Dataset,
      results: Array<
        ValidationReport.ValidationResult<
          DataFactory<Quad, Quad> &
            DatasetCoreFactory<Quad, Quad, DatasetCore<Quad, Quad>>
        >
      >,
      results: ValidationType,
      subjectNode: Quad_Subject
    ) {
      for (const result of results) {
@@ -148,12 +122,7 @@ export default defineComponent({
        this.$emit('isValid', report, clonedValidationContext);

        this.errorMessages = {};
        const results: Array<
          ValidationReport.ValidationResult<
            DataFactory<Quad, Quad> &
              DatasetCoreFactory<Quad, Quad, DatasetCore<Quad, Quad>>
          >
        > = [];
        const results: ValidationType = [];
        this.fillResults(report.results, results);
        this.setErrorMessages(clonedMetadata, results, subjectNode);

+4 −17
Original line number Diff line number Diff line
@@ -15,29 +15,16 @@
</template>

<script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi';
import { defineComponent } 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 type { NamedNode, Quad_Object } from 'rdf-js';
import factory from 'rdf-ext';
import { prefixes } from '@zazuko/rdf-vocabularies';
import type { Label } from '@coscine/api-client/dist/types/Coscine.Api.Metadata';

if (Vue) {
  Vue.use(VueI18n);
} else {
  // TODO: Deal with Vue 3
}

const i18n = new VueI18n({
  locale: 'en',
  messages: locale,
  silentFallbackWarn: true,
});
import prefixes from '@zazuko/prefixes/prefixes';
import type { Label } from '@/types/labels';

export default defineComponent({
  i18n,
+21 −28
Original line number Diff line number Diff line
@@ -15,32 +15,17 @@
</template>

<script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi';
import { defineComponent } 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';

if (Vue) {
  Vue.use(VueI18n);
} else {
  // TODO: Deal with Vue 3
}

import type {
  BilingualLabels,
  Label,
} from '@coscine/api-client/dist/types/Coscine.Api.Metadata';
import type { Label } from '@/types/labels';
import type { NamedNode, Quad_Object } from 'rdf-js';
import factory from 'rdf-ext';

const i18n = new VueI18n({
  locale: 'en',
  messages: locale,
  silentFallbackWarn: true,
});
import { retrieveChildren } from '@/util/linkedData';

export default defineComponent({
  i18n,
@@ -71,12 +56,8 @@ export default defineComponent({
      type: Object as PropType<NamedNode<string>>,
    },
    classReceiver: {
      default: () => {
        return async () => ({} as BilingualLabels);
      },
      type: Function as PropType<
        (classUrl: string) => Promise<BilingualLabels>
      >,
      default: () => retrieveChildren,
      type: Function as PropType<typeof retrieveChildren>,
    },
  },
  data() {
@@ -129,10 +110,22 @@ export default defineComponent({
      }
    },
    async retrieveLabels() {
      let classReceiver:
        | typeof retrieveChildren
        | (() => typeof retrieveChildren) = this.classReceiver;
      // Deal with weird behavior during dev builds
      try {
        const bilingualLabels = await this.classReceiver(
          this.classObject.value
        );
        // If the function has no arguments, it's not the retrieveChildren one
        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) {
          this.list = bilingualLabels.en;
        } else if (this.languageCode === 'de' && bilingualLabels.de) {
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
import { BFormDatepicker } from 'bootstrap-vue';
import type { NamedNode, Quad_Object } from 'rdf-js';
import factory from 'rdf-ext';
import { prefixes } from '@zazuko/rdf-vocabularies';
import prefixes from '@zazuko/prefixes/prefixes';

import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi';
+3 −27
Original line number Diff line number Diff line
@@ -15,33 +15,17 @@
</template>

<script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi';
import { defineComponent } 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';

if (Vue) {
  Vue.use(VueI18n);
} else {
  // TODO: Deal with Vue 3
}

import type {
  BilingualLabels,
  Label,
} from '@coscine/api-client/dist/types/Coscine.Api.Metadata';
import type { Label } from '@/types/labels';
import type { Quad_Object } from 'rdf-js';
import factory from 'rdf-ext';

const i18n = new VueI18n({
  locale: 'en',
  messages: locale,
  silentFallbackWarn: true,
});

export default defineComponent({
  i18n,
  name: 'InputCombobox',
@@ -70,14 +54,6 @@ export default defineComponent({
      required: true,
      type: Array as PropType<Array<string>>,
    },
    classReceiver: {
      default: () => {
        return async () => ({} as BilingualLabels);
      },
      type: Function as PropType<
        (classUrl: string) => Promise<BilingualLabels>
      >,
    },
  },
  data() {
    return {
+7 −28
Original line number Diff line number Diff line
@@ -18,33 +18,17 @@
</template>

<script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi';
import { defineComponent } 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 factory from 'rdf-ext';
import { BCard } from 'bootstrap-vue';
import { type FixedValues } from '@/types/fixedValues';
import { type BilingualLabels } from '@coscine/api-client/dist/types/Coscine.Api.Metadata';
import { type UserObject } from '@coscine/api-client/dist/types/Coscine.Api.User';

const i18n = new VueI18n({
  locale: 'en',
  messages: locale,
  silentFallbackWarn: true,
});
import { retrieveChildren } from '@/util/linkedData';
import type { User } from '@/types/user';

export default defineComponent({
  i18n,
  name: 'InputShape',
  components: {
    BCard,
@@ -91,18 +75,14 @@ export default defineComponent({
      type: Boolean,
    },
    classReceiver: {
      default: () => {
        return async () => ({} as BilingualLabels);
      },
      type: Function as PropType<
        (classUrl: string) => Promise<BilingualLabels>
      >,
      default: () => retrieveChildren,
      type: Function as PropType<typeof retrieveChildren>,
    },
    userReceiver: {
      default: () => {
        return async () => ({} as UserObject);
        return async () => ({});
      },
      type: Function as PropType<() => Promise<UserObject>>,
      type: Function as PropType<() => Promise<User>>,
    },
  },
  data() {
@@ -116,7 +96,6 @@ export default defineComponent({
    },
  },
  mounted() {
    i18n.locale = this.languageCode;
    this.loadData();
  },
  methods: {
+4 −4
Original line number Diff line number Diff line
@@ -22,13 +22,13 @@
<script lang="ts">
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 { prefixes } from '@zazuko/rdf-vocabularies';
import prefixes from '@zazuko/prefixes/prefixes';
import factory from 'rdf-ext';

import { defineComponent } from 'vue-demi';
import type { PropType } from 'vue-demi';
import type { User } from '@/types/user';

export default defineComponent({
  name: 'InputTextField',
@@ -75,9 +75,9 @@ export default defineComponent({
    },
    userReceiver: {
      default: () => {
        return async () => ({} as UserObject);
        return async () => ({});
      },
      type: Function as PropType<() => Promise<UserObject>>,
      type: Function as PropType<() => Promise<User>>,
    },
  },
  data() {
+17 −31
Original line number Diff line number Diff line
@@ -122,11 +122,10 @@
</template>

<script lang="ts">
import { defineComponent, Vue2 as Vue } from 'vue-demi';
import { defineComponent } 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 LockOpenIcon from 'vue-material-design-icons/LockOpen.vue';
@@ -152,29 +151,20 @@ import InputBooleanCombobox from './InputBooleanCombobox.vue';
import InputList from './InputList.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 { prefixes } from '@zazuko/rdf-vocabularies';
import prefixes from '@zazuko/prefixes/prefixes';
import factory from 'rdf-ext';
import { getObject, getObjectStringList } from '@/util/linkedData';
import {
  getObject,
  getObjectStringList,
  retrieveChildren,
} from '@/util/linkedData';
import type {
  FixedValueObject,
  FixedValues,
  ValueType,
} from '@/types/fixedValues';
import type { User } from '@/types/user';

export default defineComponent({
  i18n,
@@ -228,18 +218,14 @@ export default defineComponent({
      type: Object as PropType<{ [nodeName: string]: Quad_Object[] }>,
    },
    classReceiver: {
      default: () => {
        return async () => ({} as BilingualLabels);
      },
      type: Function as PropType<
        (classUrl: string) => Promise<BilingualLabels>
      >,
      default: () => retrieveChildren,
      type: Function as PropType<typeof retrieveChildren>,
    },
    userReceiver: {
      default: () => {
        return async () => ({} as UserObject);
        return async () => ({});
      },
      type: Function as PropType<() => Promise<UserObject>>,
      type: Function as PropType<() => Promise<User>>,
    },
    dataset: {
      required: true,
@@ -311,14 +297,14 @@ export default defineComponent({
        }
        return 'InputTextField';
      } else {
        if (this.classObject) {
          return 'InputCombobox';
        if (this.isNode) {
          return 'InputShape';
        }
        if (this.isList) {
          return 'InputList';
        }
        if (this.isNode) {
          return 'InputShape';
        if (this.classObject) {
          return 'InputCombobox';
        }
      }
      return null;

src/plugins/i18n.ts

0 → 100644
+19 −0
Original line number Diff line number Diff line
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;

src/types/labels.ts

0 → 100644
+41 −0
Original line number Diff line number Diff line
// 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;
}
+80 −0
Original line number Diff line number Diff line
export interface TerminologyResponse {
  responseHeader: ResponseHeader;
  response: Response;
  facet_counts: FacetCounts;
  highlighting: { [key: string]: FacetDates };
}

export interface FacetCounts {
  facet_queries: FacetDates;
  facet_fields: FacetFields;
  facet_dates: FacetDates;
  facet_ranges: FacetDates;
  facet_intervals: FacetDates;
  facet_heatmaps: FacetDates;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface FacetDates {}

export interface FacetFields {
  ontology_name: Array<number | string>;
  ontology_prefix: Array<number | string>;
  type: Array<number | string>;
  subset: Array<number | string>;
  is_defining_ontology: Array<number | string>;
  is_obsolete: Array<number | string>;
}

export interface Response {
  numFound: number;
  start: number;
  docs: Doc[];
}

export interface Doc {
  id: string;
  iri: string;
  short_form: string;
  label: string;
  ontology_name: Ontology;
  ontology_prefix: Ontology;
  type: Type;
  is_defining_ontology: boolean;
  obo_id?: string;
  description?: string[];
}

export enum Ontology {
  DR = 'dr',
  Premis3 = 'premis3',
}

export enum Type {
  Class = 'class',
  Individual = 'individual',
}

export interface ResponseHeader {
  status: number;
  QTime: number;
  params: Params;
}

export interface Params {
  'facet.field': string[];
  hl: string;
  fl: string;
  start: string;
  fq: string[];
  rows: string;
  'hl.simple.pre': string;
  bq: string;
  q: string;
  defType: string;
  'hl.simple.post': string;
  qf: string;
  'hl.fl': string[];
  facet: string;
  wt: string;
}

src/types/user.ts

0 → 100644
+3 −0
Original line number Diff line number Diff line
export interface User {
  displayName?: string;
}
+14 −0
Original line number Diff line number Diff line
import type ValidationReport from 'rdf-validate-shacl/src/validation-report';
import type {
  DataFactory,
  DatasetCore,
  DatasetCoreFactory,
  Quad,
} from 'rdf-js';

export type ValidationType = Array<
  ValidationReport.ValidationResult<
    DataFactory<Quad, Quad> &
      DatasetCoreFactory<Quad, Quad, DatasetCore<Quad, Quad>>
  >
>;
+22 −1
Original line number Diff line number Diff line
import { prefixes } from '@zazuko/rdf-vocabularies';
import prefixes from '@zazuko/prefixes/prefixes';
import factory from 'rdf-ext';
import type { TerminologyResponse } from '@/types/terminologyResponse';
import type { BilingualLabels } from '@/types/labels';
import type {
  Dataset,
  Literal,
@@ -70,3 +72,22 @@ export function getObjectStringList(
    .filter((quad) => quad.predicate.equals(rdfFirstNode))
    .map((quad) => quad.object.value);
}

export async function retrieveChildren(
  classUrl: string
): Promise<BilingualLabels> {
  const response = await fetch(
    `https://service.tib.eu/ts4tib/api/search?q=*&obsoletes=false&local=false&groupField=iri&childrenOf=${classUrl}&format=json`
  );
  const tibResponse: TerminologyResponse = await response.json();
  const de = tibResponse.response.docs.map((doc) => {
    return {
      name: doc.label,
      value: doc.iri,
    };
  });
  return {
    de,
    en: de,
  };
}
+15 −61
Original line number Diff line number Diff line
import path from 'node:path';
import { defineConfig } from 'vite';
import vue from "@vitejs/plugin-vue2";
import nodePolyfills from 'rollup-plugin-polyfill-node';
import globalPolyfills from 'rollup-plugin-node-globals';
import replace from '@rollup/plugin-replace';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
     "@": `${path.resolve(__dirname, "src")}`,
     './runtimeConfig': './runtimeConfig.browser', // <-- Fix from above
     stream: require.resolve('rollup-plugin-node-polyfills/polyfills/stream'),
     buffer: require.resolve('rollup-plugin-node-polyfills/polyfills/buffer-es6'),
     string_decoder: require.resolve('rollup-plugin-node-polyfills/polyfills/string-decoder'),
     process: require.resolve('rollup-plugin-node-polyfills/polyfills/process-es6'),
     util: require.resolve('rollup-plugin-node-polyfills/polyfills/util'),
     events: require.resolve('rollup-plugin-node-polyfills/polyfills/events'),
     './inherits': require.resolve('rollup-plugin-node-polyfills/polyfills/inherits'),
     './zlib-lib/binding': require.resolve('rollup-plugin-node-polyfills/polyfills/zlib-lib/binding'),
     './http-lib/request': require.resolve('rollup-plugin-node-polyfills/polyfills/http-lib/request'),
     _stream_duplex: require.resolve('rollup-plugin-node-polyfills/polyfills/readable-stream/duplex'),
     './readable-stream/duplex.js': require.resolve('rollup-plugin-node-polyfills/polyfills/readable-stream/duplex'),
     _stream_passthrough: require.resolve('rollup-plugin-node-polyfills/polyfills/readable-stream/passthrough'),
     './readable-stream/passthrough.js': require.resolve('rollup-plugin-node-polyfills/polyfills/readable-stream/passthrough'),
     _stream_readable: require.resolve('rollup-plugin-node-polyfills/polyfills/readable-stream/readable'),
     './readable-stream/readable.js': require.resolve('rollup-plugin-node-polyfills/polyfills/readable-stream/readable'),
     _stream_writable: require.resolve('rollup-plugin-node-polyfills/polyfills/readable-stream/writable'),
     './readable-stream/writable.js': require.resolve('rollup-plugin-node-polyfills/polyfills/readable-stream/writable'),
     _stream_transform: require.resolve('rollup-plugin-node-polyfills/polyfills/readable-stream/transform'),
     './readable-stream/transform.js': require.resolve('rollup-plugin-node-polyfills/polyfills/readable-stream/transform'),
    },
    dedupe: ["vue-demi"],
  },
@@ -42,56 +20,32 @@ export default defineConfig({
      formats: ['es', 'umd', 'cjs'],
    },
    rollupOptions: {
      external: ['@coscine/api-client', '@vue/composition-api', '@zazuko/rdf-vocabularies', 'vue', "vue-demi"],
      external: [
        '@vue/composition-api',
        '@zazuko/prefixes',
        'buffer',
        'rdf-parse',
        'rdf-validate-shacl',
        'vue', 
        'vue-demi'
      ],
      output: {
        // Provide global variables to use in the UMD build
        // Add external deps here
        globals: {
          buffer: 'Buffer',
          'rdf-parse': 'RdfParser',
          'rdf-validate-shacl': 'SHACLValidator',
          vue: 'Vue',
          'vue-demi': 'VueDemi'
        },
        inlineDynamicImports: false,
        manualChunks: () => 'everything.js'
      },
      plugins: [
        // Enable rollup polyfills plugin
        // used during production bundling
        nodePolyfills( /* options */ ),
        globalPolyfills(),
        replace({
          values: {
            // Fixes for rdf-parse
            'rdfParseExports.parse': 'rdfParseExports.default.parse',
            'Object.defineProperty(ContainerHandlerType, "__esModule", { value: true });': 'ContainerHandlerType = {}; Object.defineProperty(ContainerHandlerType, "__esModule", { value: true });',
            'const ContainerHandlerLanguage_1 = ContainerHandlerLanguage$1;': `const ContainerHandlerLanguage_1 = {};
            Object.defineProperty(ContainerHandlerLanguage_1, "__esModule", { value: true });
            ContainerHandlerLanguage_1.ContainerHandlerLanguage = class {
              canCombineWithGraph() {
                return false;
              }
              async handle(containers, parsingContext, util2, keys3, value, depth) {
                const language = await util2.getContainerKey(keys3[depth], keys3, depth);
                if (Array.isArray(value)) {
                  value = value.map((subValue) => ({ "@value": subValue, "@language": language }));
                } else {
                  if (typeof value !== "string") {
                    throw new jsonld_context_parser_1$7.ErrorCoded(\`Got invalid language map value, got '\${JSON.stringify(value)}', but expected string\`, jsonld_context_parser_1$7.ERROR_CODES.INVALID_LANGUAGE_MAP_VALUE);
                  }
                  value = { "@value": value, "@language": language };
                }
                await parsingContext.newOnValueJob(keys3.slice(0, keys3.length - 1), value, depth - 1, true);
                parsingContext.emittedStack[depth] = false;
              }
            };`,
            "Readable$4.call": "Readable$3.call",
            'return new Readable$3(options)': 'Object.assign(this, Readable$3.prototype, EventEmitter.prototype, Transform$2.prototype)'
          },
          delimiters: ['', ''],
          preventAssignment: false,
        })
      ],
    },
  },
  plugins: [
    nodePolyfills(),
    vue(),
  ],  
  test: {
+4415 −1928

File changed.

Preview size limit exceeded, changes collapsed.