Skip to content

Commit

Permalink
Merge pull request #447 from OHDSI/source-overview-consolidation
Browse files Browse the repository at this point in the history
Source overview consolidation
  • Loading branch information
Mikhail-iontsev authored Aug 29, 2024
2 parents b6b12fa + 3f601df commit c7cc423
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 69 deletions.
7 changes: 6 additions & 1 deletion src/app/plugins/tailwind/components/panel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
export default {
root: {
class: [
//positioning

"flex",
"flex-col",
"justify-between",
//Shape
"rounded-lg",
"shadow-md",
Expand Down Expand Up @@ -36,7 +41,7 @@ export default {
},
footer: {
class: [
"rounded-bl-lg rounded-br-lg bg-gray-100 dark:text-white text-black dark:border-surface-700 dark:bg-surface-700 p-2",
"rounded-bl-lg rounded-br-lg bg-gray-100 dark:text-white text-black dark:border-surface-700 dark:bg-surface-700 p-2 relative bottom-0",
],
},
};
2 changes: 1 addition & 1 deletion src/entities/toggleIcon/ToggleIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
? 'dark:bg-primary-50 dark:text-black bg-black text-white '
: 'bg-primary-500 dark:bg-primary-400 text-white'
} px-2 py-1 rounded-full z-10 top-0 right-0 absolute indent-0 text-xs`"
:style="{ right: '-3px' }"
:style="{ right: '-5px', top: '-5px' }"
>
{{ props.count }}
</span>
Expand Down
10 changes: 5 additions & 5 deletions src/pages/reports/source/SourceOverview/SourceOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
id="network-data-quality-overview"
class="flex flex-col gap-10"
>
<OverviewDisplay />
<div class="flex flex-row gap-5">
<PopulationHistory class="basis-full" />
<DataQualityIssuesHistory class="basis-full" />
<ReleaseListing class="basis-full" />
</div>
<div class="flex flex-row gap-5 items-stretch">
<PopulationHistory class="basis-full h-full" />
<DataQualityIssuesHistory class="basis-full h-full" />
</div>
<SourceDataStrand />
<ReleaseListing />
</div>
</template>

<script setup lang="ts">
import { useStore } from "vuex";
import OverviewDisplay from "@/pages/reports/source/SourceOverview/charts/overviewDisplay/OverviewDisplay.vue";
import PopulationHistory from "@/pages/reports/source/SourceOverview/charts/populationHistory/PopulationHistory.vue";
import DataQualityIssuesHistory from "@/pages/reports/source/SourceOverview/charts/dataQualityIssuesHistory/DataQualityIssuesHistory.vue";
import ReleaseListing from "@/pages/reports/source/SourceOverview/charts/releaseListing/ReleaseListing.vue";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,28 @@
</template>
</Column>
</DataTable>
<template #footer>
<div class="flex flex-row gap-2">
<ChartActionIcon
v-if="store.getters.getQueryIndex"
:icon="mdiClockOutline"
tooltip="Average days between releases"
:count="getDaysBetweenReleases"
/>
</div>
</template>
</Panel>
</template>

<script setup lang="ts">
import Panel from "primevue/panel";
import { helpers } from "@/shared/lib/mixins";
import { computed, ref } from "vue";
import { computed } from "vue";
import { useStore } from "vuex";
import DataTable from "primevue/datatable";
import Column from "primevue/column";
import { mdiClockOutline } from "@mdi/js";
import ChartActionIcon from "@/entities/toggleIcon/ToggleIcon.vue";
const store = useStore();
Expand Down Expand Up @@ -91,6 +103,28 @@ const getPersonLink = function (item) {
},
};
};
const getDaysBetweenReleases = computed(function () {
if (store.getters.explorerLoaded) {
const dates = store.getters.getSelectedSource.releases.map(
(value) => new Date(value.release_name)
);
const numbers = [];
for (let i = 0; i < dates.length - 1; i++) {
numbers.push((dates[i] - dates[i + 1]) / (1000 * 60 * 60 * 24));
}
return numbers.length
? (
numbers.reduce((prevValue, current) => prevValue + current, 0) /
numbers.length
).toFixed(0)
: 0;
} else {
return [];
}
});
</script>

<style scoped></style>

0 comments on commit c7cc423

Please sign in to comment.