diff --git a/public/.hermes/policies/debug-validation-report (1).json b/public/.hermes/policies/debug-validation-report (1).json new file mode 100644 index 0000000..44e3ccf --- /dev/null +++ b/public/.hermes/policies/debug-validation-report (1).json @@ -0,0 +1,14 @@ +[ + { + "@id": "_:N7dadb5f5fbbe4cbca887cdc620c43ab6", + "@type": [ + "http://www.w3.org/ns/shacl#ValidationReport" + ], + "http://www.w3.org/ns/shacl#conforms": [ + { + "@type": "http://www.w3.org/2001/XMLSchema#boolean", + "@value": true + } + ] + } +] \ No newline at end of file diff --git a/public/.hermes/policies/debug-validation-report (1).ttl b/public/.hermes/policies/debug-validation-report (1).ttl new file mode 100644 index 0000000..9b8084b --- /dev/null +++ b/public/.hermes/policies/debug-validation-report (1).ttl @@ -0,0 +1,6 @@ +@prefix sh: . +@prefix xsd: . + +[] a sh:ValidationReport ; + sh:conforms true . + diff --git a/public/.hermes/policies/debug-validation-report.json b/public/.hermes/policies/debug-validation-report.json new file mode 100644 index 0000000..c96d2a8 --- /dev/null +++ b/public/.hermes/policies/debug-validation-report.json @@ -0,0 +1,235 @@ +[ + { + "@id": "_:N8068169b02c343babe9bb8722635033a", + "@type": [ + "http://www.w3.org/ns/shacl#ValidationReport" + ], + "http://www.w3.org/ns/shacl#conforms": [ + { + "@type": "http://www.w3.org/2001/XMLSchema#boolean", + "@value": false + } + ], + "http://www.w3.org/ns/shacl#result": [ + { + "@id": "_:Na299b0ba08894a7f95ccd9234e8a247e" + } + ] + }, + { + "@id": "_:Na299b0ba08894a7f95ccd9234e8a247e", + "@type": [ + "http://www.w3.org/ns/shacl#ValidationResult" + ], + "http://www.w3.org/ns/shacl#focusNode": [ + { + "@id": "_:ne00ff720add644d5b48309d25eb5efd3b10" + } + ], + "http://www.w3.org/ns/shacl#resultMessage": [ + { + "@value": "String length not >= Literal(\"100\", datatype=xsd:integer)" + } + ], + "http://www.w3.org/ns/shacl#resultPath": [ + { + "@id": "https://schema.org/description" + } + ], + "http://www.w3.org/ns/shacl#resultSeverity": [ + { + "@id": "http://www.w3.org/ns/shacl#Violation" + } + ], + "http://www.w3.org/ns/shacl#sourceConstraintComponent": [ + { + "@id": "http://www.w3.org/ns/shacl#MinLengthConstraintComponent" + } + ], + "http://www.w3.org/ns/shacl#sourceShape": [ + { + "@id": "_:n2f40e429a2ba4abe8f8925c2ca966033b1" + } + ], + "http://www.w3.org/ns/shacl#value": [ + { + "@value": "Proof-of-concept implementation of the HERMES workflow." + } + ] + }, + { + "@id": "_:n2f40e429a2ba4abe8f8925c2ca966033b1", + "http://www.w3.org/ns/shacl#datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ], + "http://www.w3.org/ns/shacl#description": [ + { + "@value": "The software description must have a certain length." + } + ], + "http://www.w3.org/ns/shacl#minLength": [ + { + "@type": "http://www.w3.org/2001/XMLSchema#integer", + "@value": 100 + } + ], + "http://www.w3.org/ns/shacl#name": [ + { + "@value": "Long description" + } + ], + "http://www.w3.org/ns/shacl#path": [ + { + "@id": "https://schema.org/description" + } + ] + }, + { + "@id": "_:ne00ff720add644d5b48309d25eb5efd3b10", + "@type": [ + "https://schema.org/SoftwareSourceCode", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://doi.org/10.5063/schema/codemeta-2.0#readme": [ + { + "@type": "https://schema.org/URL", + "@value": "https://raw.githubusercontent.com/softwarepub/hermes/proof-of-concept/README.md" + } + ], + "https://schema.org/author": [ + { + "@id": "https://orcid.org/0000-0001-6372-3853" + }, + { + "@id": "https://orcid.org/0000-0003-1761-2591" + }, + { + "@id": "https://orcid.org/0000-0003-4925-7248" + }, + { + "@id": "_:N538b305b81934ae391b8cef6677ba07e" + }, + { + "@id": "https://orcid.org/0000-0002-2702-3419" + }, + { + "@id": "https://orcid.org/0000-0002-3145-9880" + }, + { + "@id": "https://orcid.org/0000-0001-8174-7795" + }, + { + "@id": "_:Nda10c5ecbef84b65b8015a979111ed93" + } + ], + "https://schema.org/codeRepository": [ + { + "@type": "https://schema.org/URL", + "@value": "https://github.com/hermes-hmc/hermes" + } + ], + "https://schema.org/description": [ + { + "@value": "Proof-of-concept implementation of the HERMES workflow." + } + ], + "https://schema.org/hasPart": [ + { + "@id": "_:Ncf37313a1e0340efabab1d373b7658b6" + } + ], + "https://schema.org/license": [ + { + "@value": "https://spdx.org/licenses/Apache-2.0" + } + ], + "https://schema.org/version": [ + { + "@value": "proof-of-concept" + } + ] + }, + { + "@id": "_:Ncf37313a1e0340efabab1d373b7658b6", + "@type": [ + "https://schema.org/CreativeWork", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://schema.org/associatedMedia": [ + { + "@id": "_:Ndfd4d1a0eed24ccfb2f0f32df4abbed4" + } + ], + "https://schema.org/name": [ + { + "@value": "README" + } + ] + }, + { + "@id": "_:Ndfd4d1a0eed24ccfb2f0f32df4abbed4", + "@type": [ + "https://schema.org/TextObject", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://schema.org/encodingFormat": [ + { + "@value": "text/markdown" + } + ], + "https://schema.org/url": [ + { + "@type": "https://schema.org/URL", + "@value": "https://raw.githubusercontent.com/softwarepub/hermes/proof-of-concept/README.md" + } + ] + }, + { + "@id": "_:N538b305b81934ae391b8cef6677ba07e", + "@type": [ + "https://schema.org/Organization", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://schema.org/name": [ + { + "@value": "HERMES Team" + } + ] + }, + { + "@id": "_:Nda10c5ecbef84b65b8015a979111ed93", + "@type": [ + "https://schema.org/Person", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://schema.org/affiliation": [ + { + "@id": "_:N8772291b30d041d9b1a5633fbbf68439" + } + ], + "https://schema.org/email": [ + { + "@value": "gitlab-admin+bot@hzdr.de" + } + ], + "https://schema.org/givenName": [ + { + "@value": "HIFIS Bot" + } + ] + }, + { + "@id": "_:N8772291b30d041d9b1a5633fbbf68439", + "@type": [ + "https://schema.org/Organization", + "http://www.w3.org/2000/01/rdf-schema#Resource" + ], + "https://schema.org/legalName": [ + { + "@value": "Helmholtz Federated IT Services (HIFIS)" + } + ] + } +] \ No newline at end of file diff --git a/public/.hermes/policies/debug-validation-report.ttl b/public/.hermes/policies/debug-validation-report.ttl new file mode 100644 index 0000000..744bd2f --- /dev/null +++ b/public/.hermes/policies/debug-validation-report.ttl @@ -0,0 +1,50 @@ +@prefix codemeta: . +@prefix rdfs: . +@prefix schema: . +@prefix sh: . +@prefix xsd: . + +[] a sh:ValidationReport ; + sh:conforms false ; + sh:result [ a sh:ValidationResult ; + sh:focusNode [ a rdfs:Resource, + schema:SoftwareSourceCode ; + codemeta:readme "https://raw.githubusercontent.com/softwarepub/hermes/proof-of-concept/README.md"^^schema:URL ; + schema:author [ a rdfs:Resource, + schema:Organization ; + schema:name "HERMES Team" ], + [ a rdfs:Resource, + schema:Person ; + schema:affiliation [ a rdfs:Resource, + schema:Organization ; + schema:legalName "Helmholtz Federated IT Services (HIFIS)" ] ; + schema:email "gitlab-admin+bot@hzdr.de" ; + schema:givenName "HIFIS Bot" ], + , + , + , + , + , + ; + schema:codeRepository "https://github.com/hermes-hmc/hermes"^^schema:URL ; + schema:description "Proof-of-concept implementation of the HERMES workflow." ; + schema:hasPart [ a rdfs:Resource, + schema:CreativeWork ; + schema:associatedMedia [ a rdfs:Resource, + schema:TextObject ; + schema:encodingFormat "text/markdown" ; + schema:url "https://raw.githubusercontent.com/softwarepub/hermes/proof-of-concept/README.md"^^schema:URL ] ; + schema:name "README" ] ; + schema:license "https://spdx.org/licenses/Apache-2.0" ; + schema:version "proof-of-concept" ] ; + sh:resultMessage "String length not >= Literal(\"100\", datatype=xsd:integer)" ; + sh:resultPath schema:description ; + sh:resultSeverity sh:Violation ; + sh:sourceConstraintComponent sh:MinLengthConstraintComponent ; + sh:sourceShape [ sh:datatype xsd:string ; + sh:description "The software description must have a certain length." ; + sh:minLength 100 ; + sh:name "Long description" ; + sh:path schema:description ] ; + sh:value "Proof-of-concept implementation of the HERMES workflow." ] . + diff --git a/public/.hermes/process/transport.json b/public/.hermes/process/transport.json new file mode 100644 index 0000000..4ec4858 --- /dev/null +++ b/public/.hermes/process/transport.json @@ -0,0 +1,519 @@ +{ "@context":[ [ + "https://doi.org/10.5063/schema/codemeta-2.0", + { + "hermes": "https://software-metadata.pub/ns/hermes/", + "swcard": "tba" + } + ], + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff"}, + {"conflict":"None"} + ], + "@type":[ "SoftwareSourceCode", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta" + }, + {"conflict": "None"} + ], + "author": [ + { + "@id": ["https://orcid.org/0000-0001-6372-3853", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff", + "alternative_source":{"plugin": "codemeta", + "value": "https://orcid.org/0000-0001-2345-6789", + "local_path": "codemeta.md", + "timestamp": "2025-04-18T13:28:37.657148", + "harvester": "codemeta"} + }, + {"conflict": "Curation"} + ], + "@type": ["Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName": ["German Aerospace Center (DLR)", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + + }, + "familyName": ["Meinel", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "givenName": [ "Michael", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "email": ["michael.meinel@dlr.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + }, + + { + "@id":[ "https://orcid.org/0000-0003-4925-7248", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] , + "@type": ["Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName": ["German Aerospace Center (DLR)", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta", + "alternative_source":{"plugin": "cff", + "value": "Deutsches Zentrum fuer Luft- und Raumfahrt e.V.", + "local_path": "CITATION.cff", + "timestamp": "2025-04-18T13:28:37.657148", + "harvester": "cff"} + }, + {"conflict": "Curation"} + ] + + }, + "familyName": ["Druskat", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "givenName": ["Stephan", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "email": ["stephan.druskat@dlr.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + }, + { + "@id": ["https://orcid.org/0000-0002-2702-3419", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@type":[ "Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName": ["Forschungszentrum J\u00c3\u00bclich", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta" + }, + {"conflict": "None"} + ] + }, + "familyName": ["Bertuch", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "givenName": ["Oliver", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "email": ["o.bertuch@fz-juelich.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + }, + { + "@id": ["https://orcid.org/0000-0002-3145-9880", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@type": ["Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName":[ "Helmholtz-Zentrum Dresden-Rossendorf (HZDR)", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta" + }, + {"conflict": "None"} + ] + }, + "familyName":[ "Pape", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "givenName": ["David", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "email": ["d.pape@hzdr.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + }, + { + "@id": ["https://orcid.org/0009-0005-4430-6743", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@type": ["Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName": ["German Aerospace Center (DLR)", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta" + }, + {"conflict": "None"} + ] + }, + "familyName": ["Sophie", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "policy3"} + ], + "givenName": ["Kernchen", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "policy3"} + ], + "email":["sophie.kernchen@dlr.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + }, + { + "@id": ["https://orcid.org/0009-0001-8382-4923", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@type": ["Person", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "affiliation": { + "@type": ["Organization", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "@legalName": ["Forschungszentrum J\u00c3\u00bclich", + { + "plugin": "codemeta", + "local_path": "codemeta.md", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "codemeta" + }, + {"conflict": "None"} + ] + }, + "familyName": ["Heeb", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "givenName": ["Nitai", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "email": ["n.heeb@fz-juelich.de", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ] + } + + ], + "description": ["Proof-of-concept implementation of the Software CaRD workflow.", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "policy2"} + ], + "license": ["https://spdx.org/licenses/Apache-2.0", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + "name": ["SoftwareCaRD Test", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff" + }, + {"conflict": "None"} + ], + + "version": ["0.1.0", + { + "plugin": "cff", + "local_path": "CITATION.cff", + "timestamp": "2025-03-18T13:28:37.657148", + "harvester": "cff", + "alternative_source":{"plugin": "codemeta", + "value": "0.1.1", + "local_path": "codemeta.md", + "timestamp": "2025-04-18T13:28:38.657148", + "harvester": "codemeta"} + }, + {"conflict": "Curation"} + ], + + "policies": [{"policy1": { + "name": "Policy 1", + "conforms": true}}, + {"policy2": { + "name": "Policy 2", + "conforms": false, + "resultMessage": "String length not >= Literal(\"100\", datatype=xsd:integer)" , + "resultPath": "https://schema.org/description" , + "resultSeverity": "Violation" , + "sourceConstraintComponent": "MinLengthConstraintComponent" , + "sourceShape": { "datatype": "string" , + "description": "The software description must have a certain length.", + "minLength": 100 , + "name": "Long description" , + "path": "https://schema.org/description" }, + "value": "Proof-of-concept implementation of the Software CaRD workflow." + }}, + {"policy3": { + "name": "Policy 3", + "conforms": false, + "resultMessage": "Name does not match the mapping" , + "resultPath": [["https://schema.org/familyName", "https://schema.org/givenName"]] , + "resultSeverity": "Violation" , + "sourceConstraintComponent": "MappingError" , + "sourceShape": { "datatype": "string" , + "description": "The names have to be in right order", + "name": "Name order" , + "path": [["https://schema.org/familyName", "https://schema.org/givenName"]] }, + "value": [["Sophie", "Kernchen"]] + }} + + +] +} + \ No newline at end of file diff --git a/public/callback/main.js b/public/callback/main.js index 21877c2..395b862 100644 --- a/public/callback/main.js +++ b/public/callback/main.js @@ -60,5 +60,4 @@ async function latest(projectId, token) { const pipelineId = jobData[0]["pipeline"]["id"]; window.location = `../callback?gitlab_project_id=${projectId}&gitlab_pipeline_id=${pipelineId}&gitlab_job_id=${jobId}&latest=2`; - //gitlab_pipeline_id=618554&gitlab_job_id=2513432 } diff --git a/public/curation/click.js b/public/curation/click.js new file mode 100644 index 0000000..898a92d --- /dev/null +++ b/public/curation/click.js @@ -0,0 +1,19 @@ +function showFilter() { + document.getElementById("filterDropdown").classList.toggle("show"); +} + +function filterFunction() { + var input, filter, ul, li, a, i; + input = document.getElementById("myInput"); + filter = input.value.toUpperCase(); + div = document.getElementById("filterDropdown"); + a = div.getElementsByTagName("a"); + for (i = 0; i < a.length; i++) { + txtValue = a[i].textContent || a[i].innerText; + if (txtValue.toUpperCase().indexOf(filter) > -1) { + a[i].style.display = ""; + } else { + a[i].style.display = "none"; + } + } +} \ No newline at end of file diff --git a/public/curation/curation.js b/public/curation/curation.js index 36ec687..6326e91 100644 --- a/public/curation/curation.js +++ b/public/curation/curation.js @@ -1,65 +1,139 @@ import { extract_info } from "./extract.js"; +/** +* Fetches json_document and displays their contents in a table. +* @param {Path} json_document - document do fetch data from. +*/ export function displayJSON(json_document){ + fetch(json_document) + .then(response => response.json()) + .then(data => { + const colorPalette = ["rgb(34, 198, 227)", "purple", "rgb(23, 124, 207)", "rgb(116, 75, 196)", "pink"]; + let colorPolicies = {"Curation": "red"}; + if(data["policies"]){ + for(let i=0; i response.json()) - .then(data => { - document.getElementById("test").innerHTML = 'Project '+data.name+''; - const keys = Object.keys(data); - const hermes = document.getElementById("hermes"); - const tags = document.getElementById("tags"); - const tbl = document.createElement("table"); - const tblBody = document.createElement("tbody"); + //If your seeing a data snippet, create button to go back + const back = document.createElement("button"); + back.innerText = "Back to Overview"; + back.onclick = () => {window.location = window.location.href.split('?')[0];} + document.body.appendChild(back); + } + + // Apply and fill in the template for Metadata + const keys = Object.keys(data); - const tblTags = document.createElement("table"); - const tblBodyTags = document.createElement("tbody"); + const metadateTemp = document.querySelector("#metadate"); + const tbody = document.querySelector("#metadata"); + const policyTemp = document.querySelector("#policy"), + policyDiv = document.querySelector("#sw-policies"); + + + + const header = document.querySelector("#header-policies"); + header.style.display = "none"; - - // creating all cells - keys.forEach(element => { - // creates a table row - const row = document.createElement("tr"); - const rowTags = document.createElement("tr"); + keys.forEach(element => { + // Get a something with Name as p Header + if(element.toLowerCase().includes("name")){ + document.getElementById("project-name").innerHTML = element.charAt(0).toUpperCase() + element.slice(1) +' '+data[element][0]+''; + } + // Apply and fill in the template for Policies + if(element=="policies"){ + header.style.display = "block"; + data[element].forEach(pol =>{ + const policy = document.importNode(policyTemp.content, true); + const tbodyPol = policy.querySelector("tbody"), + polname = policy.querySelector("#policy-name"), + polcolor = policy.querySelector("#color"), + pconforms = policy.querySelector("#policy-conforms"); + const policyId = Object.keys(pol)[0]; + console.log(policyId); + polname.textContent = `${pol[policyId]["name"]}`; + //const randColor = '#'+(0x1000000+Math.random()*0xffffff).toString(16).slice(1,7); + polcolor.id += '_'+policyId; + polcolor.style.background = colorPolicies[policyId]; + console.log(colorPolicies); + policyDiv.appendChild(policy); - const cell = document.createElement("td"); - const cell2 = document.createElement("td"); - const cellText = document.createTextNode(` ${element}`); - const cellText2 = document.createElement('div'); + const policyReportTemp = document.querySelector("#policy-report"); + const polKeys = Object.keys(pol[policyId]); + polKeys.forEach(report =>{ + const prow = document.importNode(policyReportTemp.content, true); + + const pkey = prow.querySelector("#pkey"), + pvalue = prow.querySelector("#pvalue"); + + if(report=="conforms"){ + pconforms.innerText = `${pol[policyId]["name"]} ${(pol[policyId][report]) ? 'is' : 'is not'} conform.`; + pconforms.style.color = (pol[policyId][report]) ? 'green' : 'red'; + } + pkey.textContent = `${report}`; + extract_info(pvalue, pol[policyId][report]); - const cellTag = document.createElement("td"); - const cellTextTag = document.createElement('div'); + tbodyPol.appendChild(prow); + }) + }) - extract_info(cellText2, data[element], cellTextTag, element); - cell.appendChild(cellText); - cell2.appendChild(cellText2); - row.appendChild(cell); - row.appendChild(cell2); + return; + } + + // Apply and fill in the template for Metadata + const row = document.importNode(metadateTemp.content, true); + const mkey = row.querySelector("#key"), + mvalue = row.querySelector("#value"), + mtag = row.querySelector("#tag"); - - cellTag.appendChild(cellTextTag); - rowTags.appendChild(cellTag); + mkey.textContent = `${element}`; + extract_info(mvalue, data[element], mtag, colorPolicies); - - // add the row to the end of the table body - tblBody.appendChild(row); - tblBodyTags.appendChild(rowTags); - }) - tbl.appendChild(tblBody); - hermes.appendChild(tbl); + tbody.appendChild(row); + }) + }) + //Extend Checkbox for metadata source + const checkbox = document.querySelector("#extended"); +checkbox.addEventListener('change', (event)=>{ + if(checkbox.checked){ + document.getElementById("col2").style.visibility = ""; +}else{ + document.getElementById("col2").style.visibility = "collapse"; +} + +}) - tblTags.appendChild(tblBodyTags); - tags.appendChild(tblTags); - }) } -const checkbox = document.getElementById("extended"); -checkbox.addEventListener('change', (event)=>{ - if(checkbox.checked){ - document.getElementById("tags").style.display = "block"; - }else{ - document.getElementById("tags").style.display = "none"; +/** +* Function to get a smaller object from the orginal object. +* searches through data till skey and svalue match and return the data from this point. +* @param {Dictonary} data - Object(dict) to search from +* @param {string} skey - search key for key-value pair to get data from +* @param {} svalue - search value for key-value pair to get data from +*/ +function get_data_snippet(data, skey, svalue){ + + const stack = [data]; + while (stack?.length > 0) { + const obj = stack.pop(); + for(let i=0; i response.json()) - .then(tags => { - if(typeof obj === "string" || typeof obj == "number"){ - element.appendChild(document.createTextNode(` ${obj}`)); - tag.appendChild(document.createTextNode(`${tags[category]["local_path"]}`)); - } - else if(typeof obj === "object" && Array.isArray(obj) === false){ - element.appendChild(document.createTextNode(` ${JSON.stringify(obj)}`)); - tag.appendChild(document.createTextNode("Blocker")); - } - else if(Array.isArray(obj) && Object.keys(obj[0]).includes("familyName")){ - const divTag = document.createElement("div"); - divTag.classList.add("elements"); - obj.forEach(e =>{ - //const name = e.exec("familyName"); - extract_person(e, element); - const tag = document.createElement("div"); - tag.classList.add("tooltip"); - tag.appendChild(document.createTextNode("See Person")); - divTag.appendChild(tag); - }) - tag.appendChild(divTag); - } - else{ - const names = []; - const div = document.createElement("div"); - div.classList.add("elements"); - const divTag = document.createElement("div"); - div.classList.add("elements"); - obj.forEach(e =>{ - - names.push(JSON.stringify(e).replaceAll("{","").replaceAll("}","")); - const element = document.createElement("div"); - element.appendChild(document.createTextNode(` ${JSON.stringify(e).replaceAll("{","").replaceAll("}","").replaceAll('"',"")}`)); - div.appendChild(element); +function extract_info(cell, obj, tag, colorPolicies){ + if(!Array.isArray(obj)){ + obj = [obj]; + } + if(typeof obj[0] === "string" || typeof obj[0] == "number" || typeof obj[0] == "boolean"){ + if(obj[2] && obj[2]["conflict"]){ + const element = document.createElement("div"); + element.style.color = colorPolicies[obj[2]["conflict"]]; + element.appendChild(document.createTextNode(` ${obj[0]}`)); + cell.appendChild(element); + }else{ + cell.appendChild(document.createTextNode(` ${obj[0]}`)); + } + + } + else if(!Array.isArray(obj[0]) && Object.keys(obj[0]).includes("familyName")){ + obj.forEach(e =>{ + const element = document.createElement("div"); + extract_person(e, element, tag, colorPolicies); + cell.appendChild(element); + + })} + else if(Array.isArray(obj[0])){ + obj[0].forEach(e =>{ + const element = document.createElement("div"); + extract_info(element, e, tag); + //element.appendChild(document.createTextNode(`hh ${e}`)); + cell.appendChild(element); + + + }) + } + else{ + const div = document.createElement("div"); + for (let key in obj[0]) { + if(typeof obj[0][key]=== "string" || typeof obj[0][key] == "number"){ + div.appendChild(document.createTextNode(`${key}: ${(obj[0][key])}`)); + }else{ + div.appendChild(document.createTextNode(`${key}: `)); + extract_info(div, obj[0][key], tag, colorPolicies); + } + div.appendChild(document.createElement("br")); + } + cell.appendChild(div); + } + if(obj[1] && Object.keys(obj[1]).includes("local_path")){ + const divTag = document.createElement("div"); + divTag.classList.add("tag"); + divTag.appendChild(document.createTextNode(`${obj[1]["local_path"]}`)); + tag.appendChild(divTag); + } - const tag = document.createElement("div"); - tag.appendChild(document.createTextNode("Blocker")); - divTag.appendChild(tag); - }) - //const text = document.createTextNode(` ${names}`); - element.appendChild(div); - tag.appendChild(divTag); } - }) -} - function extract_person(e, element){ + function extract_person(e, element, tag, colorPolicies){ const tooltip = document.createElement("div"); + const tooltiptag = document.createElement("div"); tooltip.classList.add("tooltip"); tooltip.onclick = function(){link_to_person(e)}; const tooltiptext = document.createElement("div"); tooltiptext.classList.add("tooltiptext"); - const text = document.createTextNode(`${e.familyName}, ${e.givenName} `); - if(e.familyName === "Sophie"){ - tooltip.className += " error" + const text = document.createTextNode(`${e.familyName[0]}, ${e.givenName[0]} `); + tooltiptag.appendChild(document.createTextNode("See Details")); + tooltiptag.appendChild(document.createElement("br")); + tooltiptag.onclick = function(){link_to_person(e)}; + tag.appendChild(tooltiptag); + //const data = JSON.stringify(e, null, 2); + + const names = []; + Object.keys(e).forEach(k => { + const pair = document.createElement("p"); + if(!Array.isArray(e[k])){ + for (let key in e[k]) { + const pair_in_list = document.createElement("p"); + names.push(`${k}:${key}: ${e[k][key][0]}`); + pair_in_list.appendChild(document.createTextNode(`${k}:${key}: ${e[k][key][0]}`)); + if(e[k][key][2] && e[k][key][2]["conflict"]){ + pair_in_list.style.color = colorPolicies[e[k][key][2]["conflict"]]; + tooltiptag.style.color = colorPolicies[e[k][key][2]["conflict"]]; + /*pair_in_list.className += " error"; + tooltiptag.className += " error";*/ + } + pair.appendChild(pair_in_list); + } + }else{ + names.push(`${k}: ${e[k][0]}`); + pair.appendChild(document.createTextNode(`${k}: ${e[k][0]}`)); + + if(e[k][2] && e[k][2]["conflict"]){ + pair.style.color = colorPolicies[e[k][2]["conflict"]]; + tooltiptag.style.color = colorPolicies[e[k][2]["conflict"]]; + //pair.className += " error"; + //tooltiptag.className += " error"; + } } - const data = JSON.stringify(e, null, 2); - tooltiptext.appendChild(document.createTextNode(`${data.replaceAll("{","\t").replaceAll("}","\t")}`)); //{.*\n*\t*.*\n*} + tooltiptext.appendChild(pair); + }) + //tooltiptext.appendChild(document.createTextNode(`${names.toString().replaceAll(",","\n")}`)); tooltip.appendChild(tooltiptext); tooltip.appendChild(text); element.appendChild(tooltip); } function link_to_person(data){ - document.body.innerHTML = '

'; - document.getElementById("test").innerHTML = 'Person '+data.familyName+''; - const keys = Object.keys(data); - const hermes = document.getElementById("hermes"); - const tbl = document.createElement("table"); - const tblBody = document.createElement("tbody"); - - const tags = document.getElementById("tags"); - const tblTags = document.createElement("table"); - const tblBodyTags = document.createElement("tbody"); - - // creating all cells - keys.forEach(element => { - // creates a table row - const row = document.createElement("tr"); - const rowTags = document.createElement("tr"); - - const cell = document.createElement("td"); - const cell2 = document.createElement("td"); - const cellText = document.createTextNode(` ${element}`); - const cellText2 = document.createElement('div'); - - const cellTag = document.createElement("td"); - const cellTextTag = document.createElement('div'); - - extract_info(cellText2, data[element], cellTextTag, "author[0]."+element); - //cellText2.appendChild(document.createTextNode(` ${data.affiliation[element]}`)); - cell.appendChild(cellText); - cell2.appendChild(cellText2); - row.appendChild(cell); - row.appendChild(cell2); - - cellTag.appendChild(cellTextTag); - rowTags.appendChild(cellTag); - - - - // add the row to the end of the table body - tblBody.appendChild(row); - tblBodyTags.appendChild(rowTags); - }) - tbl.appendChild(tblBody); - hermes.appendChild(tbl); - - tblTags.appendChild(tblBodyTags); - tags.appendChild(tblTags); - + window.location.href += `?id=${data["@id"][0]}`; } + export {extract_info}; diff --git a/public/curation/index.html b/public/curation/index.html index 89f9640..50eec4c 100644 --- a/public/curation/index.html +++ b/public/curation/index.html @@ -20,21 +20,73 @@

Software CaRD -

+

Metadata

+
+ + + + +
+
-
+
+ + + + + + + + + + +
+ +
+
+

Policy Report

+ +
-
- -
-
-
+ diff --git a/public/curation/person.html b/public/curation/person.html deleted file mode 100644 index 92be1a3..0000000 --- a/public/curation/person.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - Software CaRD - - - - - -

- -
-
-
- -
- - - - - \ No newline at end of file diff --git a/public/curation/script.js b/public/curation/script.js index 20fc8aa..41f9d41 100644 --- a/public/curation/script.js +++ b/public/curation/script.js @@ -16,4 +16,4 @@ drawRadar(ctx, canvas.offsetWidth/2,canvas.offsetHeight/2, [15,15,10,15,15,12], drawRadar(ctx, canvas.offsetWidth/2,canvas.offsetHeight/2, [20,20,9,10,20,15], "blue", "rgba(94, 148, 215, 0.34)"); //View for Curation -displayJSON("../.hermes/process/hermes.json"); +displayJSON("../.hermes/process/transport.json"); diff --git a/public/dashboard/main.js b/public/dashboard/main.js index 07e56c8..a5a4d59 100644 --- a/public/dashboard/main.js +++ b/public/dashboard/main.js @@ -7,7 +7,7 @@ window.onload = async function () { const token = localStorage.getItem("gitlab-api-token"); if (!token) { alert("Please set up the GitLab connection first!"); - window.location = "./"; + window.location = "../"; return; } diff --git a/public/main.js b/public/main.js index d52c67c..5761d97 100644 --- a/public/main.js +++ b/public/main.js @@ -14,4 +14,10 @@ window.onload = async function () { await deleteAllPipelines(); window.location = "./"; } + + const clearPipelineDataButton = document.getElementById("clear-pipeline-button"); + clearPipelineDataButton.onclick = async function() { + await deleteAllPipelines(); + window.location = "./"; + } } diff --git a/public/style.css b/public/style.css index 368f3ea..b2627fd 100644 --- a/public/style.css +++ b/public/style.css @@ -13,14 +13,12 @@ a{ } table { - display: flex; - align-items: center; - justify-content: center; -} -tbody { border: 1px solid; + border-collapse: collapse; + width:100%; } + th, td, tr { border: 1px solid; padding-inline: 10px; @@ -37,20 +35,28 @@ button{ justify-content: center; padding: 1%; } +#header-policies{ + display: none; + ; +} #content{ display: flex; - align-items: stretch; + justify-content: center; + align-items: center; + flex-direction: column; +} +#hermes{ + width: 80%; + display: flex; justify-content: center; } -.elements{ +.conflict-operators{ display: flex; + flex-direction: row; align-items: center; justify-content: flex-end; - flex-direction: column; - flex-wrap: nowrap; - } .tooltip { @@ -66,12 +72,17 @@ color: #fff; text-align: center; position: absolute; z-index: 1; +width: 80%; +padding: 10px; bottom: 125%; -left:20%; -translate: -12%; +left: 10%; opacity: 0; transition: opacity 0.3s; - +border-radius: 12px; +} +.tooltip .tooltiptext p{ +font-size: large; +margin: 0px; } .tooltip .tooltiptext::after { @@ -91,6 +102,93 @@ visibility: visible; opacity: 1; } +button{ + border-radius: 12px; + background-image: -webkit-linear-gradient(166.66deg, rgb(34, 198, 227) 4.62%, rgb(23, 124, 207) 10.62%, rgb(116, 75, 196) 86.29%); + color: white; + border-color: white; + padding: 10px; +} .error{ color: red; + border-color:black; +} +.policy-header{ + display: flex; + align-items: center; + justify-content: center; + +} +.policy-color{ + width:10px; + height:10px; + border-radius: 5px; + background-color: blue; + margin: 7px; +} + +/* Dropdown Button */ +.dropbtn { + font-size: 16px; + border: none; + cursor: pointer; + width: 100px; + height: 30px; + text-align: center; + background-image: none; + background-color: #ddd; + color:black + +} + +/* Dropdown button on hover & focus */ +.dropbtn:hover, .dropbtn:focus { + background-color: rgb(23, 124, 207); +} + +/* The search field */ +#myInput { + box-sizing: border-box; + background-image: url('searchicon.png'); + background-position: 14px 12px; + background-repeat: no-repeat; + font-size: 16px; + padding: 10px; + border: none; + border-bottom: 1px solid #ddd; } + +/* The search field when it gets focus/clicked on */ +#myInput:focus {outline: 3px solid #ddd;} + +.dropdown { + position: relative; + display: inline-block; + left: 41%; + top: -15px; +} + +/* Dropdown Content (Hidden by Default) */ +.dropdown-content { + display: none; + position: absolute; + top: 35px; + background-color: #f6f6f6; + min-width: 50px; + border: 1px solid #ddd; + z-index: 1; +} + +/* Links inside the dropdown */ +.dropdown-content a { + color: black; + padding: 5px; + text-decoration: none; + display: block; +} + +/* Change color of dropdown links on hover */ +.dropdown-content a:hover {background-color: #f1f1f1} + +/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */ +.show {display:block;} \ No newline at end of file