Add command autocomplete

This commit is contained in:
Daniel Espino García
2022-03-17 18:07:04 +01:00
parent 088aa193ab
commit b2408bd5d1
20 changed files with 2265 additions and 21 deletions

View File

@@ -175,3 +175,5 @@ export const makeCallErrorResponse = (errMessage: string) => {
error: errMessage,
};
};
export const filterEmptyOptions = (option: AppSelectOption): boolean => Boolean(option.value && !option.value.match(/^[ \t]+$/));

View File

@@ -62,6 +62,9 @@ export function buildQueryString(parameters: Dictionary<any>): string {
let query = '?';
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (parameters[key] == null) {
continue;
}
query += key + '=' + encodeURIComponent(parameters[key]);
if (i < keys.length - 1) {

View File

@@ -192,8 +192,8 @@ export function confirmOutOfOfficeDisabled(intl: IntlShape, status: string, upda
);
}
export function isShared(user: UserProfile): boolean {
return Boolean(user.remote_id);
export function isShared(user: UserProfile | UserModel): boolean {
return 'remote_id' in user ? Boolean(user.remote_id) : false;
}
export function removeUserFromList(userId: string, originalList: UserProfile[]): UserProfile[] {