-
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.
feat: Added session tab, action buttons, clubbed similar code from se…
…ssion list and file list
- Loading branch information
1 parent
64ce5e5
commit 48ca360
Showing
7 changed files
with
221 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<script setup> | ||
import { defineProps } from "vue"; | ||
const props = defineProps({ | ||
items: { | ||
type: Number, | ||
default: 10, | ||
}, | ||
avatar: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
button: { | ||
type: Number, | ||
default: 4, | ||
}, | ||
subTitle: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
}); | ||
</script> | ||
|
||
<template> | ||
<v-list-item | ||
v-for="n in props.items" | ||
:key="n" | ||
:title="n" | ||
class="sessions-view py-4 border-b-thin" | ||
> | ||
<template v-slot:title> | ||
<div class="d-flex align-start px-5"> | ||
<v-skeleton-loader | ||
v-if="props.avatar" | ||
type="avatar" | ||
></v-skeleton-loader> | ||
<div class="ml-4"> | ||
<v-skeleton-loader width="300px" type="heading"></v-skeleton-loader> | ||
<div | ||
v-if="props.subTitle" | ||
class="v-list-item-subtitle d-flex align-center pt-2" | ||
> | ||
<v-skeleton-loader width="200px" type="text"></v-skeleton-loader> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
<template v-slot:append> | ||
<v-skeleton-loader | ||
v-if="props.button" | ||
v-for="a in props.button" | ||
:key="a" | ||
width="24" | ||
type="heading" | ||
class="mx-3" | ||
></v-skeleton-loader> | ||
</template> | ||
</v-list-item> | ||
</template> |
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,66 @@ | ||
<script setup> | ||
import { defineProps, inject, ref } from "vue"; | ||
import Tooltip from "@/components/global/Tooltip.vue"; | ||
import { useLoader } from "@/helpers/index.js"; | ||
import { deleteBySessionNumber } from "@/api/index.js"; | ||
const props = defineProps({ | ||
session: { | ||
type: Object, | ||
default: {}, | ||
}, | ||
size: { | ||
type: String, | ||
default: "large", | ||
}, | ||
text: { | ||
type: String, | ||
default: "", | ||
}, | ||
callBack: Function, | ||
}); | ||
const snackbar = inject("set-snackbar"); | ||
const deleteSession = ref(false); | ||
const deleteSessionHandle = async () => { | ||
if (deleteSession.value) { | ||
const loader = useLoader().show(); | ||
snackbar.value = await deleteBySessionNumber(deleteSession.value.number); | ||
deleteSession.value = false; | ||
loader.hide(); | ||
await props.callBack(); | ||
} | ||
}; | ||
</script> | ||
|
||
<template> | ||
<Tooltip text="Delete Session"> | ||
<v-btn | ||
color="blue-grey-darken-4" | ||
:icon="props.text ? false : 'mdi-delete-outline'" | ||
prepend-icon="mdi-delete-outline" | ||
:size="props.size" | ||
:text="props.text" | ||
variant="text" | ||
:disabled="props.session.state === 'closed'" | ||
@click="deleteSession = props.session" | ||
class="text-capitalize font-weight-medium" | ||
></v-btn> | ||
</Tooltip> | ||
|
||
<v-dialog v-model="deleteSession" width="auto"> | ||
<v-card max-width="400" prepend-icon="mdi-alert" title="Delete Session"> | ||
<template v-slot:text> | ||
Are you sure you want to delete session: | ||
<strong>{{ deleteSession.title }}</strong> | ||
</template> | ||
<template v-slot:actions> | ||
<v-spacer></v-spacer> | ||
<v-btn @click="deleteSession = false"> Cancel </v-btn> | ||
<v-btn color="red" variant="flat" @click="deleteSessionHandle"> | ||
Delete | ||
</v-btn> | ||
</template> | ||
</v-card> | ||
</v-dialog> | ||
</template> |
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 @@ | ||
export { default as DeleteSession } from "./Delete.vue"; |
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
Oops, something went wrong.