Skip to content

Commit

Permalink
All changes for #2403.
Browse files Browse the repository at this point in the history
  • Loading branch information
knirirr committed Sep 30, 2024
1 parent a63ef6a commit 2bab9d7
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/data/footerData.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
"urlType": "internal"
},
{
"title": "Data Preservation Policy",
"url": "/preservation_policy",
"title": "Sustainability and Preservation",
"url": "/sustainability_and_preservation",
"urlType": "internal"
}
]
Expand Down
16 changes: 14 additions & 2 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
OntologyBrowser,
Organisation,
OrganisationsList,
PreservationPolicy,
Privacy,
PublicProfile,
Record,
Expand All @@ -42,6 +41,7 @@ import {
Signup,
Stakeholders,
Stat,
SustainabilityAndPreservation,
Terms,
Timeline,
User,
Expand Down Expand Up @@ -519,7 +519,19 @@ let routes = [
{
name: "PreservationPolicy",
path: "/preservation_policy",
component: PreservationPolicy,
redirect: () => {
window.location.assign(
[
process.env.VUE_APP_API_HOSTNAME,
"/sustainability_and_preservation",
].join("")
);
},
},
{
name: "SustainabilityAndPreservation",
path: "/sustainability_and_preservation",
component: SustainabilityAndPreservation,
},
{
name: "API Documentation",
Expand Down
4 changes: 2 additions & 2 deletions src/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ export const OrganisationsList = () =>
import(
/* webpackChunkName: "organisationsList-chunk" */ "@/views/Organisations/OrganisationsList"
);
export const PreservationPolicy = () =>
export const SustainabilityAndPreservation = () =>
import(
/* webpackChunkName: "privacy-chunk" */ "@/views/Static/PreservationPolicy/PreservationPolicy"
/* webpackChunkName: "privacy-chunk" */ "@/views/Static/SustainabilityAndPreservation/SustainabilityAndPreservation.vue"
);
export const AdvancedSearchRecords = () =>
import(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
<template>
<main class="pa-15 mb-10">
<!-- main_title -->
<h1 class="text-h4 text-xl-h3 mb-2 mb-xl-6">
FAIRsharing Sustainability
</h1>

<p
:class="['mb-4 lato-font-medium lato-text-sm',{'lato-text-md':$vuetify.breakpoint.xlOnly }]"
>
Since 2011, FAIRsharing is a sustainable service operating with and for the international researcher community
and other stakeholders involved in the research life cycle. The FAIRsharing resource, along its core operational
team, are based at the University of Oxford, UK. As with the vast majority of the community resources,
FAIRsharing is mainly funded by continuous and multiple R&D and infrastructure projects, but it is also supported
by University-enabled access to DOI generation and the member-only ORCID API.
</p>

<p
:class="['mb-4 lato-font-medium lato-text-sm',{'lato-text-md':$vuetify.breakpoint.xlOnly }]"
>
Other key factors contributing to its sustainability are the extensive network of national and international
collaborations and formal endorsements by organizations and research infrastructures in all disciplines,
including RDA, EOSC, and ELIXIR. A key example is the flourishing
<a href="/community_champions">FAIRsharing Community Champions Programme</a>
that roots the growth and relevance of FAIRsharing into communities of practice.
</p>

<h1 class="text-h4 text-xl-h3 mb-2 mb-xl-6">
FAIRsharing Data Preservation Policy
</h1>
Expand Down Expand Up @@ -33,9 +57,9 @@
</a>.
</p>

<h2 class="text-h5 text-xl-h4 mb-2 mb-xl-6">
<h1 class="text-h4 text-xl-h3 mb-2 mb-xl-6">
Contact
</h2>
</h1>

<p
:class="['mb-4 lato-font-medium lato-text-sm',{'lato-text-md':$vuetify.breakpoint.xlOnly }]"
Expand All @@ -49,7 +73,7 @@
<script>
export default {
name: "PreservationPolicy",
name: "SustainabilityAndPreservation",
data: () => {
return {}
}
Expand Down
20 changes: 20 additions & 0 deletions tests/unit/router/routes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,26 @@ describe("Routes", () => {
// eslint-enable no-promise-executor-return
});

it("performs preservation policy redirections correctly", async () => {
let link;
let assignMock = jest.fn();
delete window.location;
window.location = {assign: assignMock};
const redirections = {
PreservationPolicy: '/sustainability_and_preservation',
}

// eslint-disable no-promise-executor-return
Object.keys(redirections).forEach(async (goto) => {
link = router.options.routes.find((obj) => {
return obj.name === goto;
});
await link.redirect();
expect(window.location.assign).toHaveBeenCalledWith(redirections[goto]);
});
// eslint-enable no-promise-executor-return
});



it("gets sitemap from the api", async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { shallowMount } from "@vue/test-utils";
import Vuetify from "vuetify"

import PreservationPolicy from "@/views/Static/PreservationPolicy/PreservationPolicy.vue"
import PreservationPolicy from "@/views/Static/SustainabilityAndPreservation/SustainabilityAndPreservation.vue"

const vuetify = new Vuetify();

describe("PreservationPolicy.vue", function(){
describe("SustainabilityAndPreservation.vue", function(){
let wrapper;

beforeEach(() => {
Expand All @@ -15,7 +15,7 @@ describe("PreservationPolicy.vue", function(){
});

it("can be instantiated", () => {
expect(wrapper.vm.$options.name).toMatch("PreservationPolicy");
expect(wrapper.vm.$options.name).toMatch("SustainabilityAndPreservation");
});

});

0 comments on commit 2bab9d7

Please sign in to comment.