Skip to content

Commit 8b560bd

Browse files
committed
feat(policies): split policyView into active/expired sections
Simply page titles
1 parent 09b39c3 commit 8b560bd

3 files changed

Lines changed: 61 additions & 11 deletions

File tree

frontend/src/views/InventoryView.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<div>
33
<v-row class="mb-4" align="center">
44
<v-col>
5-
<div class="text-caption text-medium-emphasis">INVENTORY</div>
6-
<h1 class="text-h4 font-weight-thin">My Assets</h1>
5+
<h1 class="text-h4 font-weight-thin">Inventory</h1>
76
</v-col>
87
<v-col cols="auto">
98
<v-btn color="primary" prepend-icon="mdi-plus" size="large" @click="dialog = true">

frontend/src/views/PoliciesView.vue

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
<div v-if="currentHousehold">
33
<v-row class="mb-4" align="center">
44
<v-col>
5-
<div class="text-caption text-medium-emphasis">DASHBOARD</div>
6-
<h1 class="text-h4 font-weight-thin">{{ currentHousehold.name }}</h1>
5+
<h1 class="text-h4 font-weight-thin">Policies</h1>
76
</v-col>
87
<v-col cols="auto">
98
<v-btn color="primary" prepend-icon="mdi-plus" size="large" @click="policyDialog = true">
@@ -12,13 +11,39 @@
1211
</v-col>
1312
</v-row>
1413

15-
<PolicyList
16-
:currency-code="currencyCode"
17-
:loading="loading"
18-
:policies="policies"
19-
@edit="openEditDialog"
20-
@delete="handleDelete"
21-
/>
14+
<div class="mb-6">
15+
<div class="d-flex align-center mb-2">
16+
<v-icon color="success" class="mr-2">mdi-shield-check</v-icon>
17+
<h2 class="text-h6 font-weight-bold">Active Policies</h2>
18+
</div>
19+
20+
<PolicyList
21+
:currency-code="currencyCode"
22+
:policies="activePolicies"
23+
:loading="loading"
24+
@edit="openEditDialog"
25+
@delete="handleDelete"
26+
@upload="handleUpload"
27+
/>
28+
</div>
29+
30+
<div v-if="expiredPolicies.length > 0" class="mb-6">
31+
<v-divider class="my-6" />
32+
33+
<div class="d-flex align-center mb-2 text-medium-emphasis">
34+
<v-icon color="grey" class="mr-2">mdi-history</v-icon>
35+
<h2 class="text-h6 font-weight-bold">Expired Policies</h2>
36+
</div>
37+
38+
<PolicyList
39+
:currency-code="currencyCode"
40+
:policies="expiredPolicies"
41+
:loading="loading"
42+
@edit="openEditDialog"
43+
@delete="handleDelete"
44+
@upload="handleUpload"
45+
/>
46+
</div>
2247

2348
<PolicyForm
2449
v-model="policyDialog"
@@ -67,6 +92,27 @@ export default {
6792
if (!val) this.selectedPolicy = null
6893
},
6994
},
95+
computed: {
96+
activePolicies() {
97+
const today = new Date();
98+
today.setHours(0, 0, 0, 0);
99+
100+
return this.policies.filter(p => {
101+
if (!p.end_date) return true;
102+
return new Date(p.end_date) >= today;
103+
});
104+
},
105+
106+
expiredPolicies() {
107+
const today = new Date();
108+
today.setHours(0, 0, 0, 0);
109+
110+
return this.policies.filter(p => {
111+
if (!p.end_date) return false;
112+
return new Date(p.end_date) < today;
113+
});
114+
}
115+
},
70116
methods: {
71117
openEditDialog(policy) {
72118
this.selectedPolicy = policy

frontend/src/views/SettingsView.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<template>
22
<div>
3+
<v-row>
4+
<v-col>
5+
<h1 class="text-h4 font-weight-thin">Settings</h1>
6+
</v-col>
7+
</v-row>
38
<v-row>
49
<v-col cols="12" md="6">
510
<v-card elevation="2" rounded="lg" class="pa-4">

0 commit comments

Comments
 (0)