Skip to content
Snippets Groups Projects
Verified Commit adcfd484 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Refactor Bootstrap toast for easier usage

#88
parent ef04796d
No related branches found
No related tags found
1 merge request!85Resolve "Add UI for viewing and managing Resources"
This commit is part of merge request !85. Comments created here will be created in the context of that merge request.
Showing
with 259 additions and 422 deletions
...@@ -69,9 +69,17 @@ onBeforeMount(() => { ...@@ -69,9 +69,17 @@ onBeforeMount(() => {
<template> <template>
<NavbarTop /> <NavbarTop />
<div class="container-xxl mt-4 flex-grow-1"> <div class="container-xxl mt-4 flex-grow-1">
<div
id="global-toast-container"
class="toast-container position-fixed top-toast end-0 p-3"
></div>
<router-view></router-view> <router-view></router-view>
</div> </div>
<FooterBottom /> <FooterBottom />
</template> </template>
<style scoped></style> <style scoped>
.top-toast {
top: 4rem;
}
</style>
...@@ -4,10 +4,6 @@ ...@@ -4,10 +4,6 @@
font-size: 3.5rem; font-size: 3.5rem;
} }
.top-toast {
top: 4rem;
}
.w-fit { .w-fit {
width: fit-content; width: fit-content;
} }
......
<script setup lang="ts">
import { useSlots, computed } from "vue";
const slots = useSlots();
const props = defineProps({
colorClass: { type: String, required: false, default: "success" },
toastId: { type: String, required: true },
});
const colorClassName = computed<string>(() => {
return "text-bg-" + props.colorClass;
});
const emit = defineEmits<{
(e: "hidden.bs.toast"): void;
}>();
</script>
<template>
<Teleport to="#global-toast-container">
<div
role="alert"
aria-live="assertive"
aria-atomic="true"
class="toast align-items-center border-0"
:class="colorClassName"
data-bs-autohide="true"
:id="props.toastId"
v-on="{ 'hidden.bs.toast': () => emit('hidden.bs.toast') }"
>
<div v-if="slots.body" class="toast-header" :class="colorClassName">
<div class="me-auto">
<slot></slot>
</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
<div v-else class="d-flex">
<div class="toast-body">
<slot></slot>
</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
<div class="toast-body" v-if="slots.body">
<slot name="body"></slot>
</div>
</div>
</Teleport>
</template>
<style scoped></style>
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue"; import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue";
import { onMounted } from "vue"; import { onMounted } from "vue";
import { Toast, Tooltip } from "bootstrap"; import { Toast, Tooltip } from "bootstrap";
import BootstrapToast from "@/components/BootstrapToast.vue";
const props = defineProps<{ const props = defineProps<{
text: string; text: string;
...@@ -33,44 +34,14 @@ onMounted(() => { ...@@ -33,44 +34,14 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast :toast-id="'successToast-' + randomIDSuffix"
<div >Successfully copied to clipboard</bootstrap-toast
role="alert" >
aria-live="assertive" <bootstrap-toast
aria-atomic="true" :toast-id="'failToast-' + randomIDSuffix"
class="toast text-bg-success align-items-center border-0" color-class="danger"
data-bs-autohide="true" >Can't copy to clipboard
:id="'successToast-' + randomIDSuffix" </bootstrap-toast>
>
<div class="d-flex">
<div class="toast-body">Successfully copied to clipboard</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
<div
role="alert"
aria-live="assertive"
aria-atomic="true"
class="toast text-bg-danger align-items-center border-0"
data-bs-autohide="true"
:id="'failToast-' + randomIDSuffix"
>
<div class="d-flex">
<div class="toast-body">Can't copy to clipboard</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<span <span
class="hover-info cursor-pointer" class="hover-info cursor-pointer"
data-bs-toggle="tooltip" data-bs-toggle="tooltip"
......
...@@ -5,6 +5,7 @@ import { onMounted, reactive, watch } from "vue"; ...@@ -5,6 +5,7 @@ import { onMounted, reactive, watch } from "vue";
import type { _Object as S3Object } from "@aws-sdk/client-s3"; import type { _Object as S3Object } from "@aws-sdk/client-s3";
import { useBucketStore } from "@/stores/buckets"; import { useBucketStore } from "@/stores/buckets";
import { useS3ObjectStore } from "@/stores/s3objects"; import { useS3ObjectStore } from "@/stores/s3objects";
import BootstrapToast from "@/components/BootstrapToast.vue";
const objectRepository = useS3ObjectStore(); const objectRepository = useS3ObjectStore();
...@@ -83,49 +84,16 @@ onMounted(() => { ...@@ -83,49 +84,16 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast :toast-id="'successToast-' + randomIDSuffix">
<div Successfully copied file
role="alert" </bootstrap-toast>
aria-live="assertive" <bootstrap-toast
aria-atomic="true" :toast-id="'errorToast-' + randomIDSuffix"
class="toast text-bg-success align-items-center border-0" color-class="danger"
data-bs-autohide="true" >
:id="'successToast-' + randomIDSuffix" There has been some Error.<br />
> Try again later
<div class="d-flex"> </bootstrap-toast>
<div class="toast-body">Successfully copied file</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<div class="toast-container position-fixed top-toast end-0 p-3">
<div
role="alert"
aria-live="assertive"
aria-atomic="true"
class="toast text-bg-danger align-items-center border-0"
data-bs-autohide="true"
:id="'errorToast-' + randomIDSuffix"
>
<div class="d-flex">
<div class="toast-body">
There has been some Error.<br />
Try again later
</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<bootstrap-modal <bootstrap-modal
:modalID="modalID" :modalID="modalID"
:static-backdrop="true" :static-backdrop="true"
......
...@@ -4,6 +4,7 @@ import { computed, onMounted, reactive } from "vue"; ...@@ -4,6 +4,7 @@ import { computed, onMounted, reactive } from "vue";
import { Modal, Toast } from "bootstrap"; import { Modal, Toast } from "bootstrap";
import { useS3ObjectStore } from "@/stores/s3objects"; import { useS3ObjectStore } from "@/stores/s3objects";
import BootstrapToast from "@/components/BootstrapToast.vue";
const objectRepository = useS3ObjectStore(); const objectRepository = useS3ObjectStore();
...@@ -67,49 +68,16 @@ onMounted(() => { ...@@ -67,49 +68,16 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast :toast-id="'successToast-' + randomIDSuffix">
<div Successfully created Folder
role="alert" </bootstrap-toast>
aria-live="assertive" <bootstrap-toast
aria-atomic="true" :toast-id="'errorToast-' + randomIDSuffix"
class="toast text-bg-success align-items-center border-0" color-class="danger"
data-bs-autohide="true" >
:id="'successToast-' + randomIDSuffix" There has been some Error.<br />
> Try again later
<div class="d-flex"> </bootstrap-toast>
<div class="toast-body">Successfully created Folder</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<div class="toast-container position-fixed top-toast end-0 p-3">
<div
role="alert"
aria-live="assertive"
aria-atomic="true"
class="toast text-bg-danger align-items-center border-0"
data-bs-autohide="true"
:id="'errorToast-' + randomIDSuffix"
>
<div class="d-flex">
<div class="toast-body">
There has been some Error.<br />
Try again later
</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<bootstrap-modal <bootstrap-modal
:modalID="modalID" :modalID="modalID"
:static-backdrop="true" :static-backdrop="true"
......
...@@ -16,6 +16,7 @@ import { Permission } from "@/client/s3proxy"; ...@@ -16,6 +16,7 @@ import { Permission } from "@/client/s3proxy";
import { Toast } from "bootstrap"; import { Toast } from "bootstrap";
import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue"; import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue";
import { useBucketStore } from "@/stores/buckets"; import { useBucketStore } from "@/stores/buckets";
import BootstrapToast from "@/components/BootstrapToast.vue";
// Props // Props
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
...@@ -271,33 +272,16 @@ function toTimestampChanged(target?: HTMLInputElement | null) { ...@@ -271,33 +272,16 @@ function toTimestampChanged(target?: HTMLInputElement | null) {
:back-modal-id="modalID" :back-modal-id="modalID"
@user-found="updateUser" @user-found="updateUser"
/> />
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast
<div :toast-id="'toast-' + randomIDSuffix"
role="alert" v-on="{ 'hidden.bs.toast': toastHidden }"
aria-live="assertive" >
aria-atomic="true" Successfully
class="toast text-bg-success align-items-center border-0" <template v-if="permissionDeleted">deleted</template>
data-bs-autohide="true" <template v-else-if="editPermission">edited</template>
:id="'toast-' + randomIDSuffix" <template v-else>created</template>
v-on="{ 'hidden.bs.toast': toastHidden }" Permission
> </bootstrap-toast>
<div class="d-flex">
<div class="toast-body">
Successfully
<span v-if="permissionDeleted">deleted</span>
<span v-else-if="editPermission">edited</span>
<span v-else>created</span>
Permission
</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<bootstrap-modal <bootstrap-modal
:modalID="modalID" :modalID="modalID"
:static-backdrop="true" :static-backdrop="true"
......
...@@ -4,6 +4,7 @@ import { computed, onMounted, reactive, ref, watch } from "vue"; ...@@ -4,6 +4,7 @@ import { computed, onMounted, reactive, ref, watch } from "vue";
import { Modal, Toast } from "bootstrap"; import { Modal, Toast } from "bootstrap";
import { partial } from "filesize"; import { partial } from "filesize";
import { useS3ObjectStore } from "@/stores/s3objects"; import { useS3ObjectStore } from "@/stores/s3objects";
import BootstrapToast from "@/components/BootstrapToast.vue";
const fsize = partial({ base: 2, standard: "jedec" }); const fsize = partial({ base: 2, standard: "jedec" });
const objectRepository = useS3ObjectStore(); const objectRepository = useS3ObjectStore();
...@@ -101,49 +102,16 @@ onMounted(() => { ...@@ -101,49 +102,16 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast :toast-id="'successToast-' + randomIDSuffix">
<div Successfully uploaded file
role="alert" </bootstrap-toast>
aria-live="assertive" <bootstrap-toast
aria-atomic="true" :toast-id="'errorToast-' + randomIDSuffix"
class="toast text-bg-success align-items-center border-0" color-class="danger"
data-bs-autohide="true" >
:id="'successToast-' + randomIDSuffix" There has been some Error.<br />
> Try again later
<div class="d-flex"> </bootstrap-toast>
<div class="toast-body">Successfully uploaded file</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<div class="toast-container position-fixed top-toast end-0 p-3">
<div
role="alert"
aria-live="assertive"
aria-atomic="true"
class="toast text-bg-danger align-items-center border-0"
data-bs-autohide="true"
:id="'errorToast-' + randomIDSuffix"
>
<div class="d-flex">
<div class="toast-body">
There has been some Error.<br />
Try again later
</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<bootstrap-modal <bootstrap-modal
:modalID="modalID" :modalID="modalID"
:static-backdrop="true" :static-backdrop="true"
......
...@@ -8,6 +8,7 @@ import ParameterStringInput from "@/components/parameter-schema/form-mode/Parame ...@@ -8,6 +8,7 @@ import ParameterStringInput from "@/components/parameter-schema/form-mode/Parame
import { Toast } from "bootstrap"; import { Toast } from "bootstrap";
import { useBucketStore } from "@/stores/buckets"; import { useBucketStore } from "@/stores/buckets";
import { useS3KeyStore } from "@/stores/s3keys"; import { useS3KeyStore } from "@/stores/s3keys";
import BootstrapToast from "@/components/BootstrapToast.vue";
const bucketRepository = useBucketStore(); const bucketRepository = useBucketStore();
const s3KeyRepository = useS3KeyStore(); const s3KeyRepository = useS3KeyStore();
...@@ -186,34 +187,18 @@ onMounted(() => { ...@@ -186,34 +187,18 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast toast-id="workflowExecutionErrorToast" color-class="danger">
<div <template>Error starting workflow</template>
role="alert" <template #body>
aria-live="assertive" <template v-if="formState.errorType === 'form'">
aria-atomic="true" Some inputs are not valid.
class="toast text-bg-danger align-items-center border-0" </template>
data-bs-autohide="true" <template v-else>
id="workflowExecutionErrorToast" There was an error with starting the workflow execution. Look in the
> console for more information.
<div class="d-flex p-2 justify-content-between align-items-center"> </template>
<div class="toast-body"> </template>
<template v-if="formState.errorType === 'form'"> </bootstrap-toast>
Some inputs are not valid.
</template>
<template v-else>
There was an error with starting the workflow execution. Look in the
console for more information.
</template>
</div>
<button
type="button"
class="btn-close btn-close-white"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<div class="row mb-5 align-items-start"> <div class="row mb-5 align-items-start">
<form <form
v-if="props.schema" v-if="props.schema"
......
...@@ -34,7 +34,7 @@ const props = defineProps<{ ...@@ -34,7 +34,7 @@ const props = defineProps<{
let createResourceModal: Modal | null = null; let createResourceModal: Modal | null = null;
onMounted(() => { onMounted(() => {
createResourceModal = new Modal("#" + props.modalID); CreateResourceModal = new Modal("#" + props.modalID);
}); });
function createResource() { function createResource() {
...@@ -49,7 +49,7 @@ function createResource() { ...@@ -49,7 +49,7 @@ function createResource() {
resourceRepository resourceRepository
.createResource(resource) .createResource(resource)
.then(() => { .then(() => {
createResourceModal?.hide(); CreateResourceModal?.hide();
resource.name = ""; resource.name = "";
resource.description = ""; resource.description = "";
resource.source = ""; resource.source = "";
......
...@@ -7,6 +7,8 @@ import { ...@@ -7,6 +7,8 @@ import {
import { computed } from "vue"; import { computed } from "vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { useAuthStore } from "@/stores/users"; import { useAuthStore } from "@/stores/users";
import CopyToClipboardIcon from "@/components/CopyToClipboardIcon.vue";
import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue";
const randomIDSuffix: string = Math.random().toString(16).substring(2, 8); const randomIDSuffix: string = Math.random().toString(16).substring(2, 8);
const userRepository = useAuthStore(); const userRepository = useAuthStore();
...@@ -14,6 +16,7 @@ const userRepository = useAuthStore(); ...@@ -14,6 +16,7 @@ const userRepository = useAuthStore();
const props = defineProps<{ const props = defineProps<{
resource: ResourceOut; resource: ResourceOut;
loading: boolean; loading: boolean;
extended?: boolean;
}>(); }>();
const resourceVersions = computed<ResourceVersionOut[]>( const resourceVersions = computed<ResourceVersionOut[]>(
...@@ -86,14 +89,74 @@ const resourceVersions = computed<ResourceVersionOut[]>( ...@@ -86,14 +89,74 @@ const resourceVersions = computed<ResourceVersionOut[]>(
:data-bs-parent="'#accordion-' + props.resource.resource_id" :data-bs-parent="'#accordion-' + props.resource.resource_id"
> >
<div class="accordion-body"> <div class="accordion-body">
<p> <div>
Last Updated: Last Updated:
{{ {{
dayjs.unix(resourceVersion.created_at).format("DD MMM YYYY") dayjs.unix(resourceVersion.created_at).format("DD MMM YYYY")
}} }}
</p> </div>
<div> <div
Nextflow Access Path: <br />{{ resourceVersion.cluster_path }} v-if="
resourceVersion.status === Status.SYNCHRONIZED ||
resourceVersion.status === Status.LATEST
"
class="my-1"
>
<label
:for="
'nextflow-access-path-' +
resourceVersion.resource_version_id
"
class="form-label"
>Nextflow Access Path:</label
>
<div class="input-group fs-4 mb-3">
<input
:id="
'nextflow-access-path-' +
resourceVersion.resource_version_id
"
class="form-control"
type="text"
:value="resourceVersion.cluster_path"
aria-label="Nextflow Access Path"
readonly
/>
<span class="input-group-text"
><copy-to-clipboard-icon
:text="resourceVersion.cluster_path"
/></span>
</div>
</div>
<div
v-if="
props.extended &&
resourceVersion.status !== Status.S3_DELETED
"
class="my-1"
>
<label
:for="
's3-access-path-' + resourceVersion.resource_version_id
"
class="form-label"
>S3 Path:</label
>
<div class="input-group fs-4 mb-3">
<input
:id="
's3-access-path-' + resourceVersion.resource_version_id
"
class="form-control"
type="text"
:value="resourceVersion.s3_path"
aria-label="S3 Access Path"
readonly
/>
<span class="input-group-text"
><copy-to-clipboard-icon :text="resourceVersion.s3_path"
/></span>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -17,6 +17,7 @@ import { ...@@ -17,6 +17,7 @@ import {
import { valid } from "semver"; import { valid } from "semver";
import WorkflowModeTransitionGroup from "@/components/transitions/WorkflowModeTransitionGroup.vue"; import WorkflowModeTransitionGroup from "@/components/transitions/WorkflowModeTransitionGroup.vue";
import { useWorkflowStore } from "@/stores/workflows"; import { useWorkflowStore } from "@/stores/workflows";
import BootstrapToast from "@/components/BootstrapToast.vue";
const workflowRepository = useWorkflowStore(); const workflowRepository = useWorkflowStore();
// Emitted Events // Emitted Events
...@@ -319,26 +320,9 @@ onMounted(() => { ...@@ -319,26 +320,9 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast :toast-id="'successToast-' + randomIDSuffix">
<div Successfully created Workflow
role="alert" </bootstrap-toast>
aria-live="assertive"
aria-atomic="true"
class="toast text-bg-success align-items-center border-0"
data-bs-autohide="true"
:id="'successToast-' + randomIDSuffix"
>
<div class="d-flex">
<div class="toast-body">Successfully created Workflow</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<bootstrap-modal <bootstrap-modal
:modalID="modalID" :modalID="modalID"
:static-backdrop="true" :static-backdrop="true"
......
...@@ -7,6 +7,7 @@ import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue"; ...@@ -7,6 +7,7 @@ import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue";
import DeleteModal from "@/components/modals/DeleteModal.vue"; import DeleteModal from "@/components/modals/DeleteModal.vue";
import { GitRepository } from "@/utils/GitRepository"; import { GitRepository } from "@/utils/GitRepository";
import { useWorkflowStore } from "@/stores/workflows"; import { useWorkflowStore } from "@/stores/workflows";
import BootstrapToast from "@/components/BootstrapToast.vue";
const workflowRepository = useWorkflowStore(); const workflowRepository = useWorkflowStore();
// Constants // Constants
...@@ -131,29 +132,9 @@ onMounted(() => { ...@@ -131,29 +132,9 @@ onMounted(() => {
:back-modal-id="modalID" :back-modal-id="modalID"
@confirm-delete="deleteCredentials()" @confirm-delete="deleteCredentials()"
/> />
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast :toast-id="'successToast-' + randomIDSuffix">
<div Successfully updated credentials
role="alert" </bootstrap-toast>
aria-live="assertive"
aria-atomic="true"
class="toast text-bg-success align-items-center border-0"
data-bs-autohide="true"
:id="'successToast-' + randomIDSuffix"
>
<div class="d-flex">
<div v-if="formState.updateCredentials" class="toast-body">
Successfully updated credentials
</div>
<div v-else class="toast-body">Successfully deleted credentials</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<bootstrap-modal <bootstrap-modal
:modalID="modalID" :modalID="modalID"
:static-backdrop="true" :static-backdrop="true"
......
...@@ -21,6 +21,7 @@ import { valid, lte, inc } from "semver"; ...@@ -21,6 +21,7 @@ import { valid, lte, inc } from "semver";
import { latestVersion as calculateLatestVersion } from "@/utils/Workflow"; import { latestVersion as calculateLatestVersion } from "@/utils/Workflow";
import WorkflowModeTransitionGroup from "@/components/transitions/WorkflowModeTransitionGroup.vue"; import WorkflowModeTransitionGroup from "@/components/transitions/WorkflowModeTransitionGroup.vue";
import { useWorkflowStore } from "@/stores/workflows"; import { useWorkflowStore } from "@/stores/workflows";
import BootstrapToast from "@/components/BootstrapToast.vue";
const workflowRepository = useWorkflowStore(); const workflowRepository = useWorkflowStore();
// Bootstrap Elements // Bootstrap Elements
...@@ -307,26 +308,9 @@ onMounted(() => { ...@@ -307,26 +308,9 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast :toast-id="'successToast-' + randomIDSuffix">
<div Successfully updated Workflow
role="alert" </bootstrap-toast>
aria-live="assertive"
aria-atomic="true"
class="toast text-bg-success align-items-center border-0"
data-bs-autohide="true"
:id="'successToast-' + randomIDSuffix"
>
<div class="d-flex">
<div class="toast-body">Successfully updated Workflow</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<bootstrap-modal <bootstrap-modal
:modalID="modalID" :modalID="modalID"
:static-backdrop="true" :static-backdrop="true"
......
...@@ -6,6 +6,7 @@ import { Modal, Toast } from "bootstrap"; ...@@ -6,6 +6,7 @@ import { Modal, Toast } from "bootstrap";
import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue"; import FontAwesomeIcon from "@/components/FontAwesomeIcon.vue";
import DeleteModal from "@/components/modals/DeleteModal.vue"; import DeleteModal from "@/components/modals/DeleteModal.vue";
import { useWorkflowStore } from "@/stores/workflows"; import { useWorkflowStore } from "@/stores/workflows";
import BootstrapToast from "@/components/BootstrapToast.vue";
const workflowRepository = useWorkflowStore(); const workflowRepository = useWorkflowStore();
// Constants // Constants
...@@ -140,29 +141,10 @@ onMounted(() => { ...@@ -140,29 +141,10 @@ onMounted(() => {
:back-modal-id="modalID" :back-modal-id="modalID"
@confirm-delete="deleteIcon()" @confirm-delete="deleteIcon()"
/> />
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast :toast-id="'successToast-' + randomIDSuffix">
<div <div v-if="formState.uploadIcon">Successfully uploaded icon</div>
role="alert" <div v-else>Successfully deleted icon</div>
aria-live="assertive" </bootstrap-toast>
aria-atomic="true"
class="toast text-bg-success align-items-center border-0"
data-bs-autohide="true"
:id="'successToast-' + randomIDSuffix"
>
<div class="d-flex">
<div v-if="formState.uploadIcon" class="toast-body">
Successfully uploaded icon
</div>
<div v-else class="toast-body">Successfully deleted icon</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<bootstrap-modal <bootstrap-modal
:modalID="modalID" :modalID="modalID"
:static-backdrop="true" :static-backdrop="true"
......
...@@ -4,6 +4,7 @@ import { useAuthStore } from "@/stores/users"; ...@@ -4,6 +4,7 @@ import { useAuthStore } from "@/stores/users";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
import { OpenAPI as AuthOpenAPI } from "@/client/auth"; import { OpenAPI as AuthOpenAPI } from "@/client/auth";
import { Toast } from "bootstrap"; import { Toast } from "bootstrap";
import BootstrapToast from "@/components/BootstrapToast.vue";
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
...@@ -29,35 +30,16 @@ onMounted(() => { ...@@ -29,35 +30,16 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast toast-id="loginErrorToast" color-class="danger">
<div <template> Login Error </template>
role="alert" <template #body>
aria-live="assertive" <p>
aria-atomic="true" There has been some kind of error during the login.<br />
class="toast text-bg-danger align-items-center border-0" Please try again later.
style="--bs-bg-opacity: 0.7" </p>
data-bs-config="{'delay': 8000}" <p>Error Code: {{ route.query.login_error }}</p>
data-bs-autohide="true" </template>
id="loginErrorToast" </bootstrap-toast>
>
<div class="toast-header text-bg-danger">
<strong class="me-auto">Login Error</strong>
<button
type="button"
class="btn-close btn-close-white"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
<div class="toast-body">
<p>
There has been some kind of error during the login.<br />
Please try again later.
</p>
<p>Error Code: {{ route.query.login_error }}</p>
</div>
</div>
</div>
<div class="position-fixed start-50 translate-middle-x text-center"> <div class="position-fixed start-50 translate-middle-x text-center">
<img <img
src="/src/assets/images/clowm.svg" src="/src/assets/images/clowm.svg"
......
...@@ -21,6 +21,7 @@ import { useAuthStore } from "@/stores/users"; ...@@ -21,6 +21,7 @@ import { useAuthStore } from "@/stores/users";
import { useBucketStore } from "@/stores/buckets"; import { useBucketStore } from "@/stores/buckets";
import { useS3ObjectStore } from "@/stores/s3objects"; import { useS3ObjectStore } from "@/stores/s3objects";
import { useS3KeyStore } from "@/stores/s3keys"; import { useS3KeyStore } from "@/stores/s3keys";
import BootstrapToast from "@/components/BootstrapToast.vue";
const authStore = useAuthStore(); const authStore = useAuthStore();
const bucketRepository = useBucketStore(); const bucketRepository = useBucketStore();
...@@ -420,28 +421,9 @@ function getObjectFileName(key: string): string { ...@@ -420,28 +421,9 @@ function getObjectFileName(key: string): string {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast :toast-id="'successToast-' + randomIDSuffix">
<div Successfully deleted {{ deleteObjectsState.deletedItem }}
role="alert" </bootstrap-toast>
aria-live="assertive"
aria-atomic="true"
class="toast text-bg-success align-items-center border-0"
data-bs-autohide="true"
:id="'successToast-' + randomIDSuffix"
>
<div class="d-flex">
<div class="toast-body">
Successfully deleted {{ deleteObjectsState.deletedItem }}
</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<DeleteModal <DeleteModal
modalID="delete-object-modal" modalID="delete-object-modal"
:object-name-delete="deleteObjectsState.potentialObjectToDelete" :object-name-delete="deleteObjectsState.potentialObjectToDelete"
......
...@@ -5,6 +5,7 @@ import { reactive, onMounted, computed } from "vue"; ...@@ -5,6 +5,7 @@ import { reactive, onMounted, computed } from "vue";
import { useAuthStore } from "@/stores/users"; import { useAuthStore } from "@/stores/users";
import { Toast, Tooltip } from "bootstrap"; import { Toast, Tooltip } from "bootstrap";
import { useS3KeyStore } from "@/stores/s3keys"; import { useS3KeyStore } from "@/stores/s3keys";
import BootstrapToast from "@/components/BootstrapToast.vue";
const authStore = useAuthStore(); const authStore = useAuthStore();
const keyRepository = useS3KeyStore(); const keyRepository = useS3KeyStore();
...@@ -76,28 +77,9 @@ onMounted(() => { ...@@ -76,28 +77,9 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast toast-id="successKeyToast">
<div Successfully deleted S3 Key {{ keyState.deletedKey.slice(0, 5) }}...
role="alert" </bootstrap-toast>
aria-live="assertive"
aria-atomic="true"
class="toast text-bg-success align-items-center border-0"
data-bs-autohide="true"
:id="'successKeyToast'"
>
<div class="d-flex">
<div class="toast-body">
Successfully deleted S3 Key {{ keyState.deletedKey.slice(0, 5) }}...
</div>
<button
type="button"
class="btn-close btn-close-white me-2 m-auto"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<div class="row m-2 border-bottom mt-4"> <div class="row m-2 border-bottom mt-4">
<div class="col-12"></div> <div class="col-12"></div>
<h2 class="mb-2">S3 Keys</h2> <h2 class="mb-2">S3 Keys</h2>
......
...@@ -3,7 +3,7 @@ import { onMounted, reactive } from "vue"; ...@@ -3,7 +3,7 @@ import { onMounted, reactive } from "vue";
import { useResourceStore } from "@/stores/resources"; import { useResourceStore } from "@/stores/resources";
import CardTransitionGroup from "@/components/transitions/CardTransitionGroup.vue"; import CardTransitionGroup from "@/components/transitions/CardTransitionGroup.vue";
import ResourceCard from "@/components/resources/ResourceCard.vue"; import ResourceCard from "@/components/resources/ResourceCard.vue";
import CreateResourceModal from "@/components/resources/createResourceModal.vue"; import CreateResourceModal from "@/components/resources/CreateResourceModal.vue";
const resourceRepository = useResourceStore(); const resourceRepository = useResourceStore();
...@@ -42,7 +42,8 @@ onMounted(() => { ...@@ -42,7 +42,8 @@ onMounted(() => {
:key="resource.resource_id" :key="resource.resource_id"
:resource="resource" :resource="resource"
:loading="false" :loading="false"
style="min-width: 48%" style="width: 48%"
extended
/> />
</CardTransitionGroup> </CardTransitionGroup>
</template> </template>
......
...@@ -10,6 +10,7 @@ import { useWorkflowStore } from "@/stores/workflows"; ...@@ -10,6 +10,7 @@ import { useWorkflowStore } from "@/stores/workflows";
import type { WorkflowIn } from "@/client/workflow"; import type { WorkflowIn } from "@/client/workflow";
import { useWorkflowExecutionStore } from "@/stores/workflowExecutions"; import { useWorkflowExecutionStore } from "@/stores/workflowExecutions";
import ParameterSchemaFormComponent from "@/components/parameter-schema/ParameterSchemaFormComponent.vue"; import ParameterSchemaFormComponent from "@/components/parameter-schema/ParameterSchemaFormComponent.vue";
import BootstrapToast from "@/components/BootstrapToast.vue";
const props = defineProps<{ const props = defineProps<{
wid: string; wid: string;
...@@ -148,34 +149,21 @@ onMounted(() => { ...@@ -148,34 +149,21 @@ onMounted(() => {
</script> </script>
<template> <template>
<div class="toast-container position-fixed top-toast end-0 p-3"> <bootstrap-toast
<div toast-id="arbitraryWorkflowExecutionViewErrorToast"
role="alert" color-class="danger"
aria-live="assertive" >
aria-atomic="true" <template> Error starting workflow </template>
class="toast text-bg-danger align-items-center border-0" <template #body>
data-bs-autohide="true" <template v-if="workflowExecutionState.errorType === 'limit'">
id="arbitraryWorkflowExecutionViewErrorToast" You have too many active workflow executions to start a new one.
> </template>
<div class="d-flex p-2 justify-content-between align-items-center"> <template v-else>
<div class="toast-body"> There was an error with starting the workflow execution. Look in the
<template v-if="workflowExecutionState.errorType === 'limit'"> console for more information.
You have too many active workflow executions to start a new one. </template>
</template> </template>
<template v-else> </bootstrap-toast>
There was an error with starting the workflow execution. Look in the
console for more information.
</template>
</div>
<button
type="button"
class="btn-close btn-close-white"
data-bs-dismiss="toast"
aria-label="Close"
></button>
</div>
</div>
</div>
<template v-if="workflowState.workflow"> <template v-if="workflowState.workflow">
<div class="row m-1 border-bottom mb-4"> <div class="row m-1 border-bottom mb-4">
<h1 class="mb-2">Arbitrary Workflow</h1> <h1 class="mb-2">Arbitrary Workflow</h1>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment