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

Merge branch 'bug/6-bootstrap-import' into 'development'

Fix import of bootstrap JS plugins

Closes #6

See merge request denbi/object-storage-access-ui!7
parents 241b4ba7 b821f1b9
No related branches found
No related tags found
2 merge requests!22Version 1.0.0,!7Fix import of bootstrap JS plugins
<script setup lang="ts">
defineProps<{
modalId: string;
modalID: string;
modalLabel: string;
staticBackdrop: boolean;
}>();
......@@ -9,7 +9,7 @@ defineProps<{
<template>
<div
class="modal"
:id="modalId"
:id="modalID"
tabindex="-1"
:aria-labelledby="modalLabel"
aria-hidden="true"
......
<script setup lang="ts">
import { BucketService } from "@/client";
import type { BucketIn } from "@/client";
import { reactive } from "vue";
import { reactive, onMounted } from "vue";
import BootstrapModal from "@/components/BootstrapModal.vue";
import { useRouter } from "vue-router";
/*
import { onMounted } from "vue";
import { Modal } from "bootstrap";
*/
const router = useRouter();
const emit = defineEmits(["bucketCreated"]);
......@@ -22,20 +19,17 @@ const formState = reactive({
loading: boolean;
});
defineProps<{
modalid: string;
modallabel: string;
const props = defineProps<{
modalID: string;
modalLabel: string;
}>();
/*
let theModal: Modal | null = null;
const modal = ref(null as Element | null);
let createBucketModal: Modal | null = null;
onMounted(() => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
theModal = Modal.getOrCreateInstance(modal.value!);
createBucketModal = new Modal("#" + props.modalID);
console.log("Modal ID", props.modalID);
});
*/
function createBucket() {
formState.validated = true;
......@@ -47,8 +41,7 @@ function createBucket() {
BucketService.bucketCreateBucket(bucket)
.then((createdBucket) => {
emit("bucketCreated", createdBucket);
//console.log(theModal);
//theModal?.hide();
createBucketModal?.hide();
bucket.name = "";
bucket.description = "";
formState.bucketNameTaken = false;
......@@ -80,9 +73,9 @@ function modalClosed() {
<template>
<bootstrap-modal
:modal-id="modalid"
:modalID="modalID"
:static-backdrop="true"
:modal-label="modallabel"
:modal-label="modalLabel"
v-on="{ 'hidden.bs.modal': modalClosed }"
>
<template v-slot:header> Create new Bucket </template>
......
......@@ -21,17 +21,5 @@ app.use(router);
app.mount("#app");
// Import just what we need
// import "bootstrap/js/dist/alert";
import "bootstrap/js/dist/button";
// import "bootstrap/js/dist/carousel";
import "bootstrap/js/dist/collapse";
import "bootstrap/js/dist/dropdown";
import "bootstrap/js/dist/modal";
// import "bootstrap/js/dist/offcanvas";
// import "bootstrap/js/dist/popover";
// import "bootstrap/js/dist/scrollspy";
// import "bootstrap/js/dist/tab";
// import "bootstrap/js/dist/toast";
// import "bootstrap/js/dist/tooltip";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Modal, Collapse, Dropdown } from "bootstrap";
......@@ -73,8 +73,8 @@ onMounted(() => {
</button>
</div>
<create-bucket-component
modalid="create-bucket-modal"
modallabel="create-bucket-modal-label"
modalID="create-bucket-modal"
modal-label="create-bucket-modal-label"
@bucket-created="addBucket"
/>
<div class="input-group flex-nowrap mt-2">
......
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