Skip to content

Commit 40a972b

Browse files
authored
Merge pull request #86 from shawnwildermuth/master
Hackathon changes. - Thank you!!!
2 parents eb615a4 + c607665 commit 40a972b

17 files changed

Lines changed: 6956 additions & 6150 deletions

File tree

2wr-app/package-lock.json

Lines changed: 6621 additions & 6055 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

2wr-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"eslint": "^6.7.2",
4242
"eslint-plugin-vue": "^6.2.2",
4343
"npm-run-all": "^4.1.5",
44-
"sass": "^1.32.4",
44+
"sass": "~1.32.4",
4545
"sass-loader": "^8.0.2",
4646
"vue-cli-plugin-vuetify": "^2.0.9",
4747
"vue-template-compiler": "^2.6.11",

2wr-app/src/App.vue

Lines changed: 68 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<template>
22
<v-app>
3+
<div v-if="isBusy" class="loading-line"></div>
34
<v-main>
4-
<v-overlay v-if="isBusy" absolute v-ripple="{ center: true }">
5-
<div class="text-center headline">
6-
<v-icon>mdi-loading mdi-spin</v-icon> Loading...
7-
</div>
8-
</v-overlay>
95
<router-view></router-view>
106
<v-dialog persistent :value="error">
117
<v-card>
12-
<v-card-title class="red--text"><v-icon color="red">mdi-exclamation-thick</v-icon> Error Occurred</v-card-title>
8+
<v-card-title class="red--text"
9+
><v-icon color="red">mdi-exclamation-thick</v-icon> Error
10+
Occurred</v-card-title
11+
>
1312
<v-card-text class="body-1">{{ error }}</v-card-text>
1413
<v-card-actions>
1514
<v-btn text @click="$store.commit('setError', '')">Close</v-btn>
@@ -60,7 +59,7 @@ export default {
6059
},
6160
error() {
6261
return this.$store.state.error;
63-
},
62+
}
6463
},
6564
methods: {
6665
login() {
@@ -69,19 +68,72 @@ export default {
6968
// Log the user out
7069
logout() {
7170
this.$auth.logout({
72-
returnTo: window.location.origin,
71+
returnTo: window.location.origin
7372
});
74-
},
75-
},
73+
}
74+
}
7675
};
7776
</script>
7877

