@nerdjs/sales-kit 2.0.35-alpha.2 → 2.0.36
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/dist/entities/appointmentIssue/appointmentIssue.d.ts +46 -0
- package/dist/entities/appointmentIssue/appointmentIssue.js +116 -0
- package/dist/entities/appointmentIssue/appointmentIssue.js.map +1 -0
- package/dist/entities/appointmentIssue/helper.d.ts +5 -0
- package/dist/entities/appointmentIssue/helper.js +16 -0
- package/dist/entities/appointmentIssue/helper.js.map +1 -0
- package/dist/entities/appointmentIssue/index.d.ts +2 -0
- package/dist/entities/appointmentIssue/index.js +3 -0
- package/dist/entities/appointmentIssue/index.js.map +1 -0
- package/dist/entities/appointmentIssueCategory/appointmentIssueCategory.d.ts +10 -0
- package/dist/entities/appointmentIssueCategory/appointmentIssueCategory.js +40 -0
- package/dist/entities/appointmentIssueCategory/appointmentIssueCategory.js.map +1 -0
- package/dist/entities/appointmentIssueCategory/helper.d.ts +5 -0
- package/dist/entities/appointmentIssueCategory/helper.js +16 -0
- package/dist/entities/appointmentIssueCategory/helper.js.map +1 -0
- package/dist/entities/appointmentIssueCategory/index.d.ts +2 -0
- package/dist/entities/appointmentIssueCategory/index.js +3 -0
- package/dist/entities/appointmentIssueCategory/index.js.map +1 -0
- package/dist/entities/appointmentIssueSubcategory/appointmentIssueSubcategory.d.ts +11 -0
- package/dist/entities/appointmentIssueSubcategory/appointmentIssueSubcategory.js +43 -0
- package/dist/entities/appointmentIssueSubcategory/appointmentIssueSubcategory.js.map +1 -0
- package/dist/entities/appointmentIssueSubcategory/helper.d.ts +5 -0
- package/dist/entities/appointmentIssueSubcategory/helper.js +16 -0
- package/dist/entities/appointmentIssueSubcategory/helper.js.map +1 -0
- package/dist/entities/appointmentIssueSubcategory/index.d.ts +2 -0
- package/dist/entities/appointmentIssueSubcategory/index.js +3 -0
- package/dist/entities/appointmentIssueSubcategory/index.js.map +1 -0
- package/dist/entities/appointmentNote/appointmentNote.d.ts +13 -0
- package/dist/entities/appointmentNote/appointmentNote.js +44 -0
- package/dist/entities/appointmentNote/appointmentNote.js.map +1 -0
- package/dist/entities/appointmentNote/helper.d.ts +5 -0
- package/dist/entities/appointmentNote/helper.js +16 -0
- package/dist/entities/appointmentNote/helper.js.map +1 -0
- package/dist/entities/appointmentNote/index.d.ts +2 -0
- package/dist/entities/appointmentNote/index.js +3 -0
- package/dist/entities/appointmentNote/index.js.map +1 -0
- package/dist/entities/appointmentNoteType/appointmentNoteType.d.ts +8 -0
- package/dist/entities/appointmentNoteType/appointmentNoteType.js +34 -0
- package/dist/entities/appointmentNoteType/appointmentNoteType.js.map +1 -0
- package/dist/entities/appointmentNoteType/helper.d.ts +5 -0
- package/dist/entities/appointmentNoteType/helper.js +16 -0
- package/dist/entities/appointmentNoteType/helper.js.map +1 -0
- package/dist/entities/appointmentNoteType/index.d.ts +2 -0
- package/dist/entities/appointmentNoteType/index.js +3 -0
- package/dist/entities/appointmentNoteType/index.js.map +1 -0
- package/dist/entities/archerFileV1/archerFileV1.d.ts +25 -0
- package/dist/entities/archerFileV1/archerFileV1.js +63 -0
- package/dist/entities/archerFileV1/archerFileV1.js.map +1 -0
- package/dist/entities/archerFileV1/helper.d.ts +5 -0
- package/dist/entities/archerFileV1/helper.js +16 -0
- package/dist/entities/archerFileV1/helper.js.map +1 -0
- package/dist/entities/archerFileV1/index.d.ts +2 -0
- package/dist/entities/archerFileV1/index.js +3 -0
- package/dist/entities/archerFileV1/index.js.map +1 -0
- package/dist/entities/carrierName/carrierName.d.ts +16 -0
- package/dist/entities/carrierName/carrierName.js +49 -0
- package/dist/entities/carrierName/carrierName.js.map +1 -0
- package/dist/entities/carrierName/helper.d.ts +5 -0
- package/dist/entities/carrierName/helper.js +16 -0
- package/dist/entities/carrierName/helper.js.map +1 -0
- package/dist/entities/carrierName/index.d.ts +2 -0
- package/dist/entities/carrierName/index.js +3 -0
- package/dist/entities/carrierName/index.js.map +1 -0
- package/dist/entities/commodityV1/commodityV1.d.ts +26 -0
- package/dist/entities/commodityV1/commodityV1.js +69 -0
- package/dist/entities/commodityV1/commodityV1.js.map +1 -0
- package/dist/entities/commodityV1/helper.d.ts +5 -0
- package/dist/entities/commodityV1/helper.js +16 -0
- package/dist/entities/commodityV1/helper.js.map +1 -0
- package/dist/entities/commodityV1/index.d.ts +2 -0
- package/dist/entities/commodityV1/index.js +3 -0
- package/dist/entities/commodityV1/index.js.map +1 -0
- package/dist/entities/driverName/driverName.d.ts +16 -0
- package/dist/entities/driverName/driverName.js +49 -0
- package/dist/entities/driverName/driverName.js.map +1 -0
- package/dist/entities/driverName/helper.d.ts +5 -0
- package/dist/entities/driverName/helper.js +16 -0
- package/dist/entities/driverName/helper.js.map +1 -0
- package/dist/entities/driverName/index.d.ts +2 -0
- package/dist/entities/driverName/index.js +3 -0
- package/dist/entities/driverName/index.js.map +1 -0
- package/dist/entities/index.d.ts +19 -0
- package/dist/entities/index.js +19 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/loadAdjustmentV1/helper.d.ts +5 -0
- package/dist/entities/loadAdjustmentV1/helper.js +16 -0
- package/dist/entities/loadAdjustmentV1/helper.js.map +1 -0
- package/dist/entities/loadAdjustmentV1/index.d.ts +2 -0
- package/dist/entities/loadAdjustmentV1/index.js +3 -0
- package/dist/entities/loadAdjustmentV1/index.js.map +1 -0
- package/dist/entities/loadAdjustmentV1/loadAdjustmentV1.d.ts +16 -0
- package/dist/entities/loadAdjustmentV1/loadAdjustmentV1.js +50 -0
- package/dist/entities/loadAdjustmentV1/loadAdjustmentV1.js.map +1 -0
- package/dist/entities/loadV1/helper.d.ts +6 -0
- package/dist/entities/loadV1/helper.js +35 -0
- package/dist/entities/loadV1/helper.js.map +1 -0
- package/dist/entities/loadV1/index.d.ts +2 -0
- package/dist/entities/loadV1/index.js +3 -0
- package/dist/entities/loadV1/index.js.map +1 -0
- package/dist/entities/loadV1/loadV1.d.ts +120 -0
- package/dist/entities/loadV1/loadV1.js +260 -0
- package/dist/entities/loadV1/loadV1.js.map +1 -0
- package/dist/entities/location/index.d.ts +1 -0
- package/dist/entities/location/index.js +1 -0
- package/dist/entities/location/index.js.map +1 -1
- package/dist/entities/location/location.d.ts +2 -1
- package/dist/entities/location/location.js +9 -2
- package/dist/entities/location/location.js.map +1 -1
- package/dist/entities/locationAccessorial/helper.d.ts +5 -0
- package/dist/entities/locationAccessorial/helper.js +16 -0
- package/dist/entities/locationAccessorial/helper.js.map +1 -0
- package/dist/entities/locationAccessorial/index.d.ts +2 -0
- package/dist/entities/locationAccessorial/index.js +3 -0
- package/dist/entities/locationAccessorial/index.js.map +1 -0
- package/dist/entities/locationAccessorial/locationAccessorial.d.ts +13 -0
- package/dist/entities/locationAccessorial/locationAccessorial.js +44 -0
- package/dist/entities/locationAccessorial/locationAccessorial.js.map +1 -0
- package/dist/entities/locationV1/helper.d.ts +5 -0
- package/dist/entities/locationV1/helper.js +16 -0
- package/dist/entities/locationV1/helper.js.map +1 -0
- package/dist/entities/locationV1/index.d.ts +2 -0
- package/dist/entities/locationV1/index.js +3 -0
- package/dist/entities/locationV1/index.js.map +1 -0
- package/dist/entities/locationV1/locationV1.d.ts +73 -0
- package/dist/entities/locationV1/locationV1.js +163 -0
- package/dist/entities/locationV1/locationV1.js.map +1 -0
- package/dist/entities/nmfcClass/helper.d.ts +5 -0
- package/dist/entities/nmfcClass/helper.js +16 -0
- package/dist/entities/nmfcClass/helper.js.map +1 -0
- package/dist/entities/nmfcClass/index.d.ts +2 -0
- package/dist/entities/nmfcClass/index.js +3 -0
- package/dist/entities/nmfcClass/index.js.map +1 -0
- package/dist/entities/nmfcClass/nmfcClass.d.ts +11 -0
- package/dist/entities/nmfcClass/nmfcClass.js +39 -0
- package/dist/entities/nmfcClass/nmfcClass.js.map +1 -0
- package/dist/entities/nodeName/helper.d.ts +5 -0
- package/dist/entities/nodeName/helper.js +16 -0
- package/dist/entities/nodeName/helper.js.map +1 -0
- package/dist/entities/nodeName/index.d.ts +2 -0
- package/dist/entities/nodeName/index.js +3 -0
- package/dist/entities/nodeName/index.js.map +1 -0
- package/dist/entities/nodeName/nodeName.d.ts +14 -0
- package/dist/entities/nodeName/nodeName.js +45 -0
- package/dist/entities/nodeName/nodeName.js.map +1 -0
- package/dist/entities/personName/helper.d.ts +5 -0
- package/dist/entities/personName/helper.js +16 -0
- package/dist/entities/personName/helper.js.map +1 -0
- package/dist/entities/personName/index.d.ts +2 -0
- package/dist/entities/personName/index.js +3 -0
- package/dist/entities/personName/index.js.map +1 -0
- package/dist/entities/personName/personName.d.ts +12 -0
- package/dist/entities/personName/personName.js +41 -0
- package/dist/entities/personName/personName.js.map +1 -0
- package/dist/entities/quote/quote.d.ts +0 -1
- package/dist/entities/quoteAccessorialV1/helper.d.ts +5 -0
- package/dist/entities/quoteAccessorialV1/helper.js +16 -0
- package/dist/entities/quoteAccessorialV1/helper.js.map +1 -0
- package/dist/entities/quoteAccessorialV1/index.d.ts +2 -0
- package/dist/entities/quoteAccessorialV1/index.js +3 -0
- package/dist/entities/quoteAccessorialV1/index.js.map +1 -0
- package/dist/entities/quoteAccessorialV1/quoteAccessorialV1.d.ts +34 -0
- package/dist/entities/quoteAccessorialV1/quoteAccessorialV1.js +86 -0
- package/dist/entities/quoteAccessorialV1/quoteAccessorialV1.js.map +1 -0
- package/dist/entities/quoteResponse/quoteResponse.d.ts +0 -1
- package/dist/entities/quoteResponse/quoteResponse.js.map +1 -1
- package/dist/entities/shipconV1/helper.d.ts +5 -0
- package/dist/entities/shipconV1/helper.js +16 -0
- package/dist/entities/shipconV1/helper.js.map +1 -0
- package/dist/entities/shipconV1/index.d.ts +2 -0
- package/dist/entities/shipconV1/index.js +3 -0
- package/dist/entities/shipconV1/index.js.map +1 -0
- package/dist/entities/shipconV1/shipconV1.d.ts +163 -0
- package/dist/entities/shipconV1/shipconV1.js +350 -0
- package/dist/entities/shipconV1/shipconV1.js.map +1 -0
- package/dist/entities/userNoteV1/helper.d.ts +5 -0
- package/dist/entities/userNoteV1/helper.js +16 -0
- package/dist/entities/userNoteV1/helper.js.map +1 -0
- package/dist/entities/userNoteV1/index.d.ts +2 -0
- package/dist/entities/userNoteV1/index.js +3 -0
- package/dist/entities/userNoteV1/index.js.map +1 -0
- package/dist/entities/userNoteV1/userNoteV1.d.ts +14 -0
- package/dist/entities/userNoteV1/userNoteV1.js +46 -0
- package/dist/entities/userNoteV1/userNoteV1.js.map +1 -0
- package/dist/hooks/locationsForm/locationsForm.d.ts +1 -0
- package/dist/hooks/locationsForm/locationsForm.js +7 -7
- package/dist/hooks/locationsForm/locationsForm.js.map +1 -1
- package/dist/hooks/locationsForm/locationsFormSales.d.ts +11 -0
- package/dist/hooks/locationsForm/locationsFormSales.js +826 -0
- package/dist/hooks/locationsForm/locationsFormSales.js.map +1 -0
- package/dist/hooks/quote/constants.d.ts +42 -2
- package/dist/hooks/quote/constants.js +39 -2
- package/dist/hooks/quote/constants.js.map +1 -1
- package/dist/hooks/quote/form.js +35 -44
- package/dist/hooks/quote/form.js.map +1 -1
- package/dist/hooks/quote/helpers.d.ts +12 -5
- package/dist/hooks/quote/helpers.js +76 -101
- package/dist/hooks/quote/helpers.js.map +1 -1
- package/dist/hooks/quote/result.js +19 -23
- package/dist/hooks/quote/result.js.map +1 -1
- package/dist/hooks/tender/form.js +84 -67
- package/dist/hooks/tender/form.js.map +1 -1
- package/dist/hooks/tender/helpers.d.ts +2 -1
- package/dist/hooks/tender/helpers.js +14 -17
- package/dist/hooks/tender/helpers.js.map +1 -1
- package/dist/redux/api/salesApi.d.ts +1 -1
- package/dist/redux/api/salesApi.js +24 -0
- package/dist/redux/api/salesApi.js.map +1 -1
- package/dist/redux/appointmentIssue/appointmentIssueEndpoints.d.ts +32 -0
- package/dist/redux/appointmentIssue/appointmentIssueEndpoints.js +66 -0
- package/dist/redux/appointmentIssue/appointmentIssueEndpoints.js.map +1 -0
- package/dist/redux/appointmentIssue/index.d.ts +2 -0
- package/dist/redux/appointmentIssue/index.js +3 -0
- package/dist/redux/appointmentIssue/index.js.map +1 -0
- package/dist/redux/appointmentIssueCategory/appointmentIssueCategoryEndpoints.d.ts +27 -0
- package/dist/redux/appointmentIssueCategory/appointmentIssueCategoryEndpoints.js +72 -0
- package/dist/redux/appointmentIssueCategory/appointmentIssueCategoryEndpoints.js.map +1 -0
- package/dist/redux/appointmentIssueCategory/index.d.ts +2 -0
- package/dist/redux/appointmentIssueCategory/index.js +3 -0
- package/dist/redux/appointmentIssueCategory/index.js.map +1 -0
- package/dist/redux/appointmentIssueSubcategory/appointmentIssueSubcategoryEndpoints.d.ts +26 -0
- package/dist/redux/appointmentIssueSubcategory/appointmentIssueSubcategoryEndpoints.js +66 -0
- package/dist/redux/appointmentIssueSubcategory/appointmentIssueSubcategoryEndpoints.js.map +1 -0
- package/dist/redux/appointmentIssueSubcategory/index.d.ts +2 -0
- package/dist/redux/appointmentIssueSubcategory/index.js +3 -0
- package/dist/redux/appointmentIssueSubcategory/index.js.map +1 -0
- package/dist/redux/appointmentNote/appointmentNoteEndpoints.d.ts +26 -0
- package/dist/redux/appointmentNote/appointmentNoteEndpoints.js +70 -0
- package/dist/redux/appointmentNote/appointmentNoteEndpoints.js.map +1 -0
- package/dist/redux/appointmentNote/index.d.ts +2 -0
- package/dist/redux/appointmentNote/index.js +3 -0
- package/dist/redux/appointmentNote/index.js.map +1 -0
- package/dist/redux/appointmentNoteType/appointmentNoteTypeEndpoints.d.ts +26 -0
- package/dist/redux/appointmentNoteType/appointmentNoteTypeEndpoints.js +75 -0
- package/dist/redux/appointmentNoteType/appointmentNoteTypeEndpoints.js.map +1 -0
- package/dist/redux/appointmentNoteType/index.d.ts +2 -0
- package/dist/redux/appointmentNoteType/index.js +3 -0
- package/dist/redux/appointmentNoteType/index.js.map +1 -0
- package/dist/redux/archerFile/archerFileEndpoints.d.ts +20 -0
- package/dist/redux/archerFile/archerFileEndpoints.js +61 -0
- package/dist/redux/archerFile/archerFileEndpoints.js.map +1 -0
- package/dist/redux/archerFile/index.d.ts +2 -0
- package/dist/redux/archerFile/index.js +3 -0
- package/dist/redux/archerFile/index.js.map +1 -0
- package/dist/redux/carrierName/carrierNameEndpoints.d.ts +25 -0
- package/dist/redux/carrierName/carrierNameEndpoints.js +76 -0
- package/dist/redux/carrierName/carrierNameEndpoints.js.map +1 -0
- package/dist/redux/carrierName/index.d.ts +2 -0
- package/dist/redux/carrierName/index.js +3 -0
- package/dist/redux/carrierName/index.js.map +1 -0
- package/dist/redux/commodityV1/commodityV1Endpoints.d.ts +33 -0
- package/dist/redux/commodityV1/commodityV1Endpoints.js +71 -0
- package/dist/redux/commodityV1/commodityV1Endpoints.js.map +1 -0
- package/dist/redux/commodityV1/index.d.ts +2 -0
- package/dist/redux/commodityV1/index.js +3 -0
- package/dist/redux/commodityV1/index.js.map +1 -0
- package/dist/redux/customer/customerEndpoints.d.ts +14 -14
- package/dist/redux/driverName/driverNameEndpoints.d.ts +24 -0
- package/dist/redux/driverName/driverNameEndpoints.js +67 -0
- package/dist/redux/driverName/driverNameEndpoints.js.map +1 -0
- package/dist/redux/driverName/index.d.ts +2 -0
- package/dist/redux/driverName/index.js +3 -0
- package/dist/redux/driverName/index.js.map +1 -0
- package/dist/redux/holiday/holidayEndpoints.d.ts +10 -10
- package/dist/redux/index.d.ts +17 -0
- package/dist/redux/index.js +17 -0
- package/dist/redux/index.js.map +1 -1
- package/dist/redux/load/loadEndpoints.d.ts +10 -10
- package/dist/redux/loadAdjustment/loadAdjustmentEndpoints.d.ts +10 -10
- package/dist/redux/loadAdjustmentV1/index.d.ts +2 -0
- package/dist/redux/loadAdjustmentV1/index.js +3 -0
- package/dist/redux/loadAdjustmentV1/index.js.map +1 -0
- package/dist/redux/loadAdjustmentV1/loadAdjustmentV1Endpoints.d.ts +32 -0
- package/dist/redux/loadAdjustmentV1/loadAdjustmentV1Endpoints.js +66 -0
- package/dist/redux/loadAdjustmentV1/loadAdjustmentV1Endpoints.js.map +1 -0
- package/dist/redux/loadV1/index.d.ts +2 -0
- package/dist/redux/loadV1/index.js +3 -0
- package/dist/redux/loadV1/index.js.map +1 -0
- package/dist/redux/loadV1/loadV1Endpoints.d.ts +43 -0
- package/dist/redux/loadV1/loadV1Endpoints.js +100 -0
- package/dist/redux/loadV1/loadV1Endpoints.js.map +1 -0
- package/dist/redux/location/locationEndpoints.d.ts +14 -14
- package/dist/redux/locationV1/index.d.ts +2 -0
- package/dist/redux/locationV1/index.js +3 -0
- package/dist/redux/locationV1/index.js.map +1 -0
- package/dist/redux/locationV1/locationV1Endpoints.d.ts +59 -0
- package/dist/redux/locationV1/locationV1Endpoints.js +115 -0
- package/dist/redux/locationV1/locationV1Endpoints.js.map +1 -0
- package/dist/redux/nmfcClass/index.d.ts +2 -0
- package/dist/redux/nmfcClass/index.js +3 -0
- package/dist/redux/nmfcClass/index.js.map +1 -0
- package/dist/redux/nmfcClass/nmfcClassEndpoints.d.ts +24 -0
- package/dist/redux/nmfcClass/nmfcClassEndpoints.js +64 -0
- package/dist/redux/nmfcClass/nmfcClassEndpoints.js.map +1 -0
- package/dist/redux/nodeName/index.d.ts +2 -0
- package/dist/redux/nodeName/index.js +3 -0
- package/dist/redux/nodeName/index.js.map +1 -0
- package/dist/redux/nodeName/nodeNameEndpoints.d.ts +26 -0
- package/dist/redux/nodeName/nodeNameEndpoints.js +67 -0
- package/dist/redux/nodeName/nodeNameEndpoints.js.map +1 -0
- package/dist/redux/personName/index.d.ts +2 -0
- package/dist/redux/personName/index.js +3 -0
- package/dist/redux/personName/index.js.map +1 -0
- package/dist/redux/personName/personNameEndpoints.d.ts +26 -0
- package/dist/redux/personName/personNameEndpoints.js +67 -0
- package/dist/redux/personName/personNameEndpoints.js.map +1 -0
- package/dist/redux/quote/quoteAction.d.ts +6 -2
- package/dist/redux/quote/quoteAction.js +9 -36
- package/dist/redux/quote/quoteAction.js.map +1 -1
- package/dist/redux/quote/quoteEndpoints.d.ts +22 -15
- package/dist/redux/quote/quoteEndpoints.js +26 -1
- package/dist/redux/quote/quoteEndpoints.js.map +1 -1
- package/dist/redux/quote/quoteHooks.d.ts +2 -2
- package/dist/redux/quote/quoteReducer.d.ts +0 -1
- package/dist/redux/quote/quoteReducer.js +27 -63
- package/dist/redux/quote/quoteReducer.js.map +1 -1
- package/dist/redux/quote/quoteSelector.d.ts +0 -1
- package/dist/redux/quote/quoteSelector.js +0 -12
- package/dist/redux/quote/quoteSelector.js.map +1 -1
- package/dist/redux/quoteAccessorial/quoteAccessorialEndpoints.d.ts +9 -9
- package/dist/redux/quoteAccessorialV1/index.d.ts +2 -0
- package/dist/redux/quoteAccessorialV1/index.js +3 -0
- package/dist/redux/quoteAccessorialV1/index.js.map +1 -0
- package/dist/redux/quoteAccessorialV1/quoteAccessorialV1Endpoints.d.ts +32 -0
- package/dist/redux/quoteAccessorialV1/quoteAccessorialV1Endpoints.js +67 -0
- package/dist/redux/quoteAccessorialV1/quoteAccessorialV1Endpoints.js.map +1 -0
- package/dist/redux/shipcon/shipconEndpoints.d.ts +10 -10
- package/dist/redux/shipconV1/index.d.ts +2 -0
- package/dist/redux/shipconV1/index.js +3 -0
- package/dist/redux/shipconV1/index.js.map +1 -0
- package/dist/redux/shipconV1/shipconV1Endpoints.d.ts +44 -0
- package/dist/redux/shipconV1/shipconV1Endpoints.js +75 -0
- package/dist/redux/shipconV1/shipconV1Endpoints.js.map +1 -0
- package/dist/redux/tender/tenderEndpoints.d.ts +9 -9
- package/dist/redux/tender/tenderSelector.d.ts +0 -2
- package/dist/redux/trailerAvailability/customerEndpoints.d.ts +4 -4
- package/dist/redux/types.d.ts +2 -2
- package/dist/redux/userNoteV1/index.d.ts +2 -0
- package/dist/redux/userNoteV1/index.js +3 -0
- package/dist/redux/userNoteV1/index.js.map +1 -0
- package/dist/redux/userNoteV1/userNoteV1Endpoints.d.ts +32 -0
- package/dist/redux/userNoteV1/userNoteV1Endpoints.js +65 -0
- package/dist/redux/userNoteV1/userNoteV1Endpoints.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,826 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, FormControl, FormLabel, Input, Typography, Grid, Checkbox, CircularProgress, Select, Option, FormHelperText, Modal, ModalDialog, Textarea, Tabs, TabList, tabClasses, Tab, TabPanel, Box, useTheme, Autocomplete, } from "@mui/joy";
|
|
3
|
+
import { NerdClickToCopy, NerdDatePicker, NerdFileUpload, NerdPhoneField, NerdTimePicker, useNerdConfirm, } from "@nerdjs/nerd-ui";
|
|
4
|
+
import { useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
7
|
+
import { locationEntityTypeGuard } from "../../entities/location/location";
|
|
8
|
+
import { locationFormOpenSelector, selectedPlaceSelector, setLocationFormOpen, } from "../../redux/quote";
|
|
9
|
+
import { useCreateLocationAccessorialV1Mutation, useCreateLocationV1Mutation, useDeleteLocationAccessorialsV1Mutation, useGetAccessorialsV1Query, useGetLocationAccessorialsV1Query, useGetLocationV1Query, useUpdateLocationAccessorialsV1Mutation, useUpdateLocationV1Mutation, } from "../../redux/locationV1";
|
|
10
|
+
import { DateTime } from "luxon";
|
|
11
|
+
import { Cancel, Delete, Edit, OpenInNew, Save } from "@mui/icons-material";
|
|
12
|
+
import { useMediaQuery, Select as MuiSelect, MenuItem } from "@mui/material";
|
|
13
|
+
import { DataGridPro, GridActionsCellItem, GridRowEditStopReasons, GridRowModes, useGridApiContext, } from "@mui/x-data-grid-pro";
|
|
14
|
+
import { useDeleteArcherFileMutation, useGetArcherFilesQuery, useShareArcherFileMutation, useUnshareArcherFileMutation, useUploadArcherFileMutation, } from "../../redux/archerFile";
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {object} props props
|
|
18
|
+
* @param {Function} props.onConfirm onConfirm callback
|
|
19
|
+
* @returns {ReactElement} LocationForm
|
|
20
|
+
*/
|
|
21
|
+
export function LocationFormSales({ onCreateLocation, }) {
|
|
22
|
+
const { t } = useTranslation("salesKit");
|
|
23
|
+
const dispatch = useDispatch();
|
|
24
|
+
const open = useSelector(locationFormOpenSelector);
|
|
25
|
+
const place = useSelector(selectedPlaceSelector);
|
|
26
|
+
const [createLocation] = useCreateLocationV1Mutation();
|
|
27
|
+
const [updateLocation] = useUpdateLocationV1Mutation();
|
|
28
|
+
const [validationObject, setValidationObject] = useState({
|
|
29
|
+
phone: true,
|
|
30
|
+
phone1: true,
|
|
31
|
+
openTime: true,
|
|
32
|
+
closeTime: true,
|
|
33
|
+
FCFSIN: true,
|
|
34
|
+
FCFSOUT: true,
|
|
35
|
+
});
|
|
36
|
+
const { data, isFetching } = useGetLocationV1Query(locationEntityTypeGuard(place) ? place.id : 0, { skip: locationEntityTypeGuard(place) ? false : true });
|
|
37
|
+
const [location, setLocation] = useState(data || {});
|
|
38
|
+
const [body, setBody] = useState({
|
|
39
|
+
verified: false,
|
|
40
|
+
});
|
|
41
|
+
const theme = useTheme();
|
|
42
|
+
const matches = useMediaQuery(theme.breakpoints.down("lg"));
|
|
43
|
+
const googleMapsAutocompleteService = new google.maps.places.AutocompleteService();
|
|
44
|
+
const googleMapsGeocoder = new google.maps.Geocoder();
|
|
45
|
+
const [googleMapsPredictions, setGoogleMapsPredictions] = useState(null);
|
|
46
|
+
const [value, setValue] = useState(null);
|
|
47
|
+
const [loadingMapsLocations, setLoadingMapsLocations] = useState(true);
|
|
48
|
+
const loading = loadingMapsLocations || isFetching;
|
|
49
|
+
const addressFormGeocoder = (place) => {
|
|
50
|
+
const address = {};
|
|
51
|
+
const _ref = place.address_components;
|
|
52
|
+
const _len = _ref.length;
|
|
53
|
+
for (let _i = 0; _i < _len; _i++) {
|
|
54
|
+
const i = _ref[_i];
|
|
55
|
+
const _ref1 = i.types;
|
|
56
|
+
const _len1 = _ref1.length;
|
|
57
|
+
for (let _j = 0; _j < _len1; _j++) {
|
|
58
|
+
const t = _ref1[_j];
|
|
59
|
+
address[t] = i.short_name;
|
|
60
|
+
address[`${t}_long`] = i.long_name;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const line1 = `${address.street_number ? `${address.street_number} ` : ""}${address.route}`.trim();
|
|
64
|
+
const city = address.locality_long ||
|
|
65
|
+
address.sublocality_long ||
|
|
66
|
+
address.sublocality_level_1_long ||
|
|
67
|
+
address.neighborhood_long;
|
|
68
|
+
const state = address.administrative_area_level_1;
|
|
69
|
+
const zip = address.postal_code;
|
|
70
|
+
const formatted_address = place.formatted_address;
|
|
71
|
+
return { line1, city, state, zip, formatted_address };
|
|
72
|
+
};
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (data) {
|
|
75
|
+
setLocation(data);
|
|
76
|
+
if (data.formatted_address) {
|
|
77
|
+
getGoogleAddresses(data.formatted_address, true);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
setLoadingMapsLocations(false);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, [data]);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (value && value.place_id !== location.place_id) {
|
|
86
|
+
googleMapsGeocoder.geocode({ placeId: value.place_id }, (result) => {
|
|
87
|
+
const place = result?.[0];
|
|
88
|
+
if (place) {
|
|
89
|
+
const address = addressFormGeocoder(place);
|
|
90
|
+
setBody({
|
|
91
|
+
...body,
|
|
92
|
+
...address,
|
|
93
|
+
place_id: place.place_id,
|
|
94
|
+
});
|
|
95
|
+
setLocation({
|
|
96
|
+
...location,
|
|
97
|
+
...address,
|
|
98
|
+
place_id: place.place_id,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}, [value]);
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (place && !locationEntityTypeGuard(place)) {
|
|
106
|
+
const address = addressFormGeocoder(place);
|
|
107
|
+
setBody({ ...address });
|
|
108
|
+
setLocation({ ...address });
|
|
109
|
+
setLoadingMapsLocations(false);
|
|
110
|
+
getGoogleAddresses(place.formatted_address, true);
|
|
111
|
+
}
|
|
112
|
+
}, [place]);
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
if (!loadingMapsLocations) {
|
|
115
|
+
setValue(googleMapsPredictions?.find((l) => location.place_id === l.place_id) ||
|
|
116
|
+
googleMapsPredictions?.[0] ||
|
|
117
|
+
null);
|
|
118
|
+
}
|
|
119
|
+
}, [loadingMapsLocations]);
|
|
120
|
+
const handleSaveLocation = () => {
|
|
121
|
+
if (location.id) {
|
|
122
|
+
updateLocation({
|
|
123
|
+
id: location.id,
|
|
124
|
+
body: { location: { ...body } },
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
createLocation(body)
|
|
129
|
+
.unwrap()
|
|
130
|
+
.then((l) => {
|
|
131
|
+
onCreateLocation(l);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const handleClose = () => {
|
|
136
|
+
setValue(null);
|
|
137
|
+
setBody({});
|
|
138
|
+
setLocation({});
|
|
139
|
+
setLoadingMapsLocations(true);
|
|
140
|
+
dispatch(setLocationFormOpen(false, undefined));
|
|
141
|
+
};
|
|
142
|
+
const getGoogleAddresses = (searchText, init) => {
|
|
143
|
+
if (init)
|
|
144
|
+
setLoadingMapsLocations(true);
|
|
145
|
+
googleMapsAutocompleteService.getPlacePredictions({
|
|
146
|
+
input: searchText,
|
|
147
|
+
componentRestrictions: { country: "us" },
|
|
148
|
+
types: ["address"],
|
|
149
|
+
language: "en",
|
|
150
|
+
}, (googleSuggestions) => {
|
|
151
|
+
setGoogleMapsPredictions(googleSuggestions);
|
|
152
|
+
if (init)
|
|
153
|
+
setLoadingMapsLocations(false);
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
return (_jsx(Modal, { open: open, onClose: handleClose, onClick: (event) => event.stopPropagation(), children: _jsx(ModalDialog, { layout: matches ? "fullscreen" : "center", "aria-labelledby": "edit-location-modal-dialog-title", children: loading ? (_jsx(Box, { sx: {
|
|
157
|
+
display: "flex",
|
|
158
|
+
justifyContent: "center",
|
|
159
|
+
alignItems: "center",
|
|
160
|
+
}, children: _jsx(CircularProgress, {}) })) : (_jsxs(_Fragment, { children: [_jsx(Typography, { id: "edit-location-modal-dialog-title", level: "h4", children: location?.id ? t("Edit Location") : t("New Location") }), _jsxs(Tabs, { defaultValue: 0, sx: {
|
|
161
|
+
bgcolor: "transparent",
|
|
162
|
+
overflowY: "auto",
|
|
163
|
+
overflowX: "hidden",
|
|
164
|
+
}, size: "sm", children: [_jsxs(TabList, { sx: {
|
|
165
|
+
p: 0.5,
|
|
166
|
+
gap: 0.5,
|
|
167
|
+
borderRadius: "xl",
|
|
168
|
+
bgcolor: "background.level1",
|
|
169
|
+
[`& .${tabClasses.root}[aria-selected="true"]`]: {
|
|
170
|
+
boxShadow: "sm",
|
|
171
|
+
bgcolor: "background.surface",
|
|
172
|
+
},
|
|
173
|
+
}, children: [_jsx(Tab, { disableIndicator: true, children: "Main" }), location.id ? (_jsxs(_Fragment, { children: [_jsx(Tab, { disableIndicator: true, children: "Accessorials" }), _jsx(Tab, { disableIndicator: true, children: "Documents" })] })) : null] }), _jsx(TabPanel, { value: 0, sx: {
|
|
174
|
+
overflowY: "auto",
|
|
175
|
+
overflowX: "hidden",
|
|
176
|
+
}, children: _jsxs(Grid, { container: true, spacing: 0.5, children: [_jsx(Grid, { xs: 12, children: _jsx(Typography, { level: "h4", color: "neutral", children: _jsx("i", { className: "fa-solid fa-location-dot" }) }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: t("Name") }), _jsx(Input, { fullWidth: true, onChange: (e) => {
|
|
177
|
+
setLocation((l) => ({ ...l, name: e.target.value }));
|
|
178
|
+
setBody((l) => ({ ...l, name: e.target.value }));
|
|
179
|
+
}, size: "sm", value: location?.name ?? "", placeholder: t("Facility's name") })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Line 1" }), _jsx(Input, { fullWidth: true, readOnly: true, size: "sm", value: location?.line1 ?? "", placeholder: t("Line 1") })] }) }), _jsx(Grid, { xs: 6, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "City" }), _jsx(Input, { fullWidth: true, readOnly: true, size: "sm", value: location?.city ?? "", placeholder: t("City") })] }) }), _jsx(Grid, { xs: 3, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "State" }), _jsx(Input, { fullWidth: true, readOnly: true, size: "sm", value: location?.state ?? "", placeholder: t("State") })] }) }), _jsx(Grid, { xs: 3, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "ZIP" }), _jsx(Input, { fullWidth: true, readOnly: true, size: "sm", value: location?.zip ?? "", placeholder: t("ZIP") })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Address" }), _jsx(Autocomplete, { value: value, options: googleMapsPredictions || [], onInputChange: (_e, v) => {
|
|
180
|
+
getGoogleAddresses(v, false);
|
|
181
|
+
}, onChange: (_e, v) => setValue(v), getOptionLabel: (option) => `${option.structured_formatting.main_text}, ${option.structured_formatting.secondary_text}`, isOptionEqualToValue: (o, v) => o.place_id === v.place_id })] }) }), _jsx(Grid, { xs: 12, mt: 1, children: _jsx(Typography, { level: "h4", color: "neutral", children: _jsx("i", { className: "fa-solid fa-address-card" }) }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Emails" }), _jsx(Input, { fullWidth: true, onChange: (e) => {
|
|
182
|
+
setLocation((l) => ({
|
|
183
|
+
...l,
|
|
184
|
+
email_addresses: e.target.value,
|
|
185
|
+
}));
|
|
186
|
+
setBody((l) => ({
|
|
187
|
+
...l,
|
|
188
|
+
email_addresses: e.target.value,
|
|
189
|
+
}));
|
|
190
|
+
}, size: "sm", value: location?.email_addresses || "", placeholder: "one@email.com; two@email.com..." })] }) }), _jsx(Grid, { xs: 6, lg: 3, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Contact" }), _jsx(Input, { fullWidth: true, onChange: (e) => {
|
|
191
|
+
setLocation((l) => ({
|
|
192
|
+
...l,
|
|
193
|
+
contact: e.target.value,
|
|
194
|
+
}));
|
|
195
|
+
setBody((l) => ({
|
|
196
|
+
...l,
|
|
197
|
+
contact: e.target.value,
|
|
198
|
+
}));
|
|
199
|
+
}, size: "sm", value: location.contact || "", placeholder: "Contact" }), !matches ? (
|
|
200
|
+
/* Don't remove the FormHelperText or the space between tags. */
|
|
201
|
+
_jsx(FormHelperText, { children: " " })) : null] }) }), _jsx(Grid, { xs: 12, lg: 4.5, children: _jsx(NerdPhoneField, { value: location.phone, label: t("Phone"), inputProps: {
|
|
202
|
+
placeholder: t("Phone"),
|
|
203
|
+
size: "sm",
|
|
204
|
+
fullWidth: true,
|
|
205
|
+
}, onAccept: (value) => {
|
|
206
|
+
setValidationObject({
|
|
207
|
+
...validationObject,
|
|
208
|
+
phone: true,
|
|
209
|
+
});
|
|
210
|
+
setLocation((l) => ({ ...l, phone: value }));
|
|
211
|
+
setBody((l) => ({ ...l, phone: value }));
|
|
212
|
+
}, onError: () => {
|
|
213
|
+
setValidationObject({
|
|
214
|
+
...validationObject,
|
|
215
|
+
phone: false,
|
|
216
|
+
});
|
|
217
|
+
} }) }), _jsx(Grid, { xs: 12, lg: 4.5, children: _jsx(NerdPhoneField, { value: location.ext_number, label: "Ext", inputProps: {
|
|
218
|
+
placeholder: "Ext",
|
|
219
|
+
size: "sm",
|
|
220
|
+
fullWidth: true,
|
|
221
|
+
}, onAccept: (value) => {
|
|
222
|
+
setValidationObject({
|
|
223
|
+
...validationObject,
|
|
224
|
+
phone1: true,
|
|
225
|
+
});
|
|
226
|
+
setLocation((l) => ({ ...l, ext_number: value }));
|
|
227
|
+
setBody((l) => ({ ...l, ext_number: value }));
|
|
228
|
+
}, onError: () => {
|
|
229
|
+
setValidationObject({
|
|
230
|
+
...validationObject,
|
|
231
|
+
phone1: false,
|
|
232
|
+
});
|
|
233
|
+
} }) }), _jsx(Grid, { xs: 12, mt: 1, children: _jsx(Typography, { level: "h4", color: "neutral", children: _jsx("i", { className: "fa-regular fa-memo-circle-info" }) }) }), _jsx(Grid, { lg: 6, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: " " }), _jsx(Checkbox, { label: "Need File", checked: location.needs_file || false, onChange: (e) => {
|
|
234
|
+
setLocation((l) => ({
|
|
235
|
+
...l,
|
|
236
|
+
needs_file: e.target.checked,
|
|
237
|
+
}));
|
|
238
|
+
setBody((l) => ({
|
|
239
|
+
...l,
|
|
240
|
+
needs_file: e.target.checked,
|
|
241
|
+
}));
|
|
242
|
+
} })] }) }), _jsx(Grid, { lg: 6, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: " " }), _jsx(Checkbox, { label: "Need Liquor Permit", checked: location.needs_liquor_permit || false, onChange: (e) => {
|
|
243
|
+
setLocation((l) => ({
|
|
244
|
+
...l,
|
|
245
|
+
needs_liquor_permit: e.target.checked,
|
|
246
|
+
}));
|
|
247
|
+
setBody((l) => ({
|
|
248
|
+
...l,
|
|
249
|
+
needs_liquor_permit: e.target.checked,
|
|
250
|
+
}));
|
|
251
|
+
} })] }) }), _jsx(Grid, { lg: 12, children: _jsx(Checkbox, { label: "First come first serve(FCFS)", checked: location.first_come_first_serve || false, onChange: (e) => {
|
|
252
|
+
setLocation((l) => ({
|
|
253
|
+
...l,
|
|
254
|
+
first_come_first_serve: e.target.checked,
|
|
255
|
+
}));
|
|
256
|
+
setBody((l) => ({
|
|
257
|
+
...l,
|
|
258
|
+
first_come_first_serve: e.target.checked,
|
|
259
|
+
}));
|
|
260
|
+
} }) }), _jsx(Grid, { lg: 5, children: _jsx(NerdDatePicker, { value: location.first_come_date
|
|
261
|
+
? DateTime.fromISO(location.first_come_date)
|
|
262
|
+
: null, onChange: (newDate) => {
|
|
263
|
+
setLocation((l) => ({
|
|
264
|
+
...l,
|
|
265
|
+
first_come_date: newDate?.toISO() || "",
|
|
266
|
+
}));
|
|
267
|
+
setBody((l) => ({
|
|
268
|
+
...l,
|
|
269
|
+
first_come_date: newDate?.toISO() || "",
|
|
270
|
+
}));
|
|
271
|
+
} }) }), _jsx(Grid, { lg: "auto", children: _jsx(NerdTimePicker, { label: "FCFS IN", inputProps: {
|
|
272
|
+
sx: {
|
|
273
|
+
width: 100,
|
|
274
|
+
},
|
|
275
|
+
slotProps: {
|
|
276
|
+
input: {
|
|
277
|
+
sx: {
|
|
278
|
+
p: 0.5,
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
}, value: location.first_come_in
|
|
283
|
+
? DateTime.fromISO(location.first_come_in)
|
|
284
|
+
.toUTC()
|
|
285
|
+
.toFormat("HH:mm")
|
|
286
|
+
: null, onChange: (time) => {
|
|
287
|
+
if (!time.isValid) {
|
|
288
|
+
setValidationObject({
|
|
289
|
+
...validationObject,
|
|
290
|
+
FCFSIN: false,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
setValidationObject({
|
|
295
|
+
...validationObject,
|
|
296
|
+
FCFSIN: true,
|
|
297
|
+
});
|
|
298
|
+
const newTime = time.duration
|
|
299
|
+
? DateTime.now()
|
|
300
|
+
.toUTC()
|
|
301
|
+
.set({
|
|
302
|
+
hour: time.duration.hours,
|
|
303
|
+
minute: time.duration.minutes,
|
|
304
|
+
second: 0,
|
|
305
|
+
})
|
|
306
|
+
.toISO() || ""
|
|
307
|
+
: "";
|
|
308
|
+
setLocation((l) => ({
|
|
309
|
+
...l,
|
|
310
|
+
first_come_in: newTime,
|
|
311
|
+
}));
|
|
312
|
+
setBody((l) => ({
|
|
313
|
+
...l,
|
|
314
|
+
first_come_in: newTime,
|
|
315
|
+
}));
|
|
316
|
+
}
|
|
317
|
+
} }) }), _jsx(Grid, { lg: "auto", children: _jsx(NerdTimePicker, { label: "FCFS OUT", inputProps: {
|
|
318
|
+
sx: {
|
|
319
|
+
width: 100,
|
|
320
|
+
},
|
|
321
|
+
slotProps: {
|
|
322
|
+
input: {
|
|
323
|
+
sx: {
|
|
324
|
+
p: 0.5,
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
},
|
|
328
|
+
}, value: location.first_come_out
|
|
329
|
+
? DateTime.fromISO(location.first_come_out)
|
|
330
|
+
.toUTC()
|
|
331
|
+
.toFormat("HH:mm")
|
|
332
|
+
: null, onChange: (time) => {
|
|
333
|
+
if (!time.isValid) {
|
|
334
|
+
setValidationObject({
|
|
335
|
+
...validationObject,
|
|
336
|
+
FCFSOUT: false,
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
setValidationObject({
|
|
341
|
+
...validationObject,
|
|
342
|
+
FCFSOUT: true,
|
|
343
|
+
});
|
|
344
|
+
const newTime = time.duration
|
|
345
|
+
? DateTime.now()
|
|
346
|
+
.toUTC()
|
|
347
|
+
.set({
|
|
348
|
+
hour: time.duration.hours,
|
|
349
|
+
minute: time.duration.minutes,
|
|
350
|
+
second: 0,
|
|
351
|
+
})
|
|
352
|
+
.toISO() || ""
|
|
353
|
+
: "";
|
|
354
|
+
setLocation((l) => ({
|
|
355
|
+
...l,
|
|
356
|
+
first_come_out: newTime,
|
|
357
|
+
}));
|
|
358
|
+
setBody((l) => ({
|
|
359
|
+
...l,
|
|
360
|
+
first_come_out: newTime,
|
|
361
|
+
}));
|
|
362
|
+
}
|
|
363
|
+
} }) }), _jsx(Grid, { xs: 6, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "TMS Link" }), _jsx(Input, { fullWidth: true, onChange: (e) => {
|
|
364
|
+
setLocation((l) => ({
|
|
365
|
+
...l,
|
|
366
|
+
tms_link: e.target.value,
|
|
367
|
+
}));
|
|
368
|
+
setBody((l) => ({
|
|
369
|
+
...l,
|
|
370
|
+
tms_link: e.target.value,
|
|
371
|
+
}));
|
|
372
|
+
}, size: "sm", value: location.tms_link || "", placeholder: "TMS Link" })] }) }), _jsx(Grid, { xs: 2, alignSelf: "end", children: _jsx(Button, { variant: "soft", size: "sm", component: location.tms_link ? "a" : "button", href: location.tms_link
|
|
373
|
+
? location.tms_link.match(/^https?:\/{2}/)
|
|
374
|
+
? location.tms_link
|
|
375
|
+
: `//${location.tms_link}`
|
|
376
|
+
: "", startDecorator: _jsx(OpenInNew, {}), target: "_blank", rel: "noopener noreferrer", sx: {
|
|
377
|
+
textDecoration: "none!important",
|
|
378
|
+
}, children: "GO" }) }), _jsx(Grid, { xs: 12, lg: 4, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "PSR Days" }), _jsxs(Select, { size: "sm", defaultValue: location.preschedule_days || 0, onChange: (_e, value) => {
|
|
379
|
+
setLocation((l) => ({
|
|
380
|
+
...l,
|
|
381
|
+
preschedule_days: value || 0,
|
|
382
|
+
}));
|
|
383
|
+
setBody((l) => ({
|
|
384
|
+
...l,
|
|
385
|
+
preschedule_days: value || 0,
|
|
386
|
+
}));
|
|
387
|
+
}, slotProps: {
|
|
388
|
+
listbox: {
|
|
389
|
+
sx: { zIndex: (theme) => theme.zIndex.modal },
|
|
390
|
+
},
|
|
391
|
+
}, children: [_jsx(Option, { value: 0, children: "None" }, 0), [1, 2, 3, 4, 5].map((v) => (_jsx(Option, { value: v, children: v }, v))), _jsx(Option, { value: 14, children: "ASAP" }, 14)] })] }) }), _jsx(Grid, { xs: 4, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Channel" }), _jsx(Select, { size: "sm", defaultValue: location.scheduling_channel, onChange: (_e, value) => {
|
|
392
|
+
setLocation((l) => ({
|
|
393
|
+
...l,
|
|
394
|
+
scheduling_channel: value || "",
|
|
395
|
+
}));
|
|
396
|
+
setBody((l) => ({
|
|
397
|
+
...l,
|
|
398
|
+
scheduling_channel: value || "",
|
|
399
|
+
}));
|
|
400
|
+
}, slotProps: {
|
|
401
|
+
listbox: {
|
|
402
|
+
sx: { zIndex: (theme) => theme.zIndex.modal },
|
|
403
|
+
},
|
|
404
|
+
}, children: [
|
|
405
|
+
{ label: "None", value: "" },
|
|
406
|
+
{ label: "Email", value: "email" },
|
|
407
|
+
{ label: "Call", value: "call" },
|
|
408
|
+
{ label: "Portal", value: "portal" },
|
|
409
|
+
{ label: "Customer", value: "customer" },
|
|
410
|
+
].map((v) => (_jsx(Option, { value: v.value, children: v.label }, v.value))) }), _jsx(FormHelperText, { children: " " })] }) }), _jsx(Grid, { lg: "auto", children: _jsx(NerdTimePicker, { inputProps: {
|
|
411
|
+
sx: {
|
|
412
|
+
width: 100,
|
|
413
|
+
},
|
|
414
|
+
}, label: "Open Time", value: location.time_from
|
|
415
|
+
? DateTime.fromISO(location.time_from)
|
|
416
|
+
.toUTC()
|
|
417
|
+
.toFormat("HH:mm")
|
|
418
|
+
: null, onChange: (time) => {
|
|
419
|
+
if (!time.isValid) {
|
|
420
|
+
setValidationObject({
|
|
421
|
+
...validationObject,
|
|
422
|
+
openTime: false,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
setValidationObject({
|
|
427
|
+
...validationObject,
|
|
428
|
+
openTime: true,
|
|
429
|
+
});
|
|
430
|
+
const newTime = time.duration
|
|
431
|
+
? DateTime.now()
|
|
432
|
+
.toUTC()
|
|
433
|
+
.set({
|
|
434
|
+
hour: time.duration.hours,
|
|
435
|
+
minute: time.duration.minutes,
|
|
436
|
+
second: 0,
|
|
437
|
+
})
|
|
438
|
+
.toISO() || ""
|
|
439
|
+
: "";
|
|
440
|
+
setLocation((l) => ({
|
|
441
|
+
...l,
|
|
442
|
+
time_from: newTime,
|
|
443
|
+
}));
|
|
444
|
+
setBody((l) => ({
|
|
445
|
+
...l,
|
|
446
|
+
time_from: newTime,
|
|
447
|
+
}));
|
|
448
|
+
}
|
|
449
|
+
} }) }), _jsx(Grid, { lg: "auto", children: _jsx(NerdTimePicker, { inputProps: {
|
|
450
|
+
sx: {
|
|
451
|
+
width: 100,
|
|
452
|
+
},
|
|
453
|
+
}, label: "Close Time", value: location.time_to
|
|
454
|
+
? DateTime.fromISO(location.time_to)
|
|
455
|
+
.toUTC()
|
|
456
|
+
.toFormat("HH:mm")
|
|
457
|
+
: null, onChange: (time) => {
|
|
458
|
+
if (!time.isValid) {
|
|
459
|
+
setValidationObject({
|
|
460
|
+
...validationObject,
|
|
461
|
+
closeTime: false,
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
setValidationObject({
|
|
466
|
+
...validationObject,
|
|
467
|
+
closeTime: true,
|
|
468
|
+
});
|
|
469
|
+
const newTime = time.duration
|
|
470
|
+
? DateTime.now()
|
|
471
|
+
.toUTC()
|
|
472
|
+
.set({
|
|
473
|
+
hour: time.duration.hours,
|
|
474
|
+
minute: time.duration.minutes,
|
|
475
|
+
second: 0,
|
|
476
|
+
})
|
|
477
|
+
.toISO() || ""
|
|
478
|
+
: "";
|
|
479
|
+
setLocation((l) => ({
|
|
480
|
+
...l,
|
|
481
|
+
time_to: newTime,
|
|
482
|
+
}));
|
|
483
|
+
setBody((l) => ({
|
|
484
|
+
...l,
|
|
485
|
+
time_to: newTime,
|
|
486
|
+
}));
|
|
487
|
+
}
|
|
488
|
+
} }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Prev. Appts." }), _jsx(Textarea, { onChange: (e) => {
|
|
489
|
+
setLocation((l) => ({
|
|
490
|
+
...l,
|
|
491
|
+
prev_apts: e.target.value,
|
|
492
|
+
}));
|
|
493
|
+
setBody((l) => ({
|
|
494
|
+
...l,
|
|
495
|
+
prev_apts: e.target.value,
|
|
496
|
+
}));
|
|
497
|
+
}, size: "sm", value: location.prev_apts || "" })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Location Notes" }), _jsx(Textarea, { onChange: (e) => {
|
|
498
|
+
setLocation((l) => ({
|
|
499
|
+
...l,
|
|
500
|
+
notes: e.target.value,
|
|
501
|
+
}));
|
|
502
|
+
setLocation((l) => ({
|
|
503
|
+
...l,
|
|
504
|
+
notes: e.target.value,
|
|
505
|
+
}));
|
|
506
|
+
}, size: "sm", value: location.notes || "" })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Location Scheduling Notes" }), _jsx(Textarea, { onChange: (e) => {
|
|
507
|
+
setLocation((l) => ({
|
|
508
|
+
...l,
|
|
509
|
+
scheduling_notes: e.target.value,
|
|
510
|
+
}));
|
|
511
|
+
setBody((l) => ({
|
|
512
|
+
...l,
|
|
513
|
+
scheduling_notes: e.target.value,
|
|
514
|
+
}));
|
|
515
|
+
}, size: "sm", value: location.scheduling_notes || "" })] }) }), _jsx(Grid, { xs: 12, children: _jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Driver Instructions" }), _jsx(Textarea, { onChange: (e) => {
|
|
516
|
+
setLocation((l) => ({
|
|
517
|
+
...l,
|
|
518
|
+
driver_instructions: e.target.value,
|
|
519
|
+
}));
|
|
520
|
+
setBody((l) => ({
|
|
521
|
+
...l,
|
|
522
|
+
driver_instructions: e.target.value,
|
|
523
|
+
}));
|
|
524
|
+
}, size: "sm", value: location.driver_instructions || "" })] }) })] }) }), location.id ? (_jsx(TabPanel, { value: 1, sx: {
|
|
525
|
+
overflowY: "auto",
|
|
526
|
+
overflowX: "hidden",
|
|
527
|
+
}, children: _jsx(Box, { sx: {
|
|
528
|
+
width: { xs: "85vw", lg: "40vw" },
|
|
529
|
+
height: { xs: "55vh", lg: "70vh" },
|
|
530
|
+
}, children: _jsx(LocationAccessoralsList, { locationID: location.id }) }) })) : null, location.id ? (_jsx(TabPanel, { value: 2, sx: {
|
|
531
|
+
overflowY: "auto",
|
|
532
|
+
overflowX: "hidden",
|
|
533
|
+
}, children: _jsx(Box, { sx: {
|
|
534
|
+
width: { xs: "85vw", lg: "40vw" },
|
|
535
|
+
height: { xs: "55vh", lg: "70vh" },
|
|
536
|
+
}, children: _jsx(DocumentsList, { locationID: location.id }) }) })) : null] }), _jsxs(Box, { sx: {
|
|
537
|
+
display: "flex",
|
|
538
|
+
gap: 1,
|
|
539
|
+
justifyContent: "flex-end",
|
|
540
|
+
pt: 2,
|
|
541
|
+
}, children: [_jsx(Button, { variant: "soft", color: "neutral", onClick: () => {
|
|
542
|
+
handleClose();
|
|
543
|
+
}, children: t("Cancel") }), _jsx(Button, { variant: "soft", onClick: () => {
|
|
544
|
+
handleSaveLocation();
|
|
545
|
+
handleClose();
|
|
546
|
+
}, disabled: Object.values(validationObject).every(Boolean) ? false : true, children: location.id ? t("Save") : t("Create") })] })] })) }) }));
|
|
547
|
+
}
|
|
548
|
+
function LocationAccessoralsList({ locationID }) {
|
|
549
|
+
const { data: accessorials } = useGetAccessorialsV1Query();
|
|
550
|
+
const { data, isFetching } = useGetLocationAccessorialsV1Query({
|
|
551
|
+
id: locationID,
|
|
552
|
+
});
|
|
553
|
+
const [createLocationAccessorial] = useCreateLocationAccessorialV1Mutation();
|
|
554
|
+
const [updateLocationAccessorial] = useUpdateLocationAccessorialsV1Mutation();
|
|
555
|
+
const [deleteLocationAccessorial] = useDeleteLocationAccessorialsV1Mutation();
|
|
556
|
+
const [rows, setRows] = useState(data || []);
|
|
557
|
+
const [rowModesModel, setRowModesModel] = useState({});
|
|
558
|
+
useEffect(() => {
|
|
559
|
+
setRows(data || []);
|
|
560
|
+
}, [data]);
|
|
561
|
+
const handleEditClick = (id) => () => {
|
|
562
|
+
setRowModesModel({ ...rowModesModel, [id]: { mode: GridRowModes.Edit } });
|
|
563
|
+
};
|
|
564
|
+
const handleSaveClick = (id) => () => {
|
|
565
|
+
setRowModesModel({ ...rowModesModel, [id]: { mode: GridRowModes.View } });
|
|
566
|
+
};
|
|
567
|
+
const handleDeleteClick = (id) => () => {
|
|
568
|
+
deleteLocationAccessorial(Number(id));
|
|
569
|
+
};
|
|
570
|
+
const handleCancelClick = (id) => () => {
|
|
571
|
+
setRowModesModel({
|
|
572
|
+
...rowModesModel,
|
|
573
|
+
[id]: { mode: GridRowModes.View, ignoreModifications: true },
|
|
574
|
+
});
|
|
575
|
+
const editedRow = rows.find((row) => row.id === id);
|
|
576
|
+
if (editedRow?.isNew) {
|
|
577
|
+
setRows(rows.filter((row) => row.id !== id));
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
const processRowUpdate = (newRow) => {
|
|
581
|
+
const { isNew, ...row } = newRow;
|
|
582
|
+
if (isNew) {
|
|
583
|
+
createLocationAccessorial({ locationaccessorial: row });
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
updateLocationAccessorial({
|
|
587
|
+
id: row.id,
|
|
588
|
+
body: { locationaccessorial: row },
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
return row;
|
|
592
|
+
};
|
|
593
|
+
const handleRowEditStop = (params, event) => {
|
|
594
|
+
if (params.reason === GridRowEditStopReasons.rowFocusOut) {
|
|
595
|
+
event.defaultMuiPrevented = true;
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
return (_jsx(DataGridPro, { editMode: "row", density: "compact", rowModesModel: rowModesModel, processRowUpdate: processRowUpdate, onRowEditStop: handleRowEditStop, onRowModesModelChange: (v) => setRowModesModel(v), experimentalFeatures: {
|
|
599
|
+
newEditingApi: true,
|
|
600
|
+
}, hideFooter: true, components: {
|
|
601
|
+
Toolbar: CustomToolbar,
|
|
602
|
+
}, componentsProps: {
|
|
603
|
+
toolbar: { setRows, setRowModesModel, locationID },
|
|
604
|
+
}, loading: isFetching, rows: rows || [], columns: [
|
|
605
|
+
{
|
|
606
|
+
field: "accessorial_id",
|
|
607
|
+
headerName: "Accessorial",
|
|
608
|
+
flex: 1,
|
|
609
|
+
editable: true,
|
|
610
|
+
renderCell(params) {
|
|
611
|
+
return accessorials?.find((a) => a.id == params.value)?.name || "";
|
|
612
|
+
},
|
|
613
|
+
renderEditCell(params) {
|
|
614
|
+
return _jsx(AccessorialEditCell, { ...params });
|
|
615
|
+
},
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
field: "cost_amount",
|
|
619
|
+
headerName: "Amount",
|
|
620
|
+
type: "number",
|
|
621
|
+
flex: 1,
|
|
622
|
+
editable: true,
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
field: "load_type",
|
|
626
|
+
headerName: "Load Type",
|
|
627
|
+
flex: 1,
|
|
628
|
+
editable: true,
|
|
629
|
+
type: "singleSelect",
|
|
630
|
+
valueOptions: [
|
|
631
|
+
{ value: "all", label: "All" },
|
|
632
|
+
{ value: "tl", label: "TL" },
|
|
633
|
+
{ value: "ltl", label: "LTL" },
|
|
634
|
+
],
|
|
635
|
+
valueFormatter(params) {
|
|
636
|
+
return (params.value.charAt(0).toUpperCase() + params.value.substring(1));
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
field: "contract",
|
|
641
|
+
headerName: "Contract",
|
|
642
|
+
type: "boolean",
|
|
643
|
+
flex: 1,
|
|
644
|
+
editable: true,
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
field: "actions",
|
|
648
|
+
type: "actions",
|
|
649
|
+
headerName: "Actions",
|
|
650
|
+
width: 100,
|
|
651
|
+
cellClassName: "actions",
|
|
652
|
+
getActions: ({ id }) => {
|
|
653
|
+
const isInEditMode = rowModesModel[id]?.mode === GridRowModes.Edit;
|
|
654
|
+
if (isInEditMode) {
|
|
655
|
+
return [
|
|
656
|
+
_jsx(GridActionsCellItem, { icon: _jsx(Save, {}), label: "Save", sx: {
|
|
657
|
+
color: "primary.main",
|
|
658
|
+
}, onClick: handleSaveClick(id) }, "save"),
|
|
659
|
+
_jsx(GridActionsCellItem, { icon: _jsx(Cancel, {}), label: "Cancel", className: "textPrimary", onClick: handleCancelClick(id), color: "inherit" }, "cancel"),
|
|
660
|
+
];
|
|
661
|
+
}
|
|
662
|
+
return [
|
|
663
|
+
_jsx(GridActionsCellItem, { icon: _jsx(Edit, {}), label: "Edit", className: "textPrimary", onClick: handleEditClick(id), color: "inherit" }, "edit"),
|
|
664
|
+
_jsx(GridActionsCellItem, { icon: _jsx(Delete, {}), label: "Delete", onClick: handleDeleteClick(id), color: "inherit" }, "delete"),
|
|
665
|
+
];
|
|
666
|
+
},
|
|
667
|
+
},
|
|
668
|
+
] }));
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
*
|
|
672
|
+
* @returns {ReactElement} Custom toolbar for Datagrid
|
|
673
|
+
*/
|
|
674
|
+
function CustomToolbar(props) {
|
|
675
|
+
const { setRowModesModel, setRows, locationID } = props;
|
|
676
|
+
const handleClick = () => {
|
|
677
|
+
const id = DateTime.now().toMillis();
|
|
678
|
+
setRows((oldRows) => [
|
|
679
|
+
...oldRows,
|
|
680
|
+
{
|
|
681
|
+
id,
|
|
682
|
+
name: "",
|
|
683
|
+
accessorial_id: 0,
|
|
684
|
+
contract: false,
|
|
685
|
+
cost_amount: 0,
|
|
686
|
+
load_type: "All",
|
|
687
|
+
location_id: locationID,
|
|
688
|
+
isNew: true,
|
|
689
|
+
},
|
|
690
|
+
]);
|
|
691
|
+
setRowModesModel((oldModel) => ({
|
|
692
|
+
...oldModel,
|
|
693
|
+
[id]: { mode: GridRowModes.Edit, fieldToFocus: "accessorial_id" },
|
|
694
|
+
}));
|
|
695
|
+
};
|
|
696
|
+
return (_jsx(_Fragment, { children: _jsx(Box, { sx: { display: "flex", gap: 1, p: 1, position: "relative" }, children: _jsx(Button, { variant: "soft", size: "sm", onClick: handleClick, children: "+ Accessorial" }) }) }));
|
|
697
|
+
}
|
|
698
|
+
function AccessorialEditCell(params) {
|
|
699
|
+
const { field, id, value } = params;
|
|
700
|
+
const { data: accessorials } = useGetAccessorialsV1Query();
|
|
701
|
+
const gridApiRef = useGridApiContext();
|
|
702
|
+
return (_jsx(MuiSelect, { defaultValue: value || "", onChange: (e) => gridApiRef.current.setEditCellValue({
|
|
703
|
+
field,
|
|
704
|
+
id,
|
|
705
|
+
value: e.target.value,
|
|
706
|
+
}), fullWidth: true, children: accessorials?.map((a) => (_jsx(MenuItem, { value: a.id, children: a.name }, a.id))) }));
|
|
707
|
+
}
|
|
708
|
+
function DocumentsList({ locationID }) {
|
|
709
|
+
const params = {
|
|
710
|
+
filter: JSON.stringify([
|
|
711
|
+
{ property: "model_type", value: "Location" },
|
|
712
|
+
{ property: "model_id", value: locationID },
|
|
713
|
+
]),
|
|
714
|
+
};
|
|
715
|
+
const confirm = useNerdConfirm();
|
|
716
|
+
const [shareFileAction] = useShareArcherFileMutation();
|
|
717
|
+
const [unshareAction] = useUnshareArcherFileMutation();
|
|
718
|
+
const [deleteFile] = useDeleteArcherFileMutation();
|
|
719
|
+
const { data: rows, isFetching } = useGetArcherFilesQuery(params);
|
|
720
|
+
const [iframe, setIframe] = useState("");
|
|
721
|
+
const [iframeLoading, setIframeLoading] = useState(true);
|
|
722
|
+
const [shareFile, setShareFile] = useState(null);
|
|
723
|
+
const columns = useMemo(() => [
|
|
724
|
+
{ field: "file_name", headerName: "File", flex: 1 },
|
|
725
|
+
{
|
|
726
|
+
field: "description",
|
|
727
|
+
headerName: "Type",
|
|
728
|
+
flex: 1,
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
field: "created_at",
|
|
732
|
+
headerName: "Uploaded At",
|
|
733
|
+
flex: 1,
|
|
734
|
+
type: "string",
|
|
735
|
+
valueFormatter(params) {
|
|
736
|
+
return DateTime.fromISO(params.value).toUTC().toFormat("ff");
|
|
737
|
+
},
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
field: "user",
|
|
741
|
+
headerName: "Uploaded By",
|
|
742
|
+
flex: 1,
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
field: "actions",
|
|
746
|
+
type: "actions",
|
|
747
|
+
headerName: "Actions",
|
|
748
|
+
getActions: ({ row }) => [
|
|
749
|
+
_jsx(GridActionsCellItem, { icon: _jsx("i", { className: "fa-solid fa-eye" }), label: `View File`, onClick: () => {
|
|
750
|
+
setIframe(`https://api.alpha.wa-labs.com/v3/file-service/files/${row.id}?inline=1`);
|
|
751
|
+
} }, "view"),
|
|
752
|
+
_jsx(GridActionsCellItem, { showInMenu: true, icon: _jsx("i", { className: "fa-solid fa-download" }), label: `Download File`, onClick: () => {
|
|
753
|
+
const link = document.createElement("a");
|
|
754
|
+
link.href = `https://api.alpha.wa-labs.com/v3/file-service/files/${row.id}`;
|
|
755
|
+
link.click();
|
|
756
|
+
link.remove();
|
|
757
|
+
} }, "download"),
|
|
758
|
+
_jsx(GridActionsCellItem, { showInMenu: true, icon: _jsx("i", { className: "fa-solid fa-trash" }), label: `Delete File`, onClick: () => {
|
|
759
|
+
confirm.setOpen({
|
|
760
|
+
onConfirm() {
|
|
761
|
+
deleteFile(row.id);
|
|
762
|
+
},
|
|
763
|
+
});
|
|
764
|
+
} }, "delete"),
|
|
765
|
+
_jsx(GridActionsCellItem, { showInMenu: true, icon: _jsx("i", { className: "fa-solid fa-share" }), label: `Share File`, onClick: () => {
|
|
766
|
+
setShareFile(row);
|
|
767
|
+
} }, "share"),
|
|
768
|
+
],
|
|
769
|
+
},
|
|
770
|
+
], []);
|
|
771
|
+
const handleClose = () => {
|
|
772
|
+
setIframe("");
|
|
773
|
+
setIframeLoading(true);
|
|
774
|
+
};
|
|
775
|
+
return (_jsxs(_Fragment, { children: [_jsx(DataGridPro, { hideFooter: true, loading: isFetching, rows: rows || [], columns: columns, components: {
|
|
776
|
+
Toolbar: DocumentListCustomToolbar,
|
|
777
|
+
}, componentsProps: {
|
|
778
|
+
toolbar: {
|
|
779
|
+
locationID,
|
|
780
|
+
},
|
|
781
|
+
} }), _jsx(Modal, { open: Boolean(iframe), onClose: handleClose, children: _jsxs(ModalDialog, { sx: {
|
|
782
|
+
width: { xs: "85vw", lg: "40vw" },
|
|
783
|
+
height: { xs: "55vh", lg: "70vh" },
|
|
784
|
+
}, children: [iframeLoading && (_jsx(Box, { sx: {
|
|
785
|
+
position: "absolute",
|
|
786
|
+
top: 0,
|
|
787
|
+
left: 0,
|
|
788
|
+
width: "100%",
|
|
789
|
+
height: "100%",
|
|
790
|
+
display: "flex",
|
|
791
|
+
alignItems: "center",
|
|
792
|
+
justifyContent: "center",
|
|
793
|
+
}, children: _jsx(CircularProgress, {}) })), _jsx("iframe", { style: {
|
|
794
|
+
opacity: iframeLoading ? 0 : 1,
|
|
795
|
+
border: "none",
|
|
796
|
+
height: "100%",
|
|
797
|
+
width: "100%",
|
|
798
|
+
}, src: iframe, onLoad: () => setIframeLoading(false) })] }) }), _jsx(Modal, { open: Boolean(shareFile), onClose: () => setShareFile(null), children: _jsx(ModalDialog, { sx: {
|
|
799
|
+
maxWidth: 400,
|
|
800
|
+
}, children: _jsx(Grid, { container: true, spacing: 1, children: shareFile?.shared_file_url ? (_jsxs(_Fragment, { children: [_jsx(Grid, { xs: 12, children: _jsx(NerdClickToCopy, { typographyProps: {
|
|
801
|
+
sx: {
|
|
802
|
+
lineBreak: "anywhere",
|
|
803
|
+
},
|
|
804
|
+
}, children: shareFile.shared_file_url }) }), _jsx(Grid, { xs: 12, children: _jsx(Button, { fullWidth: true, onClick: () => {
|
|
805
|
+
unshareAction(shareFile.id);
|
|
806
|
+
}, children: "Unshare" }) })] })) : (_jsxs(_Fragment, { children: [_jsx(Grid, { xs: 12, children: _jsx(Typography, { children: "By sharing this file it will be publicly viewable to people outside of the White Arrow organization. Do you wish to continue?" }) }), _jsx(Grid, { xs: 12, children: _jsx(Button, { fullWidth: true, onClick: () => {
|
|
807
|
+
if (shareFile?.id)
|
|
808
|
+
shareFileAction(shareFile.id);
|
|
809
|
+
}, children: "Share" }) })] })) }) }) })] }));
|
|
810
|
+
}
|
|
811
|
+
function DocumentListCustomToolbar({ locationID, }) {
|
|
812
|
+
const [uploadFile] = useUploadArcherFileMutation();
|
|
813
|
+
const handleUpload = (file) => {
|
|
814
|
+
uploadFile({
|
|
815
|
+
file,
|
|
816
|
+
description: "Location Form",
|
|
817
|
+
modelID: locationID,
|
|
818
|
+
modelType: "Location",
|
|
819
|
+
});
|
|
820
|
+
};
|
|
821
|
+
return (_jsx(_Fragment, { children: _jsx(Box, { sx: { display: "flex", gap: 1, p: 1, position: "relative" }, children: _jsx(NerdFileUpload, { hideFilesList: true, uploadFile: handleUpload, browseFilesButtonProps: {
|
|
822
|
+
variant: "soft",
|
|
823
|
+
size: "sm",
|
|
824
|
+
} }) }) }));
|
|
825
|
+
}
|
|
826
|
+
//# sourceMappingURL=locationsFormSales.js.map
|