{"version":3,"file":"main-0ad67ee3.js","sources":["../../src/AppProvider.tsx","../../src/app-navigation.ts","../../src/pages/home/HomePage.tsx","../../src/pages/dog/dashboard/DashboardPage.tsx","../../src/pages/dog/breedGroups/list/BreedGroupsListPage.tsx","../../src/pages/dog/breedGroups/item/BreedGroupDetailPage.tsx","../../src/pages/dog/breedGroups/item/BreedGroupBreedPage.tsx","../../src/pages/dog/breedGroups/item/BreedGroupJudgePage.tsx","../../src/pages/dog/breedGroups/item/BreedGroupItemPage.tsx","../../src/pages/dog/breeds/list/BreedsListPage.tsx","../../src/pages/dog/breeds/item/BreedAllowedWorkbookTypePage.tsx","../../src/pages/dog/breeds/item/BreedAllowedColors/ColorSelector.tsx","../../src/pages/dog/breeds/item/BreedAllowedColors/BreedAllowedColorsPage.tsx","../../src/pages/dog/breeds/item/BreedHealthPackSelector.tsx","../../src/pages/dog/breeds/item/BreedDetailPage.tsx","../../src/pages/dog/breeds/item/BreedClubPage.tsx","../../src/pages/dog/breeds/item/BreedJudgePage.tsx","../../src/pages/dog/breeds/item/BreedVarieties/BreedVarietyPanel.tsx","../../src/pages/dog/breeds/item/BreedVarieties/BreedVarietyListPage.tsx","../../src/pages/dog/breeds/item/BreedExceptions/BreedExceptionPanel.tsx","../../src/pages/dog/breeds/item/BreedExceptions/BreedExceptionsListPage.tsx","../../src/pages/dog/breeds/item/BreedItemPage.tsx","../../src/pages/dog/color/list/ColorListPage.tsx","../../src/pages/dog/color/item/ColorDetailPage.tsx","../../src/pages/dog/color/item/ColorItemPage.tsx","../../src/pages/dog/country/list/CountryListPage.tsx","../../src/pages/dog/country/item/pedigreePrefix/PedigreePrefixPanel.tsx","../../src/pages/dog/country/item/pedigreePrefix/CountryPedigreesList.tsx","../../src/pages/dog/country/item/CountryDetailPage.tsx","../../src/pages/dog/country/item/title/CountryTitlePanel.tsx","../../src/pages/dog/country/item/title/TitleListPage.tsx","../../src/pages/dog/country/item/CountryItemPage.tsx","../../src/pages/dog/kennel/list/KennelListPage.tsx","../../src/pages/dog/kennel/item/KennelDetailPage.tsx","../../src/pages/dog/kennel/item/kennelOwnersPanelStack/KennelOwnersSelectionPanel.tsx","../../src/pages/dog/kennel/item/kennelOwnersPanelStack/KennelOwnerSavePanel.tsx","../../src/pages/dog/kennel/item/kennelOwnersPanelStack/KennelOwnersPanelStack.tsx","../../src/pages/dog/kennel/item/KennelOwnersPage.tsx","../../src/pages/dog/kennel/item/KennelDogsPage.tsx","../../src/pages/dog/kennel/item/kennelBreeds/KennelBreedPage.tsx","../../src/pages/dog/kennel/item/KennelItemPage.tsx","../../src/pages/dog/fciAffixes/fciImport/tabs/AffixImportPage.tsx","../../src/pages/dog/fciAffixes/fciImport/FciImportPage.tsx","../../src/pages/dog/fciAffixes/fciExport/lists/AffixRequestExportListPage.tsx","../../src/pages/dog/fciAffixes/fciExport/FciExportPage.tsx","../../src/pages/health/characteristics/item/CharacteristicsItemPage.tsx","../../src/pages/health/characteristics/item/CharacteristicsTypeSelector.tsx","../../src/pages/health/characteristics/item/CharacteristicsDetailPage.tsx","../../src/pages/health/characteristics/list/CharacteristicsListPage.tsx","../../src/pages/health/characteristicValues/item/CharacteristicValuesItemPage.tsx","../../src/pages/health/characteristicValues/item/CharacteristicValuesDetailPage.tsx","../../src/pages/health/characteristicValues/list/CharacteristicValuesListPage.tsx","../../src/pages/health/packs/item/CharacteristicSelector.tsx","../../src/pages/health/packs/item/HealthPackDetailPage.tsx","../../src/pages/health/packs/item/HealthPackItemPage.tsx","../../src/pages/health/packs/list/HealthPackListPage.tsx","../../src/pages/sport/workbookType/list/WorkbookTypeListPage.tsx","../../src/pages/sport/workbookType/item/WorkbookTypeDetailPage.tsx","../../src/pages/mail-log/MailLogListPage.tsx","../../src/pages/sport/workbookType/item/WorkbookTypeItemPage.tsx","../../src/pages/sport/subActivity/item/SubActivityDetailPage.tsx","../../src/pages/sport/subActivity/item/SubActivityJudgePage.tsx","../../src/pages/sport/subActivity/item/SubActivityItemPage.tsx","../../src/pages/sport/subActivity/list/SubActivityListPage.tsx","../../src/pages/sport/club/list/ClublistPage.tsx","../../src/pages/sport/club/item/ClubAdressePage.tsx","../../src/pages/sport/club/item/ClubSections/ClubAllowedSectionsSelectorPanel.tsx","../../src/pages/sport/club/item/ClubSections/ClubAllowedSectionsPage.tsx","../../src/pages/sport/club/item/ClubAllowedBreedsPage.tsx","../../src/pages/sport/club/list/ClubCompetitionRequestList.tsx","../../src/pages/sport/club/list/ClubWorkbookRequestList.tsx","../../src/pages/sport/club/item/ClubFilePage.tsx","../../src/pages/sport/club/item/clubJudges/ClubJudgeSearchPanel.tsx","../../src/pages/sport/club/item/clubJudges/ClubJudgeSavePanel.tsx","../../src/pages/sport/club/item/clubJudges/ClubJudgesPanelStack.tsx","../../src/pages/sport/club/item/ClubJuryPage.tsx","../../src/pages/sport/club/item/ClubDetails/ClubContactSelectorPanel.tsx","../../src/pages/sport/club/item/ClubDetails/ClubContactFormPanel.tsx","../../src/pages/sport/club/item/ClubDetails/ClubContactPanelStack.tsx","../../src/pages/sport/club/item/ClubDetails/ClubContactPage.tsx","../../src/pages/sport/club/item/ClubDetails/ClubDetailPage.tsx","../../src/pages/sport/club/item/ClubItemPage.tsx","../../src/pages/sport/clubRole/list/ClubRoleListPage.tsx","../../src/pages/sport/clubRole/item/ClubRoleItemPage.tsx","../../src/pages/sport/clubRole/item/ClubRoleDetailPage.tsx","../../src/pages/sport/titleType/list/TitleTypeList.tsx","../../src/pages/sport/titleType/item/TitleTypeDetails.tsx","../../src/pages/sport/titleType/item/TitleTypeItem.tsx","../../src/pages/translation/TranslationTextEditor.tsx","../../src/pages/translation/TranslationEditPage.tsx","../../src/pages/clinic/list/ClinicListPage.tsx","../../src/pages/clinic/item/ClinicDetailsPage.tsx","../../src/pages/clinic/item/ClinicVeterinaries/ClinicVeterinariesSelectorPanel.tsx","../../src/pages/clinic/item/ClinicVeterinaries/ClinicVeterinariesControlFormPanel.tsx","../../src/pages/clinic/item/ClinicVeterinaries/ClinicVeterinariesPanelStack.tsx","../../src/pages/clinic/item/ClinicVeterinaries/ClinicVeterinariesPage.tsx","../../src/pages/clinic/item/ClinicItemPage.tsx","../../src/pages/request/request/list/RequestListPage.tsx","../../src/pages/request/RequestDogOwnerList.tsx","../../src/pages/request/pedigreeDuplicataRequest/item/detail/PedigreeDuplicataRequestDetails.tsx","../../src/pages/request/BillTab.tsx","../../src/pages/request/pedigreeDuplicataRequest/item/PedigreeDuplicataRequestItemPage.tsx","../../src/pages/request/pedigreeDuplicataRequest/list/PedigreeDuplicataRequestList.tsx","../../src/pages/request/pedigreeRequest/list/PedigreeRequestListPage.tsx","../../src/pages/request/request/item/RequestTransientPersonSelection.tsx","../../src/pages/request/pedigreeRequest/item/PedigreeRequestDetailPage.tsx","../../src/pages/request/pedigreeRequest/item/PedigreeRequestItemPage.tsx","../../src/pages/request/dogOwnershipChangeRequest/item/DogOwnershipChangeRequestDetailPage.tsx","../../src/pages/request/dogOwnershipChangeRequest/item/DogOwnershipChangeRequesItemPage.tsx","../../src/pages/request/dogOwnershipChangeRequest/list/DogOwnershipChangeRequestList.tsx","../../src/pages/request/titleRequest/list/TitleRequestList.tsx","../../src/pages/request/titleRequest/item/TitleRequestDetails.tsx","../../src/pages/request/titleRequest/item/TitleRequestItemPage.tsx","../../src/pages/request/workbookRequest/list/WorkbookRequestListPage.tsx","../../src/pages/request/workbookRequest/item/detail/WorkbookSelectionPanel.tsx","../../src/pages/request/workbookRequest/item/detail/WorkbookRequestDetails.tsx","../../src/pages/request/workbookRequest/item/WorkbookRequestItemPage.tsx","../../src/pages/request/workAttestationRequest/item/WorkAttestationRequestDetailPage.tsx","../../src/pages/request/workAttestationRequest/item/WorkAttestationRequestItemPage.tsx","../../src/pages/request/workAttestationRequest/list/WorkAttestationRequestListPage.tsx","../../src/pages/request/tempRSHRequest/list/TempRSHRequestList.tsx","../../src/pages/request/tempRSHRequest/item/TempRSHRequestDetail.tsx","../../src/pages/request/tempRSHRequest/item/TempRSHRequestItemPage.tsx","../../src/pages/request/importRequest/list/ImportRequestList.tsx","../../src/pages/request/importRequest/item/ImportRequestDetail.tsx","../../src/pages/request/importRequest/item/ImportRequestItemPage.tsx","../../src/pages/request/dysplasiaRequest/list/DysplasiaRequestList.tsx","../../src/pages/request/dysplasiaRequest/item/DysplasiaResultsRemarksList.tsx","../../src/pages/request/dysplasiaRequest/item/DysplasiaRequestDetail.tsx","../../src/pages/request/dysplasiaRequest/item/DysplasiaRequestItemPage.tsx","../../src/pages/request/membershipRequest/list/MembershipRequestListPage.tsx","../../src/pages/request/membershipRequest/item/MembershipRequestDetailPage.tsx","../../src/pages/request/membershipRequest/item/MembershipRequestItemPage.tsx","../../src/pages/request/broodRequest/list/BroodRequestListPage.tsx","../../src/pages/request/broodRequest/item/BroodRequestDeclaration.tsx","../../src/pages/request/broodRequest/item/BroodRequestDetail.tsx","../../src/pages/request/broodRequest/item/DogAs400ValidationFieldSet.tsx","../../src/pages/request/broodRequest/item/PotentialFatherSingleSelection.tsx","../../src/pages/request/broodRequest/item/PotentialFathersValidation.tsx","../../src/pages/request/broodRequest/item/DogValidationTab.tsx","../../src/pages/request/broodRequest/item/PuppyGenealogyPage.tsx","../../src/pages/request/broodRequest/item/BroodRequestItemPage.tsx","../../src/pages/request/expatriationRequest/list/ExpatriationRequestList.tsx","../../src/pages/request/expatriationRequest/item/ExpatriationRequestDetailPanel.tsx","../../src/pages/request/expatriationRequest/item/ExpatriationRequestItemPage.tsx","../../src/pages/administration/user/list/UserListPage.tsx","../../src/pages/administration/user/item/UserDetailPage.tsx","../../src/pages/administration/user/item/UserItemPage.tsx","../../src/pages/administration/permission/list/PermissionGrid.tsx","../../src/pages/administration/permission/list/PermissionListPage.tsx","../../src/pages/administration/article/list/ArticleListPage.tsx","../../src/pages/administration/article/item/ArticleDetailPage.tsx","../../src/pages/administration/article/item/ArticleItemPage.tsx","../../src/pages/administration/membershipRenewal/list/MembershipRenewalListPage.tsx","../../src/pages/administration/email/list/EmailListPage.tsx","../../src/pages/administration/email/item/EmailDetailPage.tsx","../../src/pages/administration/email/item/EmailItemPage.tsx","../../src/pages/administration/documentTemplate/list/DocumentTemplateListPage.tsx","../../src/pages/administration/documentTemplate/item/DocumentTemplateDetailPage.tsx","../../src/pages/administration/documentTemplate/item/DocumentTemplateItemPage.tsx","../../src/pages/login/UnauthorizedPage.tsx","../../src/pages/report/CompetitionReport.tsx","../../src/pages/report/PuppyReport.tsx","../../src/pages/report/TurnOverReport.tsx","../../src/pages/report/MemberReport.tsx","../../src/pages/report/HDReport.tsx","../../src/pages/report/ReportPage.tsx","../../src/pages/contacts/person/list/PersonListPage.tsx","../../src/pages/contacts/person/item/PersonDogsPage.tsx","../../src/pages/contacts/person/item/PersonDetailsPage.tsx","../../src/pages/contacts/person/item/PersonBreederDogsPage.tsx","../../src/pages/contacts/person/item/PersonKennelsPage.tsx","../../src/pages/contacts/person/item/PersonBreederChartSavePanel.tsx","../../src/pages/contacts/person/item/PersonBreederChart.tsx","../../src/pages/contacts/person/item/PersonBreederPage.tsx","../../src/pages/contacts/person/item/PersonWebUserPage.tsx","../../src/pages/contacts/person/item/PersonLinkedFiles.tsx","../../src/pages/contacts/person/item/membershipHistory/PersonMemberShipHistoryPanel.tsx","../../src/pages/contacts/person/item/membershipHistory/PersonMembershipHIstoryList.tsx","../../src/pages/contacts/person/item/PersonMembershipPage.tsx","../../src/pages/contacts/person/item/vetInformation/VeterinaryClinicsList.tsx","../../src/pages/contacts/person/item/vetInformation/PersonVetPage.tsx","../../src/pages/contacts/person/item/PersonHistoryPage.tsx","../../src/pages/contacts/person/item/personJudge/PersonBreedGroupJudgePage.tsx","../../src/pages/contacts/person/item/personJudge/PersonBreedJudgeSearchPanel.tsx","../../src/pages/contacts/person/item/personJudge/PersonBreedJudgeSavePanel.tsx","../../src/pages/contacts/person/item/personJudge/PersonBreedJudgePanelStack.tsx","../../src/pages/contacts/person/item/personJudge/PersonBreedJudgePage.tsx","../../src/pages/contacts/person/item/personJudge/PersonSubActivityJudgeSearchPanel.tsx","../../src/pages/contacts/person/item/personJudge/PersonSubActivityJudgeSavePanel.tsx","../../src/pages/contacts/person/item/personJudge/PersonSubActivityJudgePanelStack.tsx","../../src/pages/contacts/person/item/personJudge/PersonSubActivityJudgePage.tsx","../../src/pages/contacts/person/item/personJudge/JudgeIcon.tsx","../../src/pages/contacts/person/item/personJudge/JudgeLabel.tsx","../../src/pages/contacts/person/item/personJudge/PersonJudgeHierarchyPage.tsx","../../src/pages/contacts/person/item/PersonJudgeInfoPage.tsx","../../src/pages/contacts/person/item/PersonJudgeTabs.tsx","../../src/pages/contacts/person/item/PersonJudgeSwitch.tsx","../../src/pages/contacts/person/item/PersonCommissionerPage.tsx","../../src/pages/contacts/person/item/PersonItemPage.tsx","../../src/pages/contacts/person/item/split/PersonSplitForm.tsx","../../src/pages/contacts/person/item/split/PersonSplit.tsx","../../src/pages/contacts/person/item/split/PersonSplitItemPage.tsx","../../src/pages/dashboard/todoList/MyTaskSubCard.tsx","../../src/pages/dashboard/accounting/AccountingTaskList.tsx","../../src/pages/dashboard/dogUpdate/DogAwaitingUpdateTaskList.tsx","../../src/pages/dashboard/health/DogHealthValidation.tsx","../../src/pages/dashboard/health/DogTransientCharacteristics.tsx","../../src/pages/dashboard/health/DogHealthDashboardPage.tsx","../../src/pages/dashboard/sport/DiplomaTaskList.tsx","../../src/pages/dashboard/sport/DashboardSportPage.tsx","../../src/pages/dashboard/sport/DogTransientTitlesList.tsx","../../src/pages/dashboard/tasksToAssign/UnassignedRequestList.tsx","../../src/pages/dashboard/tasksToAssign/UnassignedRequestItemPage.tsx","../../src/pages/dashboard/todoList/MyAssignedTasksList.tsx","../../src/pages/dashboard/judge/JudgeBreedValidationPage.tsx","../../src/pages/dashboard/todoList/MyTodoListItemPage.tsx","../../src/pages/dog/calendarYear/list/CalendarYearListPage.tsx","../../src/pages/dog/calendarYear/detail/CalendarYearDetailPage.tsx","../../src/pages/dog/calendarYear/detail/CalendarYearItemPage.tsx","../../src/pages/dog/dog/list/DogListPage.tsx","../../src/pages/dog/dog/item/DogGenealogyPage.tsx","../../src/pages/dog/dog/item/Requests/DogLinkedFilesPage.tsx","../../src/pages/dog/dog/item/health/DogDysplasiaList.tsx","../../src/pages/dog/dog/item/Workbook/DogWorkbookDialogPanel.tsx","../../src/pages/dog/dog/item/DogDetails/People/DogCurrentOwnerSelectionPanel.tsx","../../src/pages/dog/dog/item/Workbook/DogWorkbookListPage.tsx","../../src/pages/dog/dog/item/competition/titles/DogAs400Form.tsx","../../src/pages/dog/dog/item/competition/titles/DogResultsCard.tsx","../../src/pages/dog/dog/item/competition/titles/DogTitlesPanel.tsx","../../src/pages/dog/dog/item/competition/titles/DogTitlesPanelStack.tsx","../../src/pages/dog/dog/item/competition/titles/DogTitlesList.tsx","../../src/pages/dog/dog/item/competition/DogCompetitionPage.tsx","../../src/pages/dog/dog/item/health/DogHealthTestPanel.tsx","../../src/pages/dog/dog/item/health/DogHealthTestList.tsx","../../src/pages/dog/dog/item/health/DogDnaPage.tsx","../../src/pages/dog/dog/item/health/DnaMarkerEdit.tsx","../../src/pages/dog/dog/item/health/DnaMarkerSaveAllPanel.tsx","../../src/pages/dog/dog/item/health/DogDnaMarkersList.tsx","../../src/pages/dog/dog/item/health/DogDnaItemPage.tsx","../../src/pages/dog/dog/item/DogDetails/chipNumber/DogChipPanel.tsx","../../src/pages/dog/dog/item/DogDetails/chipNumber/DogChipNumersList.tsx","../../src/pages/dog/dog/item/DogDetails/Pedigree/DogPedigreePanel.tsx","../../src/pages/dog/dog/item/DogDetails/Pedigree/DogPedigreesList.tsx","../../src/pages/dog/dog/item/DogDetails/People/DogsBreederListPanel.tsx","../../src/pages/dog/dog/item/DogDetails/People/DogsBreederPanelStack.tsx","../../src/pages/dog/dog/item/DogDetails/People/DogBreederList.tsx","../../src/pages/dog/dog/item/DogDetails/People/DogKennelOwnersList.tsx","../../src/pages/dog/dog/item/DogDetails/People/DogOwnerSavePanel.tsx","../../src/pages/dog/dog/item/DogDetails/People/OwnerSearchPanel.tsx","../../src/pages/dog/dog/item/DogDetails/People/DogOwnersPanelStack.tsx","../../src/pages/dog/dog/item/DogDetails/People/DogOwnerListPage.tsx","../../src/pages/dog/dog/item/DogDetails/DogDetailPage.tsx","../../src/pages/dog/dog/item/Requests/DogLinkedBroodRequests.tsx","../../src/pages/dog/dog/item/DogHistoryTab.tsx","../../src/pages/dog/dog/item/DogItemPage.tsx","../../src/pages/fusion/dog/DogFusion.tsx","../../src/pages/fusion/dog/DogFusionPage.tsx","../../src/pages/fusion/dog/DogFusionItemPage.tsx","../../src/pages/fusion/person/PersonFusion.tsx","../../src/pages/fusion/person/PersonFusionPage.tsx","../../src/pages/fusion/person/PersonFusionItemPage.tsx","../../src/pages/dysplasie/DysplasiaList.tsx","../../src/pages/dysplasie/appeal/AppealDysplasiaList.tsx","../../src/pages/dysplasie/comission/ComissionDysplasiaList.tsx","../../src/pages/dysplasie/DysplasiaEvaluation.tsx","../../src/pages/dysplasie/VeterinaryGrid.tsx","../../src/pages/dysplasie/EvaluationDetailPage.tsx","../../src/pages/dysplasie/comission/ComissionDysplasiaItemPage.tsx","../../src/pages/dysplasie/comission/CommissionRequestFilesList.tsx","../../src/pages/dysplasie/comissionGand/ComissionGandDysplasiaList.tsx","../../src/pages/request/affixRequest/list/AffixRequestList.tsx","../../src/pages/request/affixRequest/item/detail/KennelExportRequestDetail.tsx","../../src/pages/request/affixRequest/item/detail/KennelImportRequestDetail.tsx","../../src/pages/request/affixRequest/item/detail/KennelNameChangeRequestDetail.tsx","../../src/pages/request/affixRequest/item/detail/KennelOwnershipChangeRequestDetail.tsx","../../src/pages/request/affixRequest/item/detail/NewKennelRequestDetail.tsx","../../src/pages/request/affixRequest/item/AffixDetailPage.tsx","../../src/pages/request/affixRequest/item/AffixRequestItemPage.tsx","../../src/pages/request/competitionRequest/list/CompetitionRequestList.tsx","../../src/pages/request/competitionRequest/item/CompetitionRequestDetail.tsx","../../src/pages/request/competitionRequest/item/JudgeValidationDetail.tsx","../../src/pages/request/competitionRequest/item/ExpoTab.tsx","../../src/pages/request/competitionRequest/item/CompetitionBreedPanel.tsx","../../src/pages/request/competitionRequest/item/CompetitionBreedGroupPanel.tsx","../../src/pages/request/competitionRequest/item/CompetitionRequestBreedsPanel.tsx","../../src/pages/request/competitionRequest/item/CompetitionRequestItemPage.tsx","../../src/pages/request/healthTestRequest/list/HealthTestRequestList.tsx","../../src/pages/request/healthTestRequest/item/HealthTestRequestDetail.tsx","../../src/pages/request/healthTestRequest/item/HealthTestRequestItemPage.tsx","../../src/pages/request/miscellaneousRequest/list/MiscellaneousRequestList.tsx","../../src/pages/request/miscellaneousRequest/item/MiscellaneousRequestDetail.tsx","../../src/pages/request/miscellaneousRequest/item/MiscellaneousRequestItemPage.tsx","../../src/pages/sport/activity/list/ActivityListPage.tsx","../../src/pages/sport/activity/item/ActivitySubActivitiesPage.tsx","../../src/pages/sport/activity/item/ActivityDetailsPage.tsx","../../src/pages/sport/activity/item/ActivityItemPage.tsx","../../src/pages/sport/competition/list/CompetitionList.tsx","../../src/pages/sport/competition/item/CompetitionDetail.tsx","../../src/pages/sport/competition/item/CompetitionResultImportDataTableForm.tsx","../../src/pages/sport/competition/item/CompetitionResultImportPanel.tsx","../../src/pages/sport/competition/item/CompetitionItemPage.tsx","../../src/pages/sport/sections/list/SectionListPage.tsx","../../src/pages/sport/sections/item/SectionLinkedActivitiesPage.tsx","../../src/pages/sport/sections/item/SectionDetailPage.tsx","../../src/pages/sport/sections/item/SectionItemPage.tsx","../../src/pages/TestDev.tsx","../../src/pages/login/LoginPage.tsx","../../src/pages/login/ForgottenPassword.tsx","../../src/LoginRouter.tsx","../../src/pages/login/PasswordPage.tsx","../../src/pages/administration/reprint/ReprintPedigreeList.tsx","../../src/pages/administration/language/list/LanguageListPage.tsx","../../src/pages/administration/language/item/LanguageDetailPage.tsx","../../src/pages/administration/language/item/LanguageItemPage.tsx","../../src/AppRouter.tsx","../../src/App.tsx","../../src/AppRoot.tsx","../../src/main.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { HashRouter } from \"react-router-dom\";\nimport { RecoilRoot } from \"recoil\";\nimport { EPlatform } from \"./api\";\n\nimport { FullPageLoader } from \"./components\";\nimport {\n ActionHistoryProvider,\n AuthProvider,\n BreadcrumbProvider,\n DialogProvider,\n EventsProvider,\n GlobalDataProvider,\n NavigationProvider,\n PlatformProvider,\n SearchCriteriaProvider,\n useDialog,\n} from \"./contexts\";\nimport { useTl } from \"./hooks\";\nimport { ETLCodes } from \"./locales\";\nimport { QueryClient, QueryClientProvider } from \"react-query\";\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n // query options\n refetchOnWindowFocus: false,\n },\n mutations: {\n // mutation options\n },\n },\n});\n\nconst AppWithRouterProvider: React.FunctionComponent = (props) => {\n const { showDialog } = useDialog();\n const { t } = useTl();\n const getUserConfirmation = React.useCallback(\n (message, cb) => {\n showDialog({\n message,\n title: t(ETLCodes.RouteConfirmDialogTitle),\n onDialogClosed: (res) => {\n if (res === \"yes\" || res === \"ok\") {\n cb(true);\n } else {\n cb(false);\n }\n },\n });\n },\n [showDialog, t]\n );\n const memoizedChildren = React.useMemo(() => props.children, [props.children]);\n\n return (\n \n \n \n \n \n \n \n \n {memoizedChildren}\n \n \n \n \n \n \n \n \n );\n};\n\nexport const AppProvider: React.FunctionComponent = (props) => {\n const memoizedChildren = React.useMemo(() => props.children, [props.children]);\n return (\n }>\n \n \n \n {memoizedChildren}\n \n \n \n \n );\n};\n","import { ERoutes } from \"./ERoutes\";\nimport { INavigationItem } from \"./components\";\nimport { ETLCodes } from \"./locales\";\n\nexport const BaseAppNavigation: INavigationItem[] = [\n {\n name: ETLCodes.Home,\n route: ERoutes.home,\n icon: \"home\",\n },\n {\n name: ETLCodes.Dashboard,\n alternativeIcon: \"fas fa-columns\",\n items: [\n {\n name: ETLCodes.UnassignedRequests,\n route: ERoutes.unassignedRequests,\n },\n {\n name: ETLCodes.AssignedRequests,\n route: ERoutes.assignedRequests,\n },\n ],\n },\n {\n name: ETLCodes.Cynology,\n alternativeIcon: \"fas fa-dog\",\n items: [\n {\n name: ETLCodes.Dogs,\n route: ERoutes.dog,\n },\n {\n name: ETLCodes.Colors,\n route: ERoutes.color,\n },\n {\n name: ETLCodes.BreedGroups,\n route: ERoutes.breedGroups,\n },\n {\n name: ETLCodes.Breeds,\n route: ERoutes.breeds,\n },\n ],\n },\n {\n name: ETLCodes.Divers,\n alternativeIcon: \"fas fa-info\",\n items: [\n {\n name: ETLCodes.CalendarYears,\n route: ERoutes.calendarYear,\n },\n\n {\n name: ETLCodes.Countries,\n route: ERoutes.country,\n },\n ],\n },\n {\n name: ETLCodes.Affixes,\n alternativeIcon: \"fas fa-paw\",\n items: [\n {\n name: ETLCodes.Kennels,\n route: ERoutes.kennel,\n },\n {\n name: ETLCodes.FCIAffixesExport,\n route: `${ERoutes.affixExport}/newKennel`,\n },\n {\n name: ETLCodes.FCIAffixesImport,\n route: `${ERoutes.affixImport}/newKennel`,\n },\n ],\n },\n {\n name: ETLCodes.Health,\n alternativeIcon: \"fas fa-book-medical\",\n items: [\n {\n name: ETLCodes.Clinics,\n route: ERoutes.clinic,\n },\n {\n name: ETLCodes.Characteristics,\n route: ERoutes.characteristics,\n },\n {\n name: ETLCodes.CharacteristicValues,\n route: ERoutes.characteristicValues,\n },\n {\n name: ETLCodes.Packs,\n route: ERoutes.healthPack,\n },\n ],\n },\n {\n name: ETLCodes.Dysplasias,\n alternativeIcon: \"fas fa-bone\",\n items: [\n {\n name: ETLCodes.Commissions,\n route: ERoutes.commissionDysplasia,\n },\n {\n name: ETLCodes.GentCommission,\n route: ERoutes.gentCommission,\n },\n {\n name: ETLCodes.Appeals,\n route: ERoutes.appealDysplasia,\n },\n ],\n },\n {\n name: ETLCodes.Sport,\n alternativeIcon: \"fas fa-medal\",\n items: [\n {\n name: ETLCodes.WorkbookTypes,\n route: ERoutes.workbookType,\n },\n {\n name: ETLCodes.Clubs,\n route: ERoutes.club,\n },\n {\n name: ETLCodes.ClubRoles,\n route: ERoutes.clubRoles,\n },\n\n {\n name: ETLCodes.TitleTypes,\n route: ERoutes.titleType,\n },\n {\n name: ETLCodes.Sections,\n route: ERoutes.section,\n },\n {\n name: ETLCodes.Activities,\n route: ERoutes.activity,\n },\n {\n name: ETLCodes.SubActivities,\n route: ERoutes.subActivity,\n },\n {\n name: ETLCodes.Competitions,\n route: ERoutes.competition,\n },\n ],\n },\n {\n name: ETLCodes.Requests,\n alternativeIcon: \"fas fa-folder\",\n items: [\n {\n name: ETLCodes.AllRequests,\n route: ERoutes.requests,\n },\n {\n name: ETLCodes.Dog,\n items: [\n {\n name: ETLCodes.TempRSHRequests,\n route: ERoutes.tempRsh,\n },\n {\n name: ETLCodes.RSH,\n route: ERoutes.rsh,\n },\n {\n name: ETLCodes.BroodRequests,\n route: ERoutes.broodRequest,\n },\n {\n name: ETLCodes.ExpatriationRequest,\n route: ERoutes.expatriationRequest,\n },\n ],\n },\n {\n name: ETLCodes.Divers,\n items: [\n {\n name: ETLCodes.AffixRequests,\n route: ERoutes.affixRequest,\n },\n {\n name: ETLCodes.MembershipRequests,\n route: ERoutes.membershipRequest,\n },\n {\n name: ETLCodes.MiscellaneousRequests,\n route: ERoutes.miscellaneousRequest,\n },\n ],\n },\n {\n name: ETLCodes.Pedigree,\n items: [\n {\n name: ETLCodes.RISHRequests,\n route: ERoutes.rish,\n },\n {\n name: ETLCodes.PedigreeDuplicataRequests,\n route: ERoutes.pedigreeDuplicata,\n },\n {\n name: ETLCodes.ImportRequests,\n route: ERoutes.importRequest,\n },\n ],\n },\n {\n name: ETLCodes.Health,\n items: [\n {\n name: ETLCodes.DysplasiaRequests,\n route: ERoutes.dysplasiaRequest,\n },\n {\n name: ETLCodes.HealthTestRequests,\n route: ERoutes.healthTestRequest,\n },\n ],\n },\n {\n name: ETLCodes.Sport,\n items: [\n {\n name: ETLCodes.WorkAttestationRequests,\n route: ERoutes.workAttestationRequest,\n },\n {\n name: ETLCodes.WorkbookRequests,\n route: ERoutes.workbookRequest,\n },\n {\n name: ETLCodes.CompetitionRequests,\n route: ERoutes.competitionRequest,\n },\n {\n name: ETLCodes.TitleRequests,\n route: ERoutes.titleRequests,\n //disabled: true,\n },\n ],\n },\n ],\n },\n\n {\n name: ETLCodes.Contacts,\n icon: \"people\",\n items: [\n {\n name: ETLCodes.People,\n route: ERoutes.people,\n },\n ],\n },\n {\n name: ETLCodes.Administration,\n icon: \"cog\",\n items: [\n {\n name: ETLCodes.Articles,\n route: ERoutes.article,\n },\n {\n name: ETLCodes.Users,\n route: ERoutes.user,\n },\n {\n name: ETLCodes.MembershipRenewals,\n route: ERoutes.membershipRenewal,\n },\n {\n name: ETLCodes.Languages,\n route: ERoutes.language,\n },\n {\n name: ETLCodes.Emails,\n route: ERoutes.email,\n },\n {\n name: ETLCodes.RePrint,\n route: ERoutes.reprintPedigree,\n },\n {\n name: ETLCodes.Reports,\n route: ERoutes.report,\n },\n ],\n },\n];\n\nconst InnerFindAppNavigationItemFromRoute = (pathname: string, navItem: INavigationItem) => {\n if (navItem && navItem.route && pathname.startsWith(navItem.route)) {\n return navItem;\n }\n const nextNavItems = navItem.items;\n if (nextNavItems && nextNavItems?.length > 0) {\n for (let i of nextNavItems) {\n const found = InnerFindAppNavigationItemFromRoute(pathname, i);\n if (found) {\n return found;\n }\n }\n }\n return null;\n};\n\nexport const FindAppNavigationItemFromRoute = (pathname: string) => {\n for (let i of BaseAppNavigation) {\n const found = InnerFindAppNavigationItemFromRoute(pathname, i);\n if (found) return found;\n }\n return null;\n};\n\nexport const AppNavigation = (modules: string[]) => {\n const filtered: INavigationItem[] = [];\n BaseAppNavigation.forEach((n) => {\n const filteredItem = FilterNavItemRoutes(n, modules);\n if (!filteredItem?.items || filteredItem?.items.length > 0) {\n filtered.push(filteredItem);\n }\n });\n return filtered;\n};\n\nconst FilterNavItemRoutes = (item: INavigationItem, modules: string[]): INavigationItem => {\n let filtered: INavigationItem = { ...item };\n if (item.items) {\n filtered.items = [];\n item.items.forEach((n) => {\n const filteredItem = FilterNavItemRoutes(n, modules);\n if (filteredItem && (!filteredItem.items || filteredItem.items.length > 0)) {\n filtered.items.push(filteredItem);\n }\n });\n }\n if (filtered.route) {\n filtered = modules.includes(filtered.route.split(\"/\")[1].toUpperCase()) ? filtered : null;\n }\n return filtered;\n};\n","import * as React from \"react\";\n\nexport interface IHomePageProps {}\n\nexport const HomePage: React.FunctionComponent = (props) => {\n return
;\n};\n","import * as React from \"react\";\n\nexport interface IDashboardPageProps {}\n\nexport const DashboardPage: React.FunctionComponent = (props) => {\n return
DashboardPage works!
;\n};\n","import { ButtonContainer, IDataTableColumn } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\n\nimport { BreedGroupApi, BreedGroupSearch, BreedGroupGridDto } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { EditButton, SearchTablePage, ViewButton } from \"../../../../components\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { useGlobalData } from \"../../../../contexts\";\n\nexport interface IBreedGroupsListPageProps {}\n\nexport const BreedGroupsListPage: React.FunctionComponent = (props) => {\n const breedGroupApi = useApiService(BreedGroupApi);\n const { t } = useTl();\n const history = useHistory();\n const { currentLanguage } = useGlobalData();\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: BreedGroupGridDto) => (\n \n history.push(`${ERoutes.breedGroups}/${row.breedGroupId}/detail/view`)}\n />\n history.push(`${ERoutes.breedGroups}/${row.breedGroupId}/detail/edit`)}\n />\n \n ),\n },\n {\n header: () => t(ETLCodes.BreedGroupNumber),\n fieldName: \"breedGroupNumber\",\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n },\n ],\n [history, t]\n );\n\n const addItemFunction = React.useCallback(() => {\n history.push(`${ERoutes.breedGroups}/0/detail/edit`);\n }, [history]);\n\n const searchFunction = React.useCallback(\n (sObj) => breedGroupApi.baseSearch(BreedGroupSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [breedGroupApi, currentLanguage.languageId]\n );\n\n const exportFunction = React.useCallback(\n (sObj) => breedGroupApi.exportXlsFile(BreedGroupSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [breedGroupApi, currentLanguage.languageId]\n );\n\n const searchCriteriasFunction = React.useCallback(() => breedGroupApi.getSearchCriterias(true), [breedGroupApi]);\n\n return (\n \n );\n};\n","import * as React from \"react\";\nimport {\n BreedGroupApi,\n BreedGroupDto,\n BreedGroupTranslationDto,\n} from \"../../../../api\";\nimport { useTl, useApiService, useCrudApi } from \"../../../../hooks\";\nimport { useHistory } from \"react-router\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { SmallFormGenerator, FGMultiTranslate } from \"../../../../components\";\nimport { FieldGroup, FGNumberInput, FGTextAreaInput } from \"nsitools-react\";\nimport * as Yup from \"yup\";\nimport { useGlobalData } from \"../../../../contexts\";\n\nexport interface IBreedGroupDetailPageProps {\n idBreedGroup: number;\n editMode: boolean;\n}\n\nexport const BreedGroupDetailPage: React.FunctionComponent = ({\n idBreedGroup,\n editMode,\n}) => {\n const { t } = useTl();\n const api = useApiService(BreedGroupApi);\n const history = useHistory();\n const { languages } = useGlobalData();\n const {\n data,\n loading,\n deleteItem,\n deleting,\n saveItem,\n saving,\n } = useCrudApi(\n {\n getApiFn: (id = idBreedGroup) =>\n id > 0\n ? api.get(id)\n : new BreedGroupDto({\n breedGroupTranslations: [\n ...languages.map(\n (l) =>\n new BreedGroupTranslationDto({ languageId: l.languageId })\n ),\n ],\n }).toJSON(),\n saveApiFn: (d) => api.save(d),\n onSavedRoute: (d) =>\n `${ERoutes.breedGroups}/${d.breedGroupId}/detail/edit`,\n deleteApiFn: (d) => api.delete(d.breedGroupId),\n onDeletedRoute: () => ERoutes.breedGroups,\n },\n [idBreedGroup]\n );\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n breedGroupTranslations: Yup.array().of(\n Yup.object().shape({\n text: Yup.string().nullable().required(t(ETLCodes.Required)),\n })\n ),\n breedGroupNumber: Yup.number()\n .required(t(ETLCodes.Required))\n .test(\n \"number-unique\",\n t(ETLCodes.BreedGroupNumberAlreadyExists),\n async function (value) {\n if (!value) return true;\n const res = await api.isBreedGroupNumberUnique(idBreedGroup, value);\n return res.value;\n }\n ),\n });\n }, [api, idBreedGroup, t]);\n\n return (\n data && (\n history.push(ERoutes.breedGroups)}\n onDelete={deleteItem}\n showDeleteButton={idBreedGroup > 0}\n saving={saving}\n deleting={deleting}\n >\n \n \n \n \n \n \n )\n );\n};\n","import { FieldSet, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useParams } from \"react-router\";\n\nimport { BreedGroupBreedApi, BreedGroupBreedDto, BreedGroupBreedSearch } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { Link } from \"react-router-dom\";\nimport { CustomDataTable, ExportButton } from \"../../../../components\";\n\nexport interface IBreedGroupBreedPageProps {}\n\nexport const BreedGroupBreedPage: React.FunctionComponent = (props) => {\n const { id } = useParams<{ id: string }>();\n const { t } = useTl();\n const api = useApiService(BreedGroupBreedApi);\n const { currentLanguage } = useGlobalData();\n const [sobjState, setsobjState] = React.useState();\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [15, 25, 50],\n pageSize: 15,\n sortKeys: { name: \"ASC\" },\n });\n\n const { totalCount } = tableState;\n\n const searchFunction = React.useCallback(\n (sObj?: BreedGroupBreedSearch) => {\n setsobjState(\n BreedGroupBreedSearch.fromJS({ ...sObj, languageCode: currentLanguage.languageCode, breedGroupId: +id })\n );\n return api.baseSearch(\n BreedGroupBreedSearch.fromJS({ ...sObj, languageCode: currentLanguage.languageCode, breedGroupId: +id })\n );\n },\n [api, currentLanguage.languageCode, id]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n render: (row: BreedGroupBreedDto) => (\n \n {row.name}\n \n ),\n },\n {\n header: () => t(ETLCodes.Country),\n fieldName: \"country\",\n render: (row: BreedGroupBreedDto) => (\n \n {row.country}\n \n ),\n },\n ],\n [t]\n );\n React.useEffect(() => {\n search();\n }, [currentLanguage, search]);\n return (\n 1\n ? t(ETLCodes.TableResults_Plural, { count: totalCount })\n : t(ETLCodes.TableResults, { count: totalCount })\n }\n rightElement={ api.exportXlsFile(sobj)} sObj={sobjState} />}\n >\n \n \n );\n};\n","import { FieldSet, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useParams } from \"react-router\";\n\nimport { BreedGroupJudgeApi, BreedGroupJudgeSearch, JudgeGridDto, JudgeSearch } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { CustomDataTable, EmailButton, ExportButton } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { Link } from \"react-router-dom\";\n\nexport interface IBreedGroupJudgePageProps {}\n\nexport const BreedGroupJudgePage: React.FunctionComponent = (props) => {\n const { t } = useTl();\n const { id } = useParams<{ id: string }>();\n const breedGroupId = React.useMemo(() => +id, [id]);\n const api = useApiService(BreedGroupJudgeApi);\n const { currentLanguage } = useGlobalData();\n const [sobjState, setsobjState] = React.useState();\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [15, 25, 50],\n pageSize: 15,\n sortKeys: { name: \"ASC\" },\n });\n\n const { totalCount } = tableState;\n\n const searchFunction = React.useCallback(\n (sObj?: JudgeSearch) => {\n const sobj = BreedGroupJudgeSearch.fromJS({\n ...sObj,\n languageId: currentLanguage.languageId,\n breedGroupId: breedGroupId,\n });\n setsobjState(sobj);\n return api.baseSearch(sobj);\n },\n [api, breedGroupId, currentLanguage.languageId]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.LastName),\n fieldName: \"name\",\n render: (row: JudgeGridDto) => (\n \n {row.name}\n \n ),\n },\n {\n header: () => t(ETLCodes.Language),\n fieldName: \"language\",\n },\n {\n header: () => t(ETLCodes.Email),\n fieldName: \"email\",\n render: (value: JudgeGridDto) => ,\n },\n {\n header: () => t(ETLCodes.PhoneNumber),\n fieldName: \"phoneNumber\",\n },\n {\n header: () => t(ETLCodes.MobilePhoneNumber),\n fieldName: \"mobilePhoneNumber\",\n },\n ],\n [t]\n );\n React.useEffect(() => {\n search();\n }, [currentLanguage, search]);\n return (\n 1\n ? t(ETLCodes.TableResults_Plural, { count: totalCount })\n : t(ETLCodes.TableResults, { count: totalCount })\n }\n rightElement={ api.exportXlsFile(sObj)} sObj={sobjState} />}\n >\n \n \n );\n};\n","import * as React from \"react\";\nimport { useTl, useApiService } from \"../../../../hooks\";\nimport { useParams, useHistory } from \"react-router\";\nimport { BreedGroupDetailPage } from \"./BreedGroupDetailPage\";\nimport { PageBase, BackButton, ProtectedTabs } from \"../../../../components\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport {Tab, Spinner, SpinnerSize} from \"@blueprintjs/core\";\nimport { BreedGroupApi } from \"../../../../api\";\nimport { useApiEffect } from \"nsitools-react\";\nimport { BreedGroupBreedPage } from \"./BreedGroupBreedPage\";\nimport { BreedGroupJudgePage } from \"./BreedGroupJudgePage\";\n\nexport interface IBreedGroupItemPageProps {}\n\nexport const BreedGroupItemPage: React.FunctionComponent = (props) => {\n const { t } = useTl();\n const { id, tab, state = \"edit\" } = useParams<{ id: string; tab: string; state: string }>();\n const idBreedGroup = React.useMemo(() => +id, [id]);\n const history = useHistory();\n const breedGroupApi = useApiService(BreedGroupApi);\n const [displayName, loading] = useApiEffect(() => breedGroupApi.getDisplayName(idBreedGroup), [idBreedGroup]);\n\n return (\n 0 ? loading ? : displayName : t(ETLCodes.New) },\n ]}\n >\n history.push(`${ERoutes.breedGroups}/${id}/${newTabId}/${state}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n } disabled={idBreedGroup <= 0} />\n } disabled={idBreedGroup <= 0} />\n \n \n );\n};\n","import { ButtonContainer, IDataTableColumn } from \"nsitools-react\";\nimport React from \"react\";\nimport { useHistory } from \"react-router\";\n\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { EditButton, SearchTablePage, ViewButton } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { BreedApi, BreedGridDto, BreedSearch } from \"../../../../api\";\nimport { Link } from \"react-router-dom\";\n\nexport interface IBreedsListPageProps {}\n\nexport const BreedsListPage: React.FunctionComponent = (props) => {\n const breedApi = useApiService(BreedApi);\n const { t } = useTl();\n const history = useHistory();\n const { currentLanguage } = useGlobalData();\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: BreedGridDto) => (\n \n history.push(`${ERoutes.breeds}/${row.breedId}/detail/view`)} />\n history.push(`${ERoutes.breeds}/${row.breedId}/detail/edit`)} />\n \n ),\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n },\n {\n header: () => t(ETLCodes.BreedGroupLabel),\n fieldName: \"breedGroupNumber\",\n render: (row: BreedGridDto) => (\n \n {row.breedGroupFullName}\n \n ),\n },\n ],\n [history, t]\n );\n\n const addItem = React.useCallback(() => {\n history.push(`${ERoutes.breeds}/${0}/detail/edit`);\n }, [history]);\n\n const searchFunction = React.useCallback(\n (sObj) => breedApi.baseSearch(BreedSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [breedApi, currentLanguage.languageId]\n );\n\n const exportFunction = React.useCallback(\n (sObj) => breedApi.exportXlsFile(BreedSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [breedApi, currentLanguage.languageId]\n );\n\n const searchCriteriasFunction = React.useCallback(() => breedApi.getSearchCriterias(true), [breedApi]);\n\n return (\n <>\n \n \n );\n};\n","import { Checkbox } from \"@blueprintjs/core\";\nimport { FormikProps } from \"formik\";\nimport { FGCustomPanel, IDataTableColumn, showError, showSuccess, useApiEffect } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nimport { BreedApi, BreedWorkbookTypeSaveDto, WorkbookTypeApi, WorkbookTypeGridDto } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { SmallFormGenerator, TransfertList } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface IBreedAllowedWorkbookTypeProps {\n editMode: boolean;\n breedId: number;\n}\n\nexport const BreedAllowedWorkbookTypePage: React.FunctionComponent = ({\n editMode,\n breedId,\n}) => {\n const breedApi = useApiService(BreedApi);\n const workbookTypeApi = useApiService(WorkbookTypeApi);\n const [saving, setsaving] = React.useState(false);\n\n const { t } = useTl();\n\n const [allowedWorkbook, loadingAllowed] = useApiEffect(\n () => breedApi.getAllowedWorkbookType(+breedId, currentLanguage.languageId),\n [breedId]\n );\n const { currentLanguage } = useGlobalData();\n\n const [workbookTypes, loading] = useApiEffect(() => workbookTypeApi.getAllWorkbookTypes(currentLanguage.languageId));\n\n const [choosenItems, setChoosenItems] = React.useState([]);\n\n const updateFormik = React.useCallback(\n (formik: FormikProps<{ choosenItems: WorkbookTypeGridDto[] }>, newData: WorkbookTypeGridDto[]) => {\n formik.setFieldValue(\"choosenItems\", newData);\n },\n []\n );\n\n React.useEffect(() => {\n !loadingAllowed && setChoosenItems(allowedWorkbook);\n }, [allowedWorkbook, loadingAllowed]);\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"workbookColor\",\n render: (row: WorkbookTypeGridDto) => (\n \n {`${row.workbookColor} - ${row.hasPedigree ? t(ETLCodes.WithPedigree) : t(ETLCodes.WithoutPedigree)} (${\n row.description\n })`}\n \n ),\n },\n\n {\n header: () => t(ETLCodes.HasPedigree),\n fieldName: \"hasPedigree\",\n autoFitContent: true,\n alignment: \"center\",\n render: (row: WorkbookTypeGridDto) => ,\n },\n ],\n [t]\n );\n const SaveSelected = React.useCallback(\n async (formikData: { choosenItems: WorkbookTypeGridDto[] }) => {\n try {\n setsaving(true);\n const res = await breedApi.saveWorkbookTypes(\n BreedWorkbookTypeSaveDto.fromJS({\n breedId: +breedId,\n workbookTypeIds: formikData.choosenItems.map((c) => c.workbookTypeId),\n })\n );\n if (res !== null) {\n showSuccess(t(ETLCodes.SaveSuccess));\n }\n } catch (exception) {\n showError(t(ETLCodes.Error));\n }\n setChoosenItems(formikData.choosenItems);\n setsaving(false);\n },\n [breedApi, breedId, t]\n );\n return (\n \n \n {(ctx) => (\n updateFormik(ctx.formik, newData)}\n columns={columns}\n isLoading={loading}\n keyFieldName=\"workbookTypeId\"\n editMode={editMode}\n sortKey={{ workbookColor: \"ASC\" }}\n />\n )}\n \n \n );\n};\n","import { Checkbox } from \"@blueprintjs/core\";\nimport { FGCustomPanel, FieldGroup, IDataTableColumn } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nimport { ColorApi, ColorGridDto } from \"../../../../../api\";\nimport { SRSHCustomSelector } from \"../../../../../components\";\nimport { ERoutes } from \"../../../../../ERoutes\";\nimport { useApiService, useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\n\nexport interface IColorSelectorProps {\n editMode: boolean;\n}\n\nexport const ColorSelector: React.FunctionComponent = ({ editMode }) => {\n const { t } = useTl();\n const colorApi = useApiService(ColorApi);\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n headerAlignment: \"center\",\n alignment: \"center\",\n render: (row: ColorGridDto) => (\n \n {row.name}\n \n ),\n },\n {\n header: () => t(ETLCodes.Code),\n fieldName: \"code\",\n },\n {\n header: () => t(ETLCodes.OfficialColor),\n fieldName: \"official\",\n render: (row: ColorGridDto) => ,\n },\n ],\n [t]\n );\n\n const searchColorFunc = React.useCallback(\n async (sObj) => {\n return await colorApi.baseSearch(sObj);\n },\n [colorApi]\n );\n const searchColorIdsFunc = React.useCallback(\n async (sObj) => {\n return await colorApi.searchIds(sObj);\n },\n [colorApi]\n );\n\n return (\n \n \n {(ctx) => (\n ctx.formik.setFieldValue(\"colorIds\", ids)}\n idField=\"colorId\"\n searchFunction={searchColorFunc}\n searchIdsFunc={searchColorIdsFunc}\n editMode={editMode}\n />\n )}\n \n \n );\n};\n","/* eslint-disable react/jsx-no-undef */\nimport { FieldSet } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\n\nimport { BreedApi, BreedColorSaveDto } from \"../../../../../api\";\nimport { SmallFormGenerator } from \"../../../../../components\";\nimport { ERoutes } from \"../../../../../ERoutes\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { ColorSelector } from \"./ColorSelector\";\n\nexport interface IBreedAllowedColorsPageProps {\n editMode: boolean;\n breedId: number;\n}\n\nexport const BreedAllowedColorsPage: React.FunctionComponent = ({\n editMode,\n breedId,\n}) => {\n const api = useApiService(BreedApi);\n const { t } = useTl();\n const history = useHistory();\n\n const { data, loading, saving, saveItem } = useCrudApi(\n React.useMemo(\n () => ({\n getApiFn: (id = breedId) =>\n id > 0\n ? api.getBreedColors(id)\n : new BreedColorSaveDto({ breedId: id }).toJSON(),\n saveApiFn: (d: BreedColorSaveDto) => api.saveBreedColors(d),\n onSavedRoute: (d) => `${ERoutes.breeds}/${d.breedId}/linkedColors/edit`,\n }),\n [api, breedId]\n ),\n [breedId]\n );\n\n return (\n
\n history.push(ERoutes.breeds)}\n saving={saving}\n >\n \n \n
\n );\n};\n","import { FieldSet, IDataTableColumn, Loading } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nimport { HealthPackApi, HealthPackGridDto, HealthPackSearch } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { SRSHCustomSelector, ICustomSelectorProps } from \"../../../../components\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface IBreedHealthPackSelectorProps\n extends Pick, \"linkedIds\" | \"onLinkedIdsChanged\"> {\n linkedIds;\n onLinkedIdsChanged;\n editMode;\n loading;\n}\n\nexport const BreedHealthPackSelector: React.FunctionComponent = ({\n linkedIds,\n onLinkedIdsChanged,\n editMode,\n loading,\n}) => {\n const { t } = useTl();\n const api = useApiService(HealthPackApi);\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.Code),\n fieldName: \"healthPackCode\",\n render: (row: HealthPackGridDto) => (\n \n {row.healthPackCode}\n \n ),\n },\n {\n header: () => t(ETLCodes.HealthPackGroup),\n fieldName: \"healthPackGroupName\",\n },\n\n {\n header: () => t(ETLCodes.Article),\n fieldName: \"articleName\",\n render: (row: HealthPackGridDto) => (\n \n {row.articleName}\n \n ),\n },\n {\n header: () => t(ETLCodes.Laboratory),\n fieldName: \"lab\",\n },\n ],\n [t]\n );\n\n const getHealthPacks = React.useCallback((sObj: any) => api.baseSearch(HealthPackSearch.fromJS({ ...sObj })), [api]);\n const getHealthPackIds = React.useCallback((sObj: any) => api.getIds(HealthPackSearch.fromJS({ ...sObj })), [api]);\n\n return (\n \n
\n \n
\n
\n\n // formik.setFieldValue(\"healthResultIds\", newIds)}\n // idField=\"healthResultId\"\n // searchFunction={getHealthPacks}\n // searchIdsFunc={getHealthPackIds}\n // editMode={true}\n // />\n );\n};\n","import {\n FGCustomPanel,\n FGNumberInput,\n FGSelectInput,\n FGTextAreaInput,\n FGTextInput,\n FieldGroup,\n FGMaskInput,\n FGListen,\n} from \"nsitools-react\";\nimport React from \"react\";\nimport { useHistory } from \"react-router\";\nimport * as Yup from \"yup\";\n\nimport { BreedApi, BreedDto, BreedTranslationDto } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport {\n FGCountrySelect,\n FGMultiTranslate,\n FGSRSHCheckboxInput,\n SharepointButton,\n SmallFormGenerator,\n FGSRSHDateMaskInput,\n} from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useCrudApi, useTl, useWindow } from \"../../../../hooks\";\nimport { useReferential } from \"../../../../hooks/useReferential\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { FGNumberMaskInput } from \"../../../../components/formGenerator/FGNumberMaskInput\";\nimport { BreedHealthPackSelector } from \"./BreedHealthPackSelector\";\n\nexport interface IBreedDetailPageProps {\n editMode: boolean;\n breedId: number;\n}\n\nexport const BreedDetailPage: React.FunctionComponent = ({ editMode, breedId }) => {\n const { t, tUnsafe } = useTl();\n const api = useApiService(BreedApi);\n const history = useHistory();\n const { languages } = useGlobalData();\n const [breedGroups, breedGroupsLoading] = useReferential((c) => c.getBreedGroups(), true, []);\n const [agility, agilityLoading] = useReferential((a) => a.getAgility(), false);\n const [veterinaries, veterinariesLoading] = useReferential((c) => c.getBreedAuthorizedVets(), true, []);\n const [grooming, groomingLoading] = useReferential((a) => a.getGrooming(), false);\n const [translatedAgility, setTranslatedAgilities] = React.useState([]);\n const [translatedGrooming, setTranslatedGroomings] = React.useState([]);\n\n React.useEffect(() => {\n if (!agilityLoading && agility) {\n const newAgility = agility.map((c) => {\n return { label: tUnsafe(c.label), value: c.value };\n });\n setTranslatedAgilities(newAgility);\n }\n }, [agility, agilityLoading, tUnsafe]);\n\n React.useEffect(() => {\n if (!groomingLoading && grooming) {\n const newGrooming = grooming.map((c) => {\n return { label: tUnsafe(c.label), value: c.value };\n });\n setTranslatedGroomings(newGrooming);\n }\n }, [grooming, groomingLoading, tUnsafe]);\n\n const { data, loading, deleteItem, deleting, saveItem, saving, refresh } = useCrudApi(\n {\n getApiFn: (id = breedId) =>\n id > 0\n ? api.get(id)\n : new BreedDto({\n healthPackIds: [],\n breedTranslations: [\n ...languages.map(\n (l) =>\n new BreedTranslationDto({\n languageId: l.languageId,\n })\n ),\n ],\n }).toJSON(),\n saveApiFn: (d: BreedDto) => api.save(d),\n onSavedRoute: (d) => `${ERoutes.breeds}/${d.breedId}/detail/edit`,\n deleteApiFn: (d) => api.delete(d.breedId),\n onDeletedRoute: () => ERoutes.breeds,\n },\n [breedId]\n );\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n countryId: Yup.number().nullable().required(t(ETLCodes.Required)),\n breedGroupId: Yup.number().nullable().required(t(ETLCodes.Required)),\n officialName: Yup.string()\n .nullable()\n .required(t(ETLCodes.Required))\n .test(\"name_unique\", t(ETLCodes.OfficialNameAlreadyExists), async function (value) {\n const res = await api.officialNameUnique(breedId, value);\n return res.value;\n }),\n breedTranslations: Yup.array().of(\n Yup.object().shape({\n text: Yup.string().nullable().required(t(ETLCodes.Required)),\n })\n ),\n knownAt: Yup.date()\n .nullable()\n .test(\"required\", t(ETLCodes.Required), async function (value) {\n if (this.parent.knownBreed) {\n return value !== null && value !== undefined;\n }\n return true;\n }),\n });\n }, [api, breedId, t]);\n\n const [shpLoading, setShpLoading] = React.useState(false);\n const existsInShp = React.useMemo(() => !!data?.sharepointUri, [data?.sharepointUri]);\n const openOrCreateInShp = React.useCallback(async () => {\n setShpLoading(true);\n if (!!data?.sharepointUri) {\n window.open(data?.sharepointUri, \"_blank\");\n setShpLoading(false);\n } else {\n try {\n await api.createInSharepoint(breedId);\n refresh();\n } catch (e) {\n throw e;\n } finally {\n setShpLoading(false);\n }\n }\n }, [api, breedId, data?.sharepointUri, refresh]);\n\n const { openNewTab } = useWindow();\n return (\n history.push(ERoutes.breeds)}\n onDelete={deleteItem}\n showDeleteButton={breedId > 0}\n saving={saving}\n deleting={deleting}\n >\n {\n if (!value && !!formik.values[\"knownAt\"]) {\n formik.setFieldValue(\"knownAt\", null);\n }\n if (formik.values.internship && value && !!formik.values[\"internshipDate\"] && !!formik.values[\"internship\"]) {\n formik.setFieldValue(\"internshipDate\", null);\n formik.setFieldValue(\"internship\", false);\n }\n }}\n />\n {\n if (!value && !!formik.values[\"internshipDate\"]) {\n formik.setFieldValue(\"internshipDate\", null);\n }\n if (formik.values.knownBreed && value && !!formik.values[\"knownAt\"] && !!formik.values[\"knownBreed\"]) {\n formik.setFieldValue(\"knownAt\", null);\n formik.setFieldValue(\"knownBreed\", false);\n }\n }}\n />\n 0 && (\n \n ),\n }}\n >\n \n \n openNewTab(`${ERoutes.country}/${item}/detail/view`)}\n />\n openNewTab(`${ERoutes.breedGroups}/${item}/detail/view`)}\n />\n \n \n \n \n \n {(ctx) =>\n ctx.formik.values.knownBreed && \n }\n \n \n \n {(ctx) =>\n ctx.formik.values.internship && (\n \n )\n }\n \n\n \n \n \n\n \n \n \n\n \n\n \n\n \n \n\n \n \n \n \n \n \n \n {({ formik }) => (\n formik?.setFieldValue(\"healthPackIds\", ids)}\n editMode={editMode}\n loading={loading}\n />\n )}\n \n \n );\n};\n","import * as React from \"react\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { useParams } from \"react-router\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { IDataTableColumn } from \"nsitools-react\";\nimport { SearchTablePage } from \"../../../../components\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { ClubBreedApi, ClubBreedSearch, ClubGridDto } from \"../../../../api\";\nimport { Link } from \"react-router-dom\";\nimport { generateAddress } from \"../../../../utils\";\n\nexport interface IBreedClubPageProps {}\n\nexport const BreedClubPage: React.FunctionComponent = (props) => {\n const api = useApiService(ClubBreedApi);\n const { t } = useTl();\n const { id } = useParams<{ id: string }>();\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n render: (row: ClubGridDto) => (\n \n {row.name}\n \n ),\n },\n {\n header: () => t(ETLCodes.VATNumber),\n fieldName: \"vatNumber\",\n },\n {\n header: () => t(ETLCodes.Language),\n fieldName: \"language\",\n },\n {\n header: () => t(ETLCodes.MailAddress),\n fieldName: \"address\",\n render: (row: ClubGridDto) => generateAddress(row.number, row.street, row.city, row.postalCode, row.country),\n },\n ],\n [t]\n );\n\n // const selectItemFunction = React.useCallback(() => {\n // history.push(`${ERoutes.color}/0/detail/edit`);\n // }, [history]);\n const search = React.useCallback(\n (sObj) => api.baseSearch(ClubBreedSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, breedId: +id })),\n [api, currentLanguage.languageId, id]\n );\n return (\n \n api.exportXlsFile(ClubBreedSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, breedId: +id }))\n }\n // addFunc={selectItemFunction}\n sortKeys={{ name: \"ASC\" }}\n withCard={false}\n breadCrumbs={[{ text: t(ETLCodes.Clubs) }]}\n // rightElement={\n // history.push(`${ERoutes.breeds}/${id}/clubs/selector`)}\n // intent={Intent.PRIMARY}\n // text={t(ETLCodes.Modify)}\n // />\n // }\n />\n );\n};\n","import { IDataTableColumn } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useParams } from \"react-router\";\nimport { Link } from \"react-router-dom\";\n\nimport { AllJudgesForBreedApi, BreedJudgeGridDto, BreedJudgeSearch } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { EmailButton, SearchTablePage } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface IBreedJudgePageProps {}\n\nexport const BreedJudgePage: React.FunctionComponent = (props) => {\n const api = useApiService(AllJudgesForBreedApi);\n const { t } = useTl();\n const { id } = useParams<{ id: string }>();\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.LastName),\n fieldName: \"lastName\",\n render: (row: BreedJudgeGridDto) => (\n \n {row.lastName}\n \n ),\n },\n {\n header: () => t(ETLCodes.FirstName),\n fieldName: \"firstname\",\n },\n {\n header: () => t(ETLCodes.Language),\n fieldName: \"language\",\n },\n {\n header: () => t(ETLCodes.Email),\n fieldName: \"email\",\n render: (value: BreedJudgeGridDto) => ,\n },\n {\n header: () => t(ETLCodes.PhoneNumber),\n fieldName: \"phoneNumber\",\n },\n {\n header: () => t(ETLCodes.MobilePhoneNumber),\n fieldName: \"mobilePhoneNumber\",\n },\n ],\n [t]\n );\n\n // const selectItemFunction = React.useCallback(() => {\n // history.push(`${ERoutes.color}/0/detail/edit`);\n // }, [history]);\n const search = React.useCallback(\n (sObj) =>\n api.baseSearch(BreedJudgeSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, breedId: +id })),\n [api, currentLanguage.languageId, id]\n );\n return (\n // <>\n \n api.exportXlsFile(BreedJudgeSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, breedId: +id }))\n }\n // addFunc={selectItemFunction}\n sortKeys={{ lastName: \"ASC\" }}\n withCard={false}\n breadCrumbs={[{ text: t(ETLCodes.Judges) }]}\n // rightElement={\n // history.push(`${ERoutes.breeds}/${id}/clubs/selector`)}\n // intent={Intent.PRIMARY}\n // text={t(ETLCodes.Modify)}\n // />\n // }\n />\n );\n};\n","import { FGSelectInput } from \"nsitools-react\";\nimport * as React from \"react\";\nimport * as Yup from \"yup\";\n\nimport { BreedVarietyApi, SaveBreedVarietyAndExceptionDto } from \"../../../../../api\";\nimport { SmallFormGenerator } from \"../../../../../components\";\nimport { useApiService, useSaveApi, useTl } from \"../../../../../hooks\";\nimport { useReferential } from \"../../../../../hooks/useReferential\";\nimport { ETLCodes } from \"../../../../../locales\";\n\nexport interface IBreedVarietyPanelProps {\n breedId: number;\n onSaved: () => void;\n}\n\nexport const BreedVarietyPanel: React.FunctionComponent = ({ breedId, onSaved }) => {\n const { t } = useTl();\n const api = useApiService(BreedVarietyApi);\n\n const [breeds, bloading] = useReferential((a) => a.getBreeds(null), true, []);\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n destinationBreedId: Yup.number().nullable().required(t(ETLCodes.Required)),\n });\n }, [t]);\n\n const { saving, saveItem } = useSaveApi(\n React.useMemo(\n () => ({\n saveApiFn: (data) => api.saveBreedVariety(data),\n onSaveFn: () => onSaved(),\n }),\n [api, onSaved]\n )\n );\n\n const initialData = React.useMemo(\n () => new SaveBreedVarietyAndExceptionDto({ sourceBreedId: breedId }).toJSON(),\n [breedId]\n );\n\n return (\n \n \n \n );\n};\n","import { Classes, Colors, Dialog, Intent, ButtonGroup } from \"@blueprintjs/core\";\nimport { ButtonContainer, FieldSet, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nimport {\n BreedVarietiesAndExceptionsGridDto,\n BreedVarietyAndExceptionSearch,\n BreedVarietyApi,\n} from \"../../../../../api\";\nimport { ERoutes } from \"../../../../../ERoutes\";\nimport { CustomDataTable, DeleteButton, EditButton, ExportButton } from \"../../../../../components\";\nimport { useGlobalData } from \"../../../../../contexts\";\nimport { useApiService, useDeleteApi, useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { BreedVarietyPanel } from \"./BreedVarietyPanel\";\n\nexport interface IBreedVarietyListPageProps {\n breedId: number;\n editMode: boolean;\n}\n\nexport const BreedVarietyListPage: React.FunctionComponent = ({ breedId, editMode }) => {\n const api = useApiService(BreedVarietyApi);\n const { t } = useTl();\n const { currentLanguage, languages } = useGlobalData();\n\n const [dialogOpened, setDialogOpened] = React.useState(false);\n const [sobjState, setsobjState] = React.useState();\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [15, 25, 50],\n pageSize: 15,\n sortKeys: { breedGroupLabel: \"ASC\" },\n });\n\n const searchFunction = React.useCallback(\n (sObj?: BreedVarietyAndExceptionSearch) => {\n const sobj = BreedVarietyAndExceptionSearch.fromJS({\n ...sObj,\n currentBreedId: breedId,\n languageId: currentLanguage.languageId,\n });\n setsobjState(sobj);\n return api.baseSearch(sobj);\n },\n [api, breedId, currentLanguage.languageId]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n\n const { deleteItem } = useDeleteApi(\n React.useMemo(\n () => ({\n deleteApiFn: (data) => api.deleteBreedVariety(breedId, data),\n onDeletedFn: () => search(),\n }),\n [api, breedId, search]\n )\n );\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n hidden: !editMode,\n render: (row: BreedVarietiesAndExceptionsGridDto) => (\n \n deleteItem(row.breedId)} />\n \n ),\n },\n ...languages\n .filter((lg) => {\n return lg.languageId === currentLanguage.languageId;\n })\n .map((lg) => ({\n header: () => `${t(ETLCodes.Name)} ${lg.languageCode}`,\n computed: true,\n disableSorting: true,\n fieldName: \"_lng\" + lg.languageCode,\n render: (dto: BreedVarietiesAndExceptionsGridDto) => (\n \n {dto.breedNames.find((names) => names.code === lg.languageCode)?.text}\n \n ),\n })),\n {\n header: () => t(ETLCodes.BreedGroupLabel),\n fieldName: \"breedGroupLabel\",\n render: (row: BreedVarietiesAndExceptionsGridDto) => (\n \n {row.breedGroupLabel}\n \n ),\n },\n ],\n [currentLanguage.languageId, deleteItem, editMode, languages, t]\n );\n const addItemFunction = React.useCallback(() => {\n setDialogOpened(true);\n }, []);\n React.useEffect(() => {\n search();\n }, [currentLanguage, search]);\n return (\n <>\n \n api.exportXlsFile(sObj)} sObj={sobjState} />\n {editMode && (\n {\n e.stopPropagation();\n addItemFunction();\n }}\n text={t(ETLCodes.General_Add)}\n intent={Intent.PRIMARY}\n />\n )}\n \n }\n >\n \n \n\n setDialogOpened(false)}\n canEscapeKeyClose={true}\n canOutsideClickClose={true}\n isCloseButtonShown={true}\n className={Classes.DIALOG}\n style={{ width: 1000, height: 150, background: Colors.WHITE }}\n >\n
\n {\n setDialogOpened(false);\n search();\n }}\n breedId={breedId}\n />\n
\n \n \n );\n};\n","import { FGSelectInput } from \"nsitools-react\";\nimport * as React from \"react\";\nimport * as Yup from \"yup\";\n\nimport { BreedExceptionsApi, SaveBreedVarietyAndExceptionDto } from \"../../../../../api\";\nimport { SmallFormGenerator } from \"../../../../../components\";\nimport { useApiService, useSaveApi, useTl } from \"../../../../../hooks\";\nimport { useReferential } from \"../../../../../hooks/useReferential\";\nimport { ETLCodes } from \"../../../../../locales\";\n\nexport interface IBreedExceptionPanelProps {\n breedId: number;\n onSaved: () => void;\n}\n\nexport const BreedExceptionPanel: React.FunctionComponent = ({ breedId, onSaved }) => {\n const { t } = useTl();\n const api = useApiService(BreedExceptionsApi);\n\n const [breeds, bloading] = useReferential((a) => a.getBreedExceptions(breedId), true, []);\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n destinationBreedId: Yup.number().nullable().required(t(ETLCodes.Required)),\n });\n }, [t]);\n\n const { saving, saveItem } = useSaveApi(\n React.useMemo(\n () => ({\n saveApiFn: (data) => api.saveBreedException(data),\n onSaveFn: () => onSaved(),\n }),\n [api, onSaved]\n )\n );\n\n const initialData = React.useMemo(() => new SaveBreedVarietyAndExceptionDto({ sourceBreedId: breedId }).toJSON(), [\n breedId,\n ]);\n\n return (\n \n \n \n );\n};\n","import { ButtonGroup, Classes, Colors, Dialog, Intent } from \"@blueprintjs/core\";\nimport { ButtonContainer, FieldSet, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nimport {\n BreedExceptionsApi,\n BreedVarietiesAndExceptionsGridDto,\n BreedVarietyAndExceptionSearch,\n} from \"../../../../../api\";\nimport { ERoutes } from \"../../../../../ERoutes\";\nimport { CustomDataTable, DeleteButton, EditButton, ExportButton } from \"../../../../../components\";\nimport { useGlobalData } from \"../../../../../contexts\";\nimport { useApiService, useDeleteApi, useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { BreedExceptionPanel } from \"./BreedExceptionPanel\";\n\nexport interface IBreedExceptionListPageProps {\n breedId: number;\n editMode: boolean;\n}\n\nexport const BreedExceptionListPage: React.FunctionComponent = ({\n breedId,\n editMode,\n}) => {\n const api = useApiService(BreedExceptionsApi);\n const { t } = useTl();\n const { currentLanguage, languages } = useGlobalData();\n\n const [dialogOpened, setDialogOpened] = React.useState(false);\n const [sobjState, setsobjState] = React.useState();\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [15, 25, 50],\n pageSize: 15,\n sortKeys: { breedGroupLabel: \"ASC\" },\n });\n\n const searchFunction = React.useCallback(\n (sObj?: BreedVarietyAndExceptionSearch) => {\n const sobj = BreedVarietyAndExceptionSearch.fromJS({\n ...sObj,\n currentBreedId: breedId,\n languageId: currentLanguage.languageId,\n });\n setsobjState(sobj);\n return api.baseSearch(sobj);\n },\n [api, breedId, currentLanguage.languageId]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n\n const { deleteItem } = useDeleteApi(\n React.useMemo(\n () => ({\n deleteApiFn: (data) => api.deleteBreedException(breedId, data),\n onDeletedFn: () => search(),\n }),\n [api, breedId, search]\n )\n );\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n hidden: !editMode,\n render: (row: BreedVarietiesAndExceptionsGridDto) => (\n \n deleteItem(row.breedId)} />\n \n ),\n },\n {\n header: () => t(ETLCodes.BreedGroupLabel),\n fieldName: \"breedGroupLabel\",\n render: (row: BreedVarietiesAndExceptionsGridDto) => (\n \n {row.breedGroupLabel}\n \n ),\n },\n ...languages\n .filter((lg) => {\n return lg.languageId === currentLanguage.languageId;\n })\n .map((lg) => ({\n header: () => `${t(ETLCodes.Name)} ${lg.languageCode}`,\n computed: true,\n disableSorting: true,\n fieldName: \"_lng\" + lg.languageCode,\n render: (dto: BreedVarietiesAndExceptionsGridDto) => (\n \n {dto.breedNames.find((names) => names.code === lg.languageCode)?.text}\n \n ),\n })),\n ],\n [currentLanguage.languageId, deleteItem, editMode, languages, t]\n );\n const addItemFunction = React.useCallback(() => {\n setDialogOpened(true);\n }, []);\n React.useEffect(() => {\n search();\n }, [currentLanguage, search]);\n return (\n <>\n \n api.exportXlsFile(sObj)} sObj={sobjState} />\n {editMode && (\n {\n e.stopPropagation();\n addItemFunction();\n }}\n text={t(ETLCodes.General_Add)}\n intent={Intent.PRIMARY}\n />\n )}\n \n }\n >\n \n \n\n setDialogOpened(false)}\n canEscapeKeyClose={true}\n canOutsideClickClose={true}\n isCloseButtonShown={true}\n className={Classes.DIALOG}\n style={{ width: 1000, height: 150, background: Colors.WHITE }}\n >\n
\n {\n setDialogOpened(false);\n search();\n }}\n breedId={breedId}\n />\n
\n \n \n );\n};\n","import { useApiService, useTl } from \"../../../../hooks\";\nimport { useHistory, useParams } from \"react-router\";\nimport { useApiEffect } from \"nsitools-react\";\nimport React from \"react\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { PageBase, BackButton, ProtectedTabs } from \"../../../../components\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { Tab, Spinner, SpinnerSize } from \"@blueprintjs/core\";\nimport { BreedAllowedWorkbookTypePage } from \"./BreedAllowedWorkbookTypePage\";\nimport { BreedAllowedColorsPage } from \"./BreedAllowedColors/BreedAllowedColorsPage\";\nimport { BreedDetailPage } from \"./BreedDetailPage\";\nimport { BreedApi } from \"../../../../api\";\nimport { BreedClubPage } from \"./BreedClubPage\";\nimport { BreedJudgePage } from \"./BreedJudgePage\";\nimport { BreedVarietyListPage } from \"./BreedVarieties/BreedVarietyListPage\";\nimport { BreedExceptionListPage } from \"./BreedExceptions/BreedExceptionsListPage\";\nimport { useGlobalData } from \"../../../../contexts\";\n\nexport interface IBreedItemPageProps {}\n\nexport const BreedItemPage: React.FunctionComponent = (props) => {\n const { t } = useTl();\n const { id, tab, state = \"edit\" } = useParams<{ id: string; tab: string; state: string }>();\n const breedId = React.useMemo(() => +id, [id]);\n const history = useHistory();\n const { currentLanguage } = useGlobalData();\n const breedApi = useApiService(BreedApi);\n const [displayName, loading] = useApiEffect(\n () => breedApi.getDisplayName(breedId, currentLanguage.languageId),\n [breedId],\n );\n return (\n <>\n 0 ? loading ? : displayName : t(ETLCodes.New) },\n ]}\n >\n history.push(`${ERoutes.breeds}/${id}/${newTabId}/${state}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n }\n disabled={+id <= 0}\n />\n }\n disabled={+id <= 0}\n />\n } disabled={+id <= 0} />\n\n }\n />\n }\n />\n } />\n {/* */}\n {/* panel={} */}\n \n \n \n );\n};\n","import { Checkbox } from \"@blueprintjs/core\";\nimport { ButtonContainer, IDataTableColumn } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\n\nimport { ColorApi, ColorGridDto, ColorSearch } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { EditButton, SearchTablePage, ViewButton } from \"../../../../components\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { useGlobalData } from \"../../../../contexts\";\n\nexport interface IColorListPageProps {}\n\nexport const ColorListPage: React.FunctionComponent = (props) => {\n const api = useApiService(ColorApi);\n const { t } = useTl();\n const history = useHistory();\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: ColorGridDto) => (\n \n history.push(`${ERoutes.color}/${row.colorId}/detail/view`)} />\n history.push(`${ERoutes.color}/${row.colorId}/detail/edit`)} />\n \n ),\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n },\n {\n header: () => t(ETLCodes.IsMerle),\n fieldName: \"isMerle\",\n alignment: \"center\",\n render: (row: ColorGridDto) => ,\n },\n {\n header: () => t(ETLCodes.Official),\n fieldName: \"official\",\n headerAlignment: \"center\",\n alignment: \"center\",\n render: (row: ColorGridDto) => ,\n },\n {\n header: () => t(ETLCodes.ColorCode),\n fieldName: \"code\",\n },\n ],\n [history, t]\n );\n\n const addItemFunction = React.useCallback(() => {\n history.push(`${ERoutes.color}/0/detail/edit`);\n }, [history]);\n\n const searchColorFunction = React.useCallback(\n (sObj) => {\n //api.abortPendingRequest();\n return api.baseSearch(ColorSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId }));\n },\n [api, currentLanguage.languageId]\n );\n const exportFunction = React.useCallback(\n (sObj) => api.exportXlsFile(ColorSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n\n const searchColorCriteriasFunction = React.useCallback(() => api.getSearchCriterias(true), [api]);\n\n return (\n \n );\n};\n","import { FGTextAreaInput, FGTextInput, FieldGroup } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport * as Yup from \"yup\";\n\nimport { ColorApi, ColorDto, ColorTranslationDto } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport {\n FGMultiTranslate,\n FGSRSHCheckboxInput,\n SmallFormGenerator,\n} from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface IColorDetailPageProps {\n colorId: number;\n editMode: boolean;\n}\n\nexport const ColorDetailPage: React.FunctionComponent = ({\n colorId,\n editMode,\n}) => {\n const { t } = useTl();\n const history = useHistory();\n const api = useApiService(ColorApi);\n const { languages } = useGlobalData();\n\n const { data, loading, saveItem, saving, deleteItem, deleting } = useCrudApi(\n {\n getApiFn: (id = colorId) =>\n id > 0\n ? api.getColor(id)\n : new ColorDto({\n colorTranslations: [\n ...languages.map(\n (l) =>\n new ColorTranslationDto({\n languageId: l.languageId,\n })\n ),\n ],\n }).toJSON(),\n saveApiFn: (d: ColorDto) => api.saveColor(d),\n onSavedRoute: (d) => `${ERoutes.color}/${d.colorId}/detail/edit`,\n deleteApiFn: (d) => api.deleteColor(d.colorId),\n onDeletedRoute: (d) => `${ERoutes.color}`,\n },\n [colorId]\n );\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n code: Yup.string().nullable().required(t(ETLCodes.Required)),\n colorTranslations: Yup.array().of(\n Yup.object().shape({\n text: Yup.string().nullable().required(t(ETLCodes.Required)),\n })\n ),\n });\n }, [t]);\n\n return (\n data && (\n history.push(ERoutes.color)}\n saving={saving}\n deleting={deleting}\n showDeleteButton={colorId > 0}\n onDelete={deleteItem}\n validationSchema={FormSchema}\n >\n \n \n \n \n \n \n \n \n )\n );\n};\n","import {Tab, Spinner, SpinnerSize} from \"@blueprintjs/core\";\nimport * as React from \"react\";\nimport { useHistory, useParams } from \"react-router\";\n\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { BackButton, PageBase, ProtectedTabs } from \"../../../../components\";\nimport { useTl, useApiService } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { ColorDetailPage } from \"..\";\nimport { useApiEffect } from \"nsitools-react\";\nimport { ColorApi } from \"../../../../api\";\nimport { useGlobalData } from \"../../../../contexts\";\n\nexport interface IColorItemPageProps {}\n\nexport const ColorItemPage: React.FunctionComponent = (props) => {\n const { id, tab, state } = useParams<{ id: string; tab: string; state: string }>();\n const history = useHistory();\n const { t } = useTl();\n const api = useApiService(ColorApi);\n const { currentLanguage } = useGlobalData();\n const [displayName, loading] = useApiEffect(() => api.getDisplayName(+id, currentLanguage.languageCode), [id]);\n\n return (\n 0 ? loading ? : displayName : t(ETLCodes.New) },\n ]}\n >\n history.push(`${ERoutes.color}/${id}/${newTabId}/${state}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n \n \n );\n};\n","import * as React from \"react\";\nimport { SearchTablePage, ViewButton, EditButton } from \"../../../../components\";\nimport { useTl, useApiService } from \"../../../../hooks\";\nimport { useHistory } from \"react-router\";\nimport { CountryApi, CountrySearch, CountryGridDto } from \"../../../../api\";\nimport { IDataTableColumn, ButtonContainer } from \"nsitools-react\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { Checkbox } from \"@blueprintjs/core\";\nexport interface ICountryListPageProps {}\n\nexport const CountryListPage: React.FunctionComponent = () => {\n const { t } = useTl();\n const history = useHistory();\n const api = useApiService(CountryApi);\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: CountryGridDto) => (\n \n history.push(`${ERoutes.country}/${row.countryId}/detail/view`)}\n />\n history.push(`${ERoutes.country}/${row.countryId}/detail/edit`)}\n />\n \n ),\n },\n {\n fieldName: \"_flags\",\n computed: true,\n disableSorting: true,\n autoFitContent: true,\n render: (row: CountryGridDto) => {`${row.isoCode},\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n },\n {\n header: () => t(ETLCodes.IsoCode),\n fieldName: \"isoCode\",\n autoFitContent: true,\n },\n {\n header: () => t(ETLCodes.BeautyJudgeEmail),\n fieldName: \"emailForBeautyJudge\",\n alignment: \"center\",\n autoFitContent: true,\n render: (row: CountryGridDto) => (\n \n ),\n },\n ],\n [history, t]\n );\n\n const searchCountryFunction = React.useCallback(\n (sObj) => api.baseSearch(CountrySearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n\n const exportCountryFunction = React.useCallback(\n (sObj) => api.exportXlsFile(CountrySearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n\n const searchCountryCriteriasFunction = React.useCallback(() => api.getSearchCriterias(true), [api]);\n\n return (\n \n );\n};\n","import { FGTextInput } from \"nsitools-react\";\nimport * as React from \"react\";\nimport * as Yup from \"yup\";\n\nimport { PedigreePrefixApi, SavePedigreePrefixDto } from \"../../../../../api\";\nimport { SmallFormGenerator } from \"../../../../../components\";\nimport { useApiService, useTl, useSaveApi } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\n\nexport interface IPedigreePrefixPanelProps {\n countryId: number;\n onSaved: () => void;\n}\n\nexport const PedigreePrefixPanel: React.FunctionComponent = ({ countryId, onSaved }) => {\n const { t } = useTl();\n const api = useApiService(PedigreePrefixApi);\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n prefix: Yup.string()\n .nullable()\n .required(t(ETLCodes.Required))\n .test(\"unique-prefix\", t(ETLCodes.PrefixAlreadyExists), async function (value) {\n if (value) {\n const error = await api.isPrefixUnique(countryId, value);\n return error.value;\n }\n return true;\n }),\n });\n }, [api, countryId, t]);\n\n const { saving, saveItem } = useSaveApi(\n React.useMemo(\n () => ({\n saveApiFn: (data) => api.saveNewPedigreePrefix(data),\n onSaveFn: () => onSaved(),\n }),\n [api, onSaved]\n )\n );\n\n const initialData = React.useMemo(() => new SavePedigreePrefixDto({ countryId: countryId }).toJSON(), [countryId]);\n\n return (\n \n \n \n );\n};\n","import * as React from \"react\";\nimport { useApiService, useDeleteApi, useTl } from \"../../../../../hooks\";\nimport { CountryApi, CountryPedigreePrefixGridDto, PedigreePrefixApi, PedigreePrefixSearch } from \"../../../../../api\";\nimport { ButtonContainer, FieldSet, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { CustomDataTable, DeleteButton, EditButton, ExportButton } from \"../../../../../components\";\nimport { ButtonGroup, Classes, Colors, Dialog, Intent } from \"@blueprintjs/core\";\nimport { useGlobalData } from \"../../../../../contexts\";\nimport { PedigreePrefixPanel } from \"./PedigreePrefixPanel\";\n\nexport interface ICountryPedigreesListProps {\n countryId: number;\n editMode: boolean;\n}\n\nexport const CountryPedigreesList: React.FunctionComponent = ({ countryId, editMode }) => {\n const api = useApiService(PedigreePrefixApi);\n const countryApi = useApiService(CountryApi);\n const { t } = useTl();\n\n const [dialogOpened, setDialogOpened] = React.useState(false);\n const [belgianRequest, setBelgianRequest] = React.useState(true);\n const [belgian, setBelgian] = React.useState();\n const [sobjState, setsobjState] = React.useState();\n const { currentLanguage } = useGlobalData();\n React.useEffect(() => {\n if (belgianRequest) {\n countryApi.isBelgian(countryId).then((result) => setBelgian(result.value));\n setBelgianRequest(false);\n }\n }, [belgian, belgianRequest, countryApi, countryId]);\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [5],\n pageSize: 5,\n sortKeys: { prefix: \"ASC\" },\n });\n\n const searchFunction = React.useCallback(\n (sObj?: PedigreePrefixSearch) => {\n setsobjState(PedigreePrefixSearch.fromJS({ ...sObj, countryId: countryId }));\n return api.baseSearch(PedigreePrefixSearch.fromJS({ ...sObj, countryId: countryId }));\n },\n [api, countryId]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n React.useEffect(() => {\n !dialogOpened && search();\n }, [dialogOpened, search]);\n const { deleteItem } = useDeleteApi(\n React.useMemo(\n () => ({\n deleteApiFn: (data) => api.deletePedigreePrefix(data),\n onDeletedFn: () => search(),\n }),\n [api, search]\n )\n );\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n hidden: !editMode,\n render: (row: CountryPedigreePrefixGridDto) => (\n \n deleteItem(row.countryPedigreePrefixId)} />\n \n ),\n },\n {\n header: () => t(ETLCodes.Initiales),\n fieldName: \"prefix\",\n },\n {\n header: () => t(ETLCodes.NextValue),\n fieldName: \"nextValue\",\n hidden: !belgian,\n },\n ],\n [belgian, deleteItem, editMode, t]\n );\n\n const addItemFunction = React.useCallback(() => {\n setDialogOpened(true);\n }, []);\n\n React.useEffect(() => {\n search();\n }, [currentLanguage, search]);\n return (\n <>\n \n api.exportXlsFile(sObj)} sObj={sobjState} />\n {editMode && !belgian && (\n {\n e.stopPropagation();\n addItemFunction();\n }}\n text={t(ETLCodes.General_Add)}\n intent={Intent.PRIMARY}\n />\n )}\n \n }\n >\n \n \n\n setDialogOpened(false)}\n canEscapeKeyClose={true}\n canOutsideClickClose={true}\n isCloseButtonShown={true}\n className={Classes.DIALOG}\n style={{ width: 1000, height: 550, background: Colors.WHITE }}\n >\n
\n {\n setDialogOpened(false);\n search();\n }}\n countryId={countryId}\n />\n
\n \n \n );\n};\n","import { FGCustomPanel, FGEmpty, FGMultiSuggestInput, FGTextAreaInput, FGTextInput, FieldGroup } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport styled from \"styled-components\";\nimport * as Yup from \"yup\";\n\nimport { CountryApi, CountryDto, CountryTranslationDto, ReferentialItemDto } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { FGMultiTranslate, SharepointButton, SmallFormGenerator } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { CountryPedigreesList } from \"./pedigreePrefix/CountryPedigreesList\";\nimport { useReferential } from \"../../../../hooks/useReferential\";\nimport { nameof } from \"../../../../utils\";\nimport { IOptionProps } from \"@blueprintjs/core\";\n\nexport interface ICountryDetailPageProps {\n countryId?: number;\n edit?: boolean;\n}\n\nconst TitleContainer = styled.div`\n display: flex;\n`;\n\nconst StyledContainer = styled.div`\n & > * + * {\n margin-top: 2rem;\n }\n`;\n\nexport const CountryDetailPage: React.FunctionComponent = ({\n countryId = 0,\n edit = false,\n}) => {\n const { t } = useTl();\n const api = useApiService(CountryApi);\n const history = useHistory();\n const { languages } = useGlobalData();\n\n const [allLanguagesReferential, allLanguagesReferentialLoading] = useReferential(\n (a) => a.getAllLanguages(),\n true,\n []\n );\n\n const [editMode, setEditMode] = React.useState(edit);\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n isoCode: Yup.string()\n .nullable()\n .required(t(ETLCodes.Required))\n .test(\"is-unique\", t(ETLCodes.IsoCodeAlreadyExists), async function (value) {\n if (!value) return true;\n const res = await api.isoCodeUnique(countryId, value);\n return res.value;\n }),\n canineGlobalEmail: Yup.string().nullable().email(t(ETLCodes.InvalidEmail)),\n emailForJudgeInCompetition: Yup.string().nullable().email(t(ETLCodes.InvalidEmail)),\n emailForWorkAttest: Yup.string().nullable().email(t(ETLCodes.InvalidEmail)),\n emailForBeautyJudge: Yup.string().nullable().email(t(ETLCodes.InvalidEmail)),\n caninePostalCode: Yup.string().nullable().matches(new RegExp(\"([0-9]{4})\"), t(ETLCodes.NotValidPostalCode)),\n countryTranslations: Yup.array().of(\n Yup.object().shape({\n text: Yup.string().nullable().required(t(ETLCodes.Required)),\n })\n ),\n });\n }, [api, countryId, t]);\n\n const { data, loading, deleteItem, deleting, saveItem, saving, refresh } = useCrudApi(\n {\n getApiFn: (id = countryId) =>\n id > 0\n ? api.get(id)\n : new CountryDto({\n languageIds: [],\n countryTranslations: [\n ...languages.map(\n (l) =>\n new CountryTranslationDto({\n languageId: l.languageId,\n })\n ),\n ],\n }).toJSON(),\n saveApiFn: (d: CountryDto) => api.save(d),\n onSavedRoute: (d) => `${ERoutes.country}/${d.countryId}/detail/edit`,\n deleteApiFn: (d) => api.delete(d.countryId),\n onDeletedRoute: () => ERoutes.country,\n },\n [countryId]\n );\n\n const [shpLoading, setShpLoading] = React.useState(false);\n const existsInShp = React.useMemo(() => !!data?.sharepointUri, [data?.sharepointUri]);\n const openOrCreateInShp = React.useCallback(async () => {\n setShpLoading(true);\n if (!!data?.sharepointUri) {\n window.open(data?.sharepointUri, \"_blank\");\n setShpLoading(false);\n } else {\n try {\n await api.createInSharepoint(countryId);\n refresh();\n } catch (e) {\n throw e;\n } finally {\n setShpLoading(false);\n }\n }\n }, [api, countryId, data?.sharepointUri, refresh]);\n console.log(\"langref\", allLanguagesReferential);\n return (\n \n history.push(ERoutes.country)}\n onDelete={deleteItem}\n showDeleteButton={countryId > 0}\n saving={saving}\n deleting={deleting}\n >\n \n {\" \"}\n
{t(ETLCodes.Country)}
\n \n ),\n rightElement: countryId > 0 && (\n \n ),\n }}\n >\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {(ctx) => <>{setEditMode(ctx.editMode)}}\n \n \n
\n );\n};\n","import { FGSelectInput, FGTextInput, FieldGroup, FGCheckboxInput } from \"nsitools-react\";\nimport * as React from \"react\";\nimport * as Yup from \"yup\";\n\nimport { TitleDto, TitlesApi, TitleTranslationDto } from \"../../../../../api\";\nimport { ERoutes } from \"../../../../../ERoutes\";\nimport { FGMultiTranslate, SmallFormGenerator } from \"../../../../../components\";\nimport { useGlobalData } from \"../../../../../contexts\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../../hooks\";\nimport { useReferential } from \"../../../../../hooks/useReferential\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { useParams } from \"react-router\";\n\nexport interface ICountryTitlePanelProps {\n countryId: number;\n currentTitleId: number;\n onDelete: () => void;\n search: () => void;\n belgian: boolean;\n}\n\nexport const CountryTitlePanel: React.FunctionComponent = ({\n countryId,\n currentTitleId,\n onDelete,\n search,\n belgian,\n}) => {\n const { t } = useTl();\n const api = useApiService(TitlesApi);\n const { currentLanguage, languages } = useGlobalData();\n const [types, tloading] = useReferential((a) => a.getTitleTypes(currentLanguage.languageId), true, []);\n const { state } = useParams<{ state: string }>();\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n titleTranslations: Yup.array().of(\n Yup.object().shape({\n text: Yup.string().nullable().required(t(ETLCodes.Required)),\n })\n ),\n titleTypeId: Yup.number().nullable().required(t(ETLCodes.Required)),\n });\n }, [t]);\n\n const { data, loading, deleteItem, deleting, saveItem, saving } = useCrudApi(\n {\n getApiFn: (id = currentTitleId) =>\n id > 0\n ? api.get(id)\n : new TitleDto({\n countryId: countryId,\n titleTypeId: undefined,\n abreviation: undefined,\n titleTranslations: [...languages.map((l) => new TitleTranslationDto({ languageId: l.languageId }))],\n }).toJSON(),\n saveApiFn: (d: TitleDto) => api.save(d),\n onSavedRoute: (d) => `${ERoutes.country}/${countryId}/titles/edit`,\n deleteApiFn: (d) => api.delete(d.titleId),\n onDeletedRoute: (d) => `${ERoutes.country}/${countryId}/titles/edit`,\n },\n [currentTitleId]\n );\n const deleteTitle = React.useCallback(async () => {\n onDelete();\n await deleteItem();\n search();\n }, [deleteItem, onDelete, search]);\n\n const [articles, aloading] = useReferential((a) => a.getArticles(true), true, []);\n\n return (\n saveItem(d).then((c) => search())}\n initialValues={data}\n editMode={state === \"edit\"}\n onDelete={deleteTitle}\n showDeleteButton={false}\n validationSchema={FormSchema}\n minLabelWidth={120}\n loading={loading}\n saving={saving}\n deleting={deleting}\n >\n \n \n \n \n {belgian && }\n \n \n \n );\n};\n","import { Classes, Colors, Dialog, Intent, Checkbox, ButtonGroup } from \"@blueprintjs/core\";\nimport { ButtonContainer, FieldSet, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { Link, useHistory } from \"react-router-dom\";\n\nimport { CountryApi, TitlesApi, TitleSearch, TitlesGridDto } from \"../../../../../api\";\nimport { ERoutes } from \"../../../../../ERoutes\";\nimport {\n AddButton,\n CustomDataTable,\n EditButton,\n ViewButton,\n DeleteButton,\n ExportButton,\n} from \"../../../../../components\";\nimport { useGlobalData } from \"../../../../../contexts\";\nimport { useApiService, useTl, useDeleteApi } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { CountryTitlePanel } from \"./CountryTitlePanel\";\n\nexport interface ITitleListPageProps {\n countryId: number;\n}\n\nexport const TitleListPage: React.FunctionComponent = ({ countryId }) => {\n const { t } = useTl();\n const api = useApiService(TitlesApi);\n const apiCountry = useApiService(CountryApi);\n const { currentLanguage } = useGlobalData();\n const [dialogOpened, setDialogOpened] = React.useState(false);\n const [currentTitleId, setCurrentTitleId] = React.useState(0);\n const [sobjState, setsobjState] = React.useState();\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [15, 25, 50],\n pageSize: 15,\n sortKeys: { name: \"ASC\" },\n });\n const hitory = useHistory();\n const { totalCount } = tableState;\n const searchFunction = React.useCallback(\n (sObj: TitleSearch) => {\n setsobjState(TitleSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, countryId: countryId }));\n return api.baseSearch(\n TitleSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, countryId: countryId })\n );\n },\n [api, countryId, currentLanguage.languageId]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n const [init, setInit] = React.useState(false);\n const [belgian, setBelgian] = React.useState(true);\n\n const addItemFunction = React.useCallback(\n (id: number, editMode: \"view\" | \"edit\") => {\n hitory.push(`${ERoutes.country}/${countryId}/titles/${editMode}`);\n setCurrentTitleId(id);\n setDialogOpened(true);\n },\n [countryId, hitory]\n );\n\n const { deleteItem: deleteTitle } = useDeleteApi(\n React.useMemo(\n () => ({\n deleteApiFn: (data) => api.delete(data),\n onDeletedFn: () => search(),\n }),\n [api, search]\n )\n );\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: TitlesGridDto) => (\n \n addItemFunction(row.titleId, \"view\")} />\n addItemFunction(row.titleId, \"edit\")} />\n {!belgian && deleteTitle(row.titleId)} />}\n \n ),\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n },\n {\n header: () => t(ETLCodes.Type),\n fieldName: \"type\",\n render: (row: TitlesGridDto) => (\n \n {row.type}\n \n ),\n },\n {\n header: () => t(ETLCodes.Abreviation),\n fieldName: \"abreviation\",\n },\n {\n header: () => t(ETLCodes.WorkRequired),\n fieldName: \"workRequired\",\n render: (row: TitlesGridDto) => ,\n },\n belgian && {\n header: () => t(ETLCodes.CanBeUsed),\n fieldName: \"canBeUsed\",\n render: (row: TitlesGridDto) => ,\n },\n ],\n [addItemFunction, belgian, deleteTitle, t]\n );\n\n React.useEffect(() => {\n search();\n if (!init) {\n setInit(true);\n\n apiCountry.isBelgian(countryId).then((bool) => {\n setBelgian(bool.value);\n });\n }\n }, [apiCountry, countryId, currentLanguage, init, belgian, search]);\n return (\n <>\n \n api.exportXlsFile(sObj)} sObj={sobjState} />\n {!belgian && (\n {\n e.stopPropagation();\n addItemFunction(0, \"edit\");\n }}\n text={t(ETLCodes.General_Add)}\n intent={Intent.PRIMARY}\n />\n )}\n \n }\n >\n \n \n\n setDialogOpened(false)}\n canEscapeKeyClose={true}\n canOutsideClickClose={true}\n isCloseButtonShown={true}\n style={{ width: 1000, height: 320, background: Colors.WHITE }}\n className={Classes.DIALOG}\n >\n
\n {\n setDialogOpened(false);\n }}\n />\n
\n \n \n );\n};\n","import {Tab, Spinner, SpinnerSize} from \"@blueprintjs/core\";\nimport { useApiEffect } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory, useParams } from \"react-router\";\n\nimport { CountryApi } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { BackButton, PageBase, ProtectedTabs } from \"../../../../components\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { CountryDetailPage } from \"./CountryDetailPage\";\nimport { TitleListPage } from \"./title/TitleListPage\";\n\nexport interface ICountryItemPageProps {}\n\nexport const CountryItemPage: React.FunctionComponent = () => {\n const { t } = useTl();\n const { id, tab, state = \"edit\" } = useParams<{ id: string; tab: string; state: string }>();\n const countryId = React.useMemo(() => +id, [id]);\n const history = useHistory();\n const api = useApiService(CountryApi);\n const [displayName, loading] = useApiEffect(() => api.getDisplayName(countryId), [countryId]);\n\n return (\n 0 ? loading ? : displayName : t(ETLCodes.New) },\n ]}\n >\n history.push(`${ERoutes.country}/${id}/${newTabId}/${state}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n }\n disabled={countryId <= 0}\n />\n \n \n );\n};\n","import * as React from \"react\";\nimport { KennelApi, KennelSearch, KennelGridDto } from \"../../../../api\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { useHistory } from \"react-router\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { IDataTableColumn, ButtonContainer } from \"nsitools-react\";\nimport { ViewButton, EditButton, SearchTablePage } from \"../../../../components\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { Link } from \"react-router-dom\";\nimport { Checkbox } from \"@blueprintjs/core\";\n\nexport interface IKennelListPageProps {}\n\nexport const KennelListPage: React.FunctionComponent = (props) => {\n const kennelApi = useApiService(KennelApi);\n const { t, tUnsafe } = useTl();\n const history = useHistory();\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: KennelGridDto) => (\n \n history.push(`${ERoutes.kennel}/${row.kennelId}/detail/view`)} />\n history.push(`${ERoutes.kennel}/${row.kennelId}/detail/edit`)} />\n \n ),\n },\n {\n computed: true,\n disableSorting: true,\n header: () => t(ETLCodes.Closed),\n headerAlignment: \"center\",\n alignment: \"center\",\n fieldName: \"isClosed\",\n render: (row: KennelGridDto) => ,\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n },\n {\n header: () => t(ETLCodes.Type),\n fieldName: \"type\",\n render: (row: KennelGridDto) =>
{tUnsafe(row.type)}
,\n },\n {\n header: () => t(ETLCodes.Country),\n fieldName: \"country\",\n render: (dto: KennelGridDto) => (\n \n {dto.country}\n \n ),\n },\n {\n header: () => t(ETLCodes.FciNumber),\n fieldName: \"fciNumber\",\n },\n {\n header: () => t(ETLCodes.AttributionDate),\n fieldName: \"attributionDate\",\n },\n {\n header: () => t(ETLCodes.ClosingDate),\n fieldName: \"closingDate\",\n },\n ],\n [history, t, tUnsafe]\n );\n\n const search = React.useCallback(\n (sObj) => {\n return kennelApi.baseSearch(KennelSearch.fromJS({ ...sObj, languageCode: currentLanguage.languageCode }));\n },\n [currentLanguage.languageCode, kennelApi]\n );\n\n return (\n {\n return kennelApi.exportXlsFile(KennelSearch.fromJS({ ...sObj, languageCode: currentLanguage.languageCode }));\n }}\n getCriteriasFunction={() => kennelApi.getSearchCriterias(true)}\n sortKeys={{ name: \"ASC\" }}\n breadCrumbs={[{ text: t(ETLCodes.Kennels) }]}\n />\n );\n};\n","import { Button, Intent } from \"@blueprintjs/core\";\nimport {\n FGCustomInput,\n FGSelectInput,\n FGTextAreaInput,\n FGTextInput,\n FieldGroup,\n showError,\n showSuccess,\n} from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport { Link } from \"react-router-dom\";\nimport * as Yup from \"yup\";\n\nimport { KennelApi, KennelDto } from \"../../../../api\";\nimport {\n FGCountrySelect,\n FGSRSHCheckboxInput,\n SharepointButton,\n SmallFormGenerator,\n FGSRSHDateMaskInput,\n} from \"../../../../components\";\nimport { useDialog } from \"../../../../contexts\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { useApiService, useCrudApi, useTl, useWindow } from \"../../../../hooks\";\nimport { useReferential } from \"../../../../hooks/useReferential\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface IKennelDetailPageProps {\n kennelId: number;\n editMode: boolean;\n}\n\nexport const KennelDetailPage: React.FunctionComponent = ({ kennelId, editMode }) => {\n const { t, tUnsafe } = useTl();\n const api = useApiService(KennelApi);\n const { openNewTab } = useWindow();\n const history = useHistory();\n const { showDialogPromise } = useDialog();\n const [closeKennelLoading, setcloseKennelLoading] = React.useState(false);\n const [kennelTypes, tLoading] = useReferential((a) => a.getKennelTypes(), false);\n const [translatedKennelTypes, setTranslatedKennelTypes] = React.useState([]);\n const { data, loading, deleteItem, deleting, saveItem, saving, refresh } = useCrudApi(\n {\n getApiFn: (id = kennelId) => (id > 0 ? api.get(id) : new KennelDto().toJSON()),\n saveApiFn: (d) => api.save(d),\n onSavedRoute: (d) => `${ERoutes.kennel}/${d.kennelId}/detail/edit`,\n deleteApiFn: (d) => api.delete(d.kennelId),\n onDeletedRoute: () => ERoutes.kennel,\n },\n [kennelId]\n );\n\n const [previousKennelName, setPreviousKennelName] = React.useState();\n\n React.useEffect(() => {\n data?.previousKennelId && api.getDisplayName(data?.previousKennelId).then((c) => setPreviousKennelName(c));\n }, [api, data]);\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n name: Yup.string().nullable().required(t(ETLCodes.Required)),\n countryId: Yup.number().nullable().required(t(ETLCodes.Required)),\n type: Yup.string().nullable().required(t(ETLCodes.Required)),\n originCountryId: Yup.number().nullable(),\n });\n }, [t]);\n\n React.useEffect(() => {\n if (!tLoading && kennelTypes) {\n const newKennelType = kennelTypes.map((c) => {\n return { label: tUnsafe(c.label), value: c.value };\n });\n setTranslatedKennelTypes(newKennelType);\n }\n }, [kennelTypes, tLoading, tUnsafe]);\n const closeKennel = React.useCallback(async () => {\n const dialogResult = await showDialogPromise({\n title: t(ETLCodes.CloseKennelConfirmationTitle),\n message: t(ETLCodes.CloseKennelConfirmationMessage),\n });\n if (dialogResult !== \"yes\") return;\n setcloseKennelLoading(true);\n try {\n await api.closeKennel(kennelId);\n refresh();\n showSuccess(t(ETLCodes.KennelClosed));\n setcloseKennelLoading(false);\n } catch {\n showError(t(ETLCodes.Error));\n setcloseKennelLoading(false);\n }\n }, [api, kennelId, refresh, showDialogPromise, t]);\n\n const [shpLoading, setShpLoading] = React.useState(false);\n const existsInShp = React.useMemo(() => !!data?.sharepointUri, [data?.sharepointUri]);\n const openOrCreateInShp = React.useCallback(async () => {\n setShpLoading(true);\n if (!!data?.sharepointUri) {\n window.open(data?.sharepointUri, \"_blank\");\n setShpLoading(false);\n } else {\n try {\n await api.createInSharepoint(kennelId);\n refresh();\n } catch (e) {\n throw e;\n } finally {\n setShpLoading(false);\n }\n }\n }, [data?.sharepointUri, api, kennelId, refresh]);\n\n return (\n data && (\n history.push(ERoutes.kennel)}\n onDelete={deleteItem}\n showDeleteButton={kennelId > 0}\n saving={saving}\n deleting={deleting}\n >\n 0 && (\n <>\n {\" \"}\n {data?.isClosed === false && (\n \n )}\n \n ),\n }}\n title={t(ETLCodes.Kennel)}\n >\n {data?.previousKennelId && (\n \n {(ctx) => (\n \n {previousKennelName}\n \n )}\n \n )}\n \n \n openNewTab(`${ERoutes.country}/${item}/detail/view`)}\n />\n \n \n \n \n openNewTab(`${ERoutes.country}/${item}/detail/view`)}\n />\n \n \n \n \n \n \n \n \n \n \n )\n );\n};\n","import { Button } from \"@blueprintjs/core\";\nimport { ButtonContainer, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport * as React from \"react\";\n\nimport { useTl, useApiService } from \"../../../../../hooks\";\nimport { PersonGridDto, PersonApi, PersonSearch } from \"../../../../../api\";\nimport { useGlobalData } from \"../../../../../contexts\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { CustomDataTable } from \"../../../../../components\";\nimport { generateAddress } from \"../../../../../utils\";\n\nexport interface IKennelOwnersSelectionPanelProps {\n onPersonSelected: (person: PersonGridDto) => void;\n}\n\nexport const KennelOwnersSelectionPanel: React.FunctionComponent = (props) => {\n const api = useApiService(PersonApi);\n const { currentLanguage } = useGlobalData();\n const { t } = useTl();\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [5, 10, 15],\n pageSize: 10,\n sortKeys: { lastName: \"ASC\" },\n });\n\n const searchFunction = React.useCallback(\n (sObj?: PersonGridDto) =>\n api.baseSearch(\n PersonSearch.fromJS({\n ...sObj,\n languageId: currentLanguage.languageId,\n })\n ),\n [api, currentLanguage.languageId]\n );\n\n const { loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: PersonGridDto) => (\n \n {\n props.onPersonSelected(row);\n }}\n text={t(ETLCodes.Select)}\n />\n \n ),\n },\n {\n header: () => t(ETLCodes.LastName),\n fieldName: \"lastName\",\n },\n {\n header: () => t(ETLCodes.FirstName),\n fieldName: \"firstName\",\n },\n {\n header: () => t(ETLCodes.MailAddress),\n fieldName: \"address\",\n render: (row: PersonGridDto) => generateAddress(row.number, row.street, row.city, row.postalCode, row.country),\n },\n ],\n [props, t]\n );\n\n return (\n
\n \n
\n );\n};\n","import { FGTextInput } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useParams } from \"react-router\";\nimport * as Yup from \"yup\";\n\nimport { KennelApi, PersonApi, PersonGridDto, SaveKennelOwnerDto } from \"../../../../../api\";\nimport { FGSRSHDateMaskInput, SmallFormGenerator } from \"../../../../../components\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\n\nexport interface IKennelOwnerSavePanelProps {\n onSaved: () => void;\n person: PersonGridDto;\n kennelId: number;\n kennelOwnershipId: number;\n}\n\nexport const KennelOwnerSavePanel: React.FunctionComponent = ({\n person,\n onSaved,\n kennelId,\n kennelOwnershipId,\n}) => {\n const { t } = useTl();\n const api = useApiService(KennelApi);\n const personApi = useApiService(PersonApi);\n const { id } = useParams<{ id: string }>();\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n ownerFrom: Yup.date()\n .nullable()\n .required(t(ETLCodes.Required))\n .test(\"is-not-owner\", t(ETLCodes.AlreadyIsKennelOwner), async function (value) {\n if (value) {\n const result = await personApi.isKennelOwner(\n this.parent?.personId,\n kennelOwnershipId > 0 ? +id : 0,\n value,\n this.parent.ownerTo\n );\n return !result.value;\n }\n return true;\n }),\n ownerTo: Yup.date()\n .nullable()\n .test(\"is-not-owner\", t(ETLCodes.AlreadyIsKennelOwner), async function (value) {\n if (value) {\n const result = await personApi.isKennelOwner(\n this.parent?.personId,\n kennelOwnershipId > 0 ? +id : 0,\n this.parent.ownerFrom,\n value\n );\n return !result.value;\n }\n return true;\n }),\n });\n }, [id, kennelOwnershipId, personApi, t]);\n\n const { data, loading, saving, saveItem } = useCrudApi(\n React.useMemo(\n () => ({\n getApiFn: (kId = kennelOwnershipId) =>\n kId\n ? api.getKennelOwnership(kId)\n : new SaveKennelOwnerDto({\n kennelId: kennelId,\n personId: person?.personId,\n }),\n saveApiFn: async (d: any) => {\n console.log(\"saving \", d);\n var res = await api.addNewKennelOwner(d);\n onSaved();\n return res;\n },\n }),\n [api, kennelId, kennelOwnershipId, onSaved, person?.personId]\n )\n );\n\n return (\n \n \n {\" \"}\n \n \n );\n};\n","import * as React from \"react\";\nimport styled from \"styled-components\";\nimport { PanelStack, Classes, IPanel } from \"@blueprintjs/core\";\nimport { KennelOwnersSelectionPanel } from \"./KennelOwnersSelectionPanel\";\nimport { PersonGridDto } from \"../../../../../api\";\nimport {\n KennelOwnerSavePanel,\n IKennelOwnerSavePanelProps,\n} from \"./KennelOwnerSavePanel\";\nimport { useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\n\nexport interface IKennelOwnersPanelStackProps\n extends Pick {\n kennelId: number;\n kennelOwnershipId: number;\n}\n\nconst Container = styled.div`\n flex: 1;\n height: 100%;\n & > .${Classes.PANEL_STACK} {\n height: 100%;\n }\n`;\n\nexport const KennelOwnersPanelStack: React.FunctionComponent = ({\n kennelId,\n onSaved,\n kennelOwnershipId,\n}) => {\n const { t } = useTl();\n const onSectionSelected = React.useCallback(\n (data: PersonGridDto) => {\n setPanelStack((currentStack) => [\n ...currentStack,\n {\n component: () => (\n \n ),\n },\n ]);\n },\n [kennelId, kennelOwnershipId, onSaved]\n );\n\n const [panelStack, setPanelStack] = React.useState([\n {\n component: () => (\n \n ),\n title: t(ETLCodes.Owners),\n },\n ]);\n\n React.useEffect(() => {}, [panelStack]);\n\n const removeFromPanelStack = React.useCallback(() => {\n setPanelStack((prev) => prev.slice(0, prev.length - 1));\n }, [setPanelStack]);\n\n return !kennelOwnershipId || kennelOwnershipId === 0 ? (\n \n \n \n ) : (\n \n {\" \"}\n {\" \"}\n \n );\n};\n","import { IDataTableColumn, useGridState, useSearchApi, FieldSet } from \"nsitools-react\";\nimport * as React from \"react\";\n\nimport { KennelOwnerApi, KennelOwnerDto, KennelOwnerSearch } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { AddButton, CustomDataTable, EditButton, ExportButton } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { Link } from \"react-router-dom\";\nimport { Dialog, Classes, Colors, Intent, ButtonGroup } from \"@blueprintjs/core\";\nimport { KennelOwnersPanelStack } from \"./kennelOwnersPanelStack/KennelOwnersPanelStack\";\n\nexport interface IKennelOwnersPageProps {\n kennelId: number;\n}\n\nexport const KennelOwnersPage: React.FunctionComponent = ({ kennelId }) => {\n const { t } = useTl();\n const api = useApiService(KennelOwnerApi);\n const { currentLanguage } = useGlobalData();\n const [dialogOpened, setDialogOpened] = React.useState(false);\n const [sobjState, setsobjState] = React.useState();\n const [kennelOwnershipId, setkennelOwnershipId] = React.useState(0);\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [5],\n pageSize: 5,\n sortKeys: { name: \"ASC\" },\n });\n\n const searchFunction = React.useCallback(\n (sObj?: KennelOwnerSearch) => {\n const sobj = KennelOwnerSearch.fromJS({\n ...sObj,\n kennelId: kennelId,\n languageId: currentLanguage.languageId,\n });\n setsobjState(sobj);\n return api.baseSearch(sobj);\n },\n [api, currentLanguage.languageId, kennelId]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n\n //IF GOD MODE\n const addItemFunction = React.useCallback(() => {\n setDialogOpened(true);\n }, []);\n\n const columns = React.useMemo(\n () => [\n {\n fieldName: \"action\",\n autoFitContent: true,\n alignment: \"center\",\n render: (row: KennelOwnerDto) => (\n {\n e.stopPropagation();\n setkennelOwnershipId(row.kennelOwnershipId);\n addItemFunction();\n }}\n />\n ),\n },\n {\n header: () => t(ETLCodes.Owner),\n fieldName: \"name\",\n render: (row: KennelOwnerDto) => (\n \n {row.name}\n \n ),\n },\n {\n header: () => t(ETLCodes.OwnerFrom),\n fieldName: \"ownerFrom\",\n },\n {\n header: () => t(ETLCodes.OwnerTo),\n fieldName: \"ownerTo\",\n },\n ],\n [addItemFunction, t]\n );\n\n React.useEffect(() => {\n search();\n }, [currentLanguage, search]);\n\n return (\n <>\n \n api.exportXlsFile(sObj)} sObj={sobjState} />\n {\n e.stopPropagation();\n addItemFunction();\n }}\n text={t(ETLCodes.General_Add)}\n intent={Intent.PRIMARY}\n />\n \n }\n >\n \n \n {\n setDialogOpened(false);\n setkennelOwnershipId(0);\n }}\n canEscapeKeyClose={true}\n canOutsideClickClose={true}\n isCloseButtonShown={true}\n className={Classes.DIALOG}\n style={{ width: 1000, height: 600, background: Colors.WHITE }}\n >\n
\n {\n setDialogOpened(false);\n search();\n setkennelOwnershipId(null);\n }}\n kennelId={kennelId}\n kennelOwnershipId={kennelOwnershipId}\n />\n
\n \n \n );\n};\n","import { IDataTableColumn } from \"nsitools-react\";\nimport * as React from \"react\";\n\nimport { KennelDogDto, KennelDogSearch, KennelDogApi } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { SearchTablePage } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { Link } from \"react-router-dom\";\n\nexport interface IKennelDogsPageProps {\n kennelId: number;\n}\n\nexport const KennelDogsPage: React.FunctionComponent = ({ kennelId }) => {\n const { t } = useTl();\n const api = useApiService(KennelDogApi);\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n render: (row: KennelDogDto) => (\n \n {row.name}\n \n ),\n },\n {\n header: () => t(ETLCodes.BreedGroupLabel),\n fieldName: \"breedGroup\",\n render: (row: KennelDogDto) => (\n \n {row.breedGroup}\n \n ),\n },\n\n {\n header: () => t(ETLCodes.Breed),\n fieldName: \"breed\",\n render: (row: KennelDogDto) => (\n \n {row.breed}\n \n ),\n },\n {\n header: () => t(ETLCodes.Color),\n fieldName: \"color\",\n render: (row: KennelDogDto) => (\n \n {row.color}\n \n ),\n },\n {\n header: () => t(ETLCodes.Identification1),\n computed: true,\n disableSorting: true,\n fieldName: \"dogChip\",\n },\n {\n header: () => t(ETLCodes.Pedigree),\n fieldName: \"pedigree\",\n },\n ],\n [t]\n );\n\n const search = React.useCallback(\n (sObj) => {\n return api.baseSearch(\n KennelDogSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, kennelId: kennelId })\n );\n },\n [api, currentLanguage.languageId, kennelId]\n );\n\n return (\n {\n return api.exportXlsFile(\n KennelDogSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, kennelId: kennelId })\n );\n }}\n sortKeys={{ name: \"ASC\" }}\n withCard={false}\n />\n );\n};\n","import { IDataTableColumn, Loading, FGCustomPanel } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useParams } from \"react-router\";\n\nimport { BreedApi, BreedGridDto, BreedSearch, KennelApi, KennelSaveBreedsDto } from \"../../../../../api\";\nimport { ERoutes } from \"../../../../../ERoutes\";\nimport { SRSHCustomSelector, SmallFormGenerator } from \"../../../../../components\";\nimport { useGlobalData } from \"../../../../../contexts\";\nimport { useApiService, useTl, useCrudApi } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { Link } from \"react-router-dom\";\n\nexport interface IKennelBreedPageProps {}\n\nexport const KennelBreedPage: React.FunctionComponent = (props) => {\n const { id, state } = useParams<{ id: string; state: string }>();\n const { t } = useTl();\n const kennelApi = useApiService(KennelApi);\n const breedApi = useApiService(BreedApi);\n const { currentLanguage } = useGlobalData();\n\n const { data, loading, saveItem, saving } = useCrudApi(\n {\n getApiFn: () => kennelApi.getAllowedBreedsIds(+id),\n saveApiFn: (d) => kennelApi.saveLinkedBreeds(d),\n onSavedRoute: (d) => `${ERoutes.kennel}/${+id}/breeds/edit`,\n },\n [id]\n );\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.BreedGroupLabel),\n fieldName: \"breedGroupLabel\",\n render: (row: BreedGridDto) => (\n \n {row.breedGroupLabel}\n \n ),\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n render: (row: BreedGridDto) => (\n \n {row.name}\n \n ),\n },\n ],\n [t]\n );\n\n const searchBreedIdsFunction = React.useCallback(\n (sObj) => breedApi.getIds(BreedSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [breedApi, currentLanguage.languageId]\n );\n const searchBreedFunction = React.useCallback(\n async (sObj) => {\n const res = await breedApi.baseSearch(BreedSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId }));\n console.log(\"all ids, \", res);\n return res;\n },\n [breedApi, currentLanguage.languageId]\n );\n\n return (\n \n \n \n {(ctx) => (\n ctx.formik.setFieldValue(\"breedIds\", ids)}\n idField=\"breedId\"\n searchFunction={searchBreedFunction}\n searchIdsFunc={searchBreedIdsFunction}\n editMode={state === \"edit\"}\n />\n )}\n \n \n \n );\n};\n","import {Tab, Spinner, SpinnerSize} from \"@blueprintjs/core\";\nimport { useApiEffect } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory, useParams } from \"react-router\";\n\nimport { KennelApi } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { BackButton, PageBase, ProtectedTabs } from \"../../../../components\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { KennelDetailPage } from \"./KennelDetailPage\";\nimport { KennelOwnersPage } from \"./KennelOwnersPage\";\nimport { KennelDogsPage } from \"./KennelDogsPage\";\nimport { KennelBreedPage } from \"./kennelBreeds/KennelBreedPage\";\n\nexport interface IKennelItemPageProps {}\n\nexport const KennelItemPage: React.FunctionComponent = (props) => {\n const { t } = useTl();\n const { id, tab, state = \"edit\" } = useParams<{ id: string; tab: string; state: string }>();\n const kennelId = React.useMemo(() => +id, [id]);\n const history = useHistory();\n const kennelApi = useApiService(KennelApi);\n const [displayName, loading] = useApiEffect(() => kennelApi.getDisplayName(kennelId), [kennelId]);\n\n return (\n 0 ? loading ? : displayName : t(ETLCodes.New) },\n ]}\n >\n history.push(`${ERoutes.kennel}/${id}/${newTabId}/${state}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n }\n />\n\n } />\n }\n disabled={kennelId <= 0}\n />\n \n \n );\n};\n","import { Button, Intent, NonIdealState } from \"@blueprintjs/core\";\nimport { FieldSet, IDataTableColumn, showError, showSuccess, useGridState } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { FilePond } from \"react-filepond\";\nimport styled from \"styled-components\";\n\nimport { AffixRequestApi, NewKennelRequestImportDto, Result } from \"../../../../../api\";\nimport { CustomDataTable, SaveButton } from \"../../../../../components\";\nimport { useApiService, useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\n\nexport interface IAffixImportPageProps {\n importFunction: (files: File[]) => Promise;\n saveFunction: (items: NewKennelRequestImportDto[]) => Promise;\n columns: IDataTableColumn[];\n}\n\nconst ButtonContainer = styled.div`\n display: flex;\n justify-content: space-between;\n`;\n\nexport const AffixImportPage: React.FunctionComponent = ({\n importFunction,\n saveFunction,\n columns,\n}) => {\n const [files, setFiles] = React.useState();\n const { t, tUnsafe } = useTl();\n const [importing, setimporting] = React.useState(false);\n const [saving, setSaving] = React.useState(false);\n const [uploading, setuploading] = React.useState(false);\n const api = useApiService(AffixRequestApi);\n\n const tableState = useGridState({\n serverMode: false,\n availablePageSizes: [15, 25, 50],\n enablePagination: false,\n enableFilter: false,\n });\n\n const importCallback = React.useCallback(async () => {\n setimporting(true);\n try {\n const res = await importFunction(files);\n setimporting(false);\n showSuccess(t(ETLCodes.FileReadSuccessfully));\n tableState.setData(res);\n return res;\n } catch {\n showError(t(ETLCodes.Error));\n setimporting(false);\n }\n }, [files, importFunction, t, tableState]);\n\n const wordImportCallBack = React.useCallback(async () => {\n setuploading(true);\n try {\n console.log(files);\n const docs = files.filter((f) => f.fileExtension === \"docx\");\n await api.uploadFciDoc(docs.map((f) => ({ data: f.file, fileName: f.filename })));\n showSuccess(t(ETLCodes.ImportSucessfull));\n } catch (e) {\n if (e?.errorCode) {\n showError(tUnsafe(`BackendError_${e.errorCode}`));\n } else {\n showError(t(ETLCodes.Error));\n }\n }\n setuploading(false);\n }, [api, files, t, tUnsafe]);\n\n const saveImport = React.useCallback(async () => {\n setSaving(true);\n try {\n await saveFunction(tableState.data);\n setSaving(false);\n showSuccess(t(ETLCodes.SaveSuccess));\n tableState.setData([]);\n setFiles([]);\n } catch {\n showError(t(ETLCodes.Error));\n setSaving(false);\n }\n }, [saveFunction, t, tableState]);\n\n return (\n <>\n \n \n }\n />\n }\n />\n \n\n {tableState?.data && files?.length > 0 ? (\n
\n \n
\n \n
\n
\n ) : (\n \n )}\n \n );\n};\n","import { Tab, Checkbox } from \"@blueprintjs/core\";\nimport * as React from \"react\";\nimport { useHistory, useParams } from \"react-router\";\n\nimport {\n AffixRequestApi,\n NewKennelRequestImportDto,\n KennelImportRequestImportDto,\n NameChangeRequestImporRequestDto,\n OwnershipChangeRequestImporRequestDto,\n} from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { PageBase, ProtectedTabs } from \"../../../../components\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { AffixImportPage } from \"./tabs/AffixImportPage\";\nimport { IDataTableColumn } from \"nsitools-react\";\nexport interface IFciImportPageProps {}\n\nexport const FciImportPage: React.FunctionComponent = (props) => {\n const { t } = useTl();\n const { tab } = useParams<{ tab: string; state: string }>();\n const history = useHistory();\n const api = useApiService(AffixRequestApi);\n\n const newKennelRequestSave = React.useCallback(\n (items: NewKennelRequestImportDto[]) => api.saveNewKennelImport(items),\n [api]\n );\n\n const newKennelRequestImport = React.useCallback(\n async (files: any[]) => {\n if (files && files.length > 0) {\n return await api.computeNewKennelImports({ data: files[0].file, fileName: files[0].filename });\n }\n return null;\n },\n [api]\n );\n\n const importRequestSave = React.useCallback(\n (items: NewKennelRequestImportDto[]) => api.saveImportRequestImport(items),\n [api]\n );\n\n const importRequestImport = React.useCallback(\n async (files: any[]) => {\n if (files && files.length > 0) {\n return await api.computeImportRequestImports({ data: files[0].file, fileName: files[0].filename });\n }\n return null;\n },\n [api]\n );\n\n const nameChangeRequestSave = React.useCallback(\n (items: NameChangeRequestImporRequestDto[]) => api.saveNameChangeRequestImport(items),\n [api]\n );\n\n const nameChangeRequestImport = React.useCallback(\n async (files: any[]) => {\n if (files && files.length > 0) {\n return await api.computeNameChangeRequestImport({ data: files[0].file, fileName: files[0].filename });\n }\n return null;\n },\n [api]\n );\n\n const ownershipChangeRequestSave = React.useCallback(\n (items: OwnershipChangeRequestImporRequestDto[]) => api.saveOwnershipChangeRequestImport(items),\n [api]\n );\n\n const ownershipChangeRequestImport = React.useCallback(\n async (files: any[]) => {\n if (files && files.length > 0) {\n return await api.computeOwnershipChangeRequestImport({ data: files[0].file, fileName: files[0].filename });\n }\n return null;\n },\n [api]\n );\n\n const columnsNewKennel = React.useMemo(\n () => [\n {\n fieldName: \"requestNumber\",\n header: () => t(ETLCodes.RequestNumber),\n },\n {\n fieldName: \"finalName\",\n header: () => t(ETLCodes.FinalName),\n },\n {\n fieldName: \"finalType\",\n header: () => t(ETLCodes.FinalType),\n },\n {\n fieldName: \"importable\",\n header: () => t(ETLCodes.Importable),\n render: (row: NameChangeRequestImporRequestDto) => ,\n },\n {\n fieldName: \"accepted\",\n header: () => t(ETLCodes.Accepted),\n render: (row: NameChangeRequestImporRequestDto) => ,\n },\n ],\n [t]\n );\n\n const columnsNameChange = React.useMemo(\n () => [\n {\n fieldName: \"requestNumber\",\n header: () => t(ETLCodes.RequestNumber),\n },\n {\n fieldName: \"fciNumber\",\n header: () => t(ETLCodes.FciNumber),\n },\n {\n fieldName: \"oldKennelName\",\n header: () => t(ETLCodes.PreviousKennel),\n },\n {\n fieldName: \"oldAffix\",\n header: () => t(ETLCodes.PreviousAffix),\n },\n {\n fieldName: \"finalName\",\n header: () => t(ETLCodes.FinalName),\n },\n {\n fieldName: \"finalType\",\n header: () => t(ETLCodes.FinalAffix),\n },\n {\n fieldName: \"importable\",\n header: () => t(ETLCodes.Importable),\n render: (row: KennelImportRequestImportDto) => ,\n },\n {\n fieldName: \"accepted\",\n header: () => t(ETLCodes.Accepted),\n render: (row: KennelImportRequestImportDto) => ,\n },\n ],\n [t]\n );\n\n const columnsImport = React.useMemo(\n () => [\n {\n fieldName: \"requestNumber\",\n header: () => t(ETLCodes.RequestNumber),\n },\n {\n fieldName: \"fciNumber\",\n header: () => t(ETLCodes.FciNumber),\n },\n {\n fieldName: \"originCountry\",\n header: () => t(ETLCodes.Country),\n },\n {\n fieldName: \"kennelName\",\n header: () => t(ETLCodes.Name),\n },\n {\n fieldName: \"affix\",\n header: () => t(ETLCodes.Affix),\n },\n {\n fieldName: \"importable\",\n header: () => t(ETLCodes.Importable),\n render: (row: KennelImportRequestImportDto) => ,\n },\n {\n fieldName: \"accepted\",\n header: () => t(ETLCodes.Accepted),\n render: (row: KennelImportRequestImportDto) => ,\n },\n ],\n [t]\n );\n\n const columnsOwnershipChange = React.useMemo(\n () => [\n {\n fieldName: \"requestNumber\",\n header: () => t(ETLCodes.RequestNumber),\n },\n {\n fieldName: \"kennelName\",\n header: () => t(ETLCodes.Name),\n },\n {\n fieldName: \"affix\",\n header: () => t(ETLCodes.Affix),\n },\n {\n fieldName: \"importable\",\n header: () => t(ETLCodes.Importable),\n render: (row: KennelImportRequestImportDto) => ,\n },\n {\n fieldName: \"accepted\",\n header: () => t(ETLCodes.Accepted),\n render: (row: KennelImportRequestImportDto) => ,\n },\n ],\n [t]\n );\n\n return (\n \n history.push(`${ERoutes.affixImport}/${newTabId}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n \n }\n />\n \n }\n />\n \n }\n />\n \n \n );\n};\n","import { Button, ButtonGroup, Checkbox, Intent } from \"@blueprintjs/core\";\nimport {\n DataTable,\n FieldSet,\n IDataTableColumn,\n InlineSearchCriteriaPanel,\n showError,\n useGridState,\n useSearchApi,\n} from \"nsitools-react\";\nimport * as React from \"react\";\n\nimport {\n AffixExportGridDto,\n AffixRequestApi,\n AffixRequestExportApi,\n AffixRequestExportSearch,\n AffixRequestSearch,\n ERequestType,\n ErrorDetails,\n FileResponse,\n} from \"../../../../../api\";\nimport { ExportButton } from \"../../../../../components\";\nimport { useApiService, useTl } from \"../../../../../hooks\";\nimport { useReferential } from \"../../../../../hooks/useReferential\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { saveAs } from \"file-saver\";\n\nexport interface IAffixRequestExportListPageProps {\n requestType: ERequestType;\n exportFunc: (sObj: AffixRequestSearch) => Promise;\n}\n\nexport const AffixRequestExportListPage: React.FunctionComponent = ({\n requestType,\n exportFunc,\n}) => {\n const api = useApiService(AffixRequestApi);\n const exportApi = useApiService(AffixRequestExportApi);\n const { t, tUnsafe } = useTl();\n const [sObjState, setsobjState] = React.useState();\n const [isLoadingDoc, setisLoadingDoc] = React.useState(false);\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n availablePageSizes: [5, 15, 25],\n pageSize: 25,\n sortKeys: { requestNumber: \"DESC\" },\n });\n const searchFunction = React.useCallback(\n (sObj) => {\n setsobjState(sObj);\n return exportApi.searchAffixRequestExport(requestType, sObj);\n },\n [exportApi, requestType]\n );\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n });\n const { setData, data, totalCount } = tableState;\n\n const forceExport = React.useCallback(\n async (row: AffixExportGridDto, value: boolean) => {\n const dataToSet = [...data];\n const index = dataToSet.findIndex((d) => d.requestId === row.requestId);\n dataToSet[index][\"toExport\"] = !value;\n setData(dataToSet);\n return await api.forceExport(row.requestId, requestType, !value);\n },\n [api, data, requestType, setData]\n );\n\n const GenerateDocs = React.useCallback(async () => {\n setisLoadingDoc(true);\n try {\n const res = await api.getFciDocuments(requestType);\n saveAs(res.data, res.fileName);\n setisLoadingDoc(false);\n search();\n } catch (error) {\n setisLoadingDoc(false);\n const details: ErrorDetails = JSON.parse(error.response);\n if (details?.errorCode) {\n showError(tUnsafe(`BackendError_${details.errorCode}`));\n } else {\n showError(t(ETLCodes.Error));\n }\n }\n }, [api, requestType, search, t, tUnsafe]);\n\n const columns = React.useMemo(() => {\n switch (requestType) {\n case ERequestType.NewKennelRequest:\n return [\n {\n header: () => t(ETLCodes.Export),\n computed: true,\n disableSorting: true,\n fieldName: \"toExport\",\n autoFitContent: true,\n alignment: \"center\",\n render: (row: AffixExportGridDto) => (\n forceExport(row, row.toExport)} />\n ),\n },\n {\n header: () => t(ETLCodes.RequestNumber),\n fieldName: \"requestNumber\",\n },\n ];\n case ERequestType.KennelImportRequest:\n return [\n {\n header: () => t(ETLCodes.Export),\n computed: true,\n disableSorting: true,\n fieldName: \"toExport\",\n autoFitContent: true,\n alignment: \"center\",\n render: (row: AffixExportGridDto) => (\n forceExport(row, row.toExport)} />\n ),\n },\n {\n header: () => t(ETLCodes.RequestNumber),\n fieldName: \"requestNumber\",\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"kennelName\",\n },\n {\n header: () => t(ETLCodes.Affix),\n fieldName: \"affix\",\n },\n {\n header: () => t(ETLCodes.CountryOfOrigin),\n fieldName: \"originCountry\",\n },\n ];\n case ERequestType.KennelExportRequest:\n return [\n {\n header: () => t(ETLCodes.RequestNumber),\n fieldName: \"requestNumber\",\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"kennelName\",\n },\n {\n header: () => t(ETLCodes.Affix),\n fieldName: \"affix\",\n },\n {\n header: () => t(ETLCodes.Country),\n fieldName: \"originCountry\",\n },\n ];\n case ERequestType.KennelNameChangeRequest:\n return [\n {\n header: () => t(ETLCodes.Export),\n computed: true,\n disableSorting: true,\n fieldName: \"toExport\",\n autoFitContent: true,\n alignment: \"center\",\n render: (row: AffixExportGridDto) => (\n forceExport(row, row.toExport)} />\n ),\n },\n {\n header: () => t(ETLCodes.RequestNumber),\n fieldName: \"requestNumber\",\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"kennelName\",\n },\n {\n header: () => t(ETLCodes.Affix),\n fieldName: \"affix\",\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"oldKennelName\",\n },\n {\n header: () => t(ETLCodes.Affix),\n fieldName: \"oldAffix\",\n },\n ];\n case ERequestType.KennelOwnershipChangeRequest:\n return [\n {\n header: () => t(ETLCodes.Export),\n computed: true,\n disableSorting: true,\n fieldName: \"toExport\",\n autoFitContent: true,\n alignment: \"center\",\n render: (row: AffixExportGridDto) => (\n forceExport(row, row.toExport)} />\n ),\n },\n {\n header: () => t(ETLCodes.RequestNumber),\n fieldName: \"requestNumber\",\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"kennelName\",\n },\n {\n header: () => t(ETLCodes.Affix),\n fieldName: \"affix\",\n },\n ];\n }\n }, [forceExport, requestType, t]);\n\n const exportCallback = React.useCallback(\n async (sObj: any) => {\n var res = await exportFunc(sObj);\n search();\n return res;\n },\n [exportFunc, search]\n );\n\n const getCriteriasFunction = React.useCallback(() => exportApi.getSearchCriterias(true), [exportApi]);\n return (\n \n {totalCount > 1\n ? t(ETLCodes.TableResults_Plural, { count: totalCount })\n : t(ETLCodes.TableResults, { count: totalCount })}\n
\n }\n rightElement={\n \n \n }\n onClick={GenerateDocs}\n minimal={true}\n intent={\"primary\"}\n />\n \n }\n >\n {requestType === ERequestType.KennelExportRequest ? (\n
\n \n
\n ) : null}\n \n \n );\n};\n","import * as React from \"react\";\nimport { PageBase, ProtectedTabs } from \"../../../../components\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { Tab } from \"@blueprintjs/core\";\nimport { AffixRequestExportListPage } from \"./lists/AffixRequestExportListPage\";\nimport { useTl, useApiService } from \"../../../../hooks\";\nimport { useParams, useHistory } from \"react-router\";\nimport { AffixRequestApi, ERequestType, AffixRequestSearch } from \"../../../../api\";\n\nexport interface IFciExportPageProps {}\n\nexport const FciExportPage: React.FunctionComponent = (props) => {\n const { t } = useTl();\n const { tab = \"newKennel\" } = useParams<{ tab: string; state: string }>();\n const api = useApiService(AffixRequestApi);\n\n const exportNewKennel = React.useCallback(\n async (sobj: AffixRequestSearch) => await api.exportNewKennelRequests(sobj),\n [api]\n );\n\n const exportkennelImport = React.useCallback(\n async (sobj: AffixRequestSearch) => await api.exportKennelImportRequests(sobj),\n [api]\n );\n\n const exportKennelNameChange = React.useCallback(\n async (sobj: AffixRequestSearch) => await api.exportKennelNameChangeRequests(sobj),\n [api]\n );\n\n const exportKennelOwnershipChangeRequest = React.useCallback(\n async (sobj: AffixRequestSearch) => await api.exportOwnershipChangeRequests(sobj),\n [api]\n );\n\n const exportKennelExportRequest = React.useCallback(\n async (sobj: AffixRequestSearch) => await api.exportKennelExportRequests(sobj),\n [api]\n );\n\n const history = useHistory();\n return (\n \n history.push(`${ERoutes.affixExport}/${newTabId}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n \n }\n />\n \n }\n />\n \n }\n />\n \n }\n />\n \n \n );\n};\n","import * as React from \"react\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { CharacteristicApi } from \"../../../../api\";\nimport { useHistory, useParams } from \"react-router\";\nimport { useApiEffect } from \"nsitools-react\";\nimport { PageBase, BackButton, ProtectedTabs } from \"../../../../components\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { ETLCodes } from \"../../../../locales\";\nimport {Tab, Spinner, SpinnerSize} from \"@blueprintjs/core\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { CharacteristicsDetailPage } from \"..\";\n\nexport interface ICharacteristicsItemPageProps {}\n\nexport const CharacteristicsItemPage: React.FunctionComponent = (props) => {\n const { id, tab, state } = useParams<{ id: string; tab: string; state: string }>();\n const { currentLanguage } = useGlobalData();\n const history = useHistory();\n const { t } = useTl();\n const api = useApiService(CharacteristicApi);\n const [displayName, loading] = useApiEffect(() => api.getDisplayName(+id, currentLanguage.languageId), [id]);\n\n return (\n 0 ? loading ? : displayName : t(ETLCodes.New) },\n ]}\n >\n history.push(`${ERoutes.characteristics}/${id}/${newTabId}/${state}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n \n \n );\n};\n","import { IDataTableColumn, Loading } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nimport { CharacteristicValuesApi, CharacteristicValuesGridDto, CharacteristicValuesSearch } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { ICustomSelectorProps, SRSHCustomSelector } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface ICharacteristicsTypeSelectorProps\n extends Pick, \"linkedIds\" | \"onLinkedIdsChanged\"> {\n editMode: boolean;\n loading: boolean;\n}\n\nexport const CharacteristicsTypeSelector: React.FunctionComponent = ({\n linkedIds,\n onLinkedIdsChanged,\n editMode,\n loading,\n}) => {\n const characteristicValuesApi = useApiService(CharacteristicValuesApi);\n const { t } = useTl();\n const { currentLanguage } = useGlobalData();\n\n const searchIdsFunction = React.useCallback(\n (sObj: any) =>\n characteristicValuesApi.getIds(\n CharacteristicValuesSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })\n ),\n [characteristicValuesApi, currentLanguage.languageId]\n );\n const searchFunction = React.useCallback(\n (sObj: any) =>\n characteristicValuesApi.baseSearch(\n CharacteristicValuesSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })\n ),\n [characteristicValuesApi, currentLanguage.languageId]\n );\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n render: (dto: CharacteristicValuesGridDto) => (\n \n {dto.name}\n \n ),\n },\n ],\n [t]\n );\n return (\n \n \n \n );\n};\n","import {\n FGCustomPanel,\n FGSelectInput,\n FGTextAreaInput,\n FGTextInput,\n FieldGroup,\n FGListen,\n} from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport * as Yup from \"yup\";\n\nimport {\n CharacteristicApi,\n CharacteristicsDto,\n CharacteristicTranslationDto,\n ELab,\n} from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { FGMultiTranslate, SmallFormGenerator } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../hooks\";\nimport { useReferential } from \"../../../../hooks/useReferential\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { CharacteristicsTypeSelector } from \"./CharacteristicsTypeSelector\";\n\nexport interface ICharacteristicsDetailPageProps {\n characteristicId: number;\n editMode: boolean;\n}\n\nexport const CharacteristicsDetailPage: React.FunctionComponent = ({\n characteristicId,\n editMode,\n}) => {\n const { t } = useTl();\n const history = useHistory();\n const [isTypeLab, setisTypeLab] = React.useState(false);\n const [isListValueType, setIsListValueType] = React.useState(false);\n const [\n isDysplasiaCharacteristic,\n setIsDysplasiaCharacteristic,\n ] = React.useState(false);\n const api = useApiService(CharacteristicApi);\n const { languages, currentLanguage } = useGlobalData();\n\n const [characteristicTypes, cloading] = useReferential(\n (a) => a.getCharacteristicTypes(currentLanguage.languageId),\n true,\n []\n );\n const [dysplasiaTypes, dtloading] = useReferential(\n (a) => a.getDysplasiaTypes(false,0),\n true,\n []\n );\n const [healthValueTypes, hvtLoading] = useReferential(\n (a) => a.getHealthValueTypes(isDysplasiaCharacteristic),\n true,\n [isDysplasiaCharacteristic]\n );\n\n const [labs, lLoading] = useReferential((a) => a.getLabs(), false, []);\n\n const { data, loading, saveItem, saving, deleteItem, deleting } = useCrudApi(\n {\n getApiFn: (id = characteristicId) =>\n id > 0\n ? api.get(id)\n : new CharacteristicsDto({\n lab: ELab.ZOOLYX,\n characteristicValuesIds: [],\n characteristicTranslations: [\n ...languages.map(\n (l) =>\n new CharacteristicTranslationDto({\n languageId: l.languageId,\n })\n ),\n ],\n }).toJSON(),\n saveApiFn: (d: CharacteristicsDto) => api.save(d),\n onSavedRoute: (d) =>\n `${ERoutes.characteristics}/${d.characteristicId}/detail/edit`,\n deleteApiFn: (d) => api.delete(d.characteristicId),\n onDeletedRoute: (d) => `${ERoutes.characteristics}`,\n },\n [characteristicId]\n );\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n code: Yup.string()\n .nullable()\n .required(t(ETLCodes.Required))\n .test(\n \"is-unique\",\n t(ETLCodes.CodeAlreadyExists),\n async function (value) {\n if (!value || characteristicId > 0) return true;\n const res = await api.isCodeUnique(\n characteristicId,\n this.parent.characteristicTypeId,\n value\n );\n return res.value;\n }\n ),\n characteristicTypeId: Yup.number()\n .nullable()\n .required(t(ETLCodes.Required))\n .test(\n \"is-unique\",\n t(ETLCodes.CodeAlreadyExists),\n async function (value) {\n if (!value || characteristicId > 0) return true;\n const res = await api.isCodeUnique(\n characteristicId,\n value,\n this.parent.code\n );\n return res.value;\n }\n ),\n characteristicTranslations: Yup.array().of(\n Yup.object().shape({\n text: Yup.string().nullable().required(t(ETLCodes.Required)),\n })\n ),\n lab: Yup.string().nullable().required(t(ETLCodes.Required)),\n dysplasiaTypeId: Yup.number().nullable(),\n });\n }, [api, characteristicId, t]);\n\n return (\n data && (\n history.push(ERoutes.characteristics)}\n saving={saving}\n deleting={deleting}\n showDeleteButton={characteristicId > 0}\n onDelete={deleteItem}\n validationSchema={FormSchema}\n >\n {\n setisTypeLab((await api.isTypeLab(value)).value);\n const isDysplasia = await api.isDysplasiaType(value);\n setIsDysplasiaCharacteristic(isDysplasia.value);\n }}\n />\n {\n const result = await api.isHealthValueTypeList(value);\n setIsListValueType(result.value);\n }}\n />\n \n 0}\n />\n 0}\n />\n \n \n \n \n \n \n \n \n {({ formik }) =>\n formik?.values?.characteristicValuesIds &&\n isListValueType && (\n \n formik?.setFieldValue(\"characteristicValuesIds\", ids)\n }\n editMode={editMode}\n loading={loading}\n />\n )\n }\n \n \n )\n );\n};\n","import * as React from \"react\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { CharacteristicApi, CharacteristicsGridDto, CharacteristicSearch } from \"../../../../api\";\nimport { useHistory } from \"react-router\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { IDataTableColumn, ButtonContainer } from \"nsitools-react\";\nimport { ViewButton, EditButton, SearchTablePage } from \"../../../../components\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface ICharacteristicsListPageProps {}\n\nexport const CharacteristicsListPage: React.FunctionComponent = (props) => {\n const api = useApiService(CharacteristicApi);\n const { t } = useTl();\n const history = useHistory();\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: CharacteristicsGridDto) => (\n \n history.push(`${ERoutes.characteristics}/${row.characteristicId}/detail/view`)}\n />\n history.push(`${ERoutes.characteristics}/${row.characteristicId}/detail/edit`)}\n />\n \n ),\n },\n {\n header: () => t(ETLCodes.CharacteristicType),\n fieldName: \"characteristicType\",\n },\n {\n header: () => t(ETLCodes.Code),\n fieldName: \"code\",\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n },\n {\n header: () => t(ETLCodes.AppliedToDysplasia),\n fieldName: \"appliedToDysplasia\",\n },\n {\n header: () => t(ETLCodes.Laboratory),\n fieldName: \"labName\",\n },\n ],\n [history, t]\n );\n\n const addItemFunction = React.useCallback(() => {\n history.push(`${ERoutes.characteristics}/0/detail/edit`);\n }, [history]);\n\n const searchCriteriasFunction = React.useCallback(() => api.getSearchCriterias(true), [api]);\n\n const searchFunction = React.useCallback(\n (sObj) => api.baseSearch(CharacteristicSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n\n const exportFunction = React.useCallback(\n (sObj) => api.exportXlsFile(CharacteristicSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n\n return (\n \n );\n};\n","import * as React from \"react\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { useHistory, useParams } from \"react-router\";\nimport { useApiEffect } from \"nsitools-react\";\nimport { PageBase, BackButton, ProtectedTabs } from \"../../../../components\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { ETLCodes } from \"../../../../locales\";\nimport {Tab, Spinner, SpinnerSize} from \"@blueprintjs/core\";\nimport { CharacteristicValuesDetailPage } from \"../..\";\nimport { CharacteristicValuesApi } from \"../../../../api\";\nimport { useGlobalData } from \"../../../../contexts\";\n\nexport interface ICharacteristicValuesItemPageProps {}\n\nexport const CharacteristicValuesItemPage: React.FunctionComponent = (props) => {\n const { id, tab, state } = useParams<{ id: string; tab: string; state: string }>();\n const history = useHistory();\n const { t } = useTl();\n const { currentLanguage } = useGlobalData();\n const api = useApiService(CharacteristicValuesApi);\n const [displayName, loading] = useApiEffect(() => api.getDisplayName(+id, currentLanguage.languageId), [id]);\n\n return (\n 0 ? loading ? : displayName : t(ETLCodes.New) },\n ]}\n >\n history.push(`${ERoutes.characteristicValues}/${id}/${newTabId}/${state}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n \n \n );\n};\n","import {\n FGTextInput,\n FGTextAreaInput,\n FGSelectInput,\n FGCheckboxInput,\n} from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport * as Yup from \"yup\";\n\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { FGMultiTranslate, SmallFormGenerator } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport {\n CharacteristicValuesApi,\n CharacteristicValuesDto,\n CharacteristicValuesTranslationDto,\n ELab,\n} from \"../../../../api\";\nimport { useReferential } from \"../../../../hooks/useReferential\";\n\nexport interface ICharacteristicValuesDetailPageProps {\n characteristicValueId: number;\n editMode: boolean;\n}\n\nexport const CharacteristicValuesDetailPage: React.FunctionComponent = ({\n characteristicValueId,\n editMode,\n}) => {\n const { t } = useTl();\n const history = useHistory();\n const api = useApiService(CharacteristicValuesApi);\n const { languages } = useGlobalData();\n const [labs, lLoading] = useReferential((a) => a.getLabs(), false, []);\n const { data, loading, saveItem, saving, deleteItem, deleting } = useCrudApi(\n {\n getApiFn: (id = characteristicValueId) =>\n id > 0\n ? api.get(id)\n : new CharacteristicValuesDto({\n lab: ELab.ZOOLYX,\n characteristicValuesTranslations: [\n ...languages.map(\n (l) =>\n new CharacteristicValuesTranslationDto({\n languageId: l.languageId,\n })\n ),\n ],\n }).toJSON(),\n saveApiFn: (d: CharacteristicValuesDto) => api.save(d),\n onSavedRoute: (d) =>\n `${ERoutes.characteristicValues}/${d.healthValueId}/detail/edit`,\n deleteApiFn: (d) => api.delete(d.healthValueId),\n onDeletedRoute: (d) => `${ERoutes.characteristicValues}`,\n },\n [characteristicValueId]\n );\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n lab: Yup.string().nullable().required(t(ETLCodes.Required)),\n value: Yup.string().nullable().required(t(ETLCodes.Required)),\n characteristicValuesTranslations: Yup.array().of(\n Yup.object().shape({\n text: Yup.string().nullable().required(t(ETLCodes.Required)),\n })\n ),\n });\n }, [t]);\n\n return (\n data && (\n history.push(ERoutes.characteristicValues)}\n saving={saving}\n deleting={deleting}\n showDeleteButton={characteristicValueId > 0}\n onDelete={deleteItem}\n validationSchema={FormSchema}\n >\n \n \n \n \n \n \n )\n );\n};\n","import * as React from \"react\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { useHistory } from \"react-router\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { IDataTableColumn, ButtonContainer } from \"nsitools-react\";\nimport { ViewButton, EditButton, SearchTablePage } from \"../../../../components\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { CharacteristicValuesApi, CharacteristicValuesGridDto, CharacteristicValuesSearch } from \"../../../../api\";\nimport { Checkbox } from \"@blueprintjs/core\";\n\nexport interface ICharacteristicValuesListPageProps {}\n\nexport const CharacteristicValuesListPage: React.FunctionComponent = (props) => {\n const api = useApiService(CharacteristicValuesApi);\n const { t } = useTl();\n const history = useHistory();\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: CharacteristicValuesGridDto) => (\n \n history.push(`${ERoutes.characteristicValues}/${row.healthValueId}/detail/view`)}\n />\n history.push(`${ERoutes.characteristicValues}/${row.healthValueId}/detail/edit`)}\n />\n \n ),\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n },\n {\n header: () => t(ETLCodes.Laboratory),\n fieldName: \"lab\",\n },\n {\n header: () => t(ETLCodes.OkForInheritance),\n headerAlignment: \"center\",\n fieldName: \"okForInheritance\",\n alignment: \"center\",\n render: (row: CharacteristicValuesGridDto) => (\n \n ),\n },\n ],\n [history, t]\n );\n\n const addItemFunction = React.useCallback(() => {\n history.push(`${ERoutes.characteristicValues}/0/detail/edit`);\n }, [history]);\n const search = React.useCallback(\n (sObj) => api.baseSearch(CharacteristicValuesSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n\n return (\n api.getSearchCriterias(true)}\n searchFunction={search}\n exportFunction={(sObj) =>\n api.exportXlsFile(CharacteristicValuesSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId }))\n }\n addFunc={addItemFunction}\n sortKeys={{ name: \"ASC\" }}\n breadCrumbs={[{ text: t(ETLCodes.CharacteristicValues) }]}\n />\n );\n};\n","import * as React from \"react\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { CharacteristicApi, CharacteristicSearch, CharacteristicsGridDto, ELab } from \"../../../../api\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { IDataTableColumn, Loading } from \"nsitools-react\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { SRSHCustomSelector, ICustomSelectorProps } from \"../../../../components\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { Link } from \"react-router-dom\";\nexport interface ICharacteristicSelectorProps\n extends Pick, \"linkedIds\" | \"onLinkedIdsChanged\"> {\n editMode: boolean;\n loading: boolean;\n lab?: ELab;\n onlyIsLab?: boolean;\n}\n\nexport const CharacteristicSelector: React.FunctionComponent = ({\n loading,\n editMode,\n linkedIds,\n onLinkedIdsChanged,\n lab,\n onlyIsLab = false,\n}) => {\n const api = useApiService(CharacteristicApi);\n const { currentLanguage } = useGlobalData();\n const { t } = useTl();\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n render: (row: CharacteristicsGridDto) => (\n
\n {`${row.code} - `}{\" \"}\n \n {row.name}\n \n
\n ),\n },\n ],\n [t]\n );\n\n const searchIdsFunction = React.useCallback(\n (sObj: any) =>\n api.getIds(CharacteristicSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, customLab: lab })),\n [api, currentLanguage.languageId, lab]\n );\n const searchFunction = React.useCallback(\n (sObj: any) =>\n api.baseSearch(\n CharacteristicSearch.fromJS({\n ...sObj,\n languageId: currentLanguage.languageId,\n customLab: lab,\n onlyIsLab: onlyIsLab,\n })\n ),\n [api, currentLanguage.languageId, lab, onlyIsLab]\n );\n\n return (\n \n \n \n );\n};\n","import {\n FGTextInput,\n FieldGroup,\n FGSelectInput,\n FGCustomPanel,\n} from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport * as Yup from \"yup\";\n\nimport {\n HealthPackApi,\n HealthPackDto,\n HealthPackTranslationDto,\n} from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { FGMultiTranslate, SmallFormGenerator } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useCrudApi, useTl, useWindow } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { useReferential } from \"../../../../hooks/useReferential\";\nimport { CharacteristicSelector } from \"./CharacteristicSelector\";\n\nexport interface IHealthPackDetailPageProps {\n healthPackId: number;\n editMode: boolean;\n}\n\nexport const HealthPackDetailPage: React.FunctionComponent = ({\n healthPackId,\n editMode,\n}) => {\n const history = useHistory();\n const { t } = useTl();\n const api = useApiService(HealthPackApi);\n const { languages } = useGlobalData();\n const { openNewTab } = useWindow();\n const [groups, groupsLoading] = useReferential((c) =>\n c.getHealthPackGroups()\n );\n const [articles, articlesLoading] = useReferential((c) =>\n c.getArticles(true)\n );\n const [labs, lLoading] = useReferential((a) => a.getLabs(), false, []);\n\n const { data, loading, saveItem, saving, deleteItem, deleting } = useCrudApi(\n {\n getApiFn: (id = healthPackId) =>\n id > 0\n ? api.getHealthPack(id)\n : new HealthPackDto({\n characteristicIds: [],\n healthPackTranslations: [\n ...languages.map(\n (l) =>\n new HealthPackTranslationDto({\n languageId: l.languageId,\n })\n ),\n ],\n }).toJSON(),\n saveApiFn: (d: HealthPackDto) => api.save(d),\n onSavedRoute: (d) =>\n `${ERoutes.healthPack}/${d.healthPackId}/detail/edit`,\n deleteApiFn: (d) => api.delete(d.healthPackId),\n onDeletedRoute: (d) => `${ERoutes.healthPack}`,\n },\n [healthPackId]\n );\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n lab: Yup.string().nullable().required(t(ETLCodes.Required)),\n healthPackCode: Yup.string().nullable().required(t(ETLCodes.Required)),\n articleId: Yup.number().nullable().required(t(ETLCodes.Required)),\n healthPackGroupId: Yup.number().nullable().required(t(ETLCodes.Required)),\n healthPackTranslations: Yup.array().of(\n Yup.object().shape({\n text: Yup.string().nullable().required(t(ETLCodes.Required)),\n })\n ),\n });\n }, [t]);\n\n return (\n data && (\n history.push(ERoutes.healthPack)}\n saving={saving}\n deleting={deleting}\n showDeleteButton={healthPackId > 0}\n onDelete={deleteItem}\n validationSchema={FormSchema}\n >\n \n 0}\n />\n \n \n \n \n \n \n openNewTab(`${ERoutes.article}/${value}/detail/view`)\n }\n />\n \n \n \n {({ formik }) => (\n \n formik?.setFieldValue(\"characteristicIds\", ids)\n }\n editMode={editMode}\n loading={loading}\n lab={formik?.values?.lab}\n onlyIsLab={true}\n />\n )}\n \n \n \n )\n );\n};\n","import {Spinner, SpinnerSize, Tab} from \"@blueprintjs/core\";\nimport * as React from \"react\";\nimport { useHistory, useParams } from \"react-router\";\n\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { BackButton, PageBase, ProtectedTabs } from \"../../../../components\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { useApiEffect } from \"nsitools-react\";\nimport { HealthPackApi } from \"../../../../api\";\nimport { HealthPackDetailPage } from \"./HealthPackDetailPage\";\n\nexport interface IHealthPackItemPageProps {}\n\nexport const HealthPackItemPage: React.FunctionComponent = (props) => {\n const { id, tab, state } = useParams<{ id: string; tab: string; state: string }>();\n const history = useHistory();\n const { t } = useTl();\n const api = useApiService(HealthPackApi);\n const [displayName, loading] = useApiEffect(() => api.getDisplayName(+id), [id]);\n\n return (\n 0 ? loading ? : displayName : t(ETLCodes.New) },\n ]}\n >\n history.push(`${ERoutes.healthPack}/${id}/${newTabId}/${state}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n \n \n );\n};\n","import { ButtonContainer, IDataTableColumn } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport { Link } from \"react-router-dom\";\n\nimport { HealthPackApi, HealthPackGridDto, HealthPackSearch } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { EditButton, SearchTablePage, ViewButton } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface IHealthPackListPageProps {}\n\nexport const HealthPackListPage: React.FunctionComponent = (props) => {\n const api = useApiService(HealthPackApi);\n const { t } = useTl();\n const history = useHistory();\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: HealthPackGridDto) => (\n \n history.push(`${ERoutes.healthPack}/${row.healthPackId}/detail/view`)}\n />\n history.push(`${ERoutes.healthPack}/${row.healthPackId}/detail/edit`)}\n />\n \n ),\n },\n {\n header: () => t(ETLCodes.Code),\n fieldName: \"healthPackCode\",\n },\n {\n header: () => t(ETLCodes.HealthPackGroup),\n fieldName: \"healthPackGroupName\",\n },\n {\n header: () => t(ETLCodes.Article),\n fieldName: \"articleName\",\n render: (row: HealthPackGridDto) => (\n \n {row.articleName}\n \n ),\n },\n {\n header: () => t(ETLCodes.Laboratory),\n fieldName: \"lab\",\n },\n ],\n [history, t]\n );\n\n const addItemFunction = React.useCallback(() => {\n history.push(`${ERoutes.healthPack}/0/detail/edit`);\n }, [history]);\n\n const searchHealthPackFunction = React.useCallback(\n (sObj) => api.baseSearch(HealthPackSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n const exportHealthPackFunction = React.useCallback(\n (sObj) => api.exportXlsFile(HealthPackSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n\n const searchHealthPackCriteriaFunction = React.useCallback(() => api.getSearchCriterias(true), [api]);\n\n return (\n \n );\n};\n","import { Checkbox } from \"@blueprintjs/core\";\nimport { ButtonContainer, IDataTableColumn } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\n\nimport { WorkbookTypeApi, WorkbookTypeGridDto, WorkbookTypeSearch } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { EditButton, SearchTablePage, ViewButton } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport styled from \"styled-components\";\n\nconst Center = styled.div`\n text-align: center;\n display: flex;\n flex-direction: column;\n`;\n\nexport interface IWorkbookTypeListPageProps {}\nexport const WorkbookTypeListPage: React.FunctionComponent = (props) => {\n const { t } = useTl();\n const history = useHistory();\n const api = useApiService(WorkbookTypeApi);\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: WorkbookTypeGridDto) => (\n \n history.push(`${ERoutes.workbookType}/${row.workbookTypeId}/detail/view`)}\n />\n history.push(`${ERoutes.workbookType}/${row.workbookTypeId}/detail/edit`)}\n />\n \n ),\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n render: (row: WorkbookTypeGridDto) =>\n `${row.workbookColor} - ${row.hasPedigree ? t(ETLCodes.WithPedigree) : t(ETLCodes.WithoutPedigree)}`,\n },\n {\n header: () => t(ETLCodes.WorkbookColor),\n fieldName: \"workbookColor\",\n },\n {\n header: () => t(ETLCodes.HasPedigree),\n fieldName: \"hasPedigree\",\n alignment: \"center\",\n render: (row: WorkbookTypeGridDto) => ,\n },\n {\n header: () =>
{t(ETLCodes.CanGiveWorkCertificate)}
,\n fieldName: \"canGiveWorkCertificate\",\n alignment: \"center\",\n render: (row: WorkbookTypeGridDto) => ,\n },\n {\n header: () =>
{t(ETLCodes.HasSocialibilityTest)}
,\n fieldName: \"hasSocialibilityTest\",\n alignment: \"center\",\n render: (row: WorkbookTypeGridDto) => ,\n },\n {\n header: () => t(ETLCodes.Description),\n fieldName: \"description\",\n },\n ],\n [history, t]\n );\n\n const addItemFunction = React.useCallback(() => {\n history.push(`${ERoutes.workbookType}/0/detail/edit`);\n }, [history]);\n\n const search = React.useCallback(\n (sObj) => api.baseSearch(WorkbookTypeSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n\n return (\n \n api.exportXlsFile(WorkbookTypeSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId }))\n }\n getCriteriasFunction={() => api.getSearchCriterias(true)}\n addFunc={addItemFunction}\n sortKeys={{ workbookColor: \"ASC\", hasPedigree: \"ASC\" }}\n breadCrumbs={[{ text: t(ETLCodes.WorkbookTypes) }]}\n />\n );\n};\n","import { FieldGroup, FGSelectInput, FGTextAreaInput } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport * as Yup from \"yup\";\n\nimport { WorkbookTypeApi, WorkbookTypeDto, WorkbookTypeTranslationDto } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { SmallFormGenerator, FGSRSHCheckboxInput, FGMultiTranslate } from \"../../../../components\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useReferential } from \"../../../../hooks/useReferential\";\n\nexport interface IWorkbookTypeDetailPageProps {\n id?: number;\n editMode?: boolean;\n}\n\nexport const WorkbookTypeDetailPage: React.FunctionComponent = ({ id, editMode }) => {\n const { t } = useTl();\n const api = useApiService(WorkbookTypeApi);\n const history = useHistory();\n const { languages, currentLanguage } = useGlobalData();\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n workbookColorId: Yup.number().nullable().required(t(ETLCodes.Required)),\n hasPedigree: Yup.boolean(),\n workbookTypeTranslations: Yup.array().of(\n Yup.object().shape({\n text: Yup.string().nullable().required(t(ETLCodes.Required)),\n })\n ),\n isSticker: Yup.boolean()\n .nullable()\n .test(\"has-document\", t(ETLCodes.TypeHasNoDocument), async function (value) {\n return value || !!this.parent.documentType;\n }),\n });\n }, [t]);\n\n const { data, loading, deleteItem, deleting, saveItem, saving } = useCrudApi(\n {\n getApiFn: (getId = id) =>\n getId > 0\n ? api.get(getId)\n : new WorkbookTypeDto({\n isSticker: true,\n workbookTypeTranslations: [\n ...languages.map((l) => new WorkbookTypeTranslationDto({ languageId: l.languageId })),\n ],\n }).toJSON(),\n saveApiFn: (d: WorkbookTypeDto) =>\n d.workbookTypeId > 0 ? api.save(d) : api.save(WorkbookTypeDto.fromJS({ ...d, isSticker: true })),\n onSavedRoute: (d) => `${ERoutes.workbookType}/${d.workbookTypeId}/detail/edit`,\n deleteApiFn: (d) => api.delete(d.workbookTypeId),\n onDeletedRoute: () => ERoutes.workbookType,\n },\n [id]\n );\n\n const [workbookColor, wbcLoading] = useReferential((a) => a.getWorkbookColors(currentLanguage.languageId), true, [\n currentLanguage,\n ]);\n const [articleIds, articleLoading] = useReferential((a) => a.getArticles(false), true, [currentLanguage]);\n\n return (\n history.push(ERoutes.workbookType)}\n onDelete={deleteItem}\n showDeleteButton={id > 0}\n saving={saving}\n deleting={deleting}\n >\n \n \n \n \n \n \n \n \n \n \n 0} />\n \n \n \n \n );\n};\n","import { Tag, Tooltip } from \"@blueprintjs/core\";\nimport moment from \"moment\";\nimport { IDataTableColumn } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { Tooltip2 } from \"@blueprintjs/popover2\";\n\nimport { MailAdminApi, MailLogGridDto } from \"../../api\";\nimport { SearchTablePage } from \"../../components\";\nimport { useApiService, useTl } from \"../../hooks\";\n\nimport { ETLCodes } from \"../../locales\";\n\nexport interface IMailLogListPageProps {\n requestId: number;\n}\n\nexport const MailLogListPage: React.FunctionComponent = ({ requestId }) => {\n const api = useApiService(MailAdminApi);\n const { t } = useTl();\n const columns = React.useMemo[]>(\n () => [\n {\n fieldName: \"mailLogId\",\n },\n { fieldName: \"subject\" },\n { fieldName: \"to\" },\n { fieldName: \"cc\" },\n { fieldName: \"ForceRecipients\" },\n {\n fieldName: \"attachments\",\n alignment: \"center\",\n headerAlignment: \"center\",\n render: (o) => {\n const attachmentsSplit = o.attachments.split(\",\").filter((d) => d !== \"\");\n const count = attachmentsSplit.length;\n if (count > 0) {\n return (\n \n {attachmentsSplit.map((a, i) => (\n
{a}
\n ))}\n \n }\n >\n {count}\n \n );\n }\n return null;\n },\n },\n { fieldName: \"sentOn\", render: (o) => moment(o.sentOn).format(\"DD/MM/YYYY HH:mm:ss\") },\n ],\n []\n );\n const getCriterias = React.useCallback(() => api.getSearchCriterias(true), [api]);\n const search = React.useCallback(\n (sObj: any) => {\n sObj.requestId = requestId;\n return api.baseSearch(sObj);\n },\n [api, requestId]\n );\n return (\n \n );\n};\n","import {Tab, Spinner, SpinnerSize} from \"@blueprintjs/core\";\nimport { useApiEffect } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory, useParams } from \"react-router\";\n\nimport { ERequestType, RequestApi, WorkbookTypeApi } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { BackButton, PageBase, ProtectedTabs } from \"../../../../components\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { WorkbookTypeDetailPage } from \"./WorkbookTypeDetailPage\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { MailLogListPage } from \"../../../mail-log/MailLogListPage\";\n\nexport interface IWorkbookTypeItemPageProps {}\n\nexport const WorkbookTypeItemPage: React.FunctionComponent = (props) => {\n const { t } = useTl();\n const { id, tab, state = \"edit\" } = useParams<{ id: string; tab: string; state: string }>();\n const workbooktypeId = React.useMemo(() => +id, [id]);\n const history = useHistory();\n const api = useApiService(WorkbookTypeApi);\n const requestApi = useApiService(RequestApi);\n const { currentLanguage } = useGlobalData();\n const [displayName, loading] = useApiEffect(\n () => api.getDisplayName(workbooktypeId, currentLanguage.languageId),\n [workbooktypeId],\n );\n const [requestInfo, requestInfoLoading, , refreshRequestInfo] = useApiEffect(\n () => requestApi.getRequestInfo(ERequestType.WorkAttestRequest, +id, 0, currentLanguage.languageId),\n [requestApi, id, currentLanguage],\n );\n return (\n 0 ? loading ? : displayName : t(ETLCodes.New) },\n ]}\n >\n history.push(`${ERoutes.workbookType}/${id}/${newTabId}/${state}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n : }\n disabled={+id <= 0}\n />\n \n \n );\n};\n","import { FGSelectInput, FieldGroup, FGTextAreaInput, FGTextInput, FGCheckboxInput } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport * as Yup from \"yup\";\n\nimport { SubActivityApi, SubActivityTranslationDto, SubActivityDetailDto } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { SmallFormGenerator, FGMultiTranslate, FGSRSHCheckboxInput } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../hooks\";\nimport { useReferential } from \"../../../../hooks/useReferential\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface ISubActivityDetailPageProps {\n idSubActivity: number;\n editMode: boolean;\n}\n\nexport const SubActivityDetailPage: React.FunctionComponent = ({\n idSubActivity,\n editMode,\n}) => {\n const { t } = useTl();\n const api = useApiService(SubActivityApi);\n const history = useHistory();\n const { languages } = useGlobalData();\n const { currentLanguage } = useGlobalData();\n const [activities, aLoading] = useReferential((a) => a.getActivities(0), true, [currentLanguage]);\n const { data, loading, deleteItem, deleting, saveItem, saving } = useCrudApi(\n {\n getApiFn: (id = idSubActivity) =>\n id > 0\n ? api.get(id)\n : new SubActivityDetailDto({\n isCac: false,\n subActivityTranslations: [\n ...languages.map(\n (l) =>\n new SubActivityTranslationDto({\n languageId: l.languageId,\n })\n ),\n ],\n }).toJSON(),\n saveApiFn: (d: SubActivityDetailDto) => api.save(d),\n onSavedRoute: (d) => `${ERoutes.subActivity}/${d.subActivityId}/detail/edit`,\n deleteApiFn: (d) => api.delete(d.subActivityId),\n onDeletedRoute: () => ERoutes.subActivity,\n },\n [idSubActivity]\n );\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n activityId: Yup.number().nullable().required(t(ETLCodes.Required)),\n subActivityTranslations: Yup.array().of(\n Yup.object().shape({\n text: Yup.string().nullable().required(t(ETLCodes.Required)),\n })\n ),\n });\n }, [t]);\n\n return (\n data && (\n history.push(ERoutes.subActivity)}\n onDelete={deleteItem}\n showDeleteButton={idSubActivity > 0}\n saving={saving}\n deleting={deleting}\n >\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n )\n );\n};\n","import { IDataTableColumn } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nimport { SubActivityJudgeApi, SubActivityJudgeSearch, SubActivityJudgeGridDto } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { EmailButton, SearchTablePage } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface ISubActivityJudgePageProps {\n subActivityId: number;\n}\n\nexport const SubActivityJudgePage: React.FunctionComponent = ({ subActivityId }) => {\n const api = useApiService(SubActivityJudgeApi);\n const { t } = useTl();\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n render: (row: SubActivityJudgeGridDto) => (\n \n {row.name}\n \n ),\n },\n {\n header: () => t(ETLCodes.Language),\n fieldName: \"language\",\n },\n {\n header: () => t(ETLCodes.Email),\n fieldName: \"email\",\n render: (value: SubActivityJudgeGridDto) => ,\n },\n {\n header: () => t(ETLCodes.PhoneNumber),\n fieldName: \"phoneNumber\",\n },\n {\n header: () => t(ETLCodes.MobilePhoneNumber),\n fieldName: \"mobilePhoneNumber\",\n },\n ],\n [t]\n );\n const search = React.useCallback(\n (sObj) =>\n api.baseSearch(\n SubActivityJudgeSearch.fromJS({\n ...sObj,\n languageId: currentLanguage.languageId,\n subActivityId: subActivityId,\n })\n ),\n [api, currentLanguage.languageId, subActivityId]\n );\n\n const getSearchCriterias = React.useCallback(() => api.getSearchCriterias(true), [api]);\n return (\n \n api.exportXlsFile(\n SubActivityJudgeSearch.fromJS({\n ...sObj,\n languageId: currentLanguage.languageId,\n subActivityId: subActivityId,\n })\n )\n }\n sortKeys={{ lastName: \"ASC\" }}\n withCard={false}\n breadCrumbs={[{ text: t(ETLCodes.Judges) }]}\n />\n );\n};\n","import * as React from \"react\";\nimport { useTl, useApiService } from \"../../../../hooks\";\nimport { useParams, useHistory } from \"react-router\";\nimport { useApiEffect } from \"nsitools-react\";\nimport { PageBase, BackButton, ProtectedTabs } from \"../../../../components\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport {Tab, Spinner, SpinnerSize} from \"@blueprintjs/core\";\nimport { SubActivityDetailPage } from \"./SubActivityDetailPage\";\nimport { SubActivityApi } from \"../../../../api\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { SubActivityJudgePage } from \"./SubActivityJudgePage\";\n\nexport interface ISubActivityItemPageProps {}\n\nexport const SubActivityItemPage: React.FunctionComponent = (props) => {\n const { t } = useTl();\n const { currentLanguage } = useGlobalData();\n const { id, tab, state = \"edit\" } = useParams<{ id: string; tab: string; state: string }>();\n const idSubActivity = React.useMemo(() => +id, [id]);\n const history = useHistory();\n const api = useApiService(SubActivityApi);\n const [displayName, loading] = useApiEffect(\n () => api.getDisplayName(idSubActivity, currentLanguage.languageCode),\n [idSubActivity],\n );\n\n return (\n 0 ? loading ? : displayName : t(ETLCodes.New) },\n ]}\n >\n history.push(`${ERoutes.subActivity}/${id}/${newTabId}/${state}`)}\n selectedTabId={tab}\n renderActiveTabPanelOnly\n >\n \n }\n />\n } />\n\n {/* */}\n \n \n );\n};\n","import { ButtonContainer, IDataTableColumn } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\n\nimport { SubActivityApi, SubActivityGridDto, SubActivitySearch } from \"../../../../api\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { EditButton, SearchTablePage, ViewButton } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { Link } from \"react-router-dom\";\n\nexport interface ISubActivityListPageProps {}\n\nexport const SubActivityListPage: React.FunctionComponent = (props) => {\n const api = useApiService(SubActivityApi);\n const { t } = useTl();\n const history = useHistory();\n const { currentLanguage } = useGlobalData();\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: SubActivityGridDto) => (\n \n history.push(`${ERoutes.subActivity}/${row.subActivityId}/detail/view`)}\n />\n history.push(`${ERoutes.subActivity}/${row.subActivityId}/detail/edit`)}\n />\n \n ),\n },\n {\n fieldName: \"name\",\n header: () => t(ETLCodes.Name),\n },\n {\n fieldName: \"showType\",\n header: () => t(ETLCodes.ShowType),\n },\n {\n header: () => t(ETLCodes.Activity),\n fieldName: \"activity\",\n render: (row: SubActivityGridDto) => (\n \n {row.activity}\n \n ),\n },\n ],\n [history, t]\n );\n\n const addItemFunction = React.useCallback(() => {\n history.push(`${ERoutes.subActivity}/0/detail/edit`);\n }, [history]);\n\n const searchCriteriasFunction = React.useCallback(() => api.getSearchCriterias(true), [api]);\n const searchFunction = React.useCallback(\n (sObj) => api.baseSearch(SubActivitySearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n const exportFunction = React.useCallback(\n (sObj) => api.exportXlsFile(SubActivitySearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n return (\n \n );\n};\n","import * as React from \"react\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ClubApi, ClubGridDto, ClubSearch } from \"../../../../api\";\nimport { useHistory } from \"react-router\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { IDataTableColumn, ButtonContainer } from \"nsitools-react\";\nimport { ViewButton, EditButton, SearchTablePage } from \"../../../../components\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface IClublistPageProps {}\n\nexport const ClublistPage: React.FunctionComponent = (props) => {\n const api = useApiService(ClubApi);\n const { t } = useTl();\n const history = useHistory();\n const { currentLanguage } = useGlobalData();\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: ClubGridDto) => (\n \n history.push(`${ERoutes.club}/${row.clubId}/detail/view`)} />\n history.push(`${ERoutes.club}/${row.clubId}/detail/edit`)} />\n \n ),\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n },\n {\n header: () => t(ETLCodes.FinalNumber),\n fieldName: \"finalNumber\",\n },\n ],\n [history, t]\n );\n\n const addItemFunction = React.useCallback(() => {\n history.push(`${ERoutes.club}/0/detail/edit`);\n }, [history]);\n\n const search = React.useCallback(\n (sObj) => api.baseSearch(ClubSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [api, currentLanguage.languageId]\n );\n\n return (\n api.getSearchCriterias(true)}\n searchFunction={search}\n exportFunction={(sObj) =>\n api.exportXlsFile(ClubSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId }))\n }\n addFunc={addItemFunction}\n sortKeys={{ name: \"ASC\" }}\n breadCrumbs={[{ text: t(ETLCodes.Clubs) }]}\n />\n );\n};\n","import { FGListen, FGSelectInput, FGTextInput, FieldGroup, useApiEffect } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { useHistory } from \"react-router\";\nimport * as Yup from \"yup\";\n\nimport { ClubApi, ClubDto, CountryApi } from \"../../../../api\";\nimport { FGCountrySelect, SmallFormGenerator } from \"../../../../components\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../hooks\";\nimport { useReferential } from \"../../../../hooks/useReferential\";\nimport { ETLCodes } from \"../../../../locales\";\n\nexport interface IClubAdressePageProps {\n clubId: number;\n editMode: boolean;\n}\n\nexport const ClubAdressePage: React.FunctionComponent = ({ clubId, editMode }) => {\n const { t } = useTl();\n const api = useApiService(ClubApi);\n const history = useHistory();\n const countryApi = useApiService(CountryApi);\n\n const [baseCountryId, baseCountryLoading] = useApiEffect(async () => await countryApi.getBelgianId(), []);\n\n const { data, loading, saveItem, saving } = useCrudApi(\n {\n getApiFn: (id = clubId) => (id > 0 ? api.get(id) : new ClubDto().toJSON()),\n saveApiFn: (d) => api.save(d),\n onSavedRoute: (d) => d && `${ERoutes.club}/${d.clubId}/adresse/edit`,\n deleteApiFn: () => {},\n },\n [clubId]\n );\n\n const [clubPostalCode, setClubPostalCode] = React.useState(\"\");\n const [terrainPostalCode, setTerrainPostalCode] = React.useState(\"\");\n\n React.useEffect(() => {\n if (data && clubPostalCode === \"\") {\n setClubPostalCode(data.postalCode);\n }\n }, [data, clubPostalCode]);\n\n React.useEffect(() => {\n if (data && terrainPostalCode === \"\") {\n setTerrainPostalCode(data.terrainPostalCode);\n }\n }, [data, terrainPostalCode]);\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n number: Yup.string().typeError(t(ETLCodes.MustBeANumber)),\n terrainNumber: Yup.string().typeError(t(ETLCodes.MustBeANumber)),\n terrainCountryId: Yup.number().nullable(),\n countryId: Yup.number().nullable(),\n });\n }, [t]);\n\n const [postalCodes, pcloading] = useReferential((a) => a.getStringifiedBelgianPostalCodes(), true, []);\n const [clubLocalities, clubLocloading] = useReferential(\n (a) => a.getStringifiedBelgianLocalityFromPostalCode(clubPostalCode ?? \"\"),\n false,\n [clubPostalCode]\n );\n\n const [terrainLocalities, terrainLocloading] = useReferential(\n (a) => a.getStringifiedBelgianLocalityFromPostalCode(terrainPostalCode ?? \"\"),\n false,\n [terrainPostalCode]\n );\n\n const [isTerrainBelgium, setIsTerrainBelgium] = React.useState(false);\n const [isClubBelgium, setClubIsBelgium] = React.useState(false);\n\n return (\n data &&\n !baseCountryLoading && (\n history.push(ERoutes.club)}\n saving={saving}\n >\n {\n if (value === baseCountryId) {\n setClubIsBelgium(true);\n } else {\n setClubIsBelgium(false);\n }\n }}\n />\n {\n if (isClubBelgium && value) {\n setClubPostalCode(value);\n }\n }}\n />\n\n {\n if (!value) {\n formik.setFieldValue(\"terrainCountryId\", baseCountryId);\n setIsTerrainBelgium(true);\n } else {\n if (value === baseCountryId) {\n setIsTerrainBelgium(true);\n } else {\n setIsTerrainBelgium(false);\n }\n }\n }}\n />\n {\n if (isTerrainBelgium && value) {\n setTerrainPostalCode(value);\n }\n }}\n />\n\n \n \n \n \n {isClubBelgium ? (\n \n ) : (\n \n )}\n \n \n {isClubBelgium ? (\n \n ) : (\n \n )}\n \n \n \n \n \n \n\n \n {isTerrainBelgium ? (\n \n ) : (\n \n )}\n \n \n {isTerrainBelgium ? (\n \n ) : (\n \n )}\n \n \n \n \n \n )\n );\n};\n","import * as React from \"react\";\nimport { ClubAllowedSectionsApi, SaveNewClubAllowedSectionDto } from \"../../../../../api\";\nimport { SmallFormGenerator } from \"../../../../../components\";\nimport { useApiService, useSaveApi, useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { useReferential } from \"../../../../../hooks/useReferential\";\nimport { FGSelectInput, FGTextInput, useApiEffect } from \"nsitools-react\";\nimport * as Yup from \"yup\";\nimport { useParams } from \"react-router\";\nimport { Spinner } from \"@blueprintjs/core\";\n\nexport interface IClubAllowedSectionsSelectorPanelProps {\n clubId: number;\n clubSectionId: number;\n onSaved: () => void;\n}\n\nexport const ClubAllowedSectionsSelectorPanel: React.FunctionComponent = ({\n clubId,\n clubSectionId = 0,\n onSaved,\n}) => {\n const api = useApiService(ClubAllowedSectionsApi);\n\n const [knownSection, loading] = useApiEffect(() => api.getClubAllowedSection(clubSectionId));\n\n const { t } = useTl();\n const { saving, saveItem } = useSaveApi(\n React.useMemo(\n () => ({\n saveApiFn: (data) => api.addNewClubAllowedSection(data),\n onSaveFn: () => onSaved(),\n }),\n [api, onSaved]\n )\n );\n\n const { id } = useParams<{ id: string }>();\n const [sections, sloading] = useReferential(\n (a) => (clubSectionId !== 0 ? a.getSectionsForClub(+id) : a.getSections()),\n false,\n []\n );\n\n const FormSchema = React.useMemo(() => {\n return Yup.object().shape({\n sectionId: Yup.number().nullable().required(t(ETLCodes.Required)),\n contactEmails: Yup.string()\n .nullable()\n .matches(new RegExp(\"^.+@.+\\\\.\\\\w+(?:;.+@.+\\\\.\\\\w+)*$\"), t(ETLCodes.MustBeValidSeparatedEmail)),\n });\n }, [t]);\n\n const initialData = React.useMemo(\n () => (clubSectionId !== 0 ? knownSection : new SaveNewClubAllowedSectionDto({ clubId: clubId }).toJSON()),\n [clubId, clubSectionId, knownSection]\n );\n\n return loading ? (\n \n ) : (\n \n \n \n \n );\n};\n","/* eslint-disable react/jsx-no-undef */\nimport { Classes, Colors, Dialog, Intent, ButtonGroup } from \"@blueprintjs/core\";\nimport { ButtonContainer, FieldSet, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport * as React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport styled from \"styled-components\";\n\nimport { ClubAllowedSectionsApi, ClubAllowedSectionsDto, ClubAllowedSectionsSearch } from \"../../../../../api\";\nimport { ERoutes } from \"../../../../../ERoutes\";\nimport {\n AddButton,\n CustomDataTable,\n DeleteButton,\n EditButton,\n EmailButton,\n ExportButton,\n} from \"../../../../../components\";\nimport { useGlobalData } from \"../../../../../contexts\";\nimport { useApiService, useDeleteApi, useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\nimport { ClubAllowedSectionsSelectorPanel } from \"./ClubAllowedSectionsSelectorPanel\";\n\nexport interface IClubAllowedSectionsPageProps {\n clubId: number;\n editMode: boolean;\n}\n\nconst Container = styled.div`\n flex: 1;\n height: 100%;\n & > .${Classes.PANEL_STACK} {\n height: 100%;\n }\n`;\n\nexport const ClubAllowedSectionsPage: React.FunctionComponent = ({\n clubId,\n editMode,\n}) => {\n const api = useApiService(ClubAllowedSectionsApi);\n const { t } = useTl();\n const { currentLanguage } = useGlobalData();\n const [dialogOpened, setDialogOpened] = React.useState(false);\n const [sobjState, setsobjState] = React.useState();\n const [clubSectionId, setclubSectionId] = React.useState(0);\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [15, 25, 50],\n pageSize: 15,\n sortKeys: { sectionName: \"ASC\" },\n });\n const searchFunction = React.useCallback(\n (sObj?: ClubAllowedSectionsSearch) => {\n setsobjState(\n ClubAllowedSectionsSearch.fromJS({\n ...sObj,\n languageId: currentLanguage.languageId,\n clubId: clubId,\n })\n );\n return api.baseSearch(\n ClubAllowedSectionsSearch.fromJS({\n ...sObj,\n languageId: currentLanguage.languageId,\n clubId: clubId,\n })\n );\n },\n [api, clubId, currentLanguage.languageId]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n const { deleteItem } = useDeleteApi(\n React.useMemo(\n () => ({\n deleteApiFn: (data) => api.deleteClubAllowedSection(data),\n onDeletedFn: () => search(),\n }),\n [api, search]\n )\n );\n\n const addItemFunction = React.useCallback(() => {\n setDialogOpened(true);\n }, []);\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n hidden: !editMode,\n render: (row: ClubAllowedSectionsDto) => (\n \n {\n deleteItem(row.clubSectionId);\n }}\n />\n {\n setclubSectionId(row.clubSectionId);\n addItemFunction();\n }}\n />\n \n ),\n },\n {\n header: () => t(ETLCodes.Section),\n fieldName: \"sectionName\",\n render: (row: ClubAllowedSectionsDto) => (\n \n {row.sectionName}\n \n ),\n },\n {\n header: () => t(ETLCodes.ContactEmails),\n fieldName: \"contactEmails\",\n render: (row: ClubAllowedSectionsDto) => {\n const emails = row.contactEmails?.split(\";\");\n\n return (\n
\n {emails?.map((email, i) => (\n <>\n \n \n ))}\n
\n );\n },\n },\n ],\n [addItemFunction, deleteItem, editMode, t]\n );\n\n React.useEffect(() => {\n search();\n }, [currentLanguage, search]);\n\n return (\n <>\n \n api.exportXlsFile(sObj)} sObj={sobjState} />\n {editMode && (\n {\n e.stopPropagation();\n addItemFunction();\n }}\n text={t(ETLCodes.General_Add)}\n intent={Intent.PRIMARY}\n />\n )}\n \n }\n >\n \n \n setDialogOpened(false)}\n canEscapeKeyClose={true}\n canOutsideClickClose={true}\n isCloseButtonShown={true}\n className={Classes.DIALOG}\n style={{ width: 500, background: Colors.WHITE }}\n >\n \n {\n setclubSectionId(0);\n setDialogOpened(false);\n search();\n }}\n />\n \n \n \n );\n};\n","/* eslint-disable react/jsx-no-undef */\nimport * as React from \"react\";\nimport { useApiService, useCrudApi, useTl } from \"../../../../hooks\";\nimport { FGCustomPanel, IDataTableColumn, Loading } from \"nsitools-react\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { SmallFormGenerator, SRSHCustomSelector } from \"../../../../components\";\nimport { BreedApi, BreedGridDto, BreedSearch, ClubApi, SaveClubAllowedBreedsDto } from \"../../../../api\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useParams } from \"react-router\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport { Link } from \"react-router-dom\";\n\nexport interface IClubAllowedBreedsPageProps {}\n\nexport const ClubAllowedBreedsPage: React.FunctionComponent = (props) => {\n const clubApi = useApiService(ClubApi);\n const breedApi = useApiService(BreedApi);\n const { id, state } = useParams<{ id: string; state: string }>();\n const { t } = useTl();\n const { currentLanguage } = useGlobalData();\n\n const { data, loading, saveItem, saving } = useCrudApi(\n {\n getApiFn: () => clubApi.getLinkedBreedsIds(+id),\n saveApiFn: (d) => clubApi.saveLinkedBreeds(d),\n onSavedRoute: (d) => `${ERoutes.kennel}/${+id}/breeds/edit`,\n },\n [id]\n );\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.BreedGroupLabel),\n computed: true,\n disableSorting: true,\n autoFitContent: true,\n fieldName: \"breedGroupLabel\",\n render: (row: BreedGridDto) => (\n \n {row.breedGroupNumber}. {row.breedGroupLabel}\n \n ),\n },\n {\n header: () => t(ETLCodes.Name),\n fieldName: \"name\",\n render: (item: BreedGridDto) => (\n \n {item.name}\n \n ),\n },\n ],\n [t]\n );\n\n const searchFunction = React.useCallback(\n (sObj) => breedApi.baseSearch(BreedSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [breedApi, currentLanguage.languageId]\n );\n\n const searchIdsFunction = React.useCallback(\n (sObj) => breedApi.getIds(BreedSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId })),\n [breedApi, currentLanguage.languageId]\n );\n\n return (\n \n \n \n {(ctx) => (\n ctx.formik.setFieldValue(\"breedIds\", ids)}\n idField=\"breedId\"\n searchFunction={searchFunction}\n searchIdsFunc={searchIdsFunction}\n editMode={state === \"edit\"}\n />\n )}\n \n \n \n );\n};\n","import * as React from \"react\";\nimport {\n ClubCompetitionRequestApi,\n ClubCompetitionRequestGridDto,\n ClubCompetitionRequestsSearch,\n CompetitionRequestGridDto,\n CompetitionRequestSearch,\n} from \"../../../../api\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { FieldSet, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { CustomDataTable, ExportButton } from \"../../../../components\";\nimport { Link } from \"react-router-dom\";\nimport { ERoutes } from \"../../../../ERoutes\";\nimport moment from \"moment\";\n\nexport interface IClubCompetitionRequestListProps {\n clubId: number;\n}\n\nexport const ClubCompetitionRequestList: React.FunctionComponent = ({ clubId }) => {\n const api = useApiService(ClubCompetitionRequestApi);\n const { t } = useTl();\n const { currentLanguage } = useGlobalData();\n const [sobjState, setsobjState] = React.useState();\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [15, 25, 50],\n pageSize: 15,\n sortKeys: { requestDate: \"DESC\" },\n });\n\n const searchFunction = React.useCallback(\n (sObj?: ClubCompetitionRequestsSearch) => {\n console.log(\"ClubId is \", clubId);\n setsobjState(\n ClubCompetitionRequestsSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, clubId: clubId })\n );\n return api.baseSearch(\n ClubCompetitionRequestsSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, clubId: clubId })\n );\n },\n [api, clubId, currentLanguage.languageId]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.RequestNumber),\n fieldName: \"requestNumber\",\n render: (row: ClubCompetitionRequestGridDto) => {\n return (\n \n {row.requestNumber}\n \n );\n },\n },\n {\n header: () => t(ETLCodes.RequestDate),\n fieldName: \"requestDate\",\n },\n {\n header: () => t(ETLCodes.RequestState),\n fieldName: \"requestState\",\n },\n {\n header: () => t(ETLCodes.CompetitionDate),\n fieldName: \"competitionDate\",\n render: (row: ClubCompetitionRequestGridDto) =>\n `${moment(row.dateFrom).format(\"DD/MM/YYYY\")}-${moment(row.dateTo).format(\"DD/MM/YYYY\")}`,\n },\n ],\n [t]\n );\n\n React.useEffect(() => {\n search();\n }, [currentLanguage, search]);\n return (\n api.exportXlsFile(sObj)} sObj={sobjState} />}\n >\n \n \n );\n};\n","import { FieldSet, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport * as React from \"react\";\n\nimport { ClubWorkbookRequestApi, ClubWorkbookRequestGridDto, ClubWorkbookRequestSearch } from \"../../../../api\";\nimport { CustomDataTable, ExportButton } from \"../../../../components\";\nimport { useGlobalData } from \"../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../hooks\";\nimport { ETLCodes } from \"../../../../locales\";\nimport { Link } from \"react-router-dom\";\nimport { getRouteStr } from \"../../../../utils/RequestRouteUtil\";\n\nexport interface IClubWorkbookRequestListProps {\n clubId: number;\n}\n\nexport const ClubWorkbookRequestList: React.FunctionComponent = ({ clubId }) => {\n const api = useApiService(ClubWorkbookRequestApi);\n const { t } = useTl();\n const { currentLanguage } = useGlobalData();\n const [sObjState, setsobjState] = React.useState();\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [15, 25, 50],\n pageSize: 15,\n sortKeys: { requestDate: \"DESC\" },\n });\n\n const searchFunction = React.useCallback(\n (sObj?: ClubWorkbookRequestSearch) => {\n setsobjState(\n ClubWorkbookRequestSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, clubId: clubId })\n );\n return api.baseSearch(\n ClubWorkbookRequestSearch.fromJS({ ...sObj, languageId: currentLanguage.languageId, clubId: clubId })\n );\n },\n [api, clubId, currentLanguage.languageId]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n\n const columns = React.useMemo(\n () => [\n {\n header: () => t(ETLCodes.RequestNumber),\n fieldName: \"requestNumber\",\n render: (row: ClubWorkbookRequestGridDto) => {\n return (\n \n {row.requestNumber}\n \n );\n },\n },\n {\n header: () => t(ETLCodes.RequestDate),\n fieldName: \"requestDate\",\n },\n ],\n [t]\n );\n\n React.useEffect(() => {\n search();\n }, [currentLanguage, search]);\n return (\n api.exportXlsFile(sObj)} sObj={sObjState} />}\n >\n \n \n );\n};\n","import * as React from \"react\";\nimport { ClubCompetitionRequestList } from \"../list/ClubCompetitionRequestList\";\nimport { ClubWorkbookRequestList } from \"../list/ClubWorkbookRequestList\";\nexport interface IClubFilePageProps {\n clubId: number;\n}\n\nexport const ClubFilePage: React.FunctionComponent = ({ clubId }) => {\n return (\n <>\n \n \n \n );\n};\n","import { Button } from \"@blueprintjs/core\";\nimport { ButtonContainer, IDataTableColumn, useGridState, useSearchApi } from \"nsitools-react\";\nimport * as React from \"react\";\n\nimport { AvailableJudgesApi, JudgeGridDto, PersonGridDto, ClubJudgeSearch } from \"../../../../../api\";\nimport { CustomDataTable, EmailButton } from \"../../../../../components\";\nimport { useGlobalData } from \"../../../../../contexts\";\nimport { useApiService, useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\n\nexport interface IClubJudgeSearchPanelProps {\n onPersonSelected: (person: PersonGridDto) => void;\n clubId: number;\n}\n\nexport const ClubJudgeSearchPanel: React.FunctionComponent = ({\n clubId,\n onPersonSelected,\n}) => {\n const api = useApiService(AvailableJudgesApi);\n const { currentLanguage } = useGlobalData();\n const { t } = useTl();\n\n const tableState = useGridState({\n serverMode: true,\n enablePagination: true,\n enableFilter: true,\n availablePageSizes: [5],\n pageSize: 5,\n sortKeys: { lastName: \"ASC\" },\n });\n\n const searchFunction = React.useCallback(\n (sObj?: ClubJudgeSearch) => {\n const sobj = ClubJudgeSearch.fromJS({\n ...sObj,\n clubId: clubId,\n languageId: currentLanguage.languageId,\n });\n return api.baseSearch(sobj);\n },\n [api, clubId, currentLanguage.languageId]\n );\n\n const { search, loading } = useSearchApi({\n searchFunction,\n tableState,\n initialSearch: true,\n trimSearchObjectStringValues: true,\n });\n\n const columns = React.useMemo(\n () => [\n {\n computed: true,\n disableSorting: true,\n fieldName: \"actions\",\n autoFitContent: true,\n render: (row: JudgeGridDto) => (\n \n {\n onPersonSelected(row);\n }}\n text={t(ETLCodes.Select)}\n />\n \n ),\n },\n {\n header: () => t(ETLCodes.LastName),\n fieldName: \"lastName\",\n render: (row: JudgeGridDto) => <>{row.name},\n },\n {\n header: () => t(ETLCodes.Language),\n fieldName: \"language\",\n },\n {\n header: () => t(ETLCodes.Email),\n fieldName: \"email\",\n render: (row: JudgeGridDto) => ,\n },\n {\n header: () => t(ETLCodes.PhoneNumber),\n fieldName: \"phoneNumber\",\n },\n {\n header: () => t(ETLCodes.MobilePhoneNumber),\n fieldName: \"mobilePhoneNumber\",\n },\n ],\n [onPersonSelected, t]\n );\n React.useEffect(() => {\n search();\n }, [currentLanguage, search]);\n return ;\n};\n","import { Button } from \"@blueprintjs/core\";\nimport { ButtonContainer, FGCheckboxInput, FGCustomInput, FGCustomPanel } from \"nsitools-react\";\nimport * as React from \"react\";\n\nimport { ClubJudgeApi, JudgeGridDto, SaveClubJudgeDto } from \"../../../../../api\";\nimport { SmallFormGenerator } from \"../../../../../components\";\nimport { useApiService, useSaveApi, useTl } from \"../../../../../hooks\";\nimport { ETLCodes } from \"../../../../../locales\";\n\nexport interface IClubJudgeSavePanelProps {\n onSaved: () => void;\n judge: JudgeGridDto;\n clubId: number;\n}\n\nexport const ClubJudgeSavePanel: React.FunctionComponent = ({ onSaved, judge, clubId }) => {\n const { t } = useTl();\n const api = useApiService(ClubJudgeApi);\n\n const { saving, saveItem } = useSaveApi(\n React.useMemo(\n () => ({\n saveApiFn: (data) => api.saveNewJudge(data),\n onSaveFn: () => onSaved(),\n }),\n [api, onSaved]\n )\n );\n const initialData = React.useMemo(\n () =>\n new SaveClubJudgeDto({\n clubId: clubId,\n judgeId: judge.judgeId,\n }),\n [clubId, judge.judgeId]\n );\n\n return (\n \n \n {(ctx) => <>{judge.name}}\n \n \n \n \n {(ctx) => (\n \n