79-
<!-- Global Styles -->
80-
<style>
81-
.hidden {
82-
display: none;
78+
<style scoped>
79+
.loading-line {
80+
height: 3px;
81+
position: absolute;
82+
top: 0;
83+
background-color: #eeffff;
84+
animation: loading-animate 5s linear infinite;
85+
z-index: 50;
8386
}
84-
.img-cover {
85-
object-fit: cover;
87+
88+
@keyframes loading-animate {
89+
0% {
90+
width: 0%;
91+
background-color: #dff;
92+
}
93+
10% {
94+
width: 5%;
95+
background-color: #cff;
96+
}
97+
20% {
98+
width: 10%;
99+
background-color: #bff;
100+
}
101+
30% {
102+
width: 15%;
103+
background-color: #aef;
104+
}
105+
40% {
106+
width: 25%;
107+
background-color: #8cf;
108+
}
109+
50% {
110+
width: 35%;
111+
background-color: #7af;
112+
}
113+
60% {
114+
width: 50%;
115+
background-color: #69f;
116+
}
117+
70% {
118+
width: 65%;
119+
background-color: #57f;
120+
}
121+
80% {
122+
width: 80%;
123+
background-color: #38f;
124+
}
125+
90% {
126+
width: 90%;
127+
background-color: #03f;
128+
}
129+
100% {
130+
width: 100%;
131+
background-color: #00f;
132+
}
133+
134+
0% {
135+
width: 0%;
136+
background-color: #eff;
137+
}
86138
}
87139
</style>

2wr-app/src/api/family-plans-api.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export default {
88
return (await baseApiInstance.getInstance()).post('familyplans-upsert', plan);
99
},
1010
async deletePlan(plan) {
11-
return (await baseApiInstance.getInstance()).delete('familyplans-delete', plan);
11+
return (await baseApiInstance.getInstance()).delete(`familyplans-delete/${plan.id}`);
1212
}
1313
}

2wr-app/src/assets/app.scss

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
.pseudo-text-block-label {
22
margin-left: .5rem;
33
position: absolute;
4-
margin-top: -.3rem;
5-
font-size: 12px
4+
background-color: #fff;
5+
margin-top: -9px;
6+
padding: 1px;
67
}
8+
9+
.hidden {
10+
display: none;
11+
}
12+
.img-cover {
13+
object-fit: cover;
14+
}
15+
16+
.cursor-pointer {
17+
cursor: pointer;
18+
}

2wr-app/src/components/address-editor.vue

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<template>
2+
<v-dialog v-model="showDialog">
3+
<v-card>
4+
<v-toolbar v-if="title">
5+
<v-toolbar-title class="text-body-2 font-weight-bold grey--text">
6+
{{ title }}
7+
</v-toolbar-title>
8+
</v-toolbar>
9+
<v-card-text class="pa-4">
10+
{{ message }}
11+
</v-card-text>
12+
<v-card-actions>
13+
<v-spacer></v-spacer>
14+
<v-btn plain text color="grey" @click.native='deny'>{{ denyButtonText }}</v-btn>
15+
<v-btn plain text color="primary" @click.native="confirm">{{ confirmButtonText }}</v-btn>
16+
</v-card-actions>
17+
</v-card>
18+
</v-dialog>
19+
</template>
20+
21+
<script>
22+
import { ref, defineComponent } from "@vue/composition-api";
23+
24+
export default defineComponent({
25+
name: "ConfirmationDialog",
26+
setup() {
27+
28+
const showDialog = ref(false);
29+
const titleText = ref("Confirmation");
30+
const messageText = ref("Are you sure?");
31+
const denyButtonText = ref("cancel");
32+
const confirmButtonText = ref("ok");
33+
let resolveCallback = null;
34+
35+
function open(title, message, options) {
36+
showDialog.value = true;
37+
if (title) titleText.value = title;
38+
if (message) messageText.value = message;
39+
if (options?.denyText) denyButtonText.value = options.denyText;
40+
if (options?.confirmText) confirmButtonText.value = options.confirmText;
41+
return new Promise((resolve) => {
42+
resolveCallback = resolve;
43+
});
44+
}
45+
46+
function closeDialog(result) {
47+
showDialog.value = false;
48+
resolveCallback(result);
49+
}
50+
51+
return {
52+
open,
53+
title: titleText,
54+
message: messageText,
55+
denyButtonText,
56+
confirmButtonText,
57+
showDialog,
58+
confirm:() => closeDialog(true),
59+
deny: () => closeDialog(false)
60+
}
61+
}
62+
})
63+
</script>

2wr-app/src/components/common/EditableTextBlock.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div>
33
<v-card v-if="!isEditing">
4-
<div class="pseudo-text-block-label">{{ label }}</div>
4+
<div class="pseudo-text-block-label text-caption">{{ label }}</div>
55
<v-flex class="d-flex justify-space-between px-2 py-2">
66
<v-card-title v-if="isTitle">{{ theText }}</v-card-title>
77
<v-card-text v-if="!isTitle">{{ theText }}</v-card-text>
@@ -20,9 +20,9 @@
2020
outlined
2121
>
2222
<template v-slot:append>
23-
<v-col class="pa-0">
24-
<v-icon class="pr-2" color="red" @click="cancel">mdi-cancel</v-icon>
25-
<v-icon class="pr-2" color="blue" @click="save">mdi-content-save</v-icon>
23+
<v-col class="pa-0 editable-text-block-buttons">
24+
<v-btn plain v-ripple="false" class="pr-2" color="gray" @click="cancel">cancel</v-btn>
25+
<v-btn plain v-ripple="false" class="pr-2" color="green" @click="save">save</v-btn>
2626
</v-col>
2727
</template>
2828
</v-text-field>
@@ -89,3 +89,8 @@ export default defineComponent({
8989
});
9090
</script>
9191

92+
<style scoped>
93+
.editable-text-block-buttons {
94+
margin-top: -7px;
95+
}
96+
</style>

2wr-app/src/components/common/globalComponents.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import IconTextBlock from './IconTextBlock.vue';
44
import InfoBar from './InfoBar.vue';
55
import DatePickerInput from "./DatePickerInput.vue";
66
import SecureImg from './SecureImg.vue';
7+
import ConfirmDialog from './ConfirmDialog.vue';
78

89
export default function () {
910
Vue.component("EditableTextBlock", EditableTextBlock);
1011
Vue.component("IconTextBlock", IconTextBlock);
1112
Vue.component("InfoBar", InfoBar);
1213
Vue.component("DatePickerInput", DatePickerInput);
1314
Vue.component("SecureImg", SecureImg);
15+
Vue.component("ConfirmDialog", ConfirmDialog);
1416
}

2wr-app/src/components/prepare/family-plans/address-view.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
<template>
22
<div>
33
<v-card v-if="address">
4-
<div class="pseudo-text-block-label">{{ title }}</div>
5-
<v-card-subtitle>
4+
<div class="pseudo-text-block-label text-caption">{{ title }}</div>
5+
<v-card-text>
66
<v-row class="pl-3 justify-end">
77
<v-icon class="pr-2" @click="dialogOpen = true">mdi-pencil</v-icon>
88
</v-row>
9-
</v-card-subtitle>
10-
<v-card-text v-if="!formattedAddress"
11-
><em>No Address: Click pencil to specify address.</em></v-card-text
12-
>
13-
<v-card-text v-if="formattedAddress" v-html="formattedAddress" />
9+
<v-row class="pl-4 black--text">
10+
<div v-if="!formattedAddress"
11+
><em>No Address: Click pencil to specify address.</em></div
12+
>
13+
<div
14+
v-if="formattedAddress"
15+
v-html="formattedAddress"
16+
/>
17+
</v-row>
18+
</v-card-text>
1419
</v-card>
1520
<v-dialog persistent v-model="dialogOpen">
1621
<v-card color="#eee">

0 commit comments

Comments
 (0)