ref: Refactoring

This commit is contained in:
Maksim Eltyshev
2025-11-27 18:24:55 +01:00
parent 7be2343076
commit 54e230d4c1
80 changed files with 252 additions and 159 deletions
+5
View File
@@ -3,8 +3,11 @@
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
import { StaticUserIds } from '../constants/StaticUsers';
import { ListTypes, UserRoles } from '../constants/Enums';
export const isUserStatic = (user) => [StaticUserIds.DELETED].includes(user.id);
export const isUserAdminOrProjectOwner = (user) =>
[UserRoles.ADMIN, UserRoles.PROJECT_OWNER].includes(user.role);
@@ -12,3 +15,5 @@ export const isListArchiveOrTrash = (list) =>
[ListTypes.ARCHIVE, ListTypes.TRASH].includes(list.type);
export const isListFinite = (list) => [ListTypes.ACTIVE, ListTypes.CLOSED].includes(list.type);
export const isListKanban = (list) => [ListTypes.ACTIVE, ListTypes.CLOSED].includes(list.type);
+1
View File
@@ -11,6 +11,7 @@ const USERNAME_REGEX = /^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$/;
export const isUrl = (string) =>
isURL(string, {
protocols: ['http', 'https'],
require_tld: false,
require_protocol: true,
max_allowed_length: 2048,
});