Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source overview consolidation #447

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>