Finishes Filter by Author on Activities list. #330.
This commit is contained in:
parent
a3a05408aa
commit
89abb207b3
|
@ -85,9 +85,10 @@
|
||||||
<b-autocomplete
|
<b-autocomplete
|
||||||
:data="users"
|
:data="users"
|
||||||
:placeholder="$i18n.get('instruction_type_search_users_filter')"
|
:placeholder="$i18n.get('instruction_type_search_users_filter')"
|
||||||
:keep-first="keepFirst"
|
keep-first
|
||||||
:open-on-focus="openOnFocus"
|
open-on-focus
|
||||||
@typing="fetchUsersForFiltering"
|
@input="fetchUsersForFiltering"
|
||||||
|
@focus.once="($event) => fetchUsersForFiltering($event.target.value)"
|
||||||
@select="filterActivitiesByUser"
|
@select="filterActivitiesByUser"
|
||||||
:loading="isFetchingUsers"
|
:loading="isFetchingUsers"
|
||||||
field="name"
|
field="name"
|
||||||
|
@ -447,6 +448,7 @@
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
fetchUsersForFiltering: _.debounce(function (search) {
|
fetchUsersForFiltering: _.debounce(function (search) {
|
||||||
|
|
||||||
this.isFetchingUsers = true;
|
this.isFetchingUsers = true;
|
||||||
|
|
||||||
this.fetchUsers({ search: search })
|
this.fetchUsers({ search: search })
|
||||||
|
@ -543,7 +545,7 @@
|
||||||
.button {
|
.button {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 0 !important;
|
border-radius: 0px !important;
|
||||||
height: 1.95rem !important;
|
height: 1.95rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,10 @@
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&>.control.has-icons-left .icon {
|
||||||
|
height: 2.125rem;
|
||||||
|
width: 2.125rem;
|
||||||
|
}
|
||||||
.dropdown-menu {
|
.dropdown-menu {
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
|
|
|
@ -21,18 +21,8 @@ export const fetchActivities = ({ commit }, { page, activitiesPerPage, search, s
|
||||||
endpoint += '&' + qs.stringify(dateQuery);
|
endpoint += '&' + qs.stringify(dateQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authorId != undefined && authorId != null) {
|
if (authorId != undefined && authorId != null)
|
||||||
let metaQuery = {
|
endpoint += '&authorid=' + authorId;
|
||||||
metaquery: [
|
|
||||||
{
|
|
||||||
value: authorId,
|
|
||||||
key: 'user_id',
|
|
||||||
compare: '='
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
endpoint += '&' + qs.stringify(metaQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
axios.tainacan.get(endpoint)
|
axios.tainacan.get(endpoint)
|
||||||
|
@ -70,18 +60,8 @@ export const fetchCollectionActivities = ({ commit }, { page, activitiesPerPage,
|
||||||
endpoint += '&' + qs.stringify(dateQuery);
|
endpoint += '&' + qs.stringify(dateQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authorId != undefined && authorId != null) {
|
if (authorId != undefined && authorId != null)
|
||||||
let metaQuery = {
|
endpoint += '&authorid=' + authorId;
|
||||||
metaquery: [
|
|
||||||
{
|
|
||||||
value: authorId,
|
|
||||||
key: 'user_id',
|
|
||||||
compare: '='
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
endpoint += '&' + qs.stringify(metaQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
axios.tainacan.get(endpoint)
|
axios.tainacan.get(endpoint)
|
||||||
|
@ -106,18 +86,8 @@ export const fetchItemActivities = ({ commit }, { page, activitiesPerPage, itemI
|
||||||
if (search != undefined && search != '')
|
if (search != undefined && search != '')
|
||||||
endpoint += `&search=${search}`;
|
endpoint += `&search=${search}`;
|
||||||
|
|
||||||
if (authorId != undefined && authorId != null) {
|
if (authorId != undefined && authorId != null)
|
||||||
let metaQuery = {
|
endpoint += '&authorid=' + authorId;
|
||||||
metaquery: [
|
|
||||||
{
|
|
||||||
value: authorId,
|
|
||||||
key: 'user_id',
|
|
||||||
compare: '='
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
endpoint += '&' + qs.stringify(metaQuery);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (searchDates && searchDates[0] != null && searchDates[1] != null) {
|
if (searchDates && searchDates[0] != null && searchDates[1] != null) {
|
||||||
let dateQuery = {
|
let dateQuery = {
|
||||||
|
|
Loading…
Reference in New Issue