@coopenomics/desktop 2.2.10 → 2025.4.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env-example +6 -1
- package/.env-testnet +8 -0
- package/Dockerfile +12 -0
- package/extensions/market/install.ts +78 -0
- package/extensions/market-admin/install.ts +42 -0
- package/extensions/participant/install.ts +125 -0
- package/extensions/powerup/install.ts +20 -0
- package/extensions/soviet/install.ts +83 -0
- package/package.json +6 -5
- package/quasar.config.cjs +5 -12
- package/src/app/App.vue +44 -73
- package/src/app/layouts/default.vue +40 -0
- package/src/app/layouts/useDefaultLayoutLogic.ts +59 -0
- package/src/app/providers/routes/index.ts +19 -34
- package/src/app/styles/style.css +4 -0
- package/src/boot/init.ts +6 -0
- package/src/boot/sentry.ts +1 -2
- package/src/desktops/index.ts +0 -6
- package/src/entities/Account/model/index.ts +1 -1
- package/src/entities/Agenda/api/index.ts +20 -0
- package/src/entities/Agenda/index.ts +2 -0
- package/src/entities/Agenda/model/index.ts +2 -0
- package/src/entities/Agenda/model/store.ts +36 -0
- package/src/entities/Agenda/model/types.ts +4 -0
- package/src/entities/Branch/model/index.ts +1 -1
- package/src/entities/Desktop/api/index.ts +16 -1
- package/src/entities/Desktop/model/store.ts +112 -106
- package/src/entities/Desktop/model/types.ts +14 -1
- package/src/entities/Document/api/index.ts +24 -0
- package/src/entities/Document/index.ts +2 -0
- package/src/entities/Document/model/store.ts +117 -0
- package/src/entities/Document/model/types.ts +18 -0
- package/src/entities/Meet/api/index.ts +58 -0
- package/src/entities/Meet/index.ts +2 -0
- package/src/entities/Meet/model/store.ts +72 -0
- package/src/entities/Meet/types/index.ts +7 -0
- package/src/entities/Payment/api/index.ts +20 -0
- package/src/entities/Payment/model/index.ts +2 -0
- package/src/entities/Payment/model/store.ts +62 -0
- package/src/entities/Payment/model/types.ts +7 -0
- package/src/entities/Session/model/store.ts +3 -3
- package/src/entities/System/model/store.ts +1 -1
- package/src/entities/User/model/stores.ts +3 -1
- package/src/entities/Wallet/api/index.ts +15 -33
- package/src/entities/Wallet/model/stores.ts +3 -23
- package/src/entities/Wallet/model/types.ts +2 -3
- package/src/features/Agreementer/SignAgreementDialog/ui/SignAgreementDialog.vue +1 -1
- package/src/features/Branch/SelectBranch/index.ts +2 -0
- package/src/features/Branch/SelectBranch/ui/SelectBranchOverlay.vue +52 -105
- package/src/features/Decision/CreateProject/ui/CreateProjectFreeDecisionButton.vue +1 -1
- package/src/features/Decision/ParticipantApplication/model/index.ts +38 -0
- package/src/features/FreeDecision/CreateProject/model/index.ts +92 -0
- package/src/features/FreeDecision/CreateProject/ui/CreateProjectFreeDecisionButton.vue +51 -0
- package/src/features/FreeDecision/CreateProject/ui/index.ts +1 -0
- package/src/features/FreeDecision/GenerateDecision/index.ts +1 -0
- package/src/features/FreeDecision/GenerateDecision/model/index.ts +36 -0
- package/src/features/FreeDecision/index.ts +2 -0
- package/src/features/Meet/CloseMeetWithDecision/index.ts +1 -0
- package/src/features/Meet/CloseMeetWithDecision/model/index.ts +92 -0
- package/src/features/Meet/CreateMeet/index.ts +2 -0
- package/src/features/Meet/CreateMeet/model/index.ts +65 -0
- package/src/features/Meet/CreateMeet/ui/CreateMeet.vue +34 -0
- package/src/features/Meet/CreateMeet/ui/CreateMeetForm.vue +136 -0
- package/src/features/Meet/CreateMeet/ui/index.ts +2 -0
- package/src/features/Meet/GenerateAgenda/index.ts +1 -0
- package/src/features/Meet/GenerateAgenda/model/index.ts +18 -0
- package/src/features/Meet/GenerateBallot/index.ts +1 -0
- package/src/features/Meet/GenerateBallot/model/index.ts +18 -0
- package/src/features/Meet/GenerateNotification/index.ts +1 -0
- package/src/features/Meet/GenerateNotification/model/index.ts +18 -0
- package/src/features/Meet/GenerateSovietDecision/index.ts +1 -0
- package/src/features/Meet/GenerateSovietDecision/model/index.ts +48 -0
- package/src/features/Meet/MeetDetailsManagement/index.ts +1 -0
- package/src/features/Meet/MeetDetailsManagement/model/index.ts +121 -0
- package/src/features/Meet/RestartMeet/index.ts +2 -0
- package/src/features/Meet/RestartMeet/model/index.ts +54 -0
- package/src/features/Meet/RestartMeet/ui/RestartMeet.vue +46 -0
- package/src/features/Meet/RestartMeet/ui/RestartMeetForm.vue +92 -0
- package/src/features/Meet/RestartMeet/ui/index.ts +2 -0
- package/src/features/Meet/VoteOnMeet/index.ts +1 -0
- package/src/features/Meet/VoteOnMeet/model/index.ts +18 -0
- package/src/features/Payment/SetStatus/api/index.ts +20 -0
- package/src/features/Payment/SetStatus/index.ts +1 -0
- package/src/features/Payment/SetStatus/model/index.ts +30 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderPaidStatusButton/SetOrderPaidStatusButton.vue +7 -3
- package/src/features/PaymentMethod/AddPaymentMethod/model/index.ts +2 -2
- package/src/features/PaymentMethod/AddPaymentMethod/ui/AddPaymentButton.vue +1 -1
- package/src/features/PaymentMethod/DeletePaymentMethod/model/index.ts +1 -1
- package/src/features/PaymentMethod/DeletePaymentMethod/ui/DeletePaymentMethodButton.vue +3 -1
- package/src/features/Request/CancelRequest/ui/CancelButton.vue +1 -1
- package/src/features/Request/ConfirmRecieveOnRequest/ui/ConfirmRecieveOnRequest.vue +1 -1
- package/src/features/Request/CreateParentOffer/ui/CreateParentOfferForm/CreateParentOfferForm.vue +3 -5
- package/src/features/Request/CreateParentOffer/ui/ImageUploaderWithPreview/ImageUploaderWithPreview.vue +4 -3
- package/src/features/Request/DisputeOnRequest/ui/DisputeOnRequestButton.vue +1 -1
- package/src/features/Request/ModerateRequest/ui/ModerateRequestButton.vue +2 -2
- package/src/features/Request/PublishRequest/ui/PublishRequestButton.vue +1 -1
- package/src/features/Request/RecieveOnRequest/ui/RecieveOnRequestButton.vue +1 -1
- package/src/features/Request/UnpublishRequest/ui/UnpublishRequestButton.vue +1 -1
- package/src/features/Union/AddCooperative/model/index.ts +4 -5
- package/src/features/Union/AddCooperative/ui/AddCooperativeForm.vue +5 -6
- package/src/features/User/AddUser/ui/AddUserDialog/AddUserDialog.vue +4 -4
- package/src/features/User/LoginUser/model/index.ts +3 -3
- package/src/features/User/LoginUser/ui/LoginForm/LoginForm.vue +0 -6
- package/src/features/User/Logout/model/index.ts +2 -0
- package/src/features/Wallet/DepositToWallet/ui/DepositButton/DepositButton.vue +8 -7
- package/src/features/Wallet/WithdrawFromWallet/ui/withdrawButton.vue +6 -7
- package/src/pages/Blank/index.ts +1 -0
- package/src/pages/Contacts/ContactsPage.vue +64 -0
- package/src/{widgets/Cooperative/Contacts → pages/Cooperative/ChangeContacts}/ui/index.ts +0 -1
- package/src/{widgets/Cooperative/Contributions/ui/ChangeContributions.vue → pages/Cooperative/ChangeRegisterPayments/ui/ChangeRegisterPayments.vue} +10 -11
- package/src/pages/Cooperative/ChangeRegisterPayments/ui/index.ts +1 -0
- package/src/pages/Cooperative/ListOfAgenda/index.ts +1 -0
- package/src/pages/Cooperative/ListOfAgenda/ui/ListOfAgendaQuestions.vue +118 -0
- package/src/pages/Cooperative/ListOfAgenda/ui/index.ts +1 -0
- package/src/pages/Cooperative/ListOfDocuments/ListOfDocumentsPage.vue +24 -0
- package/src/pages/Cooperative/ListOfMeets/model/index.ts +1 -0
- package/src/pages/Cooperative/ListOfMeets/model/model.ts +117 -0
- package/src/pages/Cooperative/ListOfMeets/ui/ListOfMeetsPage.vue +90 -0
- package/src/pages/Cooperative/ListOfMeets/ui/index.ts +1 -0
- package/src/pages/Cooperative/ListOfOrders/index.ts +1 -1
- package/src/pages/Cooperative/ListOfOrders/ui/ListOfOrdersPage.vue +0 -4
- package/src/pages/Cooperative/ListOfParticipants/ui/ListOfParticipantsPage.vue +61 -10
- package/src/pages/Cooperative/ListOfParticipants/ui/index.ts +1 -1
- package/src/pages/Cooperative/MeetDetails/ui/MeetDetailsPage.vue +88 -0
- package/src/pages/Cooperative/MeetDetails/ui/index.ts +1 -0
- package/src/pages/Cooperative/MemberBranchList/ui/index.ts +1 -0
- package/src/pages/Cooperative/Payments/index.ts +1 -0
- package/src/pages/Cooperative/Payments/ui/PaymentsPage.vue +7 -0
- package/src/pages/{ExtStore → ExtensionStore}/ExtensionPage/ExtensionPage.vue +35 -20
- package/src/pages/{ExtStore → ExtensionStore}/ExtensionsShowcase/ExtensionsShowcase.vue +2 -2
- package/src/pages/{ExtStore → ExtensionStore}/InstalledExtensions/InstalledExtensions.vue +2 -2
- package/src/pages/Marketplace/OfferPage/ui/OfferPage.vue +1 -1
- package/src/pages/Marketplace/Showcase/ui/ShowcasePage.vue +1 -1
- package/src/pages/Marketplace/SuppliesList/ui/SuppliesListPage.vue +1 -1
- package/src/pages/Marketplace/UserParentOffers/ui/UserParentOffersPage.vue +1 -1
- package/src/pages/Marketplace/UserSuppliesList/ui/UserSuppliesListPage.vue +1 -1
- package/src/pages/PermissionDenied/index.ts +1 -0
- package/src/pages/Registrator/SignUp/EmailInput.vue +2 -3
- package/src/pages/Registrator/SignUp/GenerateAccount.vue +2 -3
- package/src/pages/Registrator/SignUp/PayInitial.vue +1 -1
- package/src/pages/Registrator/SignUp/ReadStatement.vue +2 -2
- package/src/pages/Registrator/SignUp/SelectBranch.vue +2 -2
- package/src/pages/Registrator/SignUp/SignStatement.vue +2 -2
- package/src/pages/Registrator/SignUp/SignUp.vue +5 -12
- package/src/pages/Registrator/SignUp/WaitingRegistration.vue +1 -5
- package/src/pages/Registrator/SignUp/Welcome.vue +4 -3
- package/src/pages/Union/ConnectionAgreement/index.ts +1 -0
- package/src/pages/Union/ListOfCooperatives/ui/UnionPageListOfCooperatives.vue +139 -6
- package/src/pages/User/DocumentsPage/UserDocumentsPage.vue +23 -0
- package/src/pages/User/DocumentsPage/index.ts +1 -0
- package/src/pages/User/PaymentsPage/ui/UserPayments.vue +11 -0
- package/src/pages/User/PaymentsPage/ui/index.ts +1 -0
- package/src/pages/User/ProfilePage/index.ts +1 -0
- package/src/pages/User/ProfilePage/ui/ProfilePage.vue +114 -0
- package/src/pages/User/ProfilePage/ui/index.ts +1 -0
- package/src/pages/User/SettingsPage/ui/index.ts +1 -1
- package/src/pages/User/WalletPage/index.ts +1 -0
- package/src/pages/User/WalletPage/ui/WalletPage.vue +72 -0
- package/src/pages/User/WalletPage/ui/index.ts +1 -0
- package/src/processes/init-app/index.ts +28 -0
- package/src/processes/init-installed-extensions/index.ts +25 -0
- package/src/processes/init-wallet/index.ts +40 -0
- package/src/processes/navigation-guard-setup/index.ts +45 -0
- package/src/processes/process-decisions/index.ts +275 -0
- package/src/processes/select-branch/index.ts +80 -0
- package/src/processes/watch-branch-overlay/index.ts +38 -0
- package/src/processes/watch-desktop-health/index.ts +33 -0
- package/src/shared/api/alerts.ts +2 -6
- package/src/shared/api/axios.ts +4 -5
- package/src/shared/api/client.ts +3 -4
- package/src/shared/api/eosio.ts +1 -2
- package/src/shared/api/utils.ts +1 -3
- package/src/shared/config/index.ts +0 -1
- package/src/shared/hooks/index.ts +2 -0
- package/src/shared/hooks/useAgendaPoints.ts +24 -0
- package/src/shared/hooks/useWindowSize.ts +13 -0
- package/src/shared/lib/composables/useDisplayName.ts +34 -0
- package/src/shared/lib/navigation/index.ts +2 -0
- package/src/shared/lib/navigation/routeUtils.ts +51 -0
- package/src/shared/lib/navigation/useBackButton.ts +63 -0
- package/src/shared/lib/utils/dates/validateDateWithinRange.ts +23 -0
- package/src/shared/ui/BaseDocument/BaseDocument.vue +120 -90
- package/src/{components/menu/blockchainStatus.vue → shared/ui/BlockchainStatusBar/BlockchainStatusBar.vue} +1 -0
- package/src/shared/ui/BlockchainStatusBar/index.ts +1 -0
- package/src/shared/ui/CardStyles/index.scss +61 -0
- package/src/shared/ui/ComplexDocument/ComplexDocument.vue +31 -8
- package/src/shared/ui/CopyableInput/index.ts +1 -0
- package/src/shared/ui/CopyableInput/ui/CopyableInput.vue +62 -0
- package/src/shared/ui/EditableEntrepreneurCard/EditableEntrepreneurCard.vue +9 -8
- package/src/shared/ui/EditableIndividualCard/EditableIndividualCard.vue +10 -10
- package/src/shared/ui/EditableOrganizationCard/EditableOrganizationCard.vue +57 -47
- package/src/shared/ui/Form/Form.vue +3 -1
- package/src/shared/ui/InputStyles/index.scss +29 -0
- package/src/shared/ui/TabStyles/index.scss +53 -0
- package/src/shared/ui/index.ts +1 -0
- package/src/{components/history/AccountEvents.vue → widgets/AccountActions/AccountActionsPage.vue} +2 -2
- package/src/widgets/AccountActions/index.ts +1 -0
- package/src/widgets/BankDetailsCard/ui/BankDetailsCard.vue +2 -2
- package/src/widgets/BranchCard/ui/BranchCard.vue +2 -2
- package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/DocumentCard.vue +48 -0
- package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/DocumentsTable.vue +162 -0
- package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/ListOfDocumentsWidget.vue +77 -120
- package/src/widgets/Cooperative/Documents/ListOfDocuments/ui/index.ts +3 -1
- package/src/widgets/Cooperative/Orders/ListOfOrders/ui/ListOfOrdersWidget.vue +135 -128
- package/src/widgets/Cooperative/Orders/ListOfOrders/ui/OrderCard.vue +74 -0
- package/src/widgets/Cooperative/Orders/ListOfOrders/ui/index.ts +2 -1
- package/src/widgets/Cooperative/Payments/ListOfPayments/ui/ListOfPaymentsWidget.vue +216 -0
- package/src/widgets/Cooperative/Payments/ListOfPayments/ui/PaymentCard.vue +73 -0
- package/src/widgets/Cooperative/Payments/ListOfPayments/ui/index.ts +2 -0
- package/src/widgets/Cooperative/Payments/index.ts +1 -0
- package/src/widgets/Desktop/LeftDrawerMenu/LeftDrawerMenu.vue +3 -2
- package/src/widgets/Desktop/SecondLevelMenuList/SecondLevelMenuList.vue +58 -91
- package/src/widgets/Desktop/WorkspaceMenu/WorkspaceMenu.vue +114 -59
- package/src/widgets/{ExtStore/ExtensionCard → ExtensionCard}/ExtensionCard.vue +12 -7
- package/src/widgets/Header/BackButton/BackButton.vue +25 -0
- package/src/widgets/Header/BackButton/index.ts +1 -0
- package/src/widgets/Header/CommonHeader/CooperativeSettingsHeader.vue +34 -0
- package/src/widgets/Header/CommonHeader/ExtstoreHeader.vue +41 -0
- package/src/widgets/Header/CommonHeader/Header.vue +33 -198
- package/src/widgets/Header/CommonHeader/HeaderStyles.scss +22 -0
- package/src/widgets/Header/CommonHeader/MainHeader.vue +87 -0
- package/src/widgets/Header/CommonHeader/UserSettingsHeader.vue +29 -0
- package/src/widgets/Header/CommonHeader/index.ts +1 -1
- package/src/widgets/Header/SettingsDropdown/SettingsDropdown.vue +0 -6
- package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Base/Base.vue +1 -2
- package/src/widgets/Meets/MeetDetailsActions/MeetDetailsActions.vue +51 -0
- package/src/widgets/Meets/MeetDetailsActions/index.ts +1 -0
- package/src/widgets/Meets/MeetDetailsActions/model.ts +46 -0
- package/src/widgets/Meets/MeetDetailsAgenda/MeetDetailsAgenda.vue +29 -0
- package/src/widgets/Meets/MeetDetailsAgenda/index.ts +1 -0
- package/src/widgets/Meets/MeetDetailsHeader/MeetDetailsHeader.vue +40 -0
- package/src/widgets/Meets/MeetDetailsHeader/index.ts +1 -0
- package/src/widgets/Meets/MeetDetailsVoting/MeetDetailsVoting.vue +77 -0
- package/src/widgets/Meets/MeetDetailsVoting/index.ts +1 -0
- package/src/widgets/Meets/MeetDetailsVoting/model.ts +117 -0
- package/src/widgets/Meets/MeetInfoCard/ui/MeetInfoCard.vue +38 -0
- package/src/widgets/Meets/MeetInfoCard/ui/index.ts +1 -0
- package/src/widgets/Meets/MeetsTable/ui/MeetsTable.vue +118 -0
- package/src/widgets/Meets/MeetsTable/ui/index.ts +1 -0
- package/src/widgets/Participants/index.ts +1 -0
- package/src/widgets/Participants/ui/ParticipantCard.vue +89 -0
- package/src/widgets/Participants/ui/ParticipantDetails.vue +79 -0
- package/src/widgets/Participants/ui/ParticipantsTable.vue +129 -0
- package/src/widgets/Participants/ui/index.ts +4 -0
- package/src/widgets/Questions/index.ts +3 -0
- package/src/widgets/Questions/ui/QuestionCard/QuestionCard.vue +109 -0
- package/src/widgets/Questions/ui/QuestionCard/index.ts +1 -0
- package/src/widgets/Questions/ui/QuestionsTable/QuestionsTable.vue +177 -0
- package/src/widgets/Questions/ui/QuestionsTable/index.ts +1 -0
- package/src/widgets/Questions/ui/VotingButtons/VotingButtons.vue +75 -0
- package/src/widgets/Questions/ui/VotingButtons/index.ts +1 -0
- package/src/widgets/Questions/ui/index.ts +3 -0
- package/src/widgets/RequireAgreements/index.ts +1 -0
- package/src/widgets/User/PaymentMethods/ui/PaymentMethods.vue +81 -85
- package/tsconfig.json +1 -1
- package/extensions/powerup/boot.ts +0 -17
- package/src/app/providers/card/store.ts +0 -42
- package/src/boot/branch-selector.ts +0 -40
- package/src/boot/init-stores.ts +0 -51
- package/src/boot/navigation-guards.ts +0 -46
- package/src/components/menu/footerMobileMenu.vue +0 -79
- package/src/components/soviet/index.vue +0 -76
- package/src/components/soviet/staff.vue +0 -274
- package/src/desktops/User/index.ts +0 -1
- package/src/desktops/User/model/index.ts +0 -329
- package/src/entities/Menu/model/store.ts +0 -69
- package/src/entities/Menu/model/types.ts +0 -11
- package/src/entities/Menu/ui/index.ts +0 -1
- package/src/entities/Order/api/index.ts +0 -14
- package/src/entities/Order/model/store.ts +0 -87
- package/src/features/Order/SetStatus/api/index.ts +0 -7
- package/src/features/Order/SetStatus/model/index.ts +0 -23
- package/src/pages/Cooperative/Contacts/ui/ContactsPage.vue +0 -7
- package/src/pages/Cooperative/ListOfBranches/ui/index.ts +0 -1
- package/src/pages/Documentor/ListOfDocuments/ListOfDocumentsPage.vue +0 -12
- package/src/pages/Union/Connection/index.ts +0 -1
- package/src/pages/_layouts/blank.vue +0 -24
- package/src/pages/_layouts/default.vue +0 -79
- package/src/types/index.ts +0 -3
- package/src/widgets/Commutator/Commutator.vue +0 -7
- package/src/widgets/Commutator/index.ts +0 -1
- package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/ListOfQuestions.vue +0 -273
- package/src/widgets/Cooperative/Agenda/ListOfQuestions/ui/index.ts +0 -1
- package/src/widgets/Cooperative/Contacts/ui/Contacts.vue +0 -52
- package/src/widgets/Cooperative/Contributions/ui/index.ts +0 -1
- package/src/widgets/Cooperative/Description/ui/SetDescription.vue +0 -4
- package/src/widgets/Cooperative/Description/ui/index.ts +0 -1
- package/src/widgets/Cooperative/Participants/ListOfParticipants/ui/ListOfParticipantsWidget.vue +0 -186
- package/src/widgets/Cooperative/Participants/ListOfParticipants/ui/index.ts +0 -1
- package/src/widgets/Desktop/SecondLevelMenu/SecondLevelMenu.vue +0 -59
- package/src/widgets/Desktop/SecondLevelMenu/index.ts +0 -1
- package/src/widgets/IndividualCard/ui/IndividualCard.vue +0 -170
- package/src/widgets/IndividualCard/ui/index.ts +0 -1
- package/src/widgets/OrganizationCard/ui/OrganizationCard.vue +0 -44
- package/src/widgets/OrganizationCard/ui/index.ts +0 -1
- package/src/widgets/Union/ListOfCooperatives/ui/UnionListOfCooperatives.vue +0 -136
- package/src/widgets/Union/ListOfCooperatives/ui/index.ts +0 -1
- package/src/entities/{Menu → Document}/model/index.ts +0 -0
- package/src/entities/{Order → Meet}/model/index.ts +0 -0
- package/src/entities/{Order → Payment}/index.ts +0 -0
- package/src/features/{Order/SetStatus → Decision/ParticipantApplication}/index.ts +0 -0
- package/src/{widgets/Request/SupplyOrderRequestCard → features/FreeDecision/CreateProject}/index.ts +0 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderCompletedStatusButton/SetOrderCompletedStatusButton.vue +0 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderCompletedStatusButton/index.ts +0 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderPaidStatusButton/index.ts +0 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderRefundedStatusButton/SetOrderRefundedStatusButton.vue +0 -0
- package/src/features/{Order → Payment}/SetStatus/ui/SetOrderRefundedStatusButton/index.ts +0 -0
- package/src/pages/{blank/blank.vue → Blank/BlankPage.vue} +0 -0
- package/src/pages/{Cooperative/Contacts/ui → Contacts}/index.ts +0 -0
- package/src/pages/Cooperative/{Contacts → ChangeContacts}/index.ts +0 -0
- package/src/{widgets/Cooperative/Contacts → pages/Cooperative/ChangeContacts}/ui/ChangeContacts.vue +0 -0
- package/src/pages/Cooperative/{ListOfBranches → ChangeRegisterPayments}/index.ts +0 -0
- package/src/pages/{Documentor → Cooperative}/ListOfDocuments/index.ts +0 -0
- package/src/pages/{Installer → Cooperative/ListOfMeets}/index.ts +0 -0
- package/src/{widgets/Cooperative/Agenda/ListOfQuestions → pages/Cooperative/MeetDetails}/index.ts +0 -0
- package/src/{widgets/Cooperative/Contacts → pages/Cooperative/MemberBranchList}/index.ts +0 -0
- package/src/pages/Cooperative/{ListOfBranches/ui/ListOfBranchesPage.vue → MemberBranchList/ui/MemberBranchListPage.vue} +0 -0
- package/src/pages/{ExtStore → ExtensionStore}/BaseRoute/ExtensionStoreBase.vue +0 -0
- package/src/pages/{ExtStore → ExtensionStore}/BaseRoute/index.ts +0 -0
- package/src/pages/{ExtStore → ExtensionStore}/ExtensionPage/index.ts +0 -0
- package/src/pages/{ExtStore → ExtensionStore}/ExtensionsShowcase/index.ts +0 -0
- package/src/pages/{ExtStore → ExtensionStore}/InstalledExtensions/index.ts +0 -0
- package/src/pages/{_layouts/permissionDenied.vue → PermissionDenied/PermissionDenied.vue} +0 -0
- package/src/pages/Union/{Connection/ConnectionPage.vue → ConnectionAgreement/ConnectionAgreementPage.vue} +0 -0
- package/src/{widgets/Cooperative/Contributions → pages/Union/InstallCooperative}/index.ts +0 -0
- package/src/pages/{Installer → Union/InstallCooperative}/ui/InstallCooperativePage.vue +0 -0
- package/src/pages/{Installer → Union/InstallCooperative}/ui/index.ts +0 -0
- package/src/{widgets/Cooperative/Participants/ListOfParticipants → pages/User/PaymentsPage}/index.ts +0 -0
- package/src/{components/history → widgets/AccountActions}/AccountLink.vue +0 -0
- package/src/{components/history → widgets/AccountActions}/ActionCell.vue +0 -0
- package/src/{components/history → widgets/AccountActions}/DataCell.vue +0 -0
- package/src/widgets/{IndividualCard → Cooperative/Payments/ListOfPayments}/index.ts +0 -0
- package/src/widgets/{ExtStore/ExtensionCard → ExtensionCard}/index.ts +0 -0
- package/src/widgets/{Request → Marketplace}/CreateChildOrderCard/CreateChildOrderCard.vue +0 -0
- package/src/widgets/{Request → Marketplace}/CreateChildOrderCard/index.ts +0 -0
- package/src/widgets/{Request → Marketplace}/RequestCard/RequestCard.vue +0 -0
- package/src/widgets/{Request → Marketplace}/RequestCard/index.ts +0 -0
- package/src/{entities/Menu → widgets/Marketplace/SupplyOrderRequestCard}/index.ts +1 -1
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/model/index.ts +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/model/types.ts +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Base/index.ts +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/EightStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FifthStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FirstStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/FourthStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SecondStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SeventhStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/SixthStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/ThirdStep.vue +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/Steps/index.ts +0 -0
- /package/src/widgets/{Request → Marketplace}/SupplyOrderRequestCard/ui/index.ts +0 -0
- /package/src/widgets/{OrganizationCard → Meets/MeetInfoCard}/index.ts +0 -0
- /package/src/widgets/{Union/ListOfCooperatives → Meets/MeetsTable}/index.ts +0 -0
- /package/src/widgets/{Agreementer/RequireAgreements → RequireAgreements}/ui/RequireAgreements.vue +0 -0
- /package/src/widgets/{Agreementer/RequireAgreements → RequireAgreements}/ui/index.ts +0 -0
@@ -0,0 +1,80 @@
|
|
1
|
+
import { computed, ref } from 'vue'
|
2
|
+
import { useSelectBranch } from 'src/features/Branch/SelectBranch'
|
3
|
+
import { useSystemStore } from 'src/entities/System/model'
|
4
|
+
import { useSessionStore } from 'src/entities/Session'
|
5
|
+
import { useBranchStore } from 'src/entities/Branch/model'
|
6
|
+
import { DigitalDocument } from 'src/shared/lib/document'
|
7
|
+
import { SuccessAlert, FailAlert } from 'src/shared/api'
|
8
|
+
import { Cooperative } from 'cooptypes'
|
9
|
+
|
10
|
+
export function useSelectBranchProcess() {
|
11
|
+
const title = ref('Выберите кооперативный участок')
|
12
|
+
const step = ref(1)
|
13
|
+
const isSubmitting = ref(false)
|
14
|
+
const isLoading = ref(false)
|
15
|
+
const selectedBranch = ref('')
|
16
|
+
const document = ref()
|
17
|
+
|
18
|
+
const digitalDocument = new DigitalDocument()
|
19
|
+
|
20
|
+
const system = useSystemStore()
|
21
|
+
const session = useSessionStore()
|
22
|
+
const branchStore = useBranchStore()
|
23
|
+
const { selectBranch } = useSelectBranch()
|
24
|
+
|
25
|
+
const branches = computed(() => branchStore.publicBranches)
|
26
|
+
|
27
|
+
if (session.isAuth) {
|
28
|
+
branchStore.loadPublicBranches({ coopname: system.info.coopname })
|
29
|
+
}
|
30
|
+
|
31
|
+
const next = async () => {
|
32
|
+
isLoading.value = true
|
33
|
+
document.value = await digitalDocument.generate<Cooperative.Registry.SelectBranchStatement.Action>({
|
34
|
+
registry_id: Cooperative.Registry.SelectBranchStatement.registry_id,
|
35
|
+
coopname: system.info.coopname,
|
36
|
+
username: session.username,
|
37
|
+
braname: selectedBranch.value,
|
38
|
+
})
|
39
|
+
isLoading.value = false
|
40
|
+
step.value++
|
41
|
+
}
|
42
|
+
|
43
|
+
const back = () => {
|
44
|
+
step.value--
|
45
|
+
}
|
46
|
+
|
47
|
+
const sign = async () => {
|
48
|
+
try {
|
49
|
+
isSubmitting.value = true
|
50
|
+
const doc = await digitalDocument.sign()
|
51
|
+
|
52
|
+
await selectBranch({
|
53
|
+
braname: selectedBranch.value,
|
54
|
+
coopname: system.info.coopname,
|
55
|
+
document: doc,
|
56
|
+
username: session.username,
|
57
|
+
})
|
58
|
+
|
59
|
+
useSelectBranch().isVisible.value = false
|
60
|
+
SuccessAlert('Кооперативный участок выбран')
|
61
|
+
} catch (e: any) {
|
62
|
+
FailAlert(e)
|
63
|
+
} finally {
|
64
|
+
isSubmitting.value = false
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
return {
|
69
|
+
title,
|
70
|
+
step,
|
71
|
+
selectedBranch,
|
72
|
+
branches,
|
73
|
+
document,
|
74
|
+
isSubmitting,
|
75
|
+
isLoading,
|
76
|
+
next,
|
77
|
+
back,
|
78
|
+
sign,
|
79
|
+
}
|
80
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { watch } from 'vue'
|
2
|
+
import { useAccountStore } from 'src/entities/Account/model'
|
3
|
+
import { useSessionStore } from 'src/entities/Session'
|
4
|
+
import { useSystemStore } from 'src/entities/System/model'
|
5
|
+
import { useSelectBranch } from 'src/features/Branch/SelectBranch/model'
|
6
|
+
|
7
|
+
export function useBranchOverlayProcess() {
|
8
|
+
const session = useSessionStore()
|
9
|
+
const system = useSystemStore()
|
10
|
+
const account = useAccountStore()
|
11
|
+
const { isVisible } = useSelectBranch()
|
12
|
+
|
13
|
+
const checkConditions = () => {
|
14
|
+
const branched = system.info?.cooperator_account?.is_branched
|
15
|
+
const participant = account?.account?.participant_account
|
16
|
+
const noBraname = participant?.braname === ''
|
17
|
+
|
18
|
+
// показываем оверлей выбора КУ, если
|
19
|
+
// пользователь - авторизован,
|
20
|
+
// кооператив - в мажоритарном режиме (branched),
|
21
|
+
// пользователь - это пайщик,
|
22
|
+
// и у пользователя не выбран КУ
|
23
|
+
isVisible.value = !!(
|
24
|
+
session.isAuth &&
|
25
|
+
branched &&
|
26
|
+
participant &&
|
27
|
+
noBraname
|
28
|
+
)
|
29
|
+
}
|
30
|
+
|
31
|
+
checkConditions()
|
32
|
+
|
33
|
+
watch(
|
34
|
+
[() => session.isAuth, () => system.info, () => account.account],
|
35
|
+
checkConditions,
|
36
|
+
{ deep: true }
|
37
|
+
)
|
38
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
// processes/watch-desktop-health/index.ts
|
2
|
+
import { watch } from 'vue'
|
3
|
+
import { QSpinnerGears, useQuasar } from 'quasar'
|
4
|
+
import { useDesktopStore } from 'src/entities/Desktop/model'
|
5
|
+
|
6
|
+
export function useDesktopHealthWatcherProcess() {
|
7
|
+
const $q = useQuasar()
|
8
|
+
const desktop = useDesktopStore()
|
9
|
+
|
10
|
+
const enableLoading = () => {
|
11
|
+
$q.loading.show({
|
12
|
+
spinner: QSpinnerGears,
|
13
|
+
message: 'Техническое обслуживание..',
|
14
|
+
spinnerSize: 50,
|
15
|
+
})
|
16
|
+
}
|
17
|
+
|
18
|
+
const disableLoading = () => {
|
19
|
+
$q.loading.hide()
|
20
|
+
}
|
21
|
+
|
22
|
+
const check = () => {
|
23
|
+
if (desktop.online === false) {
|
24
|
+
enableLoading()
|
25
|
+
} else {
|
26
|
+
disableLoading()
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
check()
|
31
|
+
|
32
|
+
watch(() => desktop.online, check)
|
33
|
+
}
|
package/src/shared/api/alerts.ts
CHANGED
@@ -11,7 +11,8 @@ export function SuccessAlert(message: string): void {
|
|
11
11
|
})
|
12
12
|
}
|
13
13
|
|
14
|
-
export function FailAlert(
|
14
|
+
export function FailAlert(error: any): void{
|
15
|
+
const message = extractGraphQLErrorMessages(error)
|
15
16
|
Notify.create({
|
16
17
|
message,
|
17
18
|
type: 'negative',
|
@@ -20,8 +21,3 @@ export function FailAlert(message: string): void {
|
|
20
21
|
]
|
21
22
|
})
|
22
23
|
}
|
23
|
-
|
24
|
-
export function failAlert(error: any): void{
|
25
|
-
const message = extractGraphQLErrorMessages(error)
|
26
|
-
FailAlert(message)
|
27
|
-
}
|
package/src/shared/api/axios.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import axios from 'axios';
|
2
|
-
import { BACKEND_URL } from '../config';
|
3
2
|
import { useGlobalStore } from '../store';
|
4
3
|
|
5
4
|
export async function sendGET(
|
@@ -14,7 +13,7 @@ export async function sendGET(
|
|
14
13
|
// if (!tokens || !tokens.access || !tokens.access.token)
|
15
14
|
// throw new Error('Ошибка авторизации: токен доступа не найден');
|
16
15
|
|
17
|
-
const response = await axios.get(BACKEND_URL + url, {
|
16
|
+
const response = await axios.get(process.env.BACKEND_URL + url, {
|
18
17
|
params,
|
19
18
|
headers: {
|
20
19
|
Authorization: `Bearer ${tokens?.access?.token}`,
|
@@ -22,7 +21,7 @@ export async function sendGET(
|
|
22
21
|
});
|
23
22
|
return response.data;
|
24
23
|
} else {
|
25
|
-
const response = await axios.get(BACKEND_URL + url, {
|
24
|
+
const response = await axios.get(process.env.BACKEND_URL + url, {
|
26
25
|
params,
|
27
26
|
});
|
28
27
|
return response.data;
|
@@ -50,14 +49,14 @@ export async function sendPOST(
|
|
50
49
|
// if (!tokens || !tokens.access || !tokens.access.token)
|
51
50
|
// throw new Error('Ошибка авторизации: токен доступа не найден');
|
52
51
|
|
53
|
-
const response = await axios.post(BACKEND_URL + url, data, {
|
52
|
+
const response = await axios.post(process.env.BACKEND_URL + url, data, {
|
54
53
|
headers: {
|
55
54
|
Authorization: `Bearer ${tokens?.access?.token}`,
|
56
55
|
},
|
57
56
|
});
|
58
57
|
return response.data;
|
59
58
|
} else {
|
60
|
-
const response = await axios.post(BACKEND_URL + url, data);
|
59
|
+
const response = await axios.post(process.env.BACKEND_URL + url, data);
|
61
60
|
return response.data;
|
62
61
|
}
|
63
62
|
} catch (e: any) {
|
package/src/shared/api/client.ts
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
import { Client } from '@coopenomics/sdk'
|
2
|
-
import { BACKEND_URL, CHAIN_ID, CHAIN_URL } from '../config'
|
3
2
|
|
4
3
|
// Создаем и экспортируем экземпляр API-клиента
|
5
4
|
export const client = Client.create({
|
6
|
-
api_url: BACKEND_URL + '/v1/graphql',
|
5
|
+
api_url: process.env.BACKEND_URL + '/v1/graphql',
|
7
6
|
headers: {
|
8
7
|
'Content-Type': 'application/json',
|
9
8
|
},
|
10
|
-
chain_url: CHAIN_URL,
|
11
|
-
chain_id: CHAIN_ID,
|
9
|
+
chain_url: process.env.CHAIN_URL as string,
|
10
|
+
chain_id: process.env.CHAIN_ID as string,
|
12
11
|
})
|
13
12
|
|
package/src/shared/api/eosio.ts
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
import { TransactResult } from '@wharfkit/session';
|
2
2
|
import { APIClient, PrivateKey } from '@wharfkit/antelope';
|
3
3
|
import { ContractKit } from '@wharfkit/contract';
|
4
|
-
import { CHAIN_URL } from '../config/Env';
|
5
4
|
import { useGlobalStore } from '../store';
|
6
5
|
import { Account } from '@wharfkit/account'
|
7
6
|
|
8
7
|
export const readBlockchain = new APIClient({
|
9
|
-
url: CHAIN_URL,
|
8
|
+
url: process.env.CHAIN_URL,
|
10
9
|
});
|
11
10
|
|
12
11
|
export const contractKit = new ContractKit({
|
package/src/shared/api/utils.ts
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
import type { Mutations } from '@coopenomics/sdk'
|
2
|
+
|
3
|
+
export type AgendaPoint = Mutations.Meet.CreateAnnualGeneralMeet.IInput['data']['agenda'][number]
|
4
|
+
|
5
|
+
export function useAgendaPoints(points: AgendaPoint[]) {
|
6
|
+
const addAgendaPoint = () => {
|
7
|
+
points.push({
|
8
|
+
title: '',
|
9
|
+
context: '',
|
10
|
+
decision: ''
|
11
|
+
})
|
12
|
+
}
|
13
|
+
|
14
|
+
const removeAgendaPoint = (index: number) => {
|
15
|
+
if (points.length > 1) {
|
16
|
+
points.splice(index, 1)
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
return {
|
21
|
+
addAgendaPoint,
|
22
|
+
removeAgendaPoint
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { computed } from 'vue'
|
2
|
+
import { useWindowSize as vueWindowSize } from 'vue-window-size'
|
3
|
+
|
4
|
+
export const useWindowSize = () => {
|
5
|
+
const { width } = vueWindowSize()
|
6
|
+
|
7
|
+
const isMobile = computed(() => width.value < 768)
|
8
|
+
|
9
|
+
return {
|
10
|
+
width,
|
11
|
+
isMobile
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { computed } from 'vue';
|
2
|
+
import type { IEntrepreneurData, IIndividualData, IOrganizationData } from 'src/shared/lib/types/user/IUserData';
|
3
|
+
|
4
|
+
export function useDisplayName(privateData: IEntrepreneurData | IIndividualData | IOrganizationData | null) {
|
5
|
+
const displayName = computed(() => {
|
6
|
+
if (!privateData) return '';
|
7
|
+
|
8
|
+
if ('short_name' in privateData) {
|
9
|
+
// Это организация
|
10
|
+
return privateData.short_name;
|
11
|
+
} else if ('first_name' in privateData && 'last_name' in privateData) {
|
12
|
+
// Это физлицо или ИП
|
13
|
+
return `${privateData.last_name} ${privateData.first_name} ${privateData.middle_name || ''}`.trim();
|
14
|
+
}
|
15
|
+
|
16
|
+
return '';
|
17
|
+
});
|
18
|
+
|
19
|
+
const isIP = computed(() => {
|
20
|
+
if (!privateData) return false;
|
21
|
+
|
22
|
+
// Проверка на предпринимателя - наличие полей details.inn и details.ogrn, но нет short_name
|
23
|
+
return !('short_name' in privateData) &&
|
24
|
+
'details' in privateData &&
|
25
|
+
privateData.details &&
|
26
|
+
'inn' in privateData.details &&
|
27
|
+
'ogrn' in privateData.details;
|
28
|
+
});
|
29
|
+
|
30
|
+
return {
|
31
|
+
displayName,
|
32
|
+
isIP
|
33
|
+
};
|
34
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { RouteLocationNormalizedLoaded } from 'vue-router'
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Получает глубину текущего маршрута
|
5
|
+
*
|
6
|
+
* @param route Текущий маршрут
|
7
|
+
* @returns Глубина маршрута (количество уровней вложенности)
|
8
|
+
*/
|
9
|
+
export function getRouteDepth(route: RouteLocationNormalizedLoaded): number {
|
10
|
+
return route.matched?.length || 0
|
11
|
+
}
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Получает родительский маршрут для текущего маршрута
|
15
|
+
*
|
16
|
+
* @param route Текущий маршрут
|
17
|
+
* @returns Родительский маршрут или null, если его нет
|
18
|
+
*/
|
19
|
+
export function getParentRoute(route: RouteLocationNormalizedLoaded) {
|
20
|
+
const matched = route.matched || []
|
21
|
+
if (matched.length < 2) {
|
22
|
+
return null
|
23
|
+
}
|
24
|
+
|
25
|
+
return matched[matched.length - 2]
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Проверяет, есть ли у маршрута родительский маршрут
|
30
|
+
*
|
31
|
+
* @param route Текущий маршрут
|
32
|
+
* @returns true, если у маршрута есть родитель, иначе false
|
33
|
+
*/
|
34
|
+
export function hasParentRoute(route: RouteLocationNormalizedLoaded): boolean {
|
35
|
+
return getParentRoute(route) !== null
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Получает заголовок маршрута из его метаданных
|
40
|
+
*
|
41
|
+
* @param route Маршрут
|
42
|
+
* @param defaultTitle Заголовок по умолчанию, если в маршруте не указан
|
43
|
+
* @returns Заголовок маршрута
|
44
|
+
*/
|
45
|
+
export function getRouteTitle(route: RouteLocationNormalizedLoaded | null, defaultTitle = 'Назад'): string {
|
46
|
+
if (!route || !route.meta || !route.meta.title) {
|
47
|
+
return defaultTitle
|
48
|
+
}
|
49
|
+
|
50
|
+
return route.meta.title as string
|
51
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { onMounted, onUnmounted } from 'vue'
|
2
|
+
import { useRouter } from 'vue-router'
|
3
|
+
import { useDesktopStore } from 'src/entities/Desktop/model'
|
4
|
+
import type { IBackNavigationButton } from 'src/entities/Desktop/model/types'
|
5
|
+
|
6
|
+
interface BackButtonOptions {
|
7
|
+
text: string
|
8
|
+
routeName?: string
|
9
|
+
params?: Record<string, string>
|
10
|
+
componentId: string
|
11
|
+
onClick?: () => void
|
12
|
+
}
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Хук для работы с кнопкой навигации "назад"
|
16
|
+
*
|
17
|
+
* @param options - объект с настройками кнопки
|
18
|
+
* @returns Функции для управления кнопкой
|
19
|
+
*/
|
20
|
+
export function useBackButton(options: BackButtonOptions) {
|
21
|
+
const router = useRouter()
|
22
|
+
const desktopStore = useDesktopStore()
|
23
|
+
|
24
|
+
// Устанавливаем кнопку навигации назад
|
25
|
+
function setBackButton() {
|
26
|
+
// Формируем данные для кнопки
|
27
|
+
const button: IBackNavigationButton = {
|
28
|
+
text: options.text,
|
29
|
+
componentId: options.componentId,
|
30
|
+
onClick: options.onClick || (() => {
|
31
|
+
if (options.routeName) {
|
32
|
+
router.push({
|
33
|
+
name: options.routeName,
|
34
|
+
params: options.params || {}
|
35
|
+
})
|
36
|
+
} else {
|
37
|
+
router.back()
|
38
|
+
}
|
39
|
+
})
|
40
|
+
}
|
41
|
+
|
42
|
+
desktopStore.setBackNavigationButton(button)
|
43
|
+
}
|
44
|
+
|
45
|
+
// Удаляем кнопку навигации назад
|
46
|
+
function removeBackButton() {
|
47
|
+
desktopStore.removeBackNavigationButton(options.componentId)
|
48
|
+
}
|
49
|
+
|
50
|
+
// Автоматически устанавливаем и удаляем кнопку
|
51
|
+
onMounted(() => {
|
52
|
+
setBackButton()
|
53
|
+
})
|
54
|
+
|
55
|
+
onUnmounted(() => {
|
56
|
+
removeBackButton()
|
57
|
+
})
|
58
|
+
|
59
|
+
return {
|
60
|
+
setBackButton,
|
61
|
+
removeBackButton
|
62
|
+
}
|
63
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import moment from 'moment-with-locales-es6';
|
2
|
+
|
3
|
+
export function validateDateWithinRange(yearsAgo, yearsAhead = 0) {
|
4
|
+
return (val) => {
|
5
|
+
const inputDate = moment(val, 'YYYY/MM/DD HH:mm', true); // указание формата для парсинга
|
6
|
+
const lowerLimit = moment().subtract(Math.abs(yearsAgo), 'years'); // Предел в прошлом
|
7
|
+
const upperLimit = moment().add(Math.abs(yearsAhead), 'years'); // Предел в будущем
|
8
|
+
|
9
|
+
if (!inputDate.isValid()) {
|
10
|
+
return 'Неверный формат даты';
|
11
|
+
}
|
12
|
+
|
13
|
+
if (inputDate.isBefore(lowerLimit)) {
|
14
|
+
return `Дата не может быть раньше ${lowerLimit.format('YYYY/MM/DD HH:mm')}`;
|
15
|
+
}
|
16
|
+
|
17
|
+
if (inputDate.isAfter(upperLimit)) {
|
18
|
+
return `Дата не может быть позже ${upperLimit.format('YYYY/MM/DD HH:mm')}`;
|
19
|
+
}
|
20
|
+
|
21
|
+
return true;
|
22
|
+
};
|
23
|
+
}
|