Skip to content

Commit 052e4ad

Browse files
authored
Version 3.3.1: fix upload modal (#42)
1 parent 0e8cec9 commit 052e4ad

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "resc-frontend",
3-
"version": "3.3.0",
3+
"version": "3.3.1",
44
"author": "ABN AMRO Bank",
55
"description": "Repository Scanner Frontend",
66
"license": "MIT",

src/components/RulePack/RulePackUploadModal.vue

+16-11
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,17 @@
4949
</div>
5050
</form>
5151

52-
<template #modal-footer>
52+
<template #footer>
5353
<div class="w-100">
5454
<b-button
5555
variant="primary"
56-
class="float-right"
56+
class="float-end"
5757
v-on:click="handleOk"
58-
:disabled="(file && file.length == 0) || !versionState"
58+
:disabled="!file || !versionState"
5959
>
6060
UPLOAD
6161
</b-button>
62-
<b-button variant="secondary" class="float-right mr-3" v-on:click="hide">
63-
CLOSE
64-
</b-button>
62+
<b-button variant="secondary" class="float-end me-3" v-on:click="hide"> CLOSE </b-button>
6563
</div>
6664
</template>
6765
</b-modal>
@@ -74,12 +72,19 @@ import SpinnerVue from '@/components/Common/SpinnerVue.vue';
7472
import PushNotification from '@/utils/push-notification';
7573
import RulePackService from '@/services/rule-pack-service';
7674
import { nextTick, ref, type Ref } from 'vue';
77-
import type { BvEvent } from 'bootstrap-vue-next';
75+
import {
76+
BFormFile,
77+
BButton,
78+
BFormGroup,
79+
BFormInput,
80+
BModal,
81+
type BvEvent,
82+
} from 'bootstrap-vue-next';
7883
7984
const loadedData = ref(true);
8085
const rule_pack_upload_modal = ref();
8186
82-
const file = ref([] as File[]);
87+
const file = ref(undefined) as Ref<File | undefined>;
8388
const version = ref('');
8489
const versionState = ref(null) as Ref<boolean | null>;
8590
const emit = defineEmits(['on-file-upload-suceess']);
@@ -90,14 +95,14 @@ function show(): void {
9095
9196
function hide(): void {
9297
version.value = '';
93-
file.value = [];
98+
file.value = undefined;
9499
versionState.value = null;
95100
rule_pack_upload_modal.value.hide();
96101
}
97102
98103
function resetModal(): void {
99104
version.value = '';
100-
file.value = [];
105+
file.value = undefined;
101106
versionState.value = null;
102107
}
103108
@@ -118,7 +123,7 @@ function handleOk(bvModalEvt: BvEvent | MouseEvent) {
118123
119124
function submitForm() {
120125
loadedData.value = false;
121-
RulePackService.uploadRulePack(version.value, file.value[0])
126+
RulePackService.uploadRulePack(version.value, file.value as File)
122127
.then((response) => {
123128
emit('on-file-upload-suceess');
124129
if (response && response.status === 200) {

0 commit comments

Comments
 (0)