Finishes Filter by Author on Activities list. #330.

This commit is contained in:
Mateus Machado Luna 2019-11-08 10:29:55 -03:00
parent a3a05408aa
commit 89abb207b3
3 changed files with 16 additions and 40 deletions

View File

@ -85,9 +85,10 @@
<b-autocomplete
:data="users"
:placeholder="$i18n.get('instruction_type_search_users_filter')"
:keep-first="keepFirst"
:open-on-focus="openOnFocus"
@typing="fetchUsersForFiltering"
keep-first
open-on-focus
@input="fetchUsersForFiltering"
@focus.once="($event) => fetchUsersForFiltering($event.target.value)"
@select="filterActivitiesByUser"
:loading="isFetchingUsers"
field="name"
@ -447,6 +448,7 @@
];
},
fetchUsersForFiltering: _.debounce(function (search) {
this.isFetchingUsers = true;
this.fetchUsers({ search: search })
@ -543,7 +545,7 @@
.button {
display: flex;
align-items: center;
border-radius: 0 !important;
border-radius: 0px !important;
height: 1.95rem !important;
}

View File

@ -20,6 +20,10 @@
cursor: default;
}
}
&>.control.has-icons-left .icon {
height: 2.125rem;
width: 2.125rem;
}
.dropdown-menu {
padding: 0px;
margin-top: 0;

View File

@ -21,18 +21,8 @@ export const fetchActivities = ({ commit }, { page, activitiesPerPage, search, s
endpoint += '&' + qs.stringify(dateQuery);
}
if (authorId != undefined && authorId != null) {
let metaQuery = {
metaquery: [
{
value: authorId,
key: 'user_id',
compare: '='
}
]
};
endpoint += '&' + qs.stringify(metaQuery);
}
if (authorId != undefined && authorId != null)
endpoint += '&authorid=' + authorId;
return new Promise((resolve, reject) => {
axios.tainacan.get(endpoint)
@ -70,18 +60,8 @@ export const fetchCollectionActivities = ({ commit }, { page, activitiesPerPage,
endpoint += '&' + qs.stringify(dateQuery);
}
if (authorId != undefined && authorId != null) {
let metaQuery = {
metaquery: [
{
value: authorId,
key: 'user_id',
compare: '='
}
]
};
endpoint += '&' + qs.stringify(metaQuery);
}
if (authorId != undefined && authorId != null)
endpoint += '&authorid=' + authorId;
return new Promise((resolve, reject) => {
axios.tainacan.get(endpoint)
@ -106,18 +86,8 @@ export const fetchItemActivities = ({ commit }, { page, activitiesPerPage, itemI
if (search != undefined && search != '')
endpoint += `&search=${search}`;
if (authorId != undefined && authorId != null) {
let metaQuery = {
metaquery: [
{
value: authorId,
key: 'user_id',
compare: '='
}
]
};
endpoint += '&' + qs.stringify(metaQuery);
}
if (authorId != undefined && authorId != null)
endpoint += '&authorid=' + authorId;
if (searchDates && searchDates[0] != null && searchDates[1] != null) {
let dateQuery = {