Skip to content

Commit

Permalink
[Fix] Bug on lists badge number and on display selection only when a …
Browse files Browse the repository at this point in the history
…selected item is delet
  • Loading branch information
PRADO SEBASTIEN committed Nov 22, 2023
1 parent edc3aa3 commit a45111a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,10 @@ export default class TableAsyncView<T extends NamedResourceDTO> extends Vue {
this.refresh()
}
refresh() {
this.currentPage = 1;
this.pageSize=this.defaultPageSize;
this.tableRef.refresh();
refresh() {
this.currentPage = 1;
this.pageSize=this.defaultPageSize;
this.tableRef.refresh();
}
// function that reset the selected elements
Expand All @@ -420,7 +419,20 @@ export default class TableAsyncView<T extends NamedResourceDTO> extends Vue {
onRefreshed() {
let that = this;
this.$emit('refreshed')
this.$emit('refreshed');
//Remove elements from the selection if they are deleted / update the number of badge elements displayed
this.selectedItems.forEach((element, index) => {
let tableIndex = this.tableRef.sortedItems.findIndex(
it => element.uri == it.uri
);
if (tableIndex < 0) {
this.selectedItems.splice(index, 1);
}
});
this.numberOfSelectedRows = this.selectedItems.length;
setTimeout(function() {
that.afterRefreshedItemsSelection();
}, 1); //do it after real table refreshed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default class ProvenanceList extends Vue {
default: false
})
noActions;
visibleDetails: boolean = false;
usedVariables: any[] = [];
selectedProvenance: any = null;
Expand Down
3 changes: 1 addition & 2 deletions opensilex-front/front/src/components/data/ProvenanceView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,8 @@ export default class ProvenanceView extends Vue {
return form;
}
deleteProvenance(uri: string) {
console.log("deleteProvenance " + uri);
deleteProvenance(uri: string) {
this.service
.deleteProvenance(uri)
.then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ export default class DeviceList extends Vue {
showVariableForm: boolean = false;
showEventForm: boolean = false;
showMoveForm: boolean = false;
filter = {
name: undefined,
rdf_type: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export default class GermplasmView extends Vue {
}
deleteGermplasm(uri: string) {
console.debug("deleteGermplasm " + uri);
this.service
.deleteGermplasm(uri)
.then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
@select="$emit('select', $event)"
@unselect="$emit('unselect', $event)"
@selectall="$emit('selectall', $event)"
:itemIsSelected="itemIsSelected"
class="modalVariablesList">

<template v-slot:selectableTableButtons="{ numberOfSelectedRows }">
Expand Down Expand Up @@ -366,6 +367,9 @@ export default class VariableList extends Vue {
$i18n: any;
SearchFiltersToggle: boolean = false;
@Prop()
itemIsSelected;
displayActions:boolean = true;
get user() {
Expand Down

0 comments on commit a45111a

Please sign in to comment.