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
Loading items

Target

Select target project
  • coscine/frontend/apps/ui
1 result
Select Git revision
Loading items
Show changes
Commits on Source (21)
Showing
with 539 additions and 174 deletions
......@@ -21,30 +21,38 @@ Currently available routes in Coscine (Vue Router):
(For a specific branch, build such a URL: `https://gitpod.io/#https://git.rwth-aachen.de/coscine/frontend/apps/ui/tree/{branch}`)
## Starting the App
So, since we want to have it running on the root url at some point
- Change the following Consul key's value key:
## Commands
This project uses [Yarn](https://yarnpkg.com/) and [Node.js](https://nodejs.org/en/) to manage its dependencies.
### Project setup
```
yarn install
```
traefik/backends/sharepoint/servers/sharepoint/url
### Compiles and hot-reloads for development
```
yarn dev
```
value (replace `XX` with your machine's name):
### Compiles and minifies for production
```
http://d-spXX.devlef.campus.rwth-aachen.de:9234
yarn build
```
- This will disable your current Coscine instance, so to activate it back, remove the `:<PORT>` from the value.
1. Run integrator script on branch `uiv2`
2. Add required frontend libraries to your workspace if necessary (e.g. here `api-client` and `form-generator`):
```json
"workspaces": [
"apps/ui",
"libraries/form-generator",
"libraries/api-client"
]
### Runs the minified production build
```
yarn preview
```
3. For each library checkout the relevant branch and execute `yarn install`, then `yarn build`
- Here: `api-client` on branch `dev`/`master`, then `yarn install` and `yarn build`
- Here: `form-generator` on branch `dev`/`master`, then `yarn install` and `yarn build`
5. Check out the UI project on the provided repository branch. Start the app locally and execute `yarn install`, then `yarn dev`
6. Change your Consul key according to the [Readme](https://git.rwth-aachen.de/coscine/frontend/apps/ui/-/blob/main/README.md) (see above)
7. App is now running on your root (/) domain name, and not under `.../coscine/apps/ui/....` (e.g. https://d-sp16.devlef.campus.rwth-aachen.de/)
### Lints files
```
yarn lint
```
### Lints and fixes files
```
yarn lint:fix
```
{
"name": "ui",
"version": "1.23.6",
"version": "1.24.0",
"private": true,
"scripts": {
"dev": "vite",
......@@ -101,7 +101,7 @@
"vitest": "^0.27.1",
"vue-template-compiler": "^2.7.14"
},
"packageManager": "yarn@3.3.1",
"packageManager": "yarn@3.4.1",
"resolutions": {
"readable-stream": "3.6.0"
}
......
......@@ -5,17 +5,12 @@
<LoadingIndicator />
</header>
<div>
<div v-if="!navigationError">
<SidebarMenu v-if="isLoggedIn && areTosAccepted" />
<main
:class="
sidebarMenuToggled && isLoggedIn && areTosAccepted
? 'sidebar-active'
: 'sidebar-inactive'
"
>
<main :class="mainContainerSizing">
<b-container fluid>
<Pilot v-if="isLoggedIn" />
<Pilot />
<Maintenance />
<BreadCrumbs v-if="isLoggedIn && areTosAccepted" />
<RouterView />
......@@ -30,6 +25,10 @@
<RouterView />
</main>
</div>
<!-- Footer -->
<Footer v-if="!isLoggedIn" />
</div>
</template>
<script lang="ts">
......@@ -38,17 +37,15 @@ import { defineComponent } from "vue";
// import the main store
import useMainStore from "@/store/index";
import useLoginStore from "@/modules/login/store";
import useProjectStore from "@/modules/project/store";
import useUserStore from "@/modules/user/store";
export default defineComponent({
setup() {
const mainStore = useMainStore();
const loginStore = useLoginStore();
const projectStore = useProjectStore();
const userStore = useUserStore();
return { mainStore, loginStore, projectStore, userStore };
return { mainStore, loginStore, userStore };
},
computed: {
......@@ -77,6 +74,16 @@ export default defineComponent({
return true;
} else return false;
},
mainContainerSizing(): string {
if (this.isLoggedIn && this.areTosAccepted) {
// User is logged in, sidebar is present.
return this.sidebarMenuToggled ? "sidebar-active" : "sidebar-inactive";
} else {
// User is not logged in, no sidebar. Center overlay.
return "px-4";
}
},
},
watch: {
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 256 256" style="enable-background:new 0 0 256 256;" xml:space="preserve">
<style type="text/css">
.st0{fill:#A6CE39;}
.st1{fill:#FFFFFF;}
</style>
<path class="st0" d="M256,128c0,70.7-57.3,128-128,128C57.3,256,0,198.7,0,128C0,57.3,57.3,0,128,0C198.7,0,256,57.3,256,128z"/>
<g>
<path class="st1" d="M86.3,186.2H70.9V79.1h15.4v48.4V186.2z"/>
<path class="st1" d="M108.9,79.1h41.6c39.6,0,57,28.3,57,53.6c0,27.5-21.5,53.6-56.8,53.6h-41.8V79.1z M124.3,172.4h24.5
c34.9,0,42.9-26.5,42.9-39.7c0-21.5-13.7-39.7-43.7-39.7h-23.7V172.4z"/>
<path class="st1" d="M88.7,56.8c0,5.5-4.5,10.1-10.1,10.1c-5.6,0-10.1-4.6-10.1-10.1c0-5.6,4.5-10.1,10.1-10.1
C84.2,46.7,88.7,51.3,88.7,56.8z"/>
</g>
</svg>
\ No newline at end of file
......@@ -11,6 +11,7 @@ declare module 'vue' {
CoscineHeadline: typeof import('./components/coscine/CoscineHeadline.vue')['default']
CoscineModal: typeof import('./components/coscine/CoscineModal.vue')['default']
ExpiryToast: typeof import('./components/toasts/ExpiryToast.vue')['default']
Footer: typeof import('./components/elements/Footer.vue')['default']
LoadingIndicator: typeof import('./components/elements/LoadingIndicator.vue')['default']
LoadingSpinner: typeof import('./components/coscine/LoadingSpinner.vue')['default']
Maintenance: typeof import('./components/banner/Maintenance.vue')['default']
......
<template>
<b-navbar fixed="bottom" type="dark" variant="dark">
<b-collapse
id="nav-collapse"
class="small d-flex justify-content-center"
is-nav
>
<b-navbar-nav>
<!-- Coscine -->
<b-nav-item :href="$t('nav.url.extrasHelp').toString()" target="_blank">
<u>{{ $t("nav.coscine") }}</u>
</b-nav-item>
<div class="vl" />
<!-- Privacy Policy -->
<b-nav-item
:href="$t('nav.url.extrasDisclaimer').toString()"
target="_blank"
>
<u>{{ $t("nav.privacyPolicy") }}</u>
</b-nav-item>
<div class="vl" />
<!-- Imprint -->
<b-nav-item
:href="$t('nav.url.extrasImprint').toString()"
target="_blank"
>
<u>{{ $t("nav.extrasImprint") }}</u>
</b-nav-item>
</b-navbar-nav>
</b-collapse>
</b-navbar>
</template>
<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({});
</script>
<style scoped>
.vl {
border-left: 1px solid grey;
height: 15px;
margin-top: 10px;
}
</style>
......@@ -3,7 +3,8 @@
<b-navbar toggleable="md" type="dark" variant="dark" sticky>
<!-- Coscine Logo -->
<b-navbar-brand id="coscineLogo">
<RouterLink :to="{ name: 'home' }">
<!-- Added conditional navigation to avoid navigation guard errors in the console -->
<RouterLink :to="isLoggedIn ? { name: 'home' } : ''">
<img
alt="Coscine Logo"
src="@/assets/svg/coscine_white.svg"
......@@ -15,7 +16,7 @@
<b-navbar-toggle target="nav-collapse" class="b-0" />
<b-collapse id="nav-collapse" is-nav>
<!-- Search Bar -->
<b-navbar-nav class="ml-auto px-2">
<b-navbar-nav v-if="isLoggedIn" class="ml-auto px-2">
<b-nav-form @submit.stop.prevent="triggerSearch">
<b-input-group size="sm" class="searchBar">
<template #prepend>
......@@ -54,7 +55,7 @@
</b-dropdown-item>
</b-nav-item-dropdown>
<b-nav-item-dropdown text="?" right>
<b-nav-item-dropdown v-if="isLoggedIn" text="?" right>
<!-- Help -->
<b-dropdown-item
:href="$t('nav.url.extrasHelp').toString()"
......@@ -118,7 +119,12 @@
:to="{ name: 'login' }"
custom
>
<b-nav-item right :disabled="isActive" :href="href">
<b-nav-item
v-if="isLoggedIn"
right
:disabled="isActive"
:href="href"
>
{{ $t("nav.userLogIn") }}
</b-nav-item>
</router-link>
......
import { type SearchState } from "@/modules/search/types";
import { ItemSearchResult } from "@coscine/api-client/dist/types/Coscine.Api.Search";
export const testSearchState: SearchState = {
searchResults: [
{
graphName:
"https://purl.org/coscine/resources/eb0aa249-1a82-4d5e-832d-140867eaf6a2/VVM ToDo.txt/",
type: "Metadata",
source: {
isPublic: false,
date_created: "2021-07-24",
date_created_year: "2021",
date_created_month: "July",
date_created_day: "24",
measurement_date: "2021-07-13",
measurement_date_year: "2021",
measurement_date_month: "July",
measurement_date_day: "13",
creator: "Petar Hristov",
identifier: "TEST",
"external/alias_id": "TESTING THIS",
belongsToProject:
"https://purl.org/coscine/projects/9d70fff5-9465-40f7-b8d7-16fd814a502d",
absolutefilename: "VVM ToDo.txt",
fileName: "VVM ToDo.txt",
graphName:
"https://purl.org/coscine/resources/eb0aa249-1a82-4d5e-832d-140867eaf6a2/VVM ToDo.txt/",
homepage:
"https://coscine.rwth-aachen.de/p/sprint2021-12/r/eb0aa249-1a82-4d5e-832d-140867eaf6a2/#/VVM ToDo.txt",
version: "1672847985",
structureType: "https://purl.org/coscine/terms/structure#Metadata",
},
},
{
graphName:
"https://purl.org/coscine/resources/7edd4f50-ce18-4dcd-9eba-c27ad7b54dfb",
type: "Resource",
source: {
archived: false,
deleted: false,
isPublic: false,
alternative_title: "VVM InD",
conforms_to: "https://purl.org/coscine/ap/vvm/ind/",
creator:
"https://purl.org/coscine/users/1c77d05e-e949-43dc-86e8-944758d3f191",
rights: "",
homepage:
"https://hdl.handle.net/21.11102/7edd4f50-ce18-4dcd-9eba-c27ad7b54dfb",
title: "VVM InD",
description: "Test",
service:
"https://purl.org/coscine/resourcetypes/d0ce723a-edf8-49f8-b2ac-34d7251cf104",
visibility: "https://purl.org/coscine/terms/visibility#projectMember",
fixedvalues:
'{\r\n "https://purl.org/coscine/ap/vvm/ind/converterName": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/converterVersion": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/dayTimeStart": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/dayTimeEnd": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/formatVersion": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/formatName": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/naturalBehavior": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/naturalExposure": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/recorderNumber": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/recordingNumber": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/parentRecordingNumber": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/referencePointLon": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/referencePointLat": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/scenarioType": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/criticalityPhenomena": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/intersection": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/refModality": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n },\r\n "https://purl.org/coscine/ap/vvm/ind/comment": {\r\n "https://purl.org/coscine/invisible": [\r\n {\r\n "value": "0",\r\n "type": "literal"\r\n }\r\n ],\r\n "https://purl.org/coscine/defaultValue": []\r\n }\r\n}',
archived_written: "archived false",
catalog:
"https://purl.org/coscine/resources/7edd4f50-ce18-4dcd-9eba-c27ad7b54dfb/Cool%20Drawing%20Bro.png",
deleted_written: "deleted false",
agentgroup:
"https://purl.org/coscine/projects/11ba01d8-16ec-4d70-a9d5-82099cd6f885",
accessto:
"https://purl.org/coscine/resources/7edd4f50-ce18-4dcd-9eba-c27ad7b54dfb",
default:
"https://purl.org/coscine/resources/7edd4f50-ce18-4dcd-9eba-c27ad7b54dfb",
mode: "http://www.w3.org/ns/auth/acl#Read",
belongsToProject:
"https://purl.org/coscine/projects/11ba01d8-16ec-4d70-a9d5-82099cd6f885",
graphName:
"https://purl.org/coscine/resources/7edd4f50-ce18-4dcd-9eba-c27ad7b54dfb",
structureType: "https://purl.org/coscine/terms/structure#Resource",
},
},
{
graphName:
"https://purl.org/coscine/projects/ae752d5b-7bfe-4d27-8d60-ed7b5b33a985",
type: "Project",
source: {
deleted: false,
isPublic: false,
alternative_title: "Coscine Support VVM",
rights_holder: "Marius Politze, Michael Hoß, Petar Hristov",
subject: "HDF5",
homepage:
"https://hdl.handle.net/21.11102/ae752d5b-7bfe-4d27-8d60-ed7b5b33a985",
startdate: "01.01.2021 14:53:00",
startdate_year: "2021",
startdate_month: "January",
startdate_day: "1",
enddate: "30.06.2023 12:53:00",
enddate_year: "2023",
enddate_month: "June",
enddate_day: "30",
funding: "",
visibility: "https://purl.org/coscine/terms/visibility#projectMember",
slug: "coscine-support-vvm",
title: "Coscine Support VVM",
description:
"Project to support the research project VVM with Coscine at RWTH Aachen",
hasmember:
"https://purl.org/coscine/users/d9806b66-6b2e-423c-8a8d-f490ad628d07",
organization: "https://ror.org/04xfq0f34#ORG-93BEG",
deleted_written: "deleted false",
catalog:
"https://purl.org/coscine/resources/b77da7f0-651d-48a6-9576-4ab1f166f6e0",
member:
"https://purl.org/coscine/users/d302cb44-c934-4b54-a581-9765cab96fca",
role: "https://purl.org/coscine/roles/508b6d4e-c6ac-4aa5-8a8d-caa31dd39527",
belongsToProject:
"https://purl.org/coscine/projects/ae752d5b-7bfe-4d27-8d60-ed7b5b33a985",
graphName:
"https://purl.org/coscine/projects/ae752d5b-7bfe-4d27-8d60-ed7b5b33a985",
structureType: "https://purl.org/coscine/terms/structure#Project",
},
},
{
graphName:
"https://purl.org/coscine/projects/564e629c-5e21-41d3-b6a9-d25878f7cbb9",
type: "Project",
source: {
deleted: false,
isPublic: false,
alternative_title: "VVM",
rights_holder: "Roland Galbas, Dr. Mark Schiementz",
homepage:
"https://hdl.handle.net/21.11102/564e629c-5e21-41d3-b6a9-d25878f7cbb9",
startdate: "01.07.2019 00:00:00",
startdate_year: "2019",
startdate_month: "July",
startdate_day: "1",
enddate: "30.06.2023 00:00:00",
enddate_year: "2023",
enddate_month: "June",
enddate_day: "30",
funding: "",
visibility: "https://purl.org/coscine/terms/visibility#projectMember",
slug: "9670960",
title: "VVM",
description:
"Im Projekt VVM werden Methoden zur Absicherung von autonomen Fahrfunktionen entwickelt, die erstmals eine quantitative Beurteilung der Sicherheit dieser Fahrfunktionen ermöglichen werden. Dabei wird ein modularer Ansatz verfolgt, der den Wechsel einzelner Komponenten der Fahrfunktion handhabbar macht. Damit legt das Projekt einerseits die Basis für die Akzeptanz in der Gesellschaft und ermöglicht andererseits eine praktikable Umsetzung durch die Autoindustrie. VVM ist ein zentrales Projekt für die Realisierung des autonomen Fahrens, mit dem sich die deutsche Automobilindustrie einer komplexen Herausforderung stellt und der Erfolg wird entscheidenden Einfluss auf die weitere Entwicklung dieser Zukunftstechnologie haben.",
hasmember:
"https://purl.org/coscine/users/c262753b-3eeb-429e-a71e-635b00b05878",
organization: "https://ror.org/04xfq0f34#ORG-93BEG",
deleted_written: "deleted false",
member:
"https://purl.org/coscine/users/7c7b3fe1-34e7-4549-9ab0-5e088f869a9c",
role: "https://purl.org/coscine/roles/508b6d4e-c6ac-4aa5-8a8d-caa31dd39527",
belongsToProject:
"https://purl.org/coscine/projects/564e629c-5e21-41d3-b6a9-d25878f7cbb9",
graphName:
"https://purl.org/coscine/projects/564e629c-5e21-41d3-b6a9-d25878f7cbb9",
structureType: "https://purl.org/coscine/terms/structure#Project",
},
},
] as ItemSearchResult[],
pagination: {
TotalCount: 4,
PageSize: 10,
CurrentPage: 1,
TotalPages: 1,
HasNext: false,
HasPrevious: false,
},
};
......@@ -18,6 +18,8 @@ export default {
userProfile: "Nutzerprofil",
userLogIn: "Einloggen",
userLogOut: "Ausloggen",
coscine: "Coscine",
privacyPolicy: "Datenschutz-Bestimmungen",
url: {
extrasHelp: "https://docs.coscine.de/de/",
......
......@@ -18,6 +18,8 @@ export default {
userProfile: "User Profile",
userLogIn: "Log in",
userLogOut: "Log out",
coscine: "Coscine",
privacyPolicy: "Privacy Policy",
url: {
extrasHelp: "https://docs.coscine.de/en/",
......
<template>
<div>
<div class="mt-40">
<!-- Headline with Logo -->
<div class="h1 mb-5">
{{ $t("page.headline") }}
<div class="h6">
<div class="d-flex justify-content-center">
<img
alt="Coscine Logo"
src="@/assets/svg/coscine_rgb.svg"
class="d-inline"
/>
</div>
<div class="d-flex justify-content-center mt-3">
{{ $t("page.headline") }}
</div>
</div>
<RouterView v-if="moduleIsReady" />
</div>
</template>
......
......@@ -15,20 +15,6 @@
<!-- Buttons -->
<div v-else class="v_gapped_container">
<!-- ORCiD Login Button -->
<b-button
variant="primary"
:disabled="!loginUrls || !loginUrls.orcidUrl"
@click.prevent="toOrcidLoginPage"
>
<b-img
class="d-inline mr-1"
alt="ORCID logo"
src="https://info.orcid.org/wp-content/uploads/2019/11/orcid_24x24.png"
/>
<span>{{ $t("page.login.button_orcid") }}</span>
</b-button>
<!-- Institution Shibboleth Login -->
<b-button
v-if="selectedInstitution"
......@@ -42,6 +28,21 @@
<b-button variant="primary" @click="switchInstitution">
{{ $t("page.login.button_other_institution") }}
</b-button>
<!-- ORCID Login Button -->
<b-button
variant="primary"
:disabled="!loginUrls || !loginUrls.orcidUrl"
@click.prevent="toOrcidLoginPage"
>
<img
class="d-inline mr-1"
style="width: 1.5rem"
alt="ORCID logo"
src="@/assets/svg/ORCIDiD_iconvector.svg"
/>
<span>{{ $t("page.login.button_orcid") }}</span>
</b-button>
</div>
</transition>
</div>
......
......@@ -7,7 +7,7 @@ export default {
--------------------------------------------------------------------------------------
*/
page: {
headline: "Willkommen bei ",
headline: "Coscine - Ihre Plattform für Forschungsdatenmanagement",
releaseNewsTitle: "Coscine Release News",
releaseNewsBody:
"Wir entwickeln Coscine mit Hilfe von Nutzerfeedback kontinuierlich weiter und liefern regelmäßig Updates und neue Funktionen. Sie möchten regelmäßig über unsere neuen Funktionen und Weiterentwicklungen informiert werden? Dann tragen Sie sich in unsere {mailingList} ein.",
......@@ -15,26 +15,13 @@ export default {
mailingListUrl:
"https://lists.rwth-aachen.de/postorius/lists/coscine.lists.rwth-aachen.de/",
description: {
login: {
title: "Coscine-Anmeldeinformationen",
body: "Sie können sich entweder über DFN-AAI mit Ihrem institutionellen Account (z.B. RWTH Single Sign-On) oder über ORCID anmelden.",
},
helpPages: {
title: "Haben Sie Fragen zu Coscine?",
body: "Antworten finden Sie auf unseren {helpPages}.",
helpPages: "Coscine-Hilfeseiten",
helpPagesUrl: "https://docs.coscine.de/de/",
},
},
institution: {
placeholder: "Institution auswählen",
},
login: {
title: "Einloggen",
button_orcid: "Anmelden mit ORCiD",
button_orcid: "Anmelden mit ORCID®",
button_other_institution: "Anderes institutionelles Konto",
},
......
......@@ -7,7 +7,7 @@ export default {
--------------------------------------------------------------------------------------
*/
page: {
headline: "Welcome to ",
headline: "Coscine - Your Platform for Research Data Management ",
releaseNewsTitle: "Coscine Release News",
releaseNewsBody:
"We continuously develop Coscine with the help of user feedback and deliver regular updates and new features. You would like to be informed about our new features and further developments on a regular basis? Then sign up for our {mailingList}.",
......@@ -15,26 +15,13 @@ export default {
mailingListUrl:
"https://lists.rwth-aachen.de/postorius/lists/coscine.lists.rwth-aachen.de/",
description: {
login: {
title: "Coscine login information",
body: "You can log in using either DFN-AAI with your institutional account (e.g. RWTH Single Sign-On) or via ORCID.",
},
helpPages: {
title: "Do you have any questions about Coscine?",
body: "Please visit our {helpPages}.",
helpPages: "Coscine Help Pages",
helpPagesUrl: "https://docs.coscine.de/en/",
},
},
institution: {
placeholder: "Select Institution",
},
login: {
title: "Login",
button_orcid: "Sign in with ORCiD",
button_orcid: "Sign in with ORCID®",
button_other_institution: "Other Institutional Account",
},
......
<template>
<b-row id="login" cols="12">
<!-- Left Column -->
<b-col sm="12" md="7" class="v_gapped_container gap-4">
<!-- Pilot Banner -->
<Pilot :dismissible="false" :persistent="true" class="mb-0" />
<!-- Release News -->
<b-card :title="$t('page.releaseNewsTitle')" bg-variant="light">
<i18n path="page.releaseNewsBody" tag="p" class="card-text">
<template #mailingList>
<a :href="$t('page.mailingListUrl').toString()">
{{ $t("page.mailingList") }}
</a>
</template>
</i18n>
</b-card>
</b-col>
<!-- Right Column -->
<b-col sm="12" md="5" class="v_gapped_container gap-4">
<b-row id="login" cols="12" class="d-flex justify-content-center my-15">
<b-col style="max-width: 45rem">
<!-- Login/Logout -->
<b-card bg-variant="light">
<b-card>
<LoginMain v-if="!isLoggingOut" />
<LogoutMain v-else />
</b-card>
<!-- Description -->
<b-card bg-variant="light">
<!-- Login Description -->
<b-card-title>
{{ $t("page.description.login.title") }}
</b-card-title>
<b-card-text>
<i18n path="page.description.login.body" tag="p" class="card-text">
<template #mailingList>
<a :href="$t('page.mailingListUrl').toString()">
{{ $t("page.mailingList") }}
</a>
</template>
</i18n>
</b-card-text>
<!-- Help Pages Description -->
<b-card-title class="mt-3">
{{ $t("page.description.helpPages.title") }}
</b-card-title>
<b-card-text>
<i18n path="page.description.helpPages.body" tag="span">
<template #helpPages>
<a
:href="$t('page.description.helpPages.helpPagesUrl').toString()"
target="_blank"
>
{{ $t("page.description.helpPages.helpPages") }}
</a>
</template>
</i18n>
</b-card-text>
</b-card>
</b-col>
</b-row>
</template>
......@@ -79,14 +27,9 @@ export default defineComponent({
setup() {
const loginStore = useLoginStore();
return { loginStore };
},
data() {
return {};
},
computed: {
isLoggingOut(): boolean | null {
const query = this.$route.query["logout"];
......
/* Testing imports */
import { createLocalVue, mount } from "@vue/test-utils";
import { createTestingPinia } from "@pinia/testing";
/* Vue i18n */
import i18n, { def } from "@/plugins/vue-i18n";
import { LoginI18nMessages } from "@/modules/login/i18n/index";
i18n.availableLocales.forEach((locale) => {
i18n.setLocaleMessage(locale, def[locale]); // default locale messages
i18n.mergeLocaleMessage(locale, LoginI18nMessages[locale]); // append the locale messages for the component
});
/* Pinia */
import { PiniaVuePlugin } from "pinia";
/* Tested Component */
import ToS from "./ToS.vue";
import type Vue from "vue";
/* Create a local Vue instance */
const localVue = createLocalVue();
localVue.use(PiniaVuePlugin);
describe("ToS.vue", () => {
/* Testing ToS and PP accepted*/
test("ToSAndPPAccepted", async () => {
/* Mount the Component */
const wrapper = mount(ToS as unknown as typeof Vue, {
pinia: createTestingPinia({
createSpy: vitest.fn,
}),
i18n,
localVue,
});
// wait for created in ToS.vue
await wrapper.vm.$nextTick();
// initial state, Confirm Button is disabled
expect(wrapper.get("#confirmBtn").attributes()["disabled"]).toBe(
"disabled"
);
// check TosAccepted and PpAccepted
const toSFound = wrapper.find("#TosAccepted");
await toSFound.setChecked(true);
const pPFound = wrapper.find("#PpAccepted");
await pPFound.setChecked(true);
// Confirm button should be active
expect(wrapper.get("#confirmBtn").attributes()["disabled"]).not.toBe(
"disabled"
);
});
/* Testing only ToS accepted*/
test("ToSAccepted", async () => {
/* Mount the Component */
const wrapper = mount(ToS as unknown as typeof Vue, {
pinia: createTestingPinia({
createSpy: vitest.fn,
}),
i18n,
localVue,
});
// wait for created in ToS.vue
await wrapper.vm.$nextTick();
// initial state, Confirm Button is disabled
expect(wrapper.get("#confirmBtn").attributes()["disabled"]).toBe(
"disabled"
);
// check TosAccepted
const toSFound = wrapper.find("#TosAccepted");
await toSFound.setChecked(true);
// Confirm button should be disabled, since PP not accepted
expect(wrapper.get("#confirmBtn").attributes()["disabled"]).toBe(
"disabled"
);
});
/* Testing only Pp accepted*/
test("PpAccepted", async () => {
/* Mount the Component */
const wrapper = mount(ToS as unknown as typeof Vue, {
pinia: createTestingPinia({
createSpy: vitest.fn,
}),
i18n,
localVue,
});
// wait for created in ToS.vue
await wrapper.vm.$nextTick();
// initial state, Confirm Button is disabled
expect(wrapper.get("#confirmBtn").attributes()["disabled"]).toBe(
"disabled"
);
// check PpAccepted
const pPFound = wrapper.find("#PpAccepted");
await pPFound.setChecked(true);
// Confirm button should be disabled, since PP not accepted
expect(wrapper.get("#confirmBtn").attributes()["disabled"]).toBe(
"disabled"
);
});
});
......@@ -10,7 +10,11 @@
</a>
</template>
</i18n>
<b-form-checkbox v-model="isTosChecked" :disabled="areTosAccepted">
<b-form-checkbox
id="TosAccepted"
v-model="isTosChecked"
:disabled="areTosAccepted"
>
{{ $t("page.tos.checkbox.tos") }}
</b-form-checkbox>
</b-card-body>
......@@ -24,13 +28,18 @@
</a>
</template>
</i18n>
<b-form-checkbox v-model="isPpChecked" :disabled="areTosAccepted">
<b-form-checkbox
id="PpAccepted"
v-model="isPpChecked"
:disabled="areTosAccepted"
>
{{ $t("page.tos.checkbox.pp") }}
</b-form-checkbox>
</b-card-body>
<div class="v_gapped_container">
<b-button
id="confirmBtn"
variant="primary"
:disabled="!isTosChecked || !isPpChecked || areTosAccepted"
@click="accept"
......
......@@ -112,7 +112,6 @@ import type Vue from "vue";
// import the store for current module
import useResourceStore from "../store";
import useProjectStore from "@/modules/project/store";
// import the main store
import useMainStore from "@/store/index";
......@@ -150,9 +149,8 @@ export default defineComponent({
setup() {
const mainStore = useMainStore();
const resourceStore = useResourceStore();
const projectStore = useProjectStore();
return { mainStore, resourceStore, projectStore };
return { mainStore, resourceStore };
},
data() {
......
/* Testing imports */
import { createLocalVue, mount } from "@vue/test-utils";
import { createTestingPinia } from "@pinia/testing";
import type Vue from "vue";
/* Vue i18n */
import i18n, { def } from "@/plugins/vue-i18n";
import { SearchI18nMessages } from "@/modules/search/i18n/index";
i18n.availableLocales.forEach((locale) => {
i18n.setLocaleMessage(locale, def[locale]); // default locale messages
i18n.mergeLocaleMessage(locale, SearchI18nMessages[locale]); // append the locale messages for the component
});
/* Pinia */
import { PiniaVuePlugin } from "pinia";
/* Vue Router */
import VueRouter from "vue-router";
/* Tested Component */
import Search from "./Search.vue";
/* Import of relevant mockup data */
import { testSearchState } from "@/data/mockup/testSearch";
function sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
/* Create a local Vue instance */
const localVue = createLocalVue();
localVue.use(PiniaVuePlugin);
localVue.use(VueRouter);
const router = new VueRouter();
describe("Search", () => {
/* Describe Pre-initialization steps */
/* Description of the test */
test("metadataResults", async () => {
/* Test Pre-initialization steps */
/* Mount the Component */
const wrapper = mount(Search as unknown as typeof Vue, {
pinia: createTestingPinia({
createSpy: vitest.fn,
initialState: {
search: testSearchState,
},
}),
i18n,
localVue,
router,
});
// Set the loading state to false, so that the table is rendered
wrapper.vm.$data.resultsViewLoading = false;
await wrapper.vm.$nextTick();
await sleep(1000);
// Test how many result cards are shown
const results = wrapper.findAll({ name: "MetadataResult" });
expect(results.length).toEqual(4); // testSearchState contains 4 results
});
});
......@@ -117,6 +117,7 @@ import type { ProjectObject } from "@coscine/api-client/dist/types/Coscine.Api.P
import type { ResourceTypeObject } from "@coscine/api-client/dist/types/Coscine.Api.Resources";
export default defineComponent({
name: "MetadataResult",
filters: {
highlight(words: string, query: string) {
if (query.trim() !== "" && query.trim() !== "*") {
......