Merged in bugfix/PMCORE-3358 (pull request #8177)
PMCORE-3358 Approved-by: Rodrigo Quelca
This commit is contained in:
committed by
Julio Cesar Laura Avendaño
commit
bb0f4e2fab
@@ -1,7 +1,19 @@
|
||||
<template>
|
||||
<div>
|
||||
<i v-if="props.sortable" :class="icon"></i>
|
||||
<b-button
|
||||
class="btn-clear-sort"
|
||||
variant="primary"
|
||||
@click="clear"
|
||||
size="sm"
|
||||
v-if="this.props.sortStatus.sorted"
|
||||
>
|
||||
{{ $t('ID_CLEAR') }}
|
||||
</b-button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { Event } from "vue-tables-2";
|
||||
export default {
|
||||
name: "VtSortControl",
|
||||
props: ["props"],
|
||||
@@ -15,5 +27,15 @@ export default {
|
||||
: "fas fa-sort-amount-down";
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* Send the event to reset the sort
|
||||
*/
|
||||
clear (e) {
|
||||
e.preventDefault();
|
||||
Event.$emit("clearSortEvent");
|
||||
e.stopPropagation();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -678,6 +678,7 @@ export default {
|
||||
id: that.data.customListId
|
||||
});
|
||||
});
|
||||
Event.$on('clearSortEvent', this.clearSort);
|
||||
},
|
||||
watch: {
|
||||
columns: function(val) {
|
||||
@@ -1238,6 +1239,21 @@ export default {
|
||||
return dataEllipsisMap[page];
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Reset the sort in the table
|
||||
*/
|
||||
clearSort() {
|
||||
if (this.$refs['vueTable']) {
|
||||
this.$refs['vueTable'].setOrder(false)
|
||||
this.$emit("updateSettings", {
|
||||
data: [],
|
||||
key: "orderBy",
|
||||
page: that.data.pageParent,
|
||||
type: "custom",
|
||||
id: that.data.customListId
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
||||
@@ -352,6 +352,7 @@ export default {
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
Event.$on('clearSortEvent', this.clearSort);
|
||||
},
|
||||
watch: {
|
||||
columns: function (val) {
|
||||
@@ -687,6 +688,21 @@ export default {
|
||||
onPostNotes() {
|
||||
this.$refs["vueTable"].getData();
|
||||
},
|
||||
/**
|
||||
* Reset the sort in the table
|
||||
*/
|
||||
clearSort() {
|
||||
if (this.$refs['vueTable']) {
|
||||
this.$refs['vueTable'].setOrder(false);
|
||||
this.$emit("updateSettings", {
|
||||
data: [],
|
||||
key: "orderBy",
|
||||
page: "draft",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -387,6 +387,7 @@ export default {
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
Event.$on('clearSortEvent', this.clearSort);
|
||||
},
|
||||
watch: {
|
||||
columns: function (val) {
|
||||
@@ -789,6 +790,21 @@ export default {
|
||||
onPostNotes() {
|
||||
this.$refs["vueTable"].getData();
|
||||
},
|
||||
/**
|
||||
* Reset the sort in the table
|
||||
*/
|
||||
clearSort() {
|
||||
if (this.$refs['vueTable']) {
|
||||
this.$refs['vueTable'].setOrder(false);
|
||||
this.$emit("updateSettings", {
|
||||
data: [],
|
||||
key: "orderBy",
|
||||
page: "inbox",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -220,6 +220,7 @@ export default {
|
||||
PAUSED: this.$i18n.t("ID_PAUSED"),
|
||||
UNASSIGNED: this.$i18n.t("ID_UNASSIGNED"),
|
||||
},
|
||||
clearSortState: this.settings && this.settings.orderBy && this.settings.orderBy.column,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@@ -241,6 +242,7 @@ export default {
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
Event.$on('clearSortEvent', this.clearSort);
|
||||
},
|
||||
watch: {
|
||||
columns: function (val) {
|
||||
@@ -713,6 +715,21 @@ export default {
|
||||
countDownChanged(dismissCountDown) {
|
||||
this.dataAlert.dismissCountDown = dismissCountDown;
|
||||
},
|
||||
/**
|
||||
* Reset the sort in the table
|
||||
*/
|
||||
clearSort() {
|
||||
if (this.$refs['vueTable']) {
|
||||
this.$refs['vueTable'].setOrder(false)
|
||||
this.$emit("updateSettings", {
|
||||
data: [],
|
||||
key: "orderBy",
|
||||
page: "MyCases",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -723,4 +740,9 @@ export default {
|
||||
padding-left: 50px;
|
||||
padding-right: 50px;
|
||||
}
|
||||
/*.btn-clear-sort {
|
||||
position: fixed;
|
||||
margin-top: 16px;
|
||||
margin-left: -11px;
|
||||
}*/
|
||||
</style>
|
||||
|
||||
@@ -386,6 +386,7 @@ export default {
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
Event.$on('clearSortEvent', this.clearSort);
|
||||
},
|
||||
watch: {
|
||||
columns: function (val) {
|
||||
@@ -772,6 +773,21 @@ export default {
|
||||
onPostNotes() {
|
||||
this.$refs["vueTable"].getData();
|
||||
},
|
||||
/**
|
||||
* Reset the sort in the table
|
||||
*/
|
||||
clearSort() {
|
||||
if (this.$refs['vueTable']) {
|
||||
this.$refs['vueTable'].setOrder(false);
|
||||
this.$emit("updateSettings", {
|
||||
data: [],
|
||||
key: "orderBy",
|
||||
page: "paused",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -377,6 +377,7 @@ export default {
|
||||
id: this.id
|
||||
});
|
||||
});
|
||||
Event.$on('clearSortEvent', this.clearSort);
|
||||
},
|
||||
watch: {
|
||||
columns: function (val) {
|
||||
@@ -741,6 +742,21 @@ export default {
|
||||
onPostNotes() {
|
||||
this.$refs["vueTable"].getData();
|
||||
},
|
||||
/**
|
||||
* Reset the sort in the table
|
||||
*/
|
||||
clearSort() {
|
||||
if (this.$refs['vueTable']) {
|
||||
this.$refs['vueTable'].setOrder(false);
|
||||
this.$emit("updateSettings", {
|
||||
data: [],
|
||||
key: "orderBy",
|
||||
page: "unassigned",
|
||||
type: "normal",
|
||||
id: this.id
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user