Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/components/specific/files/files-manager/FilesManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@
v-if="showVisaManager"
:project="project"
:document="fileToManage"
:visa="currentVisa"
:toValidateVisas="toValidateVisas"
:createdVisas="createdVisas"
:visasLoading="visasLoading"
Expand Down Expand Up @@ -301,6 +302,7 @@
<script>
import { computed, onMounted, ref, watch, inject } from "vue";
import { useI18n } from "vue-i18n";
import { useRoute } from "vue-router";
import { useAppModal } from "../../app/app-modal/app-modal.js";
import { useAppNotification } from "../../app/app-notification/app-notification.js";
import { useListFilter } from "../../../../composables/list-filter.js";
Expand Down Expand Up @@ -373,6 +375,7 @@ export default {
},
emits: ["file-uploaded", "file-updated", "model-created"],
setup(props, { emit }) {
const route = useRoute();
const { t } = useI18n();
const { pushNotification } = useAppNotification();
const { currentSpace } = useSpaces();
Expand Down Expand Up @@ -538,6 +541,7 @@ export default {
const showTagManager = ref(false);
const folderToManage = ref(null);
const fileToManage = ref(null);
const currentVisa = ref(null)

let stopCurrentFilesWatcher;
const openAccessManager = folder => {
Expand Down Expand Up @@ -571,7 +575,7 @@ export default {
};

const openVisaManager = file => {
if (file.file_name) {
if (file?.file_name) {
fileToManage.value = file;
} else {
fileToManage.value = { id: null };
Expand All @@ -588,6 +592,7 @@ export default {
setTimeout(() => {
showVisaManager.value = false;
fileToManage.value = null;
currentVisa.value = null;
}, 100);
};

Expand Down Expand Up @@ -635,6 +640,14 @@ export default {

toValidateVisas.value = toValidateResponse;
createdVisas.value = createdResponse;
if (route.query.visaId) {
currentVisa.value = toValidateVisas.value.find(
v => v.id === parseInt(route.query.visaId)
);
if (currentVisa.value) {
openVisaManager();
}
}
} finally {
visasLoading.value = false;
}
Expand Down Expand Up @@ -768,6 +781,7 @@ export default {
showDeleteModal,
showSidePanel,
fileToManage,
currentVisa,
toValidateVisas,
createdVisas,
visasLoading,
Expand Down
8 changes: 6 additions & 2 deletions src/components/specific/visa/visa-main/VisaMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export default {
type: Object,
required: true
},
visa: {
type: Object,
required: false
},
toValidateVisas: {
type: Array,
required: true
Expand All @@ -69,8 +73,8 @@ export default {
setup(props, { emit }) {
const { fetchVisa } = useVisa();

const currentView = ref(props.document.id ? "visaAdd" : "visaList");
const currentVisa = ref(null);
const currentVisa = ref(props.visa);
const currentView = ref(currentVisa.value ? "visaSummary" : props.document.id ? "visaAdd" : "visaList");

const createVisa = async visa => {
currentVisa.value = await fetchVisa(props.project, visa);
Expand Down