@gen-epix/ui-client-common 4.4.2 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/dist/@types/mui.d.ts +13 -5
- package/dist/@types/ui-client-common.d.ts +1 -0
- package/dist/_chunks/ApplicationFooter.js +44 -44
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +13 -13
- package/dist/_chunks/Breadcrumbs.js.map +1 -1
- package/dist/_chunks/CrudPage.js +300 -300
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/Notifications.js +51 -51
- package/dist/_chunks/Notifications.js.map +1 -1
- package/dist/_chunks/OutageList.js +29 -29
- package/dist/_chunks/OutageUtil.js +1 -2
- package/dist/_chunks/OutageUtil.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +96 -388
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +518 -512
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +8 -16
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +14 -12
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +77 -77
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/UserManagerUtil.js +210 -209
- package/dist/_chunks/UserManagerUtil.js.map +1 -1
- package/dist/_chunks/_baseFlatten.js +8 -8
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseGet.js +280 -0
- package/dist/_chunks/_baseGet.js.map +1 -0
- package/dist/_chunks/_baseIteratee.js +274 -0
- package/dist/_chunks/_baseIteratee.js.map +1 -0
- package/dist/_chunks/_baseUnset.js +22 -299
- package/dist/_chunks/_baseUnset.js.map +1 -1
- package/dist/_chunks/last.js +13 -0
- package/dist/_chunks/last.js.map +1 -0
- package/dist/_chunks/omit.js +41 -40
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/tableStore.js +190 -183
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/uniq.js +44 -0
- package/dist/_chunks/uniq.js.map +1 -0
- package/dist/_chunks/useMutation.js +22 -22
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +25 -8
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/classes/abstracts/FilterAbstract/index.js +3 -1
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
- package/dist/classes/filters/MultiSelectFilter.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/index.js +15 -15
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/AuthorizationService/index.js +4 -4
- package/dist/classes/services/AuthorizationService/index.js.map +1 -1
- package/dist/classes/services/BackendVersionService/index.js +3 -2
- package/dist/classes/services/BackendVersionService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js +16 -38
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/index.js +9 -8
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/I18nService/index.js +11 -10
- package/dist/classes/services/I18nService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +12 -12
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/index.js +39 -33
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/NotificationService/index.js +8 -8
- package/dist/classes/services/NotificationService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/index.js +13 -9
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/classes/services/RouterService/index.js +3 -6
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/components/app/App/App.d.ts +1 -1
- package/dist/components/app/App/index.js +34 -38
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +28 -28
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +47 -45
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +35 -35
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +19 -19
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +52 -50
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +21 -21
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
- package/dist/components/filters/BooleanFilterField/index.js +5 -5
- package/dist/components/filters/DateFilterField/index.js +3 -3
- package/dist/components/filters/GeoFilterField/index.js +4 -4
- package/dist/components/filters/MultiSelectFilterField/index.js +4 -4
- package/dist/components/filters/NumberRangeFilterField/index.js +3 -3
- package/dist/components/filters/TextFilterField/index.js +3 -3
- package/dist/components/ui/ApplicationBar/index.js +188 -188
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +29 -29
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/LicensesDialog/index.js +38 -38
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/index.js +16 -16
- package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
- package/dist/components/ui/NavLink/index.js +6 -6
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +21 -21
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/PageContainer/index.js +24 -24
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/Sidebar/index.js +30 -30
- package/dist/components/ui/UserFeedbackDialog/index.js +12 -12
- package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
- package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
- package/dist/constants/config.constants.d.ts +0 -2
- package/dist/constants/config.constants.js +2 -2
- package/dist/constants/config.constants.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +12 -12
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +14 -14
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +12 -12
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +13 -13
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationsQuery/index.js +13 -13
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
- package/dist/dataHooks/useUsersQuery/index.js +10 -10
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
- package/dist/hoc/withPermissions/index.js.map +1 -1
- package/dist/hooks/useConfig/index.js +2 -2
- package/dist/hooks/useConfig/index.js.map +1 -1
- package/dist/hooks/useCreateMutation/index.js +12 -12
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/index.js +16 -9
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/index.js +48 -33
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useItemQuery/index.js +4 -4
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -1
- package/dist/locale/en.json +1 -0
- package/dist/locale/nl.json +1 -0
- package/dist/models/config.models.d.ts +1 -5
- package/dist/models/theme.models.d.ts +19 -16
- package/dist/pages/AcceptInvitationPage/index.js +25 -25
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/index.js +16 -16
- package/dist/pages/AdminPage/index.js.map +1 -1
- package/dist/pages/ChooseIdentityProviderPage/index.js +21 -21
- package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
- package/dist/pages/IdentifierIssuersAdminPage/index.js +5 -5
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +5 -5
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationContactsAdminPage/index.js +6 -6
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationSitesAdminPage/index.js +9 -9
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationsAdminPage/index.js +13 -13
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +20 -20
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/PostLoginPage/index.js +6 -6
- package/dist/pages/PostLoginPage/index.js.map +1 -1
- package/dist/pages/PostLogoutPage/index.js +8 -8
- package/dist/pages/PostLogoutPage/index.js.map +1 -1
- package/dist/pages/UsersAdminPage/index.js +39 -39
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/setup/setup.d.ts +1 -1
- package/dist/setup/setup.js +11 -4
- package/dist/setup/setup.js.map +1 -1
- package/dist/theme/demoTheme/index.js +17 -15
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/DataHookUtil/index.js +1 -1
- package/dist/utils/DataHookUtil/index.js.map +1 -1
- package/dist/utils/DependencyContainerUtil/DependencyContainerUtil.d.ts +2 -3
- package/dist/utils/DependencyContainerUtil/index.js +10 -16
- package/dist/utils/DependencyContainerUtil/index.js.map +1 -1
- package/dist/utils/MenuDataUtil/index.js +1 -1
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/StandardConfigUtil/index.js +0 -4
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TimeUtil/index.js +1 -1
- package/dist/utils/TimeUtil/index.js.map +1 -1
- package/package.json +11 -14
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +0 -9
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +0 -6
- package/dist/context/uiClientCommonConfigContext/index.d.ts +0 -3
- package/dist/context/uiClientCommonConfigContext/index.js +0 -34
- package/dist/context/uiClientCommonConfigContext/index.js.map +0 -1
- package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextFilter.js","names":["isNumber","isArray","intersection","isFinite","__toESM","toDate","isValid","isDate","format","require__root","require_isObjectLike","require__baseGetTag","require__arrayMap","require_identity","require__baseUnary","require_isArray","require_isArrayLike","require__SetCache","require__arrayIncludesWith","require__arrayIncludes","require__cacheHas","require__overRest","require__setToString","isAfter","date","dateToCompare","isBefore","isEqual","leftDate","rightDate","require__baseRest","identity","overRest","setToString","baseRest","func","start","require_isArrayLikeObject","isArrayLike","isObjectLike","isArrayLikeObject","value","BooleanFilter","FilterAbstract","rowValue","DateFilter","kwArgs","DATE_FORMAT","sanitizedValue","searchParameterValue","error","usedValue","left","right","rowDateValue","require__baseIntersection","SetCache","arrayIncludes","arrayIncludesWith","arrayMap","baseUnary","cacheHas","nativeMin","baseIntersection","includes","comparator","length","arrays","othLength","othIndex","caches","maxLength","result","array","iteratee","index","seen","computed","cache","require__castArrayLikeObject","castArrayLikeObject","require_intersection","mapped","require_isNumber","baseGetTag","numberTag","isNumber","import_intersection","import_isArray","import_isNumber","MultiSelectFilter","option","v","import_isFinite","__commonJSMin","nativeIsFinite","isFinite","NumberRangeFilter","upper_bound_censor","CommonDbComparisonOperator","TextFilter"],"sources":["../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isAfter.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isBefore.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isEqual.js","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseRest.js","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArrayLikeObject.js","../../src/classes/filters/BooleanFilter.ts","../../src/classes/filters/DateFilter.ts","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIntersection.js","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castArrayLikeObject.js","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/intersection.js","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isNumber.js","../../src/classes/filters/MultiSelectFilter.ts","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isFinite.js","../../src/classes/filters/NumberRangeFilter.ts","../../src/classes/filters/TextFilter.ts"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param date - The date that should be after the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nexport function isAfter(date, dateToCompare) {\n return +toDate(date) > +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isAfter;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param date - The date that should be before the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nexport function isBefore(date, dateToCompare) {\n return +toDate(date) < +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isBefore;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The dates are equal\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * const result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\nexport function isEqual(leftDate, rightDate) {\n return +toDate(leftDate) === +toDate(rightDate);\n}\n\n// Fallback for modularized imports:\nexport default isEqual;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","import type { TFunction } from 'i18next';\nimport type { CommonDbFiltersInner } from '@gen-epix/api-commondb';\n\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\nimport type { Filter } from '../../models/filter.models';\n\nexport class BooleanFilter extends FilterAbstract<boolean> implements Filter<boolean, boolean> {\n public filterValue: boolean = null;\n public initialFilterValue: boolean = null;\n\n public getPresentationValue(value?: unknown, t?: TFunction<'translation', undefined>): string {\n const usedValue = value as string ?? this.filterValue;\n return usedValue ? t('Yes') : t('No');\n }\n\n public matchRowValue(rowValue: boolean): boolean {\n if (this.filterValue === null || this.filterValue === undefined) {\n return true;\n }\n\n if (rowValue === null || rowValue === undefined) {\n return false;\n }\n\n return rowValue === this.filterValue;\n }\n\n public toBackendFilter(): CommonDbFiltersInner {\n throw new Error('Not implemented');\n }\n}\n","import {\n format,\n isAfter,\n isBefore,\n isDate,\n isEqual,\n isValid,\n} from 'date-fns';\nimport type {\n CommonDbDateRangeFilter,\n CommonDbPartialDateRangeFilter,\n} from '@gen-epix/api-commondb';\nimport { DATE_FORMAT } from '@gen-epix/ui-core/constants/date.constants';\n\nimport type { FilterAbstractKwArgs } from '../abstracts/FilterAbstract';\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\nimport type { Filter } from '../../models/filter.models';\n\nexport interface DateFilterKwArgs extends FilterAbstractKwArgs {\n backendFilterType?: 'DATE_RANGE' | 'PARTIAL_DATE_RANGE';\n dateFormat?: typeof DATE_FORMAT[keyof typeof DATE_FORMAT];\n dateParser: (date: string) => Date;\n maxDate: Date;\n minDate: Date;\n}\n\nexport class DateFilter extends FilterAbstract<[Date, Date]> implements Filter<[Date, Date], string> {\n public backendFilterType: 'DATE_RANGE' | 'PARTIAL_DATE_RANGE';\n public dateFormat: typeof DATE_FORMAT[keyof typeof DATE_FORMAT];\n public dateParser: (date: string) => Date;\n public filterValue: [Date, Date] = [null, null];\n public initialFilterValue: [Date, Date] = [null, null];\n public maxDate: Date;\n public minDate: Date;\n\n public constructor(kwArgs: DateFilterKwArgs) {\n super({\n filterDimensionId: kwArgs.filterDimensionId,\n filterMode: kwArgs.filterMode,\n filterPriority: kwArgs.filterPriority,\n id: kwArgs.id,\n label: kwArgs.label,\n });\n this.minDate = kwArgs.minDate;\n this.maxDate = kwArgs.maxDate;\n this.dateParser = kwArgs.dateParser;\n this.dateFormat = kwArgs.dateFormat ?? DATE_FORMAT.DATE;\n this.backendFilterType = kwArgs.backendFilterType ?? 'DATE_RANGE';\n }\n\n public fromURLSearchParameterValue(searchParameterValue: string): [Date, Date] {\n try {\n const sanitizedValue = (JSON.parse(searchParameterValue) as string[]).map(value => {\n if (!value) {\n return null;\n }\n const date = this.dateParser(value);\n return isDate(date) && isValid(date) ? date : null;\n });\n if (sanitizedValue.length !== 2) {\n return [null, null];\n }\n return sanitizedValue as [Date, Date];\n } catch (error) {\n console.error(`Error parsing search parameter value for label ${this.label} and value ${searchParameterValue}`, error);\n return [null, null];\n }\n }\n\n public getPresentationValue(value?: unknown): string {\n const usedValue = value as [Date, Date] ?? this.filterValue;\n\n let left: string;\n let right: string;\n try {\n left = usedValue[0] ? format(usedValue[0], this.dateFormat) : '...';\n } catch (_e: unknown) {\n left = '...';\n }\n try {\n right = usedValue[1] ? format(usedValue[1], this.dateFormat) : '...';\n } catch (_e: unknown) {\n right = '...';\n }\n\n return `${left} - ${right}`;\n }\n\n public matchRowValue(rowValue: string): boolean {\n if (!this.filterValue) {\n return true;\n }\n const left = this.filterValue[0];\n const right = this.filterValue[1];\n\n if (!isDate(left) && !isDate(right)) {\n return true;\n }\n if (!rowValue) { // empty string\n return false;\n }\n const rowDateValue = this.dateParser(rowValue);\n\n if (isDate(left) && isDate(right)) {\n return (isAfter(rowDateValue, left) || isEqual(rowDateValue, left)) && (isBefore(rowDateValue, right) || isEqual(rowDateValue, right));\n }\n if (isDate(left)) {\n return isAfter(rowDateValue, left) || isEqual(rowDateValue, left);\n }\n if (isDate(right)) {\n return isBefore(rowDateValue, right) || isEqual(rowDateValue, right);\n }\n }\n\n public toBackendFilter(): CommonDbDateRangeFilter | CommonDbPartialDateRangeFilter {\n if (this.isInitialFilterValue()) {\n return;\n }\n\n return {\n key: this.id,\n lower_bound: this.filterValue[0] && isDate(this.filterValue[0]) ? format(this.filterValue[0], DATE_FORMAT.DATE) : undefined,\n lower_bound_censor: this.filterValue[0] ? '>=' : undefined,\n type: this.backendFilterType,\n upper_bound: this.filterValue[1] && isDate(this.filterValue[1]) ? format(this.filterValue[1], DATE_FORMAT.DATE) : undefined,\n upper_bound_censor: this.filterValue[1] ? '<=' : undefined,\n };\n }\n\n public toURLSearchParameterValue(): string {\n return JSON.stringify(this.filterValue);\n }\n}\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseIntersection;\n","var isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n}\n\nmodule.exports = castArrayLikeObject;\n","var arrayMap = require('./_arrayMap'),\n baseIntersection = require('./_baseIntersection'),\n baseRest = require('./_baseRest'),\n castArrayLikeObject = require('./_castArrayLikeObject');\n\n/**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\nvar intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n});\n\nmodule.exports = intersection;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","import intersection from 'lodash/intersection';\nimport isArray from 'lodash/isArray';\nimport isNumber from 'lodash/isNumber';\nimport type { CommonDbStringSetFilter } from '@gen-epix/api-commondb';\nimport type { AutoCompleteOption } from '@gen-epix/ui-core-form/models/form.models';\n\nimport type { FilterAbstractKwArgs } from '../abstracts/FilterAbstract';\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\nimport type { Filter } from '../../models/filter.models';\n\nexport interface MultiSelectFilterKwArgs extends FilterAbstractKwArgs {\n maxNumOptionsExpanded?: number;\n options: AutoCompleteOption[];\n}\n\nexport class MultiSelectFilter extends FilterAbstract<string[]> implements Filter<string[], string> {\n public filterValue: string[] = [];\n public initialFilterValue: string[] = [];\n public maxNumOptionsExpanded = 5;\n public options: AutoCompleteOption[];\n private readonly optionsMap: Map<string, string> = new Map<string, string>();\n\n public constructor(kwArgs: MultiSelectFilterKwArgs) {\n super({\n filterDimensionId: kwArgs.filterDimensionId,\n filterMode: kwArgs.filterMode,\n filterPriority: kwArgs.filterPriority,\n id: kwArgs.id,\n label: kwArgs.label,\n });\n this.options = kwArgs.options;\n if (isNumber(kwArgs.maxNumOptionsExpanded)) {\n this.maxNumOptionsExpanded = kwArgs.maxNumOptionsExpanded;\n }\n kwArgs.options.forEach(option => {\n this.optionsMap.set(option.value as string, option.label);\n });\n }\n\n public getPresentationValue(value?: unknown): string {\n const usedValues = value as string[] ?? this.filterValue;\n return usedValues.map(v => this.optionsMap.get(v)).join(', ');\n }\n\n public matchRowValue(rowValue: string): boolean {\n if (!this.filterValue) {\n return true;\n }\n\n if (!this.filterValue || !isArray(this.filterValue) || this.filterValue.length === 0) {\n return true;\n }\n if (isArray(rowValue)) {\n return intersection(rowValue, this.filterValue).length > 0;\n }\n return (this.filterValue).includes(rowValue);\n }\n\n public toBackendFilter(): CommonDbStringSetFilter {\n if (this.isInitialFilterValue()) {\n return;\n }\n\n return {\n key: this.id,\n members: this.filterValue,\n type: 'STRING_SET',\n };\n }\n}\n","var root = require('./_root');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsFinite = root.isFinite;\n\n/**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\nfunction isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n}\n\nmodule.exports = isFinite;\n","import isFinite from 'lodash/isFinite';\nimport type { CommonDbNumberRangeFilter } from '@gen-epix/api-commondb';\nimport { CommonDbComparisonOperator } from '@gen-epix/api-commondb';\n\nimport type { Filter } from '../../models/filter.models';\nimport type { FilterAbstractKwArgs } from '../abstracts/FilterAbstract';\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\n\nexport interface NumberRangeFilterKwArgs extends FilterAbstractKwArgs {\n max: number;\n min: number;\n}\n\nexport class NumberRangeFilter extends FilterAbstract<[number, number]> implements Filter<[number, number], number> {\n public filterValue: [number, number] = [null, null];\n public initialFilterValue: [number, number] = [null, null];\n public max: number;\n public min: number;\n\n public constructor(kwArgs: NumberRangeFilterKwArgs) {\n super({\n filterDimensionId: kwArgs.filterDimensionId,\n filterMode: kwArgs.filterMode,\n filterPriority: kwArgs.filterPriority,\n id: kwArgs.id,\n label: kwArgs.label,\n });\n this.min = kwArgs.min;\n this.max = kwArgs.max;\n }\n\n public getPresentationValue(value?: unknown): string {\n const usedValue = value as [number, number] ?? this.filterValue;\n const left = isFinite(usedValue[0]) ? `[${usedValue[0]}` : '';\n const middle = usedValue.every(isFinite) ? ',' : '';\n const right = isFinite(usedValue[1]) ? `${usedValue[1]}[` : '';\n\n return `${left}${middle}${right}`;\n }\n\n public matchRowValue(rowValue: number): boolean {\n if (!this.filterValue) {\n return true;\n }\n\n if (!isFinite(rowValue)) {\n return false;\n }\n\n const left = this.filterValue[0];\n const right = this.filterValue[1];\n\n if (isFinite(left) && +rowValue < this.filterValue[0]) {\n return false;\n }\n if (isFinite(right) && +rowValue > this.filterValue[1]) {\n return false;\n }\n return true;\n }\n\n public toBackendFilter(): CommonDbNumberRangeFilter {\n if (this.isInitialFilterValue()) {\n return;\n }\n let upper_bound_censor: CommonDbComparisonOperator;\n if (this.filterValue[0] === this.filterValue[1]) {\n upper_bound_censor = CommonDbComparisonOperator.Less_Than_Or_Equal_To;\n } else if (isFinite(this.filterValue[1])) {\n upper_bound_censor = CommonDbComparisonOperator.Less_Than;\n }\n\n return {\n key: this.id,\n lower_bound: this.filterValue[0] ?? undefined,\n lower_bound_censor: isFinite(this.filterValue[0]) ? CommonDbComparisonOperator.Greater_Than_Or_Equal_To : undefined,\n type: 'NUMBER_RANGE',\n upper_bound: this.filterValue[1] ?? undefined,\n upper_bound_censor,\n };\n }\n}\n","import type { CommonDbRegexFilter } from '@gen-epix/api-commondb';\n\nimport type { Filter } from '../../models/filter.models';\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\n\nexport class TextFilter extends FilterAbstract<string> implements Filter<string, string> {\n public filterValue: string = '';\n public initialFilterValue: string = '';\n\n public getPresentationValue(value?: unknown): string {\n const usedValue = value as string ?? this.filterValue;\n return usedValue ?? '';\n }\n\n public matchRowValue(rowValue: string): boolean {\n if (!this.filterValue) {\n return true;\n }\n\n if (!rowValue) {\n return false;\n }\n return String(rowValue).toLocaleLowerCase().includes(String(this.filterValue).toLocaleLowerCase());\n }\n\n public toBackendFilter(): CommonDbRegexFilter {\n if (this.isInitialFilterValue()) {\n return;\n }\n\n return {\n key: this.id,\n pattern: `.*${this.filterValue}.*`,\n type: 'REGEX',\n };\n }\n}\n"],"ignoreList":[0,1,2,3,4,7,8,9,10,12],"mappings":";;;;;;;;;;;AAoBA,SAAgBuB,EAAQ,GAAM,GAAe;CAC3C,OAAO,CAAClB,EAAOmB,CAAI,IAAI,CAACnB,EAAOoB,CAAa;AAC9C;;;ACFA,SAAgBC,EAAS,GAAM,GAAe;CAC5C,OAAO,CAACrB,EAAOmB,CAAI,IAAI,CAACnB,EAAOoB,CAAa;AAC9C;;;ACCA,SAAgBE,EAAQ,GAAU,GAAW;CAC3C,OAAO,CAACtB,EAAOuB,CAAQ,KAAM,CAACvB,EAAOwB,CAAS;AAChD;;;;CCzBA,IAAIE,IAAAlB,EAAA,GACAmB,IAAAX,EAAA,GACAY,IAAAX,EAAA;CAUJ,SAASY,EAAS,GAAM,GAAO;EAC7B,OAAOD,EAAYD,EAASG,GAAMC,GAAOL,CAAQ,GAAGI,IAAO,EAAE;CAC/D;CAEA,EAAO,UAAUD;;CChBjB,IAAII,IAAAtB,EAAA,GACAuB,IAAA7B,EAAA;CA2BJ,SAAS8B,EAAkB,GAAO;EAChC,OAAOD,EAAaE,CAAK,KAAKH,EAAYG,CAAK;CACjD;CAEA,EAAO,UAAUD;KC1BJE,IAAb,cAAmCC,EAA4D;CAC7F,cAA8B;CAC9B,qBAAqC;CAErC,qBAA4B,GAAiB,GAAiD;EAE5F,OADkBF,KAAmB,KAAK,cACvB,EAAE,KAAK,IAAI,EAAE,IAAI;CACtC;CAEA,cAAqB,GAA4B;EAS/C,OARI,KAAK,gBAAgB,QAAQ,KAAK,gBAAgB,KAAA,KAIlDG,KAAa,QAIVA,M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Y;EAQ/B,OAHA,GAHA,GAAIlD,EAAAA,QAAAA,CAASiD,CAAI,KAAK,CAACR,IAAW,KAAK,YAAY,OAGnD,GAAIzC,EAAAA,QAAAA,CAASkD,CAAK,KAAK,CAACT,IAAW,KAAK,YAAY;CAItD;CAEA,kBAAoD;EAClD,IAAI,KAAK,qBAAqB,GAC5B;EAEF,IAAIsD;EAOJ,OANI,KAAK,YAAY,OAAO,KAAK,YAAY,KAC3C,IAAqBC,EAA2B,yBAC3C,GAAIhG,EAAAA,QAAAA,CAAS,KAAK,YAAY,EAAE,MACrC,IAAqBgG,EAA2B,YAG3C;GACL,KAAK,KAAK;GACV,aAAa,KAAK,YAAY,MAAM,KAAA;GACpC,qBAAA,GAAoBhG,EAAAA,QAAAA,CAAS,KAAK,YAAY,EAAE,IAAIgG,EAA2B,2BAA2B,KAAA;GAC1G,MAAM;GACN,aAAa,KAAK,YAAY,MAAM,KAAA;GACpC;EACF;CACF;AACF,GC5EaC,IAAb,cAAgCzD,EAAyD;CACvF,cAA6B;CAC7B,qBAAoC;CAEpC,qBAA4B,GAAyB;EAEnD,OADkBF,KAAmB,KAAK,eACtB;CACtB;CAEA,cAAqB,GAA2B;EAQ9C,OAPK,KAAK,cAILG,IAGE,OAAOA,CAAQ,CAAC,CAAC,kBAAkB,CAAC,CAAC,SAAS,OAAO,KAAK,WAAW,CAAC,CAAC,kBAAkB,CAAC,IAFxF,KAJA;CAOX;CAEA,kBAA8C;EAC5C,IAAI,MAAK,qBAAqB,GAI9B,OAAO;GACL,KAAK,KAAK;GACV,SAAS,KAAK,KAAK,YAAY;GAC/B,MAAM;EACR;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"TextFilter.js","names":["isNumber","isArray","intersection","isFinite","__toESM","toDate","isValid","isDate","format","require__root","require_isObjectLike","require__baseGetTag","require__arrayMap","require_identity","require__baseUnary","require_isArray","require_isArrayLike","require__SetCache","require__arrayIncludesWith","require__arrayIncludes","require__cacheHas","require__overRest","require__setToString","isAfter","date","dateToCompare","isBefore","isEqual","leftDate","rightDate","require__baseRest","identity","overRest","setToString","baseRest","func","start","require_isArrayLikeObject","isArrayLike","isObjectLike","isArrayLikeObject","value","BooleanFilter","FilterAbstract","rowValue","DateFilter","kwArgs","DATE_FORMAT","sanitizedValue","searchParameterValue","error","usedValue","left","right","rowDateValue","lowerBound","upperBound","hasValidLowerBound","hasValidUpperBound","require__baseIntersection","SetCache","arrayIncludes","arrayIncludesWith","arrayMap","baseUnary","cacheHas","nativeMin","baseIntersection","includes","comparator","length","arrays","othLength","othIndex","caches","maxLength","result","array","iteratee","index","seen","computed","cache","require__castArrayLikeObject","castArrayLikeObject","require_intersection","mapped","require_isNumber","baseGetTag","numberTag","isNumber","import_intersection","import_isArray","import_isNumber","MultiSelectFilter","option","v","import_isFinite","__commonJSMin","nativeIsFinite","isFinite","NumberRangeFilter","isSingleValueRange","upper_bound_censor","CommonDbComparisonOperator","TextFilter"],"sources":["../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isAfter.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isBefore.js","../../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isEqual.js","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseRest.js","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArrayLikeObject.js","../../src/classes/filters/BooleanFilter.ts","../../src/classes/filters/DateFilter.ts","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIntersection.js","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castArrayLikeObject.js","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/intersection.js","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isNumber.js","../../src/classes/filters/MultiSelectFilter.ts","../../../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isFinite.js","../../src/classes/filters/NumberRangeFilter.ts","../../src/classes/filters/TextFilter.ts"],"sourcesContent":["import { toDate } from \"./toDate.js\";\n\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param date - The date that should be after the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nexport function isAfter(date, dateToCompare) {\n return +toDate(date) > +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isAfter;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param date - The date that should be before the other one to return true\n * @param dateToCompare - The date to compare with\n *\n * @returns The first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nexport function isBefore(date, dateToCompare) {\n return +toDate(date) < +toDate(dateToCompare);\n}\n\n// Fallback for modularized imports:\nexport default isBefore;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The dates are equal\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * const result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\nexport function isEqual(leftDate, rightDate) {\n return +toDate(leftDate) === +toDate(rightDate);\n}\n\n// Fallback for modularized imports:\nexport default isEqual;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","import type { TFunction } from 'i18next';\nimport type { CommonDbFiltersInner } from '@gen-epix/api-commondb';\n\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\nimport type { Filter } from '../../models/filter.models';\n\nexport class BooleanFilter extends FilterAbstract<boolean> implements Filter<boolean, boolean> {\n public filterValue: boolean = null;\n public initialFilterValue: boolean = null;\n\n public getPresentationValue(value?: unknown, t?: TFunction<'translation', undefined>): string {\n const usedValue = value as string ?? this.filterValue;\n if (usedValue) {\n return t ? t('Yes') : 'Yes';\n }\n return t ? t('No') : 'No';\n }\n\n public matchRowValue(rowValue: boolean): boolean {\n if (this.filterValue === null || this.filterValue === undefined) {\n return true;\n }\n\n if (rowValue === null || rowValue === undefined) {\n return false;\n }\n\n return rowValue === this.filterValue;\n }\n\n public toBackendFilter(): CommonDbFiltersInner {\n throw new Error('Not implemented');\n }\n}\n","import {\n format,\n isAfter,\n isBefore,\n isDate,\n isEqual,\n isValid,\n} from 'date-fns';\nimport type {\n CommonDbDateRangeFilter,\n CommonDbPartialDateRangeFilter,\n} from '@gen-epix/api-commondb';\nimport { DATE_FORMAT } from '@gen-epix/ui-core/constants/date.constants';\n\nimport type { FilterAbstractKwArgs } from '../abstracts/FilterAbstract';\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\nimport type { Filter } from '../../models/filter.models';\n\nexport interface DateFilterKwArgs extends FilterAbstractKwArgs {\n backendFilterType?: 'DATE_RANGE' | 'PARTIAL_DATE_RANGE';\n dateFormat?: typeof DATE_FORMAT[keyof typeof DATE_FORMAT];\n dateParser: (date: string) => Date;\n maxDate: Date;\n minDate: Date;\n}\n\nexport class DateFilter extends FilterAbstract<[Date, Date]> implements Filter<[Date, Date], string> {\n public backendFilterType: 'DATE_RANGE' | 'PARTIAL_DATE_RANGE';\n public dateFormat: typeof DATE_FORMAT[keyof typeof DATE_FORMAT];\n public dateParser: (date: string) => Date;\n public filterValue: [Date, Date] = [null, null];\n public initialFilterValue: [Date, Date] = [null, null];\n public maxDate: Date;\n public minDate: Date;\n\n public constructor(kwArgs: DateFilterKwArgs) {\n super({\n filterDimensionId: kwArgs.filterDimensionId,\n filterMode: kwArgs.filterMode,\n filterPriority: kwArgs.filterPriority,\n id: kwArgs.id,\n label: kwArgs.label,\n });\n this.minDate = kwArgs.minDate;\n this.maxDate = kwArgs.maxDate;\n this.dateParser = kwArgs.dateParser;\n this.dateFormat = kwArgs.dateFormat ?? DATE_FORMAT.DATE;\n this.backendFilterType = kwArgs.backendFilterType ?? 'DATE_RANGE';\n }\n\n public fromURLSearchParameterValue(searchParameterValue: string): [Date, Date] {\n try {\n const sanitizedValue = (JSON.parse(searchParameterValue) as string[]).map(value => {\n if (!value) {\n return null;\n }\n const date = this.dateParser(value);\n return isDate(date) && isValid(date) ? date : null;\n });\n if (sanitizedValue.length !== 2) {\n return [null, null];\n }\n return sanitizedValue as [Date, Date];\n } catch (error) {\n console.error(`Error parsing search parameter value for label ${this.label} and value ${searchParameterValue}`, error);\n return [null, null];\n }\n }\n\n public getPresentationValue(value?: unknown): string {\n const usedValue = value as [Date, Date] ?? this.filterValue;\n\n let left: string;\n let right: string;\n try {\n left = usedValue[0] ? format(usedValue[0], this.dateFormat) : '...';\n } catch (_e: unknown) {\n left = '...';\n }\n try {\n right = usedValue[1] ? format(usedValue[1], this.dateFormat) : '...';\n } catch (_e: unknown) {\n right = '...';\n }\n\n return `${left} - ${right}`;\n }\n\n public matchRowValue(rowValue: string): boolean {\n if (!this.filterValue) {\n return true;\n }\n const left = this.filterValue[0];\n const right = this.filterValue[1];\n\n if (!isDate(left) && !isDate(right)) {\n return true;\n }\n if (!rowValue) { // empty string\n return false;\n }\n const rowDateValue = this.dateParser(rowValue);\n\n if (isDate(left) && isDate(right)) {\n return (isAfter(rowDateValue, left) || isEqual(rowDateValue, left)) && (isBefore(rowDateValue, right) || isEqual(rowDateValue, right));\n }\n if (isDate(left)) {\n return isAfter(rowDateValue, left) || isEqual(rowDateValue, left);\n }\n return isBefore(rowDateValue, right) || isEqual(rowDateValue, right);\n }\n\n public toBackendFilter(): CommonDbDateRangeFilter | CommonDbPartialDateRangeFilter {\n if (this.isInitialFilterValue()) {\n return;\n }\n\n const lowerBound = this.filterValue[0];\n const upperBound = this.filterValue[1];\n const hasValidLowerBound = isDate(lowerBound) && isValid(lowerBound);\n const hasValidUpperBound = isDate(upperBound) && isValid(upperBound);\n\n return {\n key: this.id,\n lower_bound: hasValidLowerBound ? format(lowerBound, DATE_FORMAT.DATE) : undefined,\n lower_bound_censor: hasValidLowerBound ? '>=' : undefined,\n type: this.backendFilterType,\n upper_bound: hasValidUpperBound ? format(upperBound, DATE_FORMAT.DATE) : undefined,\n upper_bound_censor: hasValidUpperBound ? '<=' : undefined,\n };\n }\n\n public toURLSearchParameterValue(): string {\n return JSON.stringify(this.filterValue);\n }\n}\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseIntersection;\n","var isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n}\n\nmodule.exports = castArrayLikeObject;\n","var arrayMap = require('./_arrayMap'),\n baseIntersection = require('./_baseIntersection'),\n baseRest = require('./_baseRest'),\n castArrayLikeObject = require('./_castArrayLikeObject');\n\n/**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\nvar intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n});\n\nmodule.exports = intersection;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n","import intersection from 'lodash/intersection';\nimport isArray from 'lodash/isArray';\nimport isNumber from 'lodash/isNumber';\nimport type { CommonDbStringSetFilter } from '@gen-epix/api-commondb';\nimport type { AutoCompleteOption } from '@gen-epix/ui-core-form/models/form.models';\n\nimport type { FilterAbstractKwArgs } from '../abstracts/FilterAbstract';\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\nimport type { Filter } from '../../models/filter.models';\n\nexport interface MultiSelectFilterKwArgs extends FilterAbstractKwArgs {\n maxNumOptionsExpanded?: number;\n options: AutoCompleteOption[];\n}\n\nexport class MultiSelectFilter extends FilterAbstract<string[]> implements Filter<string[], string> {\n public filterValue: string[] = [];\n public initialFilterValue: string[] = [];\n public maxNumOptionsExpanded = 5;\n public options: AutoCompleteOption[];\n private readonly optionsMap: Map<string, string> = new Map<string, string>();\n\n public constructor(kwArgs: MultiSelectFilterKwArgs) {\n super({\n filterDimensionId: kwArgs.filterDimensionId,\n filterMode: kwArgs.filterMode,\n filterPriority: kwArgs.filterPriority,\n id: kwArgs.id,\n label: kwArgs.label,\n });\n this.options = kwArgs.options;\n if (isNumber(kwArgs.maxNumOptionsExpanded) && !Number.isNaN(kwArgs.maxNumOptionsExpanded)) {\n this.maxNumOptionsExpanded = kwArgs.maxNumOptionsExpanded;\n }\n kwArgs.options.forEach(option => {\n this.optionsMap.set(option.value as string, option.label);\n });\n }\n\n public getPresentationValue(value?: unknown): string {\n const usedValues = value as string[] ?? this.filterValue;\n return usedValues.map(v => this.optionsMap.get(v)).join(', ');\n }\n\n public matchRowValue(rowValue: string | string[]): boolean {\n if (!this.filterValue) {\n return true;\n }\n\n if (!this.filterValue || !isArray(this.filterValue) || this.filterValue.length === 0) {\n return true;\n }\n if (isArray(rowValue)) {\n return intersection(rowValue, this.filterValue).length > 0;\n }\n return (this.filterValue).includes(rowValue);\n }\n\n public toBackendFilter(): CommonDbStringSetFilter {\n if (this.isInitialFilterValue()) {\n return;\n }\n\n return {\n key: this.id,\n members: this.filterValue,\n type: 'STRING_SET',\n };\n }\n}\n","var root = require('./_root');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsFinite = root.isFinite;\n\n/**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\nfunction isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n}\n\nmodule.exports = isFinite;\n","import isFinite from 'lodash/isFinite';\nimport type { CommonDbNumberRangeFilter } from '@gen-epix/api-commondb';\nimport { CommonDbComparisonOperator } from '@gen-epix/api-commondb';\n\nimport type { Filter } from '../../models/filter.models';\nimport type { FilterAbstractKwArgs } from '../abstracts/FilterAbstract';\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\n\nexport interface NumberRangeFilterKwArgs extends FilterAbstractKwArgs {\n max: number;\n min: number;\n}\n\nexport class NumberRangeFilter extends FilterAbstract<[number, number]> implements Filter<[number, number], number> {\n public filterValue: [number, number] = [null, null];\n public initialFilterValue: [number, number] = [null, null];\n public max: number;\n public min: number;\n\n public constructor(kwArgs: NumberRangeFilterKwArgs) {\n super({\n filterDimensionId: kwArgs.filterDimensionId,\n filterMode: kwArgs.filterMode,\n filterPriority: kwArgs.filterPriority,\n id: kwArgs.id,\n label: kwArgs.label,\n });\n this.min = kwArgs.min;\n this.max = kwArgs.max;\n }\n\n public getPresentationValue(value?: unknown): string {\n const usedValue = value as [number, number] ?? this.filterValue;\n const left = isFinite(usedValue[0]) ? `[${usedValue[0]}` : '';\n const middle = usedValue.every(isFinite) ? ',' : '';\n const right = isFinite(usedValue[1]) ? `${usedValue[1]}${usedValue[0] === usedValue[1] ? ']' : '['}` : '';\n\n return `${left}${middle}${right}`;\n }\n\n public matchRowValue(rowValue: number): boolean {\n if (!this.filterValue) {\n return true;\n }\n\n if (!isFinite(rowValue)) {\n return false;\n }\n\n const left = this.filterValue[0];\n const right = this.filterValue[1];\n\n if (isFinite(left) && +rowValue < this.filterValue[0]) {\n return false;\n }\n const isSingleValueRange = left === right;\n if (isFinite(right) && (isSingleValueRange ? +rowValue > right : +rowValue >= right)) {\n return false;\n }\n return true;\n }\n\n public toBackendFilter(): CommonDbNumberRangeFilter {\n if (this.isInitialFilterValue()) {\n return;\n }\n let upper_bound_censor: CommonDbComparisonOperator;\n if (this.filterValue[0] === this.filterValue[1]) {\n upper_bound_censor = CommonDbComparisonOperator.Less_Than_Or_Equal_To;\n } else if (isFinite(this.filterValue[1])) {\n upper_bound_censor = CommonDbComparisonOperator.Less_Than;\n }\n\n return {\n key: this.id,\n lower_bound: this.filterValue[0] ?? undefined,\n lower_bound_censor: isFinite(this.filterValue[0]) ? CommonDbComparisonOperator.Greater_Than_Or_Equal_To : undefined,\n type: 'NUMBER_RANGE',\n upper_bound: this.filterValue[1] ?? undefined,\n upper_bound_censor,\n };\n }\n}\n","import type { CommonDbRegexFilter } from '@gen-epix/api-commondb';\n\nimport type { Filter } from '../../models/filter.models';\nimport { FilterAbstract } from '../abstracts/FilterAbstract';\n\nexport class TextFilter extends FilterAbstract<string> implements Filter<string, string> {\n public filterValue: string = '';\n public initialFilterValue: string = '';\n\n public getPresentationValue(value?: unknown): string {\n const usedValue = value as string ?? this.filterValue;\n return usedValue ?? '';\n }\n\n public matchRowValue(rowValue: string): boolean {\n if (!this.filterValue) {\n return true;\n }\n\n if (!rowValue) {\n return false;\n }\n return String(rowValue).toLocaleLowerCase().includes(String(this.filterValue).toLocaleLowerCase());\n }\n\n public toBackendFilter(): CommonDbRegexFilter {\n if (this.isInitialFilterValue()) {\n return;\n }\n\n return {\n key: this.id,\n pattern: `.*${this.filterValue}.*`,\n type: 'REGEX',\n };\n }\n}\n"],"ignoreList":[0,1,2,3,4,7,8,9,10,12],"mappings":";;;;;;;;;;;AAoBA,SAAgBuB,EAAQ,GAAM,GAAe;CAC3C,OAAO,CAAClB,EAAOmB,CAAI,IAAI,CAACnB,EAAOoB,CAAa;AAC9C;;;ACFA,SAAgBC,EAAS,GAAM,GAAe;CAC5C,OAAO,CAACrB,EAAOmB,CAAI,IAAI,CAACnB,EAAOoB,CAAa;AAC9C;;;ACCA,SAAgBE,EAAQ,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A2B,YAG3C;GACL,KAAK,KAAK;GACV,aAAa,KAAK,YAAY,MAAM,KAAA;GACpC,qBAAA,GAAoBrG,EAAAA,QAAAA,CAAS,KAAK,YAAY,EAAE,IAAIqG,EAA2B,2BAA2B,KAAA;GAC1G,MAAM;GACN,aAAa,KAAK,YAAY,MAAM,KAAA;GACpC;EACF;CACF;AACF,GC7EaC,IAAb,cAAgC9D,EAAyD;CACvF,cAA6B;CAC7B,qBAAoC;CAEpC,qBAA4B,GAAyB;EAEnD,OADkBF,KAAmB,KAAK,eACtB;CACtB;CAEA,cAAqB,GAA2B;EAQ9C,OAPK,KAAK,cAILG,IAGE,OAAOA,CAAQ,CAAC,CAAC,kBAAkB,CAAC,CAAC,SAAS,OAAO,KAAK,WAAW,CAAC,CAAC,kBAAkB,CAAC,IAFxF,KAJA;CAOX;CAEA,kBAA8C;EAC5C,IAAI,MAAK,qBAAqB,GAI9B,OAAO;GACL,KAAK,KAAK;GACV,SAAS,KAAK,KAAK,YAAY;GAC/B,MAAM;EACR;CACF;AACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as e } from "./format.js";
|
|
2
2
|
import { t } from "./TableUtil.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { API_ORGANIZATION_TOKEN as n } from "../constants/api.constants.js";
|
|
4
|
+
import { useConfig as r } from "../hooks/useConfig/index.js";
|
|
5
|
+
import { AuthenticationService as i } from "../classes/services/AuthenticationService/index.js";
|
|
6
|
+
import { ResponseHandler as a } from "../components/ui/ResponseHandler/index.js";
|
|
7
|
+
import { t as o } from "./QueryClientService.js";
|
|
8
8
|
import { NotificationService as s } from "../classes/services/NotificationService/index.js";
|
|
9
9
|
import { t as c } from "./yup.js";
|
|
10
10
|
import { t as l } from "./CrudPage.js";
|
|
@@ -13,13 +13,13 @@ import { useOrganizationOptionsQuery as d } from "../dataHooks/useOrganizationsQ
|
|
|
13
13
|
import { useUserOptionsQuery as f } from "../dataHooks/useUsersQuery/index.js";
|
|
14
14
|
import { useOrganizationAdminPolicyMapQuery as p } from "../dataHooks/useOrganizationAdminPoliciesQuery/index.js";
|
|
15
15
|
import { useInviteUserConstraintsQuery as m } from "../dataHooks/useInviteUserConstraintsQuery/index.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
16
|
+
import { container as h } from "tsyringe";
|
|
17
|
+
import { WindowService as g } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
18
|
+
import { DATE_FORMAT as _ } from "@gen-epix/ui-core/constants/date.constants";
|
|
19
|
+
import { CommonDbCommandName as v } from "@gen-epix/api-commondb";
|
|
20
|
+
import { Box as y, ListItemIcon as b, ListItemText as x, MenuItem as S, Typography as C } from "@mui/material";
|
|
21
|
+
import { useCallback as w, useEffect as T, useId as E, useMemo as D, useRef as O, useState as k } from "react";
|
|
22
|
+
import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
23
23
|
import { useTranslation as N } from "react-i18next";
|
|
24
24
|
import { array as P, object as F, string as I } from "yup";
|
|
25
25
|
import { TestIdUtil as L } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
@@ -34,37 +34,37 @@ import G from "@mui/icons-material/Password";
|
|
|
34
34
|
import K from "@mui/icons-material/Email";
|
|
35
35
|
import { CopyToClipboardButton as q } from "@gen-epix/ui-core-components/components/CopyToClipboardButton";
|
|
36
36
|
//#region src/pages/UserInvitationsAdminPage/UserInvitationShareDialog.tsx
|
|
37
|
-
var J = V(({ onActionsChange: t, onTitleChange: n, openProps:
|
|
38
|
-
let { t: a } = N(), o =
|
|
39
|
-
|
|
40
|
-
n(a("Invitation details for {{email}}", { email:
|
|
37
|
+
var J = V(({ onActionsChange: t, onTitleChange: n, openProps: i }) => {
|
|
38
|
+
let { t: a } = N(), o = r();
|
|
39
|
+
T(() => {
|
|
40
|
+
n(a("Invitation details for {{email}}", { email: i.item.key }));
|
|
41
41
|
}, [
|
|
42
42
|
n,
|
|
43
|
-
|
|
43
|
+
i.item.key,
|
|
44
44
|
a
|
|
45
45
|
]);
|
|
46
|
-
let s =
|
|
47
|
-
let e = new URL(h.
|
|
48
|
-
return e.search = "", e.hash = "", e.pathname = `/accept-invitation/${
|
|
49
|
-
}, [
|
|
46
|
+
let s = D(() => e(i.item.expires_at, _.DATE), [i.item.expires_at]), c = D(() => {
|
|
47
|
+
let e = new URL(h.resolve(g).window.location.href);
|
|
48
|
+
return e.search = "", e.hash = "", e.pathname = `/accept-invitation/${i.item.token}`, e.toString();
|
|
49
|
+
}, [i.item.token]), l = D(() => `mailto:?subject=${a("Invitation to join {{applicationName}}", { applicationName: o.applicationName })}&body=${a("Use the following link to accept the invitation: {{invitationLink}}. This link will expire: {{expiryDate}}.", {
|
|
50
50
|
expiryDate: s,
|
|
51
51
|
invitationLink: c
|
|
52
|
-
})}&to=${
|
|
52
|
+
})}&to=${i.item.key}`, [
|
|
53
53
|
o.applicationName,
|
|
54
54
|
s,
|
|
55
55
|
c,
|
|
56
|
-
|
|
56
|
+
i.item.key,
|
|
57
57
|
a
|
|
58
58
|
]);
|
|
59
|
-
return
|
|
59
|
+
return T(() => {
|
|
60
60
|
t([{
|
|
61
61
|
...L.createAttributes("UserInvitationShareDialog-agree"),
|
|
62
62
|
color: "primary",
|
|
63
63
|
href: l,
|
|
64
64
|
label: a("Email invitation link"),
|
|
65
|
-
startIcon: /* @__PURE__ */
|
|
65
|
+
startIcon: /* @__PURE__ */ j(K, {}),
|
|
66
66
|
variant: "contained"
|
|
67
|
-
}, /* @__PURE__ */
|
|
67
|
+
}, /* @__PURE__ */ j(q, {
|
|
68
68
|
buttonText: a("Copy invitation link to clipboard"),
|
|
69
69
|
clipboardValue: c
|
|
70
70
|
}, "copyToClipboard")]);
|
|
@@ -73,13 +73,13 @@ var J = V(({ onActionsChange: t, onTitleChange: n, openProps: r }) => {
|
|
|
73
73
|
l,
|
|
74
74
|
a,
|
|
75
75
|
c
|
|
76
|
-
]), /* @__PURE__ */
|
|
77
|
-
email:
|
|
76
|
+
]), /* @__PURE__ */ M(y, { children: [/* @__PURE__ */ j(y, { children: /* @__PURE__ */ j(C, { children: a("The invitation for {{email}} will expire on {{expiryDate}}.", {
|
|
77
|
+
email: i.item.key,
|
|
78
78
|
expiryDate: s
|
|
79
|
-
}) }) }), /* @__PURE__ */
|
|
79
|
+
}) }) }), /* @__PURE__ */ j(y, {
|
|
80
80
|
sx: { marginY: 1 },
|
|
81
81
|
children: a("Invitation link: {{invitationLink}}", {
|
|
82
|
-
email:
|
|
82
|
+
email: i.item.key,
|
|
83
83
|
invitationLink: c
|
|
84
84
|
})
|
|
85
85
|
})] });
|
|
@@ -88,41 +88,41 @@ var J = V(({ onActionsChange: t, onTitleChange: n, openProps: r }) => {
|
|
|
88
88
|
fullWidth: !0,
|
|
89
89
|
maxWidth: "md",
|
|
90
90
|
testId: "UserInvitationShareDialog"
|
|
91
|
-
}), Y = V(({ onActionsChange: e, onClose: t, onTitleChange:
|
|
92
|
-
let { t: d } = N(), f =
|
|
91
|
+
}), Y = V(({ onActionsChange: e, onClose: t, onTitleChange: r, openProps: l }) => {
|
|
92
|
+
let { t: d } = N(), f = E(), [p, m] = k(null), g = D(() => F().shape({ bearerToken: I().required() }), []), _ = D(() => [{
|
|
93
93
|
definition: R.TEXTFIELD,
|
|
94
94
|
label: d`Bearer Token`,
|
|
95
95
|
multiline: !0,
|
|
96
96
|
name: "bearerToken",
|
|
97
97
|
rows: 10
|
|
98
|
-
}], [d]),
|
|
99
|
-
resolver: c(
|
|
98
|
+
}], [d]), v = B({
|
|
99
|
+
resolver: c(g, void 0, { raw: !0 }),
|
|
100
100
|
values: { bearerToken: "" }
|
|
101
|
-
}), { handleSubmit:
|
|
101
|
+
}), { handleSubmit: b } = v, x = w(async (e) => {
|
|
102
102
|
try {
|
|
103
|
-
|
|
103
|
+
h.resolve(i).temporaryToken = e.bearerToken, await h.resolve(n).userRegistrationsPostOne(l.item.token), h.resolve(s).showNotification({
|
|
104
104
|
message: d`Invitation has been consumed by bearer token`,
|
|
105
105
|
severity: "success"
|
|
106
106
|
}), t();
|
|
107
107
|
} catch (e) {
|
|
108
108
|
m(e);
|
|
109
109
|
} finally {
|
|
110
|
-
delete
|
|
111
|
-
let e =
|
|
112
|
-
await
|
|
110
|
+
delete h.resolve(i).temporaryToken;
|
|
111
|
+
let e = h.resolve(o).getQueryKeyDependencies([u.USER_INVITATIONS], !0);
|
|
112
|
+
await h.resolve(o).invalidateQueryKeys(e);
|
|
113
113
|
}
|
|
114
114
|
}, [
|
|
115
115
|
t,
|
|
116
116
|
l.item.token,
|
|
117
117
|
d
|
|
118
118
|
]);
|
|
119
|
-
return
|
|
120
|
-
|
|
119
|
+
return T(() => {
|
|
120
|
+
r(d`Consume invitation with bearer token`);
|
|
121
121
|
}, [
|
|
122
|
-
|
|
122
|
+
r,
|
|
123
123
|
l.item.key,
|
|
124
124
|
d
|
|
125
|
-
]),
|
|
125
|
+
]), T(() => {
|
|
126
126
|
e([{
|
|
127
127
|
...L.createAttributes("UserInvitationConsumeDialog-agree"),
|
|
128
128
|
color: "primary",
|
|
@@ -137,15 +137,15 @@ var J = V(({ onActionsChange: t, onTitleChange: n, openProps: r }) => {
|
|
|
137
137
|
d,
|
|
138
138
|
f,
|
|
139
139
|
p
|
|
140
|
-
]), /* @__PURE__ */
|
|
140
|
+
]), /* @__PURE__ */ j(y, { children: /* @__PURE__ */ j(a, {
|
|
141
141
|
error: p,
|
|
142
142
|
shouldHideActionButtons: !0,
|
|
143
|
-
children: /* @__PURE__ */
|
|
144
|
-
formFieldDefinitions:
|
|
143
|
+
children: /* @__PURE__ */ j(H, {
|
|
144
|
+
formFieldDefinitions: _,
|
|
145
145
|
formId: f,
|
|
146
|
-
formMethods:
|
|
147
|
-
onSubmit:
|
|
148
|
-
schema:
|
|
146
|
+
formMethods: v,
|
|
147
|
+
onSubmit: b(x),
|
|
148
|
+
schema: g
|
|
149
149
|
})
|
|
150
150
|
}) });
|
|
151
151
|
}, {
|
|
@@ -154,24 +154,24 @@ var J = V(({ onActionsChange: t, onTitleChange: n, openProps: r }) => {
|
|
|
154
154
|
maxWidth: "md",
|
|
155
155
|
testId: "UserInvitationConsumeDialog"
|
|
156
156
|
}), X = () => {
|
|
157
|
-
let { t: e } = N(),
|
|
157
|
+
let { t: e } = N(), r = d(), i = m(), a = f(), o = p(), s = D(() => !r?.options?.length || !i?.data ? [] : r.options.filter((e) => i.data.organization_ids.includes(e.value)), [r.options, i.data]), c = D(() => i?.data ? i.data.roles.map((e) => ({
|
|
158
158
|
label: e,
|
|
159
159
|
value: e
|
|
160
|
-
})) : [], [i.data]),
|
|
160
|
+
})) : [], [i.data]), g = U([
|
|
161
161
|
i,
|
|
162
|
-
|
|
162
|
+
r,
|
|
163
163
|
a,
|
|
164
164
|
o
|
|
165
|
-
]),
|
|
165
|
+
]), _ = O(null), y = O(null), C = w(async (e) => (await h.resolve(n).userInvitationsGetAll(null, null, { signal: e }))?.data, []), T = w(async (e) => await h.resolve(n).userInvitationsDeleteOne(e.id), []), E = w(async (e) => (await h.resolve(n).inviteUser({ ...e })).data, []), k = w((e) => e.key, []), B = D(() => F().shape({
|
|
166
166
|
description: z.description,
|
|
167
167
|
key: I().max(100).transform((e) => e === "" ? void 0 : e),
|
|
168
168
|
organization_id: I().uuid4().required().max(100),
|
|
169
169
|
roles: P().min(1).required()
|
|
170
|
-
}), []), V =
|
|
171
|
-
|
|
172
|
-
}, []), H =
|
|
173
|
-
|
|
174
|
-
}, []), K =
|
|
170
|
+
}), []), V = w((e) => {
|
|
171
|
+
_.current.open({ item: e });
|
|
172
|
+
}, []), H = w((e) => {
|
|
173
|
+
_.current.open({ item: e.row });
|
|
174
|
+
}, []), K = D(() => {
|
|
175
175
|
let t = [];
|
|
176
176
|
return t.push({
|
|
177
177
|
definition: R.TEXTFIELD,
|
|
@@ -181,7 +181,7 @@ var J = V(({ onActionsChange: t, onTitleChange: n, openProps: r }) => {
|
|
|
181
181
|
}, {
|
|
182
182
|
definition: R.AUTOCOMPLETE,
|
|
183
183
|
label: e`Organization`,
|
|
184
|
-
loading:
|
|
184
|
+
loading: r.isLoading,
|
|
185
185
|
name: "organization_id",
|
|
186
186
|
options: s
|
|
187
187
|
}, {
|
|
@@ -199,16 +199,16 @@ var J = V(({ onActionsChange: t, onTitleChange: n, openProps: r }) => {
|
|
|
199
199
|
}, [
|
|
200
200
|
e,
|
|
201
201
|
s,
|
|
202
|
-
|
|
202
|
+
r.isLoading,
|
|
203
203
|
c,
|
|
204
204
|
i.isLoading
|
|
205
|
-
]), q =
|
|
206
|
-
onClick: () =>
|
|
207
|
-
children: [/* @__PURE__ */
|
|
208
|
-
}, "custom-action-1"), /* @__PURE__ */
|
|
209
|
-
onClick: () =>
|
|
210
|
-
children: [/* @__PURE__ */
|
|
211
|
-
}, "custom-action-2")], [e]), X =
|
|
205
|
+
]), q = w((t) => [/* @__PURE__ */ M(S, {
|
|
206
|
+
onClick: () => _.current.open({ item: t.row }),
|
|
207
|
+
children: [/* @__PURE__ */ j(b, { children: /* @__PURE__ */ j(W, { fontSize: "small" }) }), /* @__PURE__ */ j(x, { children: e`Send invitation` })]
|
|
208
|
+
}, "custom-action-1"), /* @__PURE__ */ M(S, {
|
|
209
|
+
onClick: () => y.current.open({ item: t.row }),
|
|
210
|
+
children: [/* @__PURE__ */ j(b, { children: /* @__PURE__ */ j(G, { fontSize: "small" }) }), /* @__PURE__ */ j(x, { children: e`Consume invitation (advanced)` })]
|
|
211
|
+
}, "custom-action-2")], [e]), X = D(() => [
|
|
212
212
|
t.createTextColumn({
|
|
213
213
|
id: "key",
|
|
214
214
|
name: e`Key`
|
|
@@ -242,22 +242,22 @@ var J = V(({ onActionsChange: t, onTitleChange: n, openProps: r }) => {
|
|
|
242
242
|
a.options,
|
|
243
243
|
c
|
|
244
244
|
]);
|
|
245
|
-
return /* @__PURE__ */
|
|
246
|
-
/* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ M(A, { children: [
|
|
246
|
+
/* @__PURE__ */ j(l, {
|
|
247
247
|
createItemButtonText: e`Invite user`,
|
|
248
248
|
createItemDialogTitle: e`Create new user invitation`,
|
|
249
|
-
createOne:
|
|
250
|
-
crudCommandType:
|
|
249
|
+
createOne: E,
|
|
250
|
+
crudCommandType: v.UserInvitationCrudCommand,
|
|
251
251
|
customOnRowClick: H,
|
|
252
252
|
defaultSortByField: "key",
|
|
253
253
|
defaultSortDirection: "asc",
|
|
254
|
-
deleteOne:
|
|
254
|
+
deleteOne: T,
|
|
255
255
|
extraActionsFactory: q,
|
|
256
|
-
fetchAll:
|
|
256
|
+
fetchAll: C,
|
|
257
257
|
formFieldDefinitions: K,
|
|
258
|
-
getName:
|
|
258
|
+
getName: k,
|
|
259
259
|
itemName: e`User invitation`,
|
|
260
|
-
loadables:
|
|
260
|
+
loadables: g,
|
|
261
261
|
onCreateSuccess: V,
|
|
262
262
|
resourceQueryKeyBase: u.USER_INVITATIONS,
|
|
263
263
|
schema: B,
|
|
@@ -265,8 +265,8 @@ var J = V(({ onActionsChange: t, onTitleChange: n, openProps: r }) => {
|
|
|
265
265
|
testIdAttributes: L.createAttributes("UserInvitationsAdminPage"),
|
|
266
266
|
title: e`User invitations`
|
|
267
267
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ j(J, { ref: _ }),
|
|
269
|
+
/* @__PURE__ */ j(Y, { ref: y })
|
|
270
270
|
] });
|
|
271
271
|
};
|
|
272
272
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInvitationsAdminPage.js","names":["yupResolver","rootContainer","rootContainer","_Fragment","format","QueryClientService","o","CrudPage","Fragment$1","MailIcon","PasswordIcon","EmailIcon","UserInvitationShareDialog","withDialog","useTranslation","config","useConfig","t","openProps","onTitleChange","expiryDate","useMemo","DATE_FORMAT","invitationLink","url","WindowService","shareInvitationHref","useEffect","TestIdUtil","CopyToClipboardButton","onActionsChange","Box","Typography","UserInvitationConsumeDialog","formId","useId","error","setError","useState","schema","object","string","formFieldDefinitions","FORM_FIELD_DEFINITION_TYPE","formMethods","useForm","onFormSubmit","useCallback","AuthenticationService","data","container","API_ORGANIZATION_TOKEN","NotificationService","onClose","responseError","queryKeys","COMMON_QUERY_KEY","ResponseHandler","GenericForm","handleSubmit","UserInvitationsAdminPage","organizationOptionsQuery","useOrganizationOptionsQuery","inviteUserConstraintsQuery","useInviteUserConstraintsQuery","userOptionsQuery","useUserOptionsQuery","organizationAdminPolicyMapQuery","useOrganizationAdminPolicyMapQuery","organizationOptions","option","roleOptions","role","loadables","useArray","userInvitationShareDialogRef","useRef","userInvitationConsumeDialogRef","fetchAll","deleteOne","item","createOne","variables","getName","SchemaUtil","value","array","onCreateSuccess","customOnRowClick","params","fields","extraActionsFactory","MenuItem","ListItemIcon","ListItemText","tableColumns","TableUtil","CommonDbCommandName"],"sources":["../../src/pages/UserInvitationsAdminPage/UserInvitationShareDialog.tsx","../../src/pages/UserInvitationsAdminPage/UserInvitationConsumeDialog.tsx","../../src/pages/UserInvitationsAdminPage/UserInvitationsAdminPage.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next';\nimport EmailIcon from '@mui/icons-material/Email';\nimport {\n Box,\n Typography,\n} from '@mui/material';\nimport type { ReactElement } from 'react';\nimport {\n useEffect,\n useMemo,\n} from 'react';\nimport { format } from 'date-fns';\nimport type { CommonDbUserInvitation } from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport { DATE_FORMAT } from '@gen-epix/ui-core/constants/date.constants';\nimport { CopyToClipboardButton } from '@gen-epix/ui-core-components/components/CopyToClipboardButton';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\n\nimport { useConfig } from '../../hooks/useConfig';\n\nexport interface UserInvitationShareDialogOpenProps {\n item: CommonDbUserInvitation;\n}\n\nexport interface UserInvitationShareDialogProps extends WithDialogRenderProps<UserInvitationShareDialogOpenProps> {\n}\n\nexport type UserInvitationShareDialogRefMethods = WithDialogRefMethods<UserInvitationShareDialogProps, UserInvitationShareDialogOpenProps>;\n\nexport const UserInvitationShareDialog = withDialog<UserInvitationShareDialogProps, UserInvitationShareDialogOpenProps>((\n {\n onActionsChange,\n onTitleChange,\n openProps,\n }: UserInvitationShareDialogProps,\n): ReactElement => {\n const { t } = useTranslation();\n const config = useConfig();\n\n useEffect(() => {\n onTitleChange(t('Invitation details for {{email}}', { email: openProps.item.key }));\n }, [onTitleChange, openProps.item.key, t]);\n\n const expiryDate = useMemo(() => {\n return format(openProps.item.expires_at, DATE_FORMAT.DATE);\n }, [openProps.item.expires_at]);\n\n const invitationLink = useMemo(() => {\n const url = new URL(WindowService.getInstance().window.location.href);\n url.search = '';\n url.hash = '';\n url.pathname = `/accept-invitation/${openProps.item.token}`;\n return url.toString();\n }, [openProps.item.token]);\n\n const shareInvitationHref = useMemo(() => {\n return `mailto:?subject=${t('Invitation to join {{applicationName}}', { applicationName: config.applicationName })}&body=${t('Use the following link to accept the invitation: {{invitationLink}}. This link will expire: {{expiryDate}}.', { expiryDate, invitationLink })}&to=${openProps.item.key}`;\n }, [config.applicationName, expiryDate, invitationLink, openProps.item.key, t]);\n\n\n useEffect(() => {\n onActionsChange([\n {\n ...TestIdUtil.createAttributes('UserInvitationShareDialog-agree'),\n color: 'primary',\n href: shareInvitationHref,\n label: t('Email invitation link'),\n startIcon: <EmailIcon />,\n variant: 'contained',\n },\n <CopyToClipboardButton\n buttonText={t('Copy invitation link to clipboard')}\n clipboardValue={invitationLink}\n key={'copyToClipboard'}\n />,\n ]);\n }, [onActionsChange, shareInvitationHref, t, invitationLink]);\n\n return (\n <Box>\n <Box>\n <Typography>\n {t('The invitation for {{email}} will expire on {{expiryDate}}.', { email: openProps.item.key, expiryDate })}\n </Typography>\n </Box>\n <Box\n sx={{\n marginY: 1,\n }}\n >\n {t('Invitation link: {{invitationLink}}', { email: openProps.item.key, invitationLink })}\n </Box>\n </Box>\n );\n}, {\n defaultTitle: '',\n fullWidth: true,\n maxWidth: 'md',\n testId: 'UserInvitationShareDialog',\n});\n","import { container as rootContainer } from 'tsyringe';\nimport { useTranslation } from 'react-i18next';\nimport { Box } from '@mui/material';\nimport type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport {\n object,\n string,\n} from 'yup';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport type { Resolver } from 'react-hook-form';\nimport { useForm } from 'react-hook-form';\nimport type { CommonDbUserInvitation } from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { GenericForm } from '@gen-epix/ui-core-form/components/helpers/GenericForm';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form.models';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form.models';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\n\nimport { API_ORGANIZATION_TOKEN } from '../../constants/api.constants';\nimport { AuthenticationService } from '../../classes/services/AuthenticationService';\nimport { ResponseHandler } from '../../components/ui/ResponseHandler';\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\n\nexport interface UserInvitationConsumeDialogOpenProps {\n item: CommonDbUserInvitation;\n}\n\nexport interface UserInvitationConsumeDialogProps extends WithDialogRenderProps<UserInvitationConsumeDialogOpenProps> {\n}\n\nexport type UserInvitationConsumeDialogRefMethods = WithDialogRefMethods<UserInvitationConsumeDialogProps, UserInvitationConsumeDialogOpenProps>;\n\ntype FormFields = {\n bearerToken: string;\n};\n\nexport const UserInvitationConsumeDialog = withDialog<UserInvitationConsumeDialogProps, UserInvitationConsumeDialogOpenProps>((\n {\n onActionsChange,\n onClose,\n onTitleChange,\n openProps,\n }: UserInvitationConsumeDialogProps,\n): ReactElement => {\n const { t } = useTranslation();\n const formId = useId();\n const [error, setError] = useState<unknown>(null);\n\n const schema = useMemo(() => object<FormFields>().shape({\n bearerToken: string().required(),\n }), []);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Bearer Token`,\n multiline: true,\n name: 'bearerToken',\n rows: 10,\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const, [t]);\n\n const formMethods = useForm<FormFields>({\n resolver: yupResolver(schema, undefined, { raw: true }) as Resolver<FormFields>,\n values: {\n bearerToken: '',\n },\n });\n const { handleSubmit } = formMethods;\n\n const onFormSubmit = useCallback(async (data: FormFields) => {\n try {\n rootContainer.resolve(AuthenticationService).temporaryToken = data.bearerToken;\n await rootContainer.resolve(API_ORGANIZATION_TOKEN).userRegistrationsPostOne(openProps.item.token);\n rootContainer.resolve(NotificationService).showNotification({\n message: t`Invitation has been consumed by bearer token`,\n severity: 'success',\n });\n onClose();\n } catch (responseError) {\n setError(responseError);\n } finally {\n delete rootContainer.resolve(AuthenticationService).temporaryToken;\n const queryKeys = rootContainer.resolve(QueryClientService).getQueryKeyDependencies([COMMON_QUERY_KEY.USER_INVITATIONS], true);\n await rootContainer.resolve(QueryClientService).invalidateQueryKeys(queryKeys);\n }\n }, [onClose, openProps.item.token, t]);\n\n useEffect(() => {\n onTitleChange(t`Consume invitation with bearer token`);\n }, [onTitleChange, openProps.item.key, t]);\n\n\n useEffect(() => {\n onActionsChange([\n {\n ...TestIdUtil.createAttributes('UserInvitationConsumeDialog-agree'),\n color: 'primary',\n disabled: !!error,\n form: formId,\n label: t('Submit'),\n type: 'submit',\n variant: 'contained',\n },\n ]);\n }, [onActionsChange, t, formId, error]);\n\n return (\n <Box>\n <ResponseHandler\n error={error}\n shouldHideActionButtons\n >\n <GenericForm<FormFields>\n formFieldDefinitions={formFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={handleSubmit(onFormSubmit)}\n schema={schema}\n />\n </ResponseHandler>\n </Box>\n );\n}, {\n defaultTitle: '',\n fullWidth: true,\n maxWidth: 'md',\n testId: 'UserInvitationConsumeDialog',\n});\n","import { container as rootContainer } from 'tsyringe';\nimport {\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n array,\n object,\n string,\n} from 'yup';\nimport {\n ListItemIcon,\n ListItemText,\n MenuItem,\n} from '@mui/material';\nimport MailIcon from '@mui/icons-material/Mail';\nimport PasswordIcon from '@mui/icons-material/Password';\nimport type { CommonDbUserInvitation } from '@gen-epix/api-commondb';\nimport { CommonDbCommandName } from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport type {\n FormFieldDefinition,\n OptionBase,\n} from '@gen-epix/ui-core-form/models/form.models';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form.models';\nimport { SchemaUtil } from '@gen-epix/ui-core-form/utils/SchemaUtil';\n\nimport { API_ORGANIZATION_TOKEN } from '../../constants/api.constants';\nimport { useOrganizationAdminPolicyMapQuery } from '../../dataHooks/useOrganizationAdminPoliciesQuery';\nimport { useOrganizationOptionsQuery } from '../../dataHooks/useOrganizationsQuery';\nimport { useUserOptionsQuery } from '../../dataHooks/useUsersQuery';\nimport type {\n TableColumn,\n TableRowParams,\n} from '../../models/table.models';\nimport { TableUtil } from '../../utils/TableUtil';\nimport { CrudPage } from '../CrudPage';\nimport { useInviteUserConstraintsQuery } from '../../dataHooks/useInviteUserConstraintsQuery';\nimport type { OmitWithMetaData } from '../../models/data.models';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\n\nimport { UserInvitationShareDialog } from './UserInvitationShareDialog';\nimport type { UserInvitationShareDialogRefMethods } from './UserInvitationShareDialog';\nimport { UserInvitationConsumeDialog } from './UserInvitationConsumeDialog';\nimport type { UserInvitationConsumeDialogRefMethods } from './UserInvitationConsumeDialog';\n\ntype FormFields = OmitWithMetaData<CommonDbUserInvitation, 'email' | 'expires_at' | 'invited_by_user_id' | 'invited_by_user' | 'name' | 'organization' | 'token'>;\n\nexport const UserInvitationsAdminPage = () => {\n const { t } = useTranslation();\n const organizationOptionsQuery = useOrganizationOptionsQuery();\n const inviteUserConstraintsQuery = useInviteUserConstraintsQuery();\n const userOptionsQuery = useUserOptionsQuery();\n const organizationAdminPolicyMapQuery = useOrganizationAdminPolicyMapQuery();\n\n const organizationOptions = useMemo<OptionBase<string>[]>(() => {\n if (!organizationOptionsQuery?.options?.length || !inviteUserConstraintsQuery?.data) {\n return [];\n }\n return organizationOptionsQuery.options.filter(option => inviteUserConstraintsQuery.data.organization_ids.includes(option.value));\n\n }, [organizationOptionsQuery.options, inviteUserConstraintsQuery.data]);\n\n const roleOptions = useMemo<OptionBase<string>[]>(() => {\n if (!inviteUserConstraintsQuery?.data) {\n return [];\n }\n return inviteUserConstraintsQuery.data.roles.map(role => ({\n label: role,\n value: role,\n }));\n }, [inviteUserConstraintsQuery.data]);\n\n const loadables = useArray([inviteUserConstraintsQuery, organizationOptionsQuery, userOptionsQuery, organizationAdminPolicyMapQuery]);\n\n const userInvitationShareDialogRef = useRef<UserInvitationShareDialogRefMethods>(null);\n const userInvitationConsumeDialogRef = useRef<UserInvitationConsumeDialogRefMethods>(null);\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n return (await rootContainer.resolve(API_ORGANIZATION_TOKEN).userInvitationsGetAll(null, null, { signal }))?.data;\n }, []);\n\n const deleteOne = useCallback(async (item: CommonDbUserInvitation) => {\n return await rootContainer.resolve(API_ORGANIZATION_TOKEN).userInvitationsDeleteOne(item.id);\n }, []);\n\n const createOne = useCallback(async (variables: FormFields) => {\n return (await rootContainer.resolve(API_ORGANIZATION_TOKEN).inviteUser({\n ...variables,\n })).data;\n }, []);\n\n const getName = useCallback((item: FormFields) => {\n return item.key;\n }, []);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n description: SchemaUtil.description,\n key: string().max(100).transform((value) => value === '' ? undefined : value as string),\n organization_id: string().uuid4().required().max(100),\n roles: array().min(1).required(),\n });\n }, []);\n\n const onCreateSuccess = useCallback((item: CommonDbUserInvitation) => {\n userInvitationShareDialogRef.current.open({ item });\n }, []);\n\n const customOnRowClick = useCallback((params: TableRowParams<CommonDbUserInvitation, null>) => {\n userInvitationShareDialogRef.current.open({ item: params.row });\n }, []);\n\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n const fields: FormFieldDefinition<FormFields>[] = [];\n\n fields.push(\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n infoMessage: t`If known, fill in the user's key. This is typically the user's email address, but can be any string depending on the Identity Provider. Filling in a key makes the invitation more secure. If left empty, the invitation can be consumed by anyone with the invite link.`,\n label: t`Key`,\n name: 'key',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Organization`,\n loading: organizationOptionsQuery.isLoading,\n name: 'organization_id',\n options: organizationOptions,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Roles`,\n loading: inviteUserConstraintsQuery.isLoading,\n multiple: true,\n name: 'roles',\n options: roleOptions,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Description`,\n name: 'description',\n } as const satisfies FormFieldDefinition<FormFields>,\n );\n return fields;\n }, [t, organizationOptions, organizationOptionsQuery.isLoading, roleOptions, inviteUserConstraintsQuery.isLoading]);\n\n const extraActionsFactory = useCallback((params: TableRowParams<CommonDbUserInvitation, null>) => {\n return [\n (\n <MenuItem\n key={'custom-action-1'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => userInvitationShareDialogRef.current.open({ item: params.row })}\n >\n <ListItemIcon>\n <MailIcon fontSize={'small'} />\n </ListItemIcon>\n <ListItemText>\n {t`Send invitation`}\n </ListItemText>\n </MenuItem>\n ),\n (\n <MenuItem\n key={'custom-action-2'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => userInvitationConsumeDialogRef.current.open({ item: params.row })}\n >\n <ListItemIcon>\n <PasswordIcon fontSize={'small'} />\n </ListItemIcon>\n <ListItemText>\n {t`Consume invitation (advanced)`}\n </ListItemText>\n </MenuItem>\n ),\n ];\n }, [t]);\n\n const tableColumns = useMemo((): TableColumn<CommonDbUserInvitation>[] => {\n return [\n TableUtil.createTextColumn<CommonDbUserInvitation>({ id: 'key', name: t`Key` }),\n TableUtil.createOptionsColumn<CommonDbUserInvitation>({ id: 'organization_id', name: t`Organization`, options: organizationOptions }),\n TableUtil.createOptionsColumn<CommonDbUserInvitation>({ id: 'invited_by_user_id', name: t`Invited by user`, options: userOptionsQuery.options }),\n TableUtil.createOptionsColumn<CommonDbUserInvitation>({ id: 'roles', name: t`Roles`, options: roleOptions }),\n TableUtil.createTextColumn<CommonDbUserInvitation>({ id: 'description', name: t`Description` }),\n TableUtil.createDateColumn<CommonDbUserInvitation>({ id: 'expires_at', name: t`Expires` }),\n ];\n }, [t, organizationOptions, userOptionsQuery.options, roleOptions]);\n\n return (\n <>\n <CrudPage<FormFields, CommonDbUserInvitation>\n createItemButtonText={t`Invite user`}\n createItemDialogTitle={t`Create new user invitation`}\n createOne={createOne}\n crudCommandType={CommonDbCommandName.UserInvitationCrudCommand}\n customOnRowClick={customOnRowClick}\n defaultSortByField={'key'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n extraActionsFactory={extraActionsFactory}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n itemName={t`User invitation`}\n loadables={loadables}\n onCreateSuccess={onCreateSuccess}\n resourceQueryKeyBase={COMMON_QUERY_KEY.USER_INVITATIONS}\n schema={schema}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('UserInvitationsAdminPage')}\n title={t`User invitations`}\n />\n <UserInvitationShareDialog ref={userInvitationShareDialogRef} />\n <UserInvitationConsumeDialog ref={userInvitationConsumeDialogRef} />\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAaY,IAA4BC,GACvC,EACE,oBACA,kBACA,mBAEe;CACjB,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAASC,EAAU;CAEzB,QAAgB;EACd,EAAcC,EAAE,oCAAoC,EAAE,OAAOC,EAAU,KAAK,IAAI,CAAC,CAAC;CACpF,GAAG;EAACC;EAAeD,EAAU,KAAK;EAAKD;CAAC,CAAC;CAEzC,IAAMG,IAAaC,QACVjB,EAAOc,EAAU,KAAK,YAAYI,EAAY,IAAI,GACxD,CAACJ,EAAU,KAAK,UAAU,CAAC,GAExBK,IAAiBF,QAAc;EACnC,IAAMG,IAAM,IAAI,IAAIC,EAAc,YAAY,CAAC,CAAC,OAAO,SAAS,IAAI;EAIpE,OAHA,EAAI,SAAS,IACb,EAAI,OAAO,IACX,EAAI,WAAW,sBAAsBP,EAAU,KAAK,SAC7CM,EAAI,SAAS;CACtB,GAAG,CAACN,EAAU,KAAK,KAAK,CAAC,GAEnBQ,IAAsBL,QACnB,mBAAmBJ,EAAE,0CAA0C,EAAE,iBAAiBF,EAAO,gBAAgB,CAAC,EAAE,QAAQE,EAAE,+GAA+G;EAAE;EAAY;CAAe,CAAC,EAAE,MAAMC,EAAU,K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CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"UserInvitationsAdminPage.js","names":["yupResolver","_Fragment","format","QueryClientService","o","CrudPage","Fragment$1","MailIcon","PasswordIcon","EmailIcon","UserInvitationShareDialog","withDialog","useTranslation","config","useConfig","t","openProps","onTitleChange","expiryDate","useMemo","DATE_FORMAT","invitationLink","url","container","WindowService","shareInvitationHref","useEffect","TestIdUtil","CopyToClipboardButton","onActionsChange","Box","Typography","UserInvitationConsumeDialog","formId","useId","error","setError","useState","schema","object","string","formFieldDefinitions","FORM_FIELD_DEFINITION_TYPE","formMethods","useForm","onFormSubmit","useCallback","AuthenticationService","data","API_ORGANIZATION_TOKEN","NotificationService","onClose","responseError","queryKeys","COMMON_QUERY_KEY","ResponseHandler","GenericForm","handleSubmit","UserInvitationsAdminPage","organizationOptionsQuery","useOrganizationOptionsQuery","inviteUserConstraintsQuery","useInviteUserConstraintsQuery","userOptionsQuery","useUserOptionsQuery","organizationAdminPolicyMapQuery","useOrganizationAdminPolicyMapQuery","organizationOptions","option","roleOptions","role","loadables","useArray","userInvitationShareDialogRef","useRef","userInvitationConsumeDialogRef","fetchAll","deleteOne","item","createOne","variables","getName","SchemaUtil","value","array","onCreateSuccess","customOnRowClick","params","fields","extraActionsFactory","MenuItem","ListItemIcon","ListItemText","tableColumns","TableUtil","CommonDbCommandName"],"sources":["../../src/pages/UserInvitationsAdminPage/UserInvitationShareDialog.tsx","../../src/pages/UserInvitationsAdminPage/UserInvitationConsumeDialog.tsx","../../src/pages/UserInvitationsAdminPage/UserInvitationsAdminPage.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next';\nimport EmailIcon from '@mui/icons-material/Email';\nimport {\n Box,\n Typography,\n} from '@mui/material';\nimport type { ReactElement } from 'react';\nimport {\n useEffect,\n useMemo,\n} from 'react';\nimport { format } from 'date-fns';\nimport { container } from 'tsyringe';\nimport type { CommonDbUserInvitation } from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { DATE_FORMAT } from '@gen-epix/ui-core/constants/date.constants';\nimport { CopyToClipboardButton } from '@gen-epix/ui-core-components/components/CopyToClipboardButton';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\n\nimport { useConfig } from '../../hooks/useConfig';\n\nexport interface UserInvitationShareDialogOpenProps {\n item: CommonDbUserInvitation;\n}\n\nexport interface UserInvitationShareDialogProps extends WithDialogRenderProps<UserInvitationShareDialogOpenProps> {\n}\n\nexport type UserInvitationShareDialogRefMethods = WithDialogRefMethods<UserInvitationShareDialogProps, UserInvitationShareDialogOpenProps>;\n\nexport const UserInvitationShareDialog = withDialog<UserInvitationShareDialogProps, UserInvitationShareDialogOpenProps>((\n {\n onActionsChange,\n onTitleChange,\n openProps,\n }: UserInvitationShareDialogProps,\n): ReactElement => {\n const { t } = useTranslation();\n const config = useConfig();\n\n useEffect(() => {\n onTitleChange(t('Invitation details for {{email}}', { email: openProps.item.key }));\n }, [onTitleChange, openProps.item.key, t]);\n\n const expiryDate = useMemo(() => {\n return format(openProps.item.expires_at, DATE_FORMAT.DATE);\n }, [openProps.item.expires_at]);\n\n const invitationLink = useMemo(() => {\n const url = new URL(container.resolve(WindowService).window.location.href);\n url.search = '';\n url.hash = '';\n url.pathname = `/accept-invitation/${openProps.item.token}`;\n return url.toString();\n }, [openProps.item.token]);\n\n const shareInvitationHref = useMemo(() => {\n return `mailto:?subject=${t('Invitation to join {{applicationName}}', { applicationName: config.applicationName })}&body=${t('Use the following link to accept the invitation: {{invitationLink}}. This link will expire: {{expiryDate}}.', { expiryDate, invitationLink })}&to=${openProps.item.key}`;\n }, [config.applicationName, expiryDate, invitationLink, openProps.item.key, t]);\n\n\n useEffect(() => {\n onActionsChange([\n {\n ...TestIdUtil.createAttributes('UserInvitationShareDialog-agree'),\n color: 'primary',\n href: shareInvitationHref,\n label: t('Email invitation link'),\n startIcon: <EmailIcon />,\n variant: 'contained',\n },\n <CopyToClipboardButton\n buttonText={t('Copy invitation link to clipboard')}\n clipboardValue={invitationLink}\n key={'copyToClipboard'}\n />,\n ]);\n }, [onActionsChange, shareInvitationHref, t, invitationLink]);\n\n return (\n <Box>\n <Box>\n <Typography>\n {t('The invitation for {{email}} will expire on {{expiryDate}}.', { email: openProps.item.key, expiryDate })}\n </Typography>\n </Box>\n <Box\n sx={{\n marginY: 1,\n }}\n >\n {t('Invitation link: {{invitationLink}}', { email: openProps.item.key, invitationLink })}\n </Box>\n </Box>\n );\n}, {\n defaultTitle: '',\n fullWidth: true,\n maxWidth: 'md',\n testId: 'UserInvitationShareDialog',\n});\n","import { container } from 'tsyringe';\nimport { useTranslation } from 'react-i18next';\nimport { Box } from '@mui/material';\nimport type { ReactElement } from 'react';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport {\n object,\n string,\n} from 'yup';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport type { Resolver } from 'react-hook-form';\nimport { useForm } from 'react-hook-form';\nimport type { CommonDbUserInvitation } from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { GenericForm } from '@gen-epix/ui-core-form/components/helpers/GenericForm';\nimport type { FormFieldDefinition } from '@gen-epix/ui-core-form/models/form.models';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form.models';\nimport type {\n WithDialogRefMethods,\n WithDialogRenderProps,\n} from '@gen-epix/ui-core-components/hoc/withDialog';\nimport { withDialog } from '@gen-epix/ui-core-components/hoc/withDialog';\n\nimport { API_ORGANIZATION_TOKEN } from '../../constants/api.constants';\nimport { AuthenticationService } from '../../classes/services/AuthenticationService';\nimport { ResponseHandler } from '../../components/ui/ResponseHandler';\nimport { NotificationService } from '../../classes/services/NotificationService';\nimport { QueryClientService } from '../../classes/services/QueryClientService';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\n\nexport interface UserInvitationConsumeDialogOpenProps {\n item: CommonDbUserInvitation;\n}\n\nexport interface UserInvitationConsumeDialogProps extends WithDialogRenderProps<UserInvitationConsumeDialogOpenProps> {\n}\n\nexport type UserInvitationConsumeDialogRefMethods = WithDialogRefMethods<UserInvitationConsumeDialogProps, UserInvitationConsumeDialogOpenProps>;\n\ntype FormFields = {\n bearerToken: string;\n};\n\nexport const UserInvitationConsumeDialog = withDialog<UserInvitationConsumeDialogProps, UserInvitationConsumeDialogOpenProps>((\n {\n onActionsChange,\n onClose,\n onTitleChange,\n openProps,\n }: UserInvitationConsumeDialogProps,\n): ReactElement => {\n const { t } = useTranslation();\n const formId = useId();\n const [error, setError] = useState<unknown>(null);\n\n const schema = useMemo(() => object<FormFields>().shape({\n bearerToken: string().required(),\n }), []);\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => [\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Bearer Token`,\n multiline: true,\n name: 'bearerToken',\n rows: 10,\n } as const satisfies FormFieldDefinition<FormFields>,\n ] as const, [t]);\n\n const formMethods = useForm<FormFields>({\n resolver: yupResolver(schema, undefined, { raw: true }) as Resolver<FormFields>,\n values: {\n bearerToken: '',\n },\n });\n const { handleSubmit } = formMethods;\n\n const onFormSubmit = useCallback(async (data: FormFields) => {\n try {\n container.resolve(AuthenticationService).temporaryToken = data.bearerToken;\n await container.resolve(API_ORGANIZATION_TOKEN).userRegistrationsPostOne(openProps.item.token);\n container.resolve(NotificationService).showNotification({\n message: t`Invitation has been consumed by bearer token`,\n severity: 'success',\n });\n onClose();\n } catch (responseError) {\n setError(responseError);\n } finally {\n delete container.resolve(AuthenticationService).temporaryToken;\n const queryKeys = container.resolve(QueryClientService).getQueryKeyDependencies([COMMON_QUERY_KEY.USER_INVITATIONS], true);\n await container.resolve(QueryClientService).invalidateQueryKeys(queryKeys);\n }\n }, [onClose, openProps.item.token, t]);\n\n useEffect(() => {\n onTitleChange(t`Consume invitation with bearer token`);\n }, [onTitleChange, openProps.item.key, t]);\n\n\n useEffect(() => {\n onActionsChange([\n {\n ...TestIdUtil.createAttributes('UserInvitationConsumeDialog-agree'),\n color: 'primary',\n disabled: !!error,\n form: formId,\n label: t('Submit'),\n type: 'submit',\n variant: 'contained',\n },\n ]);\n }, [onActionsChange, t, formId, error]);\n\n return (\n <Box>\n <ResponseHandler\n error={error}\n shouldHideActionButtons\n >\n <GenericForm<FormFields>\n formFieldDefinitions={formFieldDefinitions}\n formId={formId}\n formMethods={formMethods}\n onSubmit={handleSubmit(onFormSubmit)}\n schema={schema}\n />\n </ResponseHandler>\n </Box>\n );\n}, {\n defaultTitle: '',\n fullWidth: true,\n maxWidth: 'md',\n testId: 'UserInvitationConsumeDialog',\n});\n","import { container } from 'tsyringe';\nimport {\n useCallback,\n useMemo,\n useRef,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n array,\n object,\n string,\n} from 'yup';\nimport {\n ListItemIcon,\n ListItemText,\n MenuItem,\n} from '@mui/material';\nimport MailIcon from '@mui/icons-material/Mail';\nimport PasswordIcon from '@mui/icons-material/Password';\nimport type { CommonDbUserInvitation } from '@gen-epix/api-commondb';\nimport { CommonDbCommandName } from '@gen-epix/api-commondb';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\nimport { useArray } from '@gen-epix/ui-core/hooks/useArray';\nimport type {\n FormFieldDefinition,\n OptionBase,\n} from '@gen-epix/ui-core-form/models/form.models';\nimport { FORM_FIELD_DEFINITION_TYPE } from '@gen-epix/ui-core-form/models/form.models';\nimport { SchemaUtil } from '@gen-epix/ui-core-form/utils/SchemaUtil';\n\nimport { API_ORGANIZATION_TOKEN } from '../../constants/api.constants';\nimport { useOrganizationAdminPolicyMapQuery } from '../../dataHooks/useOrganizationAdminPoliciesQuery';\nimport { useOrganizationOptionsQuery } from '../../dataHooks/useOrganizationsQuery';\nimport { useUserOptionsQuery } from '../../dataHooks/useUsersQuery';\nimport type {\n TableColumn,\n TableRowParams,\n} from '../../models/table.models';\nimport { TableUtil } from '../../utils/TableUtil';\nimport { CrudPage } from '../CrudPage';\nimport { useInviteUserConstraintsQuery } from '../../dataHooks/useInviteUserConstraintsQuery';\nimport type { OmitWithMetaData } from '../../models/data.models';\nimport { COMMON_QUERY_KEY } from '../../constants/query.constants';\n\nimport { UserInvitationShareDialog } from './UserInvitationShareDialog';\nimport type { UserInvitationShareDialogRefMethods } from './UserInvitationShareDialog';\nimport { UserInvitationConsumeDialog } from './UserInvitationConsumeDialog';\nimport type { UserInvitationConsumeDialogRefMethods } from './UserInvitationConsumeDialog';\n\ntype FormFields = OmitWithMetaData<CommonDbUserInvitation, 'email' | 'expires_at' | 'invited_by_user_id' | 'invited_by_user' | 'name' | 'organization' | 'token'>;\n\nexport const UserInvitationsAdminPage = () => {\n const { t } = useTranslation();\n const organizationOptionsQuery = useOrganizationOptionsQuery();\n const inviteUserConstraintsQuery = useInviteUserConstraintsQuery();\n const userOptionsQuery = useUserOptionsQuery();\n const organizationAdminPolicyMapQuery = useOrganizationAdminPolicyMapQuery();\n\n const organizationOptions = useMemo<OptionBase<string>[]>(() => {\n if (!organizationOptionsQuery?.options?.length || !inviteUserConstraintsQuery?.data) {\n return [];\n }\n return organizationOptionsQuery.options.filter(option => inviteUserConstraintsQuery.data.organization_ids.includes(option.value));\n\n }, [organizationOptionsQuery.options, inviteUserConstraintsQuery.data]);\n\n const roleOptions = useMemo<OptionBase<string>[]>(() => {\n if (!inviteUserConstraintsQuery?.data) {\n return [];\n }\n return inviteUserConstraintsQuery.data.roles.map(role => ({\n label: role,\n value: role,\n }));\n }, [inviteUserConstraintsQuery.data]);\n\n const loadables = useArray([inviteUserConstraintsQuery, organizationOptionsQuery, userOptionsQuery, organizationAdminPolicyMapQuery]);\n\n const userInvitationShareDialogRef = useRef<UserInvitationShareDialogRefMethods>(null);\n const userInvitationConsumeDialogRef = useRef<UserInvitationConsumeDialogRefMethods>(null);\n\n const fetchAll = useCallback(async (signal: AbortSignal) => {\n return (await container.resolve(API_ORGANIZATION_TOKEN).userInvitationsGetAll(null, null, { signal }))?.data;\n }, []);\n\n const deleteOne = useCallback(async (item: CommonDbUserInvitation) => {\n return await container.resolve(API_ORGANIZATION_TOKEN).userInvitationsDeleteOne(item.id);\n }, []);\n\n const createOne = useCallback(async (variables: FormFields) => {\n return (await container.resolve(API_ORGANIZATION_TOKEN).inviteUser({\n ...variables,\n })).data;\n }, []);\n\n const getName = useCallback((item: FormFields) => {\n return item.key;\n }, []);\n\n const schema = useMemo(() => {\n return object<FormFields>().shape({\n description: SchemaUtil.description,\n key: string().max(100).transform((value) => value === '' ? undefined : value as string),\n organization_id: string().uuid4().required().max(100),\n roles: array().min(1).required(),\n });\n }, []);\n\n const onCreateSuccess = useCallback((item: CommonDbUserInvitation) => {\n userInvitationShareDialogRef.current.open({ item });\n }, []);\n\n const customOnRowClick = useCallback((params: TableRowParams<CommonDbUserInvitation, null>) => {\n userInvitationShareDialogRef.current.open({ item: params.row });\n }, []);\n\n\n const formFieldDefinitions = useMemo<FormFieldDefinition<FormFields>[]>(() => {\n const fields: FormFieldDefinition<FormFields>[] = [];\n\n fields.push(\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n infoMessage: t`If known, fill in the user's key. This is typically the user's email address, but can be any string depending on the Identity Provider. Filling in a key makes the invitation more secure. If left empty, the invitation can be consumed by anyone with the invite link.`,\n label: t`Key`,\n name: 'key',\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Organization`,\n loading: organizationOptionsQuery.isLoading,\n name: 'organization_id',\n options: organizationOptions,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.AUTOCOMPLETE,\n label: t`Roles`,\n loading: inviteUserConstraintsQuery.isLoading,\n multiple: true,\n name: 'roles',\n options: roleOptions,\n } as const satisfies FormFieldDefinition<FormFields>,\n {\n definition: FORM_FIELD_DEFINITION_TYPE.TEXTFIELD,\n label: t`Description`,\n name: 'description',\n } as const satisfies FormFieldDefinition<FormFields>,\n );\n return fields;\n }, [t, organizationOptions, organizationOptionsQuery.isLoading, roleOptions, inviteUserConstraintsQuery.isLoading]);\n\n const extraActionsFactory = useCallback((params: TableRowParams<CommonDbUserInvitation, null>) => {\n return [\n (\n <MenuItem\n key={'custom-action-1'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => userInvitationShareDialogRef.current.open({ item: params.row })}\n >\n <ListItemIcon>\n <MailIcon fontSize={'small'} />\n </ListItemIcon>\n <ListItemText>\n {t`Send invitation`}\n </ListItemText>\n </MenuItem>\n ),\n (\n <MenuItem\n key={'custom-action-2'}\n // eslint-disable-next-line @eslint-react/kit/jsx-no-bind\n onClick={() => userInvitationConsumeDialogRef.current.open({ item: params.row })}\n >\n <ListItemIcon>\n <PasswordIcon fontSize={'small'} />\n </ListItemIcon>\n <ListItemText>\n {t`Consume invitation (advanced)`}\n </ListItemText>\n </MenuItem>\n ),\n ];\n }, [t]);\n\n const tableColumns = useMemo((): TableColumn<CommonDbUserInvitation>[] => {\n return [\n TableUtil.createTextColumn<CommonDbUserInvitation>({ id: 'key', name: t`Key` }),\n TableUtil.createOptionsColumn<CommonDbUserInvitation>({ id: 'organization_id', name: t`Organization`, options: organizationOptions }),\n TableUtil.createOptionsColumn<CommonDbUserInvitation>({ id: 'invited_by_user_id', name: t`Invited by user`, options: userOptionsQuery.options }),\n TableUtil.createOptionsColumn<CommonDbUserInvitation>({ id: 'roles', name: t`Roles`, options: roleOptions }),\n TableUtil.createTextColumn<CommonDbUserInvitation>({ id: 'description', name: t`Description` }),\n TableUtil.createDateColumn<CommonDbUserInvitation>({ id: 'expires_at', name: t`Expires` }),\n ];\n }, [t, organizationOptions, userOptionsQuery.options, roleOptions]);\n\n return (\n <>\n <CrudPage<FormFields, CommonDbUserInvitation>\n createItemButtonText={t`Invite user`}\n createItemDialogTitle={t`Create new user invitation`}\n createOne={createOne}\n crudCommandType={CommonDbCommandName.UserInvitationCrudCommand}\n customOnRowClick={customOnRowClick}\n defaultSortByField={'key'}\n defaultSortDirection={'asc'}\n deleteOne={deleteOne}\n extraActionsFactory={extraActionsFactory}\n fetchAll={fetchAll}\n formFieldDefinitions={formFieldDefinitions}\n getName={getName}\n itemName={t`User invitation`}\n loadables={loadables}\n onCreateSuccess={onCreateSuccess}\n resourceQueryKeyBase={COMMON_QUERY_KEY.USER_INVITATIONS}\n schema={schema}\n tableColumns={tableColumns}\n testIdAttributes={TestIdUtil.createAttributes('UserInvitationsAdminPage')}\n title={t`User invitations`}\n />\n <UserInvitationShareDialog ref={userInvitationShareDialogRef} />\n <UserInvitationConsumeDialog ref={userInvitationConsumeDialogRef} />\n </>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,IAAaU,IAA4BC,GACvC,EACE,oBACA,kBACA,mBAEe;CACjB,IAAM,EAAE,SAAMC,EAAe,GACvBC,IAASC,EAAU;CAEzB,QAAgB;EACd,EAAcC,EAAE,oCAAoC,EAAE,OAAOC,EAAU,KAAK,IAAI,CAAC,CAAC;CACpF,GAAG;EAACC;EAAeD,EAAU,KAAK;EAAKD;CAAC,CAAC;CAEzC,IAAMG,IAAaC,QACVjB,EAAOc,EAAU,KAAK,YAAYI,EAAY,IAAI,GACxD,CAACJ,EAAU,KAAK,UAAU,CAAC,GAExBK,IAAiBF,QAAc;EACnC,IAAMG,IAAM,IAAI,IAAIC,EAAU,QAAQC,CAAa,CAAC,CAAC,OAAO,SAAS,IAAI;EAIzE,OAHA,EAAI,SAAS,IACb,EAAI,OAAO,IACX,EAAI,WAAW,sBAAsBR,EAAU,KAAK,SAC7CM,EAAI,SAAS;CACtB,GAAG,CAACN,EAAU,KAAK,KAAK,CAAC,GAEnBS,IAAsB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