-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #197 from Sun-Mountain/159-bug-fix-alerts
159 - Fix Alerts
- Loading branch information
Showing
18 changed files
with
179 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.v-alert-title { | ||
text-transform: capitalize !important; | ||
} | ||
|
||
.v-alert__close { | ||
.v-icon:before { | ||
position: relative; | ||
content: "✖"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<template v-slot:close="{toggle}"> | ||
<v-alert | ||
v-if="alert" | ||
border="start" | ||
variant="tonal" | ||
closable | ||
close-label="Close Alert" | ||
:title="alert?.type" | ||
:text="alert?.message" | ||
:type="alert?.type" | ||
:icon="alert?.icon" | ||
> | ||
<!-- Close slot for custom close behavior --> | ||
<template v-slot:close="{toggle}"> | ||
<v-btn @click="closeAlert(toggle)"> | ||
<v-icon size="22px" icon="mdi:mdiClose" /> | ||
</v-btn> | ||
</template> | ||
<!-- --> | ||
</v-alert> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { storeToRefs } from "pinia"; | ||
import { useAlertStore } from "@/store"; | ||
const alertStore = useAlertStore(); | ||
const { alert } = storeToRefs(alertStore); | ||
const closeAlert = (toggle) => { | ||
alertStore.clear(); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
<template> | ||
<v-container class="layout-with-subnav main-content-container"> | ||
<EventSubNav /> | ||
<div class="sub-content-container"> | ||
<EventHeader /> | ||
<v-container> | ||
<router-view /> | ||
</v-container> | ||
<v-container> | ||
<v-container> | ||
<Alert /> | ||
</v-container> | ||
<div class="layout-with-subnav main-content-container"> | ||
<EventSubNav /> | ||
<div class="sub-content-container"> | ||
<EventHeader /> | ||
<v-container> | ||
<router-view /> | ||
</v-container> | ||
</div> | ||
</div> | ||
</v-container> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { EventHeader, EventSubNav } from '@/components'; | ||
import { Alert, EventHeader, EventSubNav } from '@/components'; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
<template> | ||
<v-container> | ||
<v-container> | ||
<Alert /> | ||
</v-container> | ||
<router-view /> | ||
</v-container> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
// | ||
import { Alert } from '@/components'; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface Alert { | ||
type: string; | ||
message: string; | ||
icon?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export interface Event { | ||
id?: number, | ||
event_title: string, | ||
description?: string, | ||
start_date: Date, | ||
end_date?: Date, | ||
uid: string, | ||
user_id: string | ||
id?: number; | ||
event_title: string; | ||
description?: string; | ||
start_date: Date; | ||
end_date?: Date; | ||
uid: string; | ||
user_id: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
export interface User { | ||
id?: number, | ||
first_name: string, | ||
last_name: string, | ||
preferred_username: string, | ||
email: string, | ||
current_password?: string, | ||
password?: string, | ||
password_confirmation?: string | ||
id?: number; | ||
first_name: string; | ||
last_name: string; | ||
preferred_username: string; | ||
email: string; | ||
current_password?: string; | ||
password?: string; | ||
password_confirmation?: string; | ||
} | ||
|
||
export interface Login { | ||
email: string, | ||
password: string | ||
email: string; | ||
password: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { defineStore } from "pinia"; | ||
import { Alert } from "@/models/alert.model"; | ||
|
||
export const useAlertStore = defineStore({ | ||
id: "alert", | ||
state: () => ({ | ||
alert: null as Alert | null | ||
}), | ||
actions: { | ||
success(message) { | ||
this.alert = { message, type: "success", icon: "mdi:mdi-checkbox-marked-circle" } | ||
}, | ||
error(message) { | ||
this.alert = {message, type: "error", icon: "mdi:mdi-alert" } | ||
}, | ||
clear() { | ||
this.alert = null; | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from "./admin.store"; | ||
export * from "./alert.store"; | ||
export * from "./auth.store"; | ||
export * from "./event.store"; | ||
export * from "./users.store"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,6 +175,44 @@ | |
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.39.0.tgz#58b536bcc843f4cd1e02a7e6171da5c040f4d44b" | ||
integrity sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng== | ||
|
||
"@fortawesome/[email protected]": | ||
version "6.4.0" | ||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.0.tgz#88da2b70d6ca18aaa6ed3687832e11f39e80624b" | ||
integrity sha512-HNii132xfomg5QVZw0HwXXpN22s7VBHQBv9CeOu9tfJnhsWQNd2lmTNi8CSrnw5B+5YOmzu1UoPAyxaXsJ6RgQ== | ||
|
||
"@fortawesome/fontawesome-svg-core@^6.4.0": | ||
version "6.4.0" | ||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.4.0.tgz#3727552eff9179506e9203d72feb5b1063c11a21" | ||
integrity sha512-Bertv8xOiVELz5raB2FlXDPKt+m94MQ3JgDfsVbrqNpLU9+UE2E18GKjLKw+d3XbeYPqg1pzyQKGsrzbw+pPaw== | ||
dependencies: | ||
"@fortawesome/fontawesome-common-types" "6.4.0" | ||
|
||
"@fortawesome/free-brands-svg-icons@^6.4.0": | ||
version "6.4.0" | ||
resolved "https://registry.yarnpkg.com/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.4.0.tgz#c785cf5563231eadc5ef5f8cd0274e0b8920433f" | ||
integrity sha512-qvxTCo0FQ5k2N+VCXb/PZQ+QMhqRVM4OORiO6MXdG6bKolIojGU/srQ1ptvKk0JTbRgaJOfL2qMqGvBEZG7Z6g== | ||
dependencies: | ||
"@fortawesome/fontawesome-common-types" "6.4.0" | ||
|
||
"@fortawesome/free-regular-svg-icons@^6.4.0": | ||
version "6.4.0" | ||
resolved "https://registry.yarnpkg.com/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.4.0.tgz#cacc53bd8d832d46feead412d9ea9ce80a55e13a" | ||
integrity sha512-ZfycI7D0KWPZtf7wtMFnQxs8qjBXArRzczABuMQqecA/nXohquJ5J/RCR77PmY5qGWkxAZDxpnUFVXKwtY/jPw== | ||
dependencies: | ||
"@fortawesome/fontawesome-common-types" "6.4.0" | ||
|
||
"@fortawesome/free-solid-svg-icons@^6.4.0": | ||
version "6.4.0" | ||
resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.0.tgz#48c0e790847fa56299e2f26b82b39663b8ad7119" | ||
integrity sha512-kutPeRGWm8V5dltFP1zGjQOEAzaLZj4StdQhWVZnfGFCvAPVvHh8qk5bRrU4KXnRRRNni5tKQI9PBAdI6MP8nQ== | ||
dependencies: | ||
"@fortawesome/fontawesome-common-types" "6.4.0" | ||
|
||
"@fortawesome/vue-fontawesome@^3.0.3": | ||
version "3.0.3" | ||
resolved "https://registry.yarnpkg.com/@fortawesome/vue-fontawesome/-/vue-fontawesome-3.0.3.tgz#633e2998d11f7d4ed41f0d5ea461a22ec9b9d034" | ||
integrity sha512-KCPHi9QemVXGMrfuwf3nNnNo129resAIQWut9QTAMXmXqL2ErABC6ohd2yY5Ipq0CLWNbKHk8TMdTXL/Zf3ZhA== | ||
|
||
"@humanwhocodes/config-array@^0.11.8": | ||
version "0.11.8" | ||
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" | ||
|