Remove archive confirmation modals from all tables [SCI-9989]"

This commit is contained in:
Giga Chubinidze 2024-01-18 04:41:57 +04:00
parent 003990993d
commit a2cd0b2075
3 changed files with 18 additions and 48 deletions

View file

@ -26,13 +26,6 @@
</template>
</DataTable>
<ConfirmationModal
:title="i18n.t('experiments.index.archive_confirm_title')"
:description="i18n.t('experiments.index.archive_confirm')"
:confirmClass="'btn btn-primary'"
:confirmText="i18n.t('general.archive')"
ref="archiveModal"
></ConfirmationModal>
<DescriptionModal
v-if="descriptionModalObject"
:experiment="descriptionModalObject"
@ -224,15 +217,12 @@ export default {
this.reloadingTable = true;
},
async archive(event, rows) {
const ok = await this.$refs.archiveModal.show();
if (ok) {
axios.post(event.path, { experiment_ids: rows.map((row) => row.id) }).then((response) => {
this.reloadingTable = true;
HelperModule.flashAlertMsg(response.data.message, 'success');
}).catch((error) => {
HelperModule.flashAlertMsg(error.response.data.error, 'danger');
});
}
axios.post(event.path, { experiment_ids: rows.map((row) => row.id) }).then((response) => {
this.reloadingTable = true;
HelperModule.flashAlertMsg(response.data.message, 'success');
}).catch((error) => {
HelperModule.flashAlertMsg(error.response.data.error, 'danger');
});
},
restore(event, rows) {
axios.post(event.path, { experiment_ids: rows.map((row) => row.id) }).then((response) => {

View file

@ -33,13 +33,6 @@
:assignedUsersUrl="assignedUsersUrl"
@create="updateTable"
@close="newModalOpen = false" />
<ConfirmationModal
:title="i18n.t('experiments.table.archive_confirm_title')"
:description="i18n.t('experiments.table.archive_confirm')"
:confirmClass="'btn btn-primary'"
:confirmText="i18n.t('general.archive')"
ref="archiveModal"
></ConfirmationModal>
<EditModal v-if="editModalObject"
:my_module="editModalObject"
@close="editModalObject = null"
@ -269,15 +262,12 @@ export default {
this.moveModalObject = null;
},
async archive(event, rows) {
const ok = await this.$refs.archiveModal.show();
if (ok) {
axios.post(event.path, { my_modules: rows.map((row) => row.id) }).then((response) => {
this.reloadingTable = true;
HelperModule.flashAlertMsg(response.data.message, 'success');
}).catch((error) => {
HelperModule.flashAlertMsg(error.response.data.error, 'danger');
});
}
axios.post(event.path, { my_modules: rows.map((row) => row.id) }).then((response) => {
this.reloadingTable = true;
HelperModule.flashAlertMsg(response.data.message, 'success');
}).catch((error) => {
HelperModule.flashAlertMsg(error.response.data.error, 'danger');
});
},
restore(event, rows) {
axios.post(event.path, { my_modules_ids: rows.map((row) => row.id), view: 'table' }).then((response) => {

View file

@ -28,13 +28,6 @@
</DataTable>
<a href="#" ref="commentButton" class="open-comments-sidebar hidden"
data-turbolinks="false" data-object-type="Project" data-object-id=""></a>
<ConfirmationModal
:title="i18n.t('projects.index.archive_confirm_title')"
:description="i18n.t('projects.index.archive_confirm')"
:confirmClass="'btn btn-primary'"
:confirmText="i18n.t('general.archive')"
ref="archiveModal"
></ConfirmationModal>
<ConfirmationModal
:title="i18n.t('projects.index.modal_delete_folders.title')"
:description="folderDeleteDescription"
@ -261,15 +254,12 @@ export default {
};
},
async archive(event, rows) {
const ok = await this.$refs.archiveModal.show();
if (ok) {
axios.post(event.path, { project_ids: rows.map((row) => row.id) }).then((response) => {
this.reloadingTable = true;
HelperModule.flashAlertMsg(response.data.message, 'success');
}).catch((error) => {
HelperModule.flashAlertMsg(error.response.data.error, 'danger');
});
}
axios.post(event.path, { project_ids: rows.map((row) => row.id) }).then((response) => {
this.reloadingTable = true;
HelperModule.flashAlertMsg(response.data.message, 'success');
}).catch((error) => {
HelperModule.flashAlertMsg(error.response.data.error, 'danger');
});
},
restore(event, rows) {
axios.post(event.path, { project_ids: rows.map((row) => row.id) }).then((response) => {