Skip to content

Commit

Permalink
Merge pull request #601 from inab/feature/observatory-pages
Browse files Browse the repository at this point in the history
Feature/observatory pages
  • Loading branch information
jmfernandez authored May 30, 2024
2 parents 4040da1 + 17a6e97 commit ea6f6b3
Show file tree
Hide file tree
Showing 167 changed files with 25,783 additions and 67 deletions.
11 changes: 8 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.eslint": true
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
},
"eslint.validate": [
"javascript",
Expand Down Expand Up @@ -84,5 +84,10 @@
"activityBar.background": "#124c4f",
"titleBar.activeBackground": "#124c4f",
"titleBar.activeForeground": "#FDF9F8"
}
},
"editor.autoClosingBrackets": "never",
"html.autoClosingTags": false,
"javascript.autoClosingTags": false,
"typescript.autoClosingTags": false,
"vue.complete.casing.props": "autoCamel"
}
4 changes: 3 additions & 1 deletion Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ ARG BENCH_EVENT_API_URL=https://openebench.bsc.es/rest/bench_event_api
ARG KEYCLOAK_HOST=https://inb.bsc.es
ARG KEYCLOAK_REALM=openebench
ARG KEYCLOAK_CLIENT_ID=oeb-frontend
ARG OBSERVATORY_API_URL=https://observatory.openebench.bsc.es/api/stats
ARG OBSERVATORY_API_URL=https://observatory.openebench.bsc.es/api
ARG GITHUBAPP_API_URL=https://observatory.openebench.bsc.es/githubapp/api
ENV ENVIRONMENT $ENVIRONMENT
ENV OEB_LEGACY_ANGULAR_URI $OEB_LEGACY_ANGULAR_URI
ENV VRE_URI $VRE_URI
Expand All @@ -24,6 +25,7 @@ ENV KEYCLOAK_HOST $KEYCLOAK_HOST
ENV KEYCLOAK_REALM $KEYCLOAK_REALM
ENV KEYCLOAK_CLIENT_ID $KEYCLOAK_CLIENT_ID
ENV OBSERVATORY_API_URL $OBSERVATORY_API_URL
ENV GITHUBAPP_API_URL $GITHUBAPP_API_URL
ENV NODE_OPTIONS --openssl-legacy-provider
COPY . .
RUN npm ci
Expand Down
32 changes: 30 additions & 2 deletions components/Header/HeaderMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,28 @@
{{ item.title }}
</v-btn>
</div>
<v-menu v-if="$vuetify.breakpoint.mdAndUp" left offset-y>
<template #activator="{ on, attrs }">
<v-btn v-bind="attrs" text v-on="on">
<v-icon>mdi-chevron-down</v-icon>
Observatory
</v-btn>
</template>
<v-list>
<v-list-item
v-for="(item, index) in subMenuEntriesObservatory"
:key="`sub` + index"
:to="item.to"
:href="item.href"
:target="item.external ? '_blank' : ''"
>
<v-list-item-title class="text-subtitle-2">{{
item.title
}}</v-list-item-title>
<v-icon v-if="item.external" right small>mdi-open-in-new</v-icon>
</v-list-item>
</v-list>
</v-menu>
<v-menu v-if="$vuetify.breakpoint.mdAndUp" left offset-y>
<template #activator="{ on, attrs }">
<v-btn v-bind="attrs" text v-on="on">
Expand All @@ -88,7 +110,9 @@
:href="item.href"
:target="item.external ? '_blank' : ''"
>
<v-list-item-title>{{ item.title }}</v-list-item-title>
<v-list-item-title class="text-subtitle-2">{{
item.title
}}</v-list-item-title>
<v-icon v-if="item.external" right small>mdi-open-in-new</v-icon>
</v-list-item>
<v-list-item
Expand Down Expand Up @@ -116,7 +140,9 @@
:href="item.href"
:target="item.external ? '_blank' : ''"
>
<v-list-item-title>{{ item.title }}</v-list-item-title>
<v-list-item-title class="text-subtitle-2">{{
item.title
}}</v-list-item-title>
<v-icon v-if="item.external" right small>mdi-open-in-new</v-icon>
</v-list-item>
<v-list-item
Expand Down Expand Up @@ -177,6 +203,7 @@ import CookieLaw from 'vue-cookie-law';
import menuEntries from './menuEntries';
import subMenuEntriesDocs from './subMenuEntriesDocs';
import subMenuEntriesAbout from './subMenuEntriesAbout';
import subMenuEntriesObservatory from './subMenuEntriesObservatory';
import opebLogo from '~/static/images/opeb_logo.gif';
export default {
Expand All @@ -195,6 +222,7 @@ export default {
menuEntries,
subMenuEntriesDocs,
subMenuEntriesAbout,
subMenuEntriesObservatory,
opebLogo,
};
},
Expand Down
4 changes: 0 additions & 4 deletions components/Header/menuEntries.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ const menuEntries = [
title: 'Benchmarking',
to: '/benchmarking',
},
{
title: 'Observatory',
to: '/observatory',
},
{
title: 'Projects',
to: '/projects',
Expand Down
36 changes: 36 additions & 0 deletions components/Header/subMenuEntriesObservatory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Displayed in Header and Footer

const subMenuEntriesObservatory = [
{
title: 'Trends',
title_hide: 'Trends',
to: '/observatory/Trends',
icon: 'mdi-chart-line',
},
{
title: 'FAIRness Scoreboard',
title_hide: 'FAIRness Scoreboard',
to: '/observatory/FAIRness',
icon: 'mdi-bullseye',
},
{
title: 'FAIR Evaluator',
title_hide: 'FAIR Evaluator',
to: '/observatory/Evaluation',
icon: 'mdi-check-circle-outline',
},
{
title: 'Data',
title_hide: 'Observatory Data',
to: '/observatory/Data',
icon: 'mdi-database',
},
{
title: 'About',
title_hide: 'Observatory About',
to: '/observatory/About',
icon: 'mdi-information',
},
];

export default subMenuEntriesObservatory;
4 changes: 2 additions & 2 deletions components/TheFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<script>
import logo from '~/static/images/opeb_logo_white_minimal.png';
import euFlag from '~/static/images/eu.svg';
import menuEntries from '~/components/Header/menuEntries';
import footerEntries from '~/components/footerEntries';
import subMenuEntries from '~/components/Header/subMenuEntriesDocs';
export default {
Expand All @@ -122,7 +122,7 @@ export default {
footers: [
{
headline: 'OpenEBench',
links: menuEntries,
links: footerEntries,
},
{
headline: 'Project',
Expand Down
26 changes: 26 additions & 0 deletions components/footerEntries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Displayed in Header and Footer

const footerEntries = [
{
title: 'Benchmarking',
to: '/benchmarking',
},
{
title: 'Observatory',
to: '/observatory',
},
{
title: 'Projects',
to: '/projects',
},
{
title: 'Tools',
to: '/tool',
},
{
title: 'Stats',
to: '/statistics',
},
];

export default footerEntries;
157 changes: 157 additions & 0 deletions components/observatory/CollectionSelector.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<template>
<v-sheet class="mx-auto mb-4" elevation="0" max-width="900">
<v-card outlined class="pa-2">
<h6 class="overline text-center collections-header mt-4 mb-2">
collections
</h6>
<p class="mb-1 text-body-2 text-center">
Select a collection below to view the trends of the software associated
to a specific project/organization
</p>
<v-slide-group
v-model="model"
class="pa-4 mb-4"
show-arrows
center-active
>
<v-slide-item
v-for="(n, idx) in collections"
:key="idx"
v-slot="{ active }"
>
<v-btn
class="mx-2"
:input-value="active"
active-class="primary white--text"
depressed
rounded
@click="setCollection(idx)"
>
{{ n.title }}
</v-btn>
</v-slide-item>
</v-slide-group>

<v-expand-transition>
<v-sheet v-if="model != null" class="mb-2">
<v-row
class="fill-height mr-4 ml-4"
align-content="center"
justify="center"
align="center"
>
<v-col cols="10">
<h6 class="text-subtitle mb-0 pb-0 text-left collection-title">
{{ collections[model].title }}
</h6>
<p class="text-subtitle-2 mt-0 pt-0 mb-2 text-left">
{{ collections[model].subtitle }}
</p>
<p
class="text--secondary text-left collection-description mb-0 mt-0"
>
{{ collections[model].description }}
</p>
</v-col>
<v-col cols="2">
<v-img
:src="
require(`@/static/collections/${collections[model].image}`)
"
></v-img>
</v-col>
</v-row>
</v-sheet>
</v-expand-transition>
</v-card>
</v-sheet>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
computed: {
...mapGetters('observatory', {
currentCollection: 'getCurrentCollection',
collections: 'getCollections',
uniqueCollection: 'getUniqueCollection',
}),
model() {
return this.updateModel();
},
},
methods: {
updateModel() {
// model is an index, find the index of the current collection
const index = this.collections.findIndex((object) => {
return object.id === this.currentCollection;
});
if (index !== -1) {
// set model equal to that index
// console.log('model is ' + index)
return index;
} else {
// console.log('model is null')
return null;
}
},
setCollection(idx) {
// Unless a unique collection is stated, allow the user to select a collection
if (this.uniqueCollection === null) {
// Step 1: set currentCollection
/// If the collection clicked is not already selected, set currentCollection to it
if (this.collections[idx].id !== this.currentCollection) {
this.$store.dispatch(
'observatory/changeCurrentCollection',
this.collections[idx].id
);
}
/// If the collection is already selected, set currentCollection to (all) tools
else {
this.$store.dispatch('observatory/changeCurrentCollection', 'tools');
}
// Step2: Refresh data
this.triggerDataRefresh();
}
},
triggerDataRefresh() {
// data for fairness page <- fairness store
this.$store.dispatch('observatory/fairness/getFAIRscores');
// data for index page <- trends store
this.$store.dispatch('observatory/trends/getLicensesSunburst');
this.$store.dispatch('observatory/trends/getLicensesOpenSource');
this.$store.dispatch('observatory/trends/getSemanticVersioning');
this.$store.dispatch('observatory/trends/getVersionControlCount');
this.$store.dispatch('observatory/trends/getVersionControlRepositories');
this.$store.dispatch('observatory/trends/getPublications');
// data for data page <- data store
this.$store.dispatch('observatory/data/getCountsPerSource');
this.$store.dispatch('observatory/data/getTotalCount');
this.$store.dispatch('observatory/data/getFeatures');
this.$store.dispatch('observatory/data/getCoverageSources');
this.$store.dispatch('observatory/data/getCompleteness');
this.$store.dispatch('observatory/data/getTypes');
this.$forceUpdate();
},
},
};
</script>
<style scoped>
.collections-header {
color: #0b579f;
}
.collection-title {
color: #0b579f;
font-size: 1.8rem;
font-weight: 500;
}
.collection-description {
font-size: 0.9em !important;
}
</style>
Loading

0 comments on commit ea6f6b3

Please sign in to comment.