1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-23 23:33:01 +02:00

Compare commits

..

4 Commits

Author SHA1 Message Date
Hubert
cde490a59b Solved the typescript error. 2023-08-17 10:51:14 -03:00
Hubert
eefebb2444 lowercase the searchQuery to turns the search for users case-insensitive, in postgresql and sqlite. 2023-08-16 15:29:44 -03:00
Hubert
f92ca399b8 Removes the trim. 2023-08-16 15:00:38 -03:00
Hubert
c30f895db9 Just added a trim in the searchQuery. 2023-08-16 14:44:14 -03:00
2 changed files with 18 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
import * as React from 'react';
import { useState, useEffect, useCallback } from 'react';
import { Banner, ActivityIndicator } from 'react-native-paper';
import { Banner, ActivityIndicator, Modal } from 'react-native-paper';
import { _, languageName } from '@joplin/lib/locale';
import useAsyncEffect, { AsyncEffectEvent } from '@joplin/lib/hooks/useAsyncEffect';
import { getVosk, Recorder, startRecording, Vosk } from '../../services/voiceTyping/vosk';
@@ -107,16 +107,18 @@ export default (props: Props) => {
};
return (
<Banner
visible={true}
icon={renderIcon()}
actions={[
{
label: _('Done'),
onPress: onDismiss,
},
]}>
{`${_('Voice typing...')}\n${renderContent()}`}
</Banner>
<Modal visible={true} style={{ display: 'flex', flexDirection: 'column', justifyContent: 'flex-end' }}>
<Banner
visible={true}
icon={renderIcon()}
actions={[
{
label: _('Done'),
onPress: onDismiss,
},
]}>
{`${_('Voice typing...')}\n${renderContent()}`}
</Banner>
</Modal>
);
};

View File

@@ -100,7 +100,7 @@ router.get('admin/users', async (_path: SubPath, ctx: AppContext) => {
await userModel.checkIfAllowed(ctx.joplin.owner, AclAction.List);
const showDisabled = ctx.query.show_disabled === '1';
const searchQuery = ctx.query.query || '';
const searchQuery = (ctx.query.query && ctx.query.query.toString().toLowerCase()) || '';
const pagination = makeTablePagination(ctx.query, 'full_name', PaginationOrderDir.ASC);
pagination.limit = 1000;
@@ -112,7 +112,9 @@ router.get('admin/users', async (_path: SubPath, ctx: AppContext) => {
if (searchQuery) {
void query.where(qb => {
void qb.whereRaw('full_name like ?', [`%${searchQuery}%`]).orWhereRaw('email like ?', [`%${searchQuery}%`]);
void qb
.whereRaw('lower(full_name) like ?', [`%${searchQuery}%`])
.orWhereRaw('lower(email) like ?', [`%${searchQuery}%`]);
});
}