oa-componentbook 0.0.0-sit1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -0
- package/build/MockData.js +2311 -0
- package/build/components/oa-component-accordion/Accordion.js +195 -0
- package/build/components/oa-component-accordion/styles.js +13 -0
- package/build/components/oa-component-auto-complete/CustomAutoComplete.js +167 -0
- package/build/components/oa-component-bar-chart/BarChart.js +295 -0
- package/build/components/oa-component-bread-crumb/CustomBreadCrumb.js +47 -0
- package/build/components/oa-component-button/CustomButton.js +108 -0
- package/build/components/oa-component-button/styles.js +41 -0
- package/build/components/oa-component-checkbox/CustomCheckBox.js +115 -0
- package/build/components/oa-component-checkbox/styles.js +12 -0
- package/build/components/oa-component-count-card/CustomCountCard.js +74 -0
- package/build/components/oa-component-count-card/styles.js +12 -0
- package/build/components/oa-component-datepicker/CustomDatePicker.js +134 -0
- package/build/components/oa-component-demo-border-radius/BorderRadiusDemo.js +35 -0
- package/build/components/oa-component-demo-border-radius/styles.js +12 -0
- package/build/components/oa-component-demo-color-variables/ColorVariablesDemo.js +34 -0
- package/build/components/oa-component-demo-color-variables/styles.js +12 -0
- package/build/components/oa-component-demo-elevation/ElevationDemo.js +22 -0
- package/build/components/oa-component-demo-elevation/styles.js +12 -0
- package/build/components/oa-component-demo-spacing/SpacingScales.js +26 -0
- package/build/components/oa-component-demo-spacing/styles.js +259 -0
- package/build/components/oa-component-drawer/CustomDrawer.js +178 -0
- package/build/components/oa-component-drawer/styles.js +16 -0
- package/build/components/oa-component-dropdown/CustomDropdown.js +102 -0
- package/build/components/oa-component-dropdown/customClass.css +9 -0
- package/build/components/oa-component-dropdown/styles.js +12 -0
- package/build/components/oa-component-feedback-form/FeedbackForm.js +75 -0
- package/build/components/oa-component-feedback-tooltip/FeedbackTooltip.js +69 -0
- package/build/components/oa-component-form-item/CustomFormItem.js +74 -0
- package/build/components/oa-component-header/CustomHeader.js +104 -0
- package/build/components/oa-component-header/styles.js +12 -0
- package/build/components/oa-component-icons/CustomIcon.js +92 -0
- package/build/components/oa-component-icons/MaterialIcon.js +70 -0
- package/build/components/oa-component-icons/SizedSvg.js +42 -0
- package/build/components/oa-component-info/CustomInfo.js +119 -0
- package/build/components/oa-component-info/styles.js +15 -0
- package/build/components/oa-component-input/CustomInput.js +131 -0
- package/build/components/oa-component-input-number/CustomInputNumber.js +140 -0
- package/build/components/oa-component-lable/CustomLable.js +37 -0
- package/build/components/oa-component-lable/styles.js +12 -0
- package/build/components/oa-component-loader/CustomLoader.js +66 -0
- package/build/components/oa-component-modal/CustomModal.js +153 -0
- package/build/components/oa-component-modal/styles.js +14 -0
- package/build/components/oa-component-notification/CustomNotification.js +152 -0
- package/build/components/oa-component-notification/styles.js +12 -0
- package/build/components/oa-component-notification/usage-example.md +44 -0
- package/build/components/oa-component-pagination/CustomPagination.js +111 -0
- package/build/components/oa-component-pagination/styles.js +12 -0
- package/build/components/oa-component-popover/CustomPopover.js +58 -0
- package/build/components/oa-component-progress-bar/CustomProgressBar.js +68 -0
- package/build/components/oa-component-progress-bar/styles.js +12 -0
- package/build/components/oa-component-radio/CustomRadio.js +112 -0
- package/build/components/oa-component-radio/styles.js +13 -0
- package/build/components/oa-component-rating/CustomRating.js +13 -0
- package/build/components/oa-component-select/CustomSelect.js +432 -0
- package/build/components/oa-component-steps/CustomSteps.js +117 -0
- package/build/components/oa-component-steps/styles.js +12 -0
- package/build/components/oa-component-table/CustomTable.js +300 -0
- package/build/components/oa-component-table/CustomTableV1.js +610 -0
- package/build/components/oa-component-table/styles.js +14 -0
- package/build/components/oa-component-table/stylesV1.js +19 -0
- package/build/components/oa-component-tabs/CustomTabs.js +102 -0
- package/build/components/oa-component-tabs/styles.js +13 -0
- package/build/components/oa-component-tag/CustomTag.js +66 -0
- package/build/components/oa-component-tag/styles.js +75 -0
- package/build/components/oa-component-textarea/CustomTextArea.js +74 -0
- package/build/components/oa-component-textarea/styles.js +16 -0
- package/build/components/oa-component-timeline/CustomTimeline.js +65 -0
- package/build/components/oa-component-timeline/styles.js +15 -0
- package/build/components/oa-component-timepicker/CustomTimePicker.js +104 -0
- package/build/components/oa-component-toggle/CustomToggle.js +111 -0
- package/build/components/oa-component-toggle/styles.js +43 -0
- package/build/components/oa-component-tooltip/CustomTooltip.js +70 -0
- package/build/components/oa-component-typography/Typography.js +58 -0
- package/build/components/oa-component-typography/styles.js +13 -0
- package/build/components/oa-component-upload/CustomUpload.js +332 -0
- package/build/components/oa-component-upload/styles.js +13 -0
- package/build/components/oa-component-viewer/CustomViewer.js +273 -0
- package/build/components/oa-component-viewer/styles.js +14 -0
- package/build/constants/ratingConstants.js +194 -0
- package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +367 -0
- package/build/dev/oa-component-document-viewer/styles.js +12 -0
- package/build/dev/oa-component-timeline/CustomTimeline.js +53 -0
- package/build/dev/oa-component-timeline/styles.js +15 -0
- package/build/dev/oa-component-upload/CustomUpload.js +285 -0
- package/build/dev/oa-component-upload/styles.js +13 -0
- package/build/dev/oa-component-viewer/CustomViewer.js +326 -0
- package/build/dev/oa-component-viewer/styles.js +14 -0
- package/build/dev/oa-widget-document-modal/DocumentSideModal.js +166 -0
- package/build/dev/oa-widget-document-modal/styles.js +12 -0
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +196 -0
- package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
- package/build/dev/oa-widget-document-upload-card/DocUploadCardWidget.js +179 -0
- package/build/dev/oa-widget-document-upload-card/styles.js +13 -0
- package/build/global-css/BorderRadius.js +22 -0
- package/build/global-css/ColorVariables.js +26 -0
- package/build/global-css/ColorVariablesMap.js +29 -0
- package/build/global-css/CustomDropDownThemes.js +31 -0
- package/build/global-css/Elevation.js +35 -0
- package/build/global-css/GlobalCss.js +26 -0
- package/build/global-css/GridLayout.js +25 -0
- package/build/global-css/SpacingScales.js +11 -0
- package/build/global-css/Typographies.js +26 -0
- package/build/global-css/TypographiesMap.js +71 -0
- package/build/global-css/color-options.js +8 -0
- package/build/global-css/commonStyles.js +11 -0
- package/build/global-css/tooltip-placement-option.js +8 -0
- package/build/global-css/typography-options.js +8 -0
- package/build/images/AC.png +0 -0
- package/build/images/Car.png +0 -0
- package/build/images/Cooler.png +0 -0
- package/build/images/Default.png +0 -0
- package/build/images/Footwear.png +0 -0
- package/build/images/Furniture.png +0 -0
- package/build/images/Glasses.png +0 -0
- package/build/images/HA.png +0 -0
- package/build/images/Laptop.png +0 -0
- package/build/images/Luggage.png +0 -0
- package/build/images/Microwave.png +0 -0
- package/build/images/Mobile.png +0 -0
- package/build/images/PdfSampleImage.png +0 -0
- package/build/images/Refrigerator.png +0 -0
- package/build/images/Shirts.png +0 -0
- package/build/images/Tablets.png +0 -0
- package/build/images/Television.png +0 -0
- package/build/images/TwoWheeler.png +0 -0
- package/build/images/Wallet.png +0 -0
- package/build/images/WashingMachine.png +0 -0
- package/build/images/WaterPurifier.png +0 -0
- package/build/images/Wearable.png +0 -0
- package/build/images/ajax-loader.gif +0 -0
- package/build/images/astronaut_emptystate.png +0 -0
- package/build/images/caution.svg +3 -0
- package/build/images/close.svg +3 -0
- package/build/images/current-location.svg +3 -0
- package/build/images/delete.svg +8 -0
- package/build/images/exportGrp01.png +0 -0
- package/build/images/exportGrp02.png +0 -0
- package/build/images/exportGrp03.png +0 -0
- package/build/images/hand-icon.svg +4 -0
- package/build/images/iphone.svg +9 -0
- package/build/images/left-icon.svg +28 -0
- package/build/images/map_pointer.svg +25 -0
- package/build/images/modal-img.svg +8 -0
- package/build/images/oaChat.svg +5 -0
- package/build/images/offer.svg +3 -0
- package/build/images/oneassist-logo.png +0 -0
- package/build/images/outOfStock.png +0 -0
- package/build/images/right-icon.svg +28 -0
- package/build/images/search_ic.svg +3 -0
- package/build/images/search_not_found.svg +7 -0
- package/build/images/upload.svg +8 -0
- package/build/images/zoom.svg +4 -0
- package/build/index.js +763 -0
- package/build/layout/DetailDataLayout/DetailDataLayout.js +20 -0
- package/build/layout/DetailDataLayout/components/Form.js +22 -0
- package/build/layout/DetailDataLayout/components/Header.js +32 -0
- package/build/layout/DetailDataLayout/style.css +9 -0
- package/build/layout/DetailDataLayout/styles.js +12 -0
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +235 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +63 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2293 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +84 -0
- package/build/layout/GenricLayOut/components/CardList.js +34 -0
- package/build/layout/GenricLayOut/components/DropdownSearch.js +48 -0
- package/build/layout/GenricLayOut/components/Header.js +74 -0
- package/build/layout/GenricLayOut/components/Modal.js +85 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +87 -0
- package/build/layout/GenricLayOut/components/Search.js +51 -0
- package/build/layout/GenricLayOut/components/StaticFilter.css +73 -0
- package/build/layout/GenricLayOut/components/StaticFilter.js +37 -0
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +294 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +25 -0
- package/build/layout/paymentAndConsent/CancelScreen.js +46 -0
- package/build/layout/paymentAndConsent/ConsentCard.js +68 -0
- package/build/layout/paymentAndConsent/DetailsCard.js +75 -0
- package/build/layout/paymentAndConsent/DetailsList.js +38 -0
- package/build/layout/paymentAndConsent/Header.js +33 -0
- package/build/layout/paymentAndConsent/InProgressScreen.js +46 -0
- package/build/layout/paymentAndConsent/Loader.js +21 -0
- package/build/layout/paymentAndConsent/Modal.js +28 -0
- package/build/layout/paymentAndConsent/PaymentAndConsent.js +22 -0
- package/build/layout/paymentAndConsent/PaymentCard.js +83 -0
- package/build/layout/paymentAndConsent/Section.js +34 -0
- package/build/layout/paymentAndConsent/SuccessScreen.js +46 -0
- package/build/layout/paymentAndConsent/TimeLineCard.js +28 -0
- package/build/layout/paymentAndConsent/TncList.js +32 -0
- package/build/layout/paymentAndConsent/style.js +12 -0
- package/build/utils/common.js +20 -0
- package/build/utils/download-file.js +23 -0
- package/build/utils/fix-decimal-places.js +24 -0
- package/build/utils/get-uuid.js +41 -0
- package/build/utils/hex-to-rgb.js +30 -0
- package/build/utils/index.js +78 -0
- package/build/utils/random-generators.js +19 -0
- package/build/utils/rupee-formatters.js +69 -0
- package/build/utils/type-checkers.js +16 -0
- package/build/widgets/oa-form-widget/FormWidget.js +544 -0
- package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +461 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +355 -0
- package/build/widgets/oa-widget-add-spare-part/styles.js +12 -0
- package/build/widgets/oa-widget-address/AddressWidget.js +55 -0
- package/build/widgets/oa-widget-address/styles.js +13 -0
- package/build/widgets/oa-widget-approval/ApprovalWidget.js +200 -0
- package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +492 -0
- package/build/widgets/oa-widget-approval/styles.js +13 -0
- package/build/widgets/oa-widget-chat/ChatWidget.js +261 -0
- package/build/widgets/oa-widget-chat/styles.js +17 -0
- package/build/widgets/oa-widget-close-claim/CloseClaimWidget.js +256 -0
- package/build/widgets/oa-widget-close-claim/styles.js +12 -0
- package/build/widgets/oa-widget-collapsible-key-value/CollapsibleKeyValueWidget.js +395 -0
- package/build/widgets/oa-widget-collapsible-key-value/styles.js +16 -0
- package/build/widgets/oa-widget-content-panel/ContentPanel.js +82 -0
- package/build/widgets/oa-widget-content-panel/styles.js +12 -0
- package/build/widgets/oa-widget-custom-details/CustomDetails.js +41 -0
- package/build/widgets/oa-widget-customer-rating-card/CustomerRatingCard.js +147 -0
- package/build/widgets/oa-widget-customer-rating-card/styles.js +12 -0
- package/build/widgets/oa-widget-date-dropdown/DateDropDown.js +385 -0
- package/build/widgets/oa-widget-date-dropdown/styles.js +12 -0
- package/build/widgets/oa-widget-detailcard/MembershipDetailCard.js +182 -0
- package/build/widgets/oa-widget-detailcard/styles.js +12 -0
- package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +264 -0
- package/build/widgets/oa-widget-document-upload/styles.js +13 -0
- package/build/widgets/oa-widget-document-upload-card/DocUploadCardWidget.js +178 -0
- package/build/widgets/oa-widget-document-upload-card/styles.js +13 -0
- package/build/widgets/oa-widget-dropdown-search-input/DropdownSearchInput.js +200 -0
- package/build/widgets/oa-widget-dropdown-search-input/styles.js +12 -0
- package/build/widgets/oa-widget-feedback/FeedbackWidget.js +83 -0
- package/build/widgets/oa-widget-feedback/styles.js +13 -0
- package/build/widgets/oa-widget-form/CustomFormWidget.js +51 -0
- package/build/widgets/oa-widget-form/styles.js +12 -0
- package/build/widgets/oa-widget-googlerating/GoogleRating.js +55 -0
- package/build/widgets/oa-widget-googlerating/styles.js +12 -0
- package/build/widgets/oa-widget-guide/GuideWidget.js +70 -0
- package/build/widgets/oa-widget-guide/GuideWidgetStyle.js +12 -0
- package/build/widgets/oa-widget-header/CustomHeaderWidget.js +98 -0
- package/build/widgets/oa-widget-header/styles.js +12 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationDeleteBiker.js +24 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModal.js +34 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModalStyle.js +13 -0
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +256 -0
- package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
- package/build/widgets/oa-widget-image-gallery/FullscreenViewer.js +169 -0
- package/build/widgets/oa-widget-image-gallery/ImageGallery.js +87 -0
- package/build/widgets/oa-widget-image-gallery/ThumbnailGrid.js +146 -0
- package/build/widgets/oa-widget-image-gallery/imageCache.js +15 -0
- package/build/widgets/oa-widget-image-gallery/imageGalleryStyle.js +16 -0
- package/build/widgets/oa-widget-input-pattern-pin/CustomPinPatternCaptureWidget.js +395 -0
- package/build/widgets/oa-widget-input-pattern-pin/styles.js +12 -0
- package/build/widgets/oa-widget-item-info-card/InfoCardListWidget.js +60 -0
- package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +77 -0
- package/build/widgets/oa-widget-item-info-card/styles.css +50 -0
- package/build/widgets/oa-widget-item-info-card/styles.js +14 -0
- package/build/widgets/oa-widget-key-value/KeyValueWidget.js +121 -0
- package/build/widgets/oa-widget-key-value/styles.js +14 -0
- package/build/widgets/oa-widget-kpi/KPICardWidget.js +86 -0
- package/build/widgets/oa-widget-kpi/styles.js +12 -0
- package/build/widgets/oa-widget-location-access/LocationAccessWidget.js +92 -0
- package/build/widgets/oa-widget-location-access/styles.js +12 -0
- package/build/widgets/oa-widget-map-base-location/AddressDetails.js +84 -0
- package/build/widgets/oa-widget-map-base-location/AddressForm.js +106 -0
- package/build/widgets/oa-widget-map-base-location/CustomModalComponent.js +58 -0
- package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +93 -0
- package/build/widgets/oa-widget-map-base-location/MapComponent.js +167 -0
- package/build/widgets/oa-widget-map-base-location/styles.js +12 -0
- package/build/widgets/oa-widget-membershipcard/MembershipCard.js +266 -0
- package/build/widgets/oa-widget-membershipcard/styles.js +13 -0
- package/build/widgets/oa-widget-multiple-collapse-with-slots/MultipleCollapseWithSlots.js +85 -0
- package/build/widgets/oa-widget-multiple-collapse-with-slots/checkactive.svg +8 -0
- package/build/widgets/oa-widget-multiple-collapse-with-slots/checkhover.svg +8 -0
- package/build/widgets/oa-widget-multiple-collapse-with-slots/styles.js +16 -0
- package/build/widgets/oa-widget-notes/NotesWidget.js +135 -0
- package/build/widgets/oa-widget-notes/styles.js +13 -0
- package/build/widgets/oa-widget-pincode-base-location/PincodeBaseLocation.js +281 -0
- package/build/widgets/oa-widget-pincode-base-location/styles.js +12 -0
- package/build/widgets/oa-widget-plan-card/PlanCard.js +183 -0
- package/build/widgets/oa-widget-plan-card/styles.js +13 -0
- package/build/widgets/oa-widget-preview/Preview.js +172 -0
- package/build/widgets/oa-widget-preview/ZoomImageComponent.js +95 -0
- package/build/widgets/oa-widget-preview/styles.js +12 -0
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +117 -0
- package/build/widgets/oa-widget-profile-data/styles.js +13 -0
- package/build/widgets/oa-widget-progressive-steps/ProgressiveStepsWidget.js +362 -0
- package/build/widgets/oa-widget-progressive-steps/styles.js +12 -0
- package/build/widgets/oa-widget-reimbursement-breakup/ReimbursementBreakupWidget.js +141 -0
- package/build/widgets/oa-widget-reimbursement-breakup/styles.js +12 -0
- package/build/widgets/oa-widget-repair-service/RepairServiceWidget.js +79 -0
- package/build/widgets/oa-widget-repair-service/styles.js +12 -0
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
- package/build/widgets/oa-widget-send-payment-link/SendPaymentLinkWidget.js +224 -0
- package/build/widgets/oa-widget-send-payment-link/styles.js +15 -0
- package/build/widgets/oa-widget-servicecard/ServiceCard.js +185 -0
- package/build/widgets/oa-widget-servicecard/styles.js +13 -0
- package/build/widgets/oa-widget-sidebar/SidebarWidget.js +105 -0
- package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
- package/build/widgets/oa-widget-sidebar/sidebar.css +0 -0
- package/build/widgets/oa-widget-sidebar/styles.js +13 -0
- package/build/widgets/oa-widget-spare-part/SparePartsCollapseWidget.js +127 -0
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +294 -0
- package/build/widgets/oa-widget-spare-part/styles.js +18 -0
- package/build/widgets/oa-widget-stage-timeline/StageTimelineWidget.js +159 -0
- package/build/widgets/oa-widget-stage-timeline/styles.js +29 -0
- package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +232 -0
- package/build/widgets/oa-widget-track-shipment/styles.js +13 -0
- package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +103 -0
- package/build/widgets/oa-widget-track-shipment-list/fn.js +81 -0
- package/build/widgets/oa-widget-track-shipment-list/styles.js +13 -0
- package/build/widgets/oa-widget-upload-download/UploadDownloadWidget.js +167 -0
- package/build/widgets/oa-widget-upload-download/styles.js +14 -0
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +352 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/build/widgets/oa-widget-view-history/ViewHistoryWidget.js +181 -0
- package/build/widgets/oa-widget-view-history/styles.js +12 -0
- package/build/widgets/oa-widget-view-previous-description/ViewPreviousDescriptionWidget.js +188 -0
- package/build/widgets/oa-widget-view-previous-description/styles.js +16 -0
- package/package.json +100 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = ViewHistoryWidget;
|
|
8
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
+
require("core-js/modules/es.array.sort.js");
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
|
|
13
|
+
var _CustomTable = _interopRequireDefault(require("../../components/oa-component-table/CustomTable"));
|
|
14
|
+
var _UploadDownloadWidget = _interopRequireDefault(require("../oa-widget-upload-download/UploadDownloadWidget"));
|
|
15
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
16
|
+
var _styles = require("./styles");
|
|
17
|
+
const _excluded = ["currentDocument", "data-test", "previousDocuments", "name", "onClose", "open"],
|
|
18
|
+
_excluded2 = ["key", "docDetails"],
|
|
19
|
+
_excluded3 = ["uploadedDocuments"];
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
22
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
24
|
+
const columns = [{
|
|
25
|
+
title: 'File',
|
|
26
|
+
dataIndex: 'File',
|
|
27
|
+
key: 'docDetails',
|
|
28
|
+
// width: '155px',
|
|
29
|
+
width: '25%'
|
|
30
|
+
}, {
|
|
31
|
+
title: 'Uploaded On',
|
|
32
|
+
dataIndex: 'dateUploaded',
|
|
33
|
+
key: 'dateUploaded',
|
|
34
|
+
render: text => /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
35
|
+
typography: "type-b2-400"
|
|
36
|
+
}, text),
|
|
37
|
+
width: '25%'
|
|
38
|
+
}
|
|
39
|
+
// {
|
|
40
|
+
// title: 'Description',
|
|
41
|
+
// dataIndex: 'description',
|
|
42
|
+
// key: 'description',
|
|
43
|
+
// width: '25%',
|
|
44
|
+
// render: (text) => <Typography typography="type-b2-400">{text}</Typography>,
|
|
45
|
+
// },
|
|
46
|
+
// {
|
|
47
|
+
// title: 'Rejected By',
|
|
48
|
+
// dataIndex: 'rejectedBy',
|
|
49
|
+
// key: 'rejectedBy',
|
|
50
|
+
// width: '25%',
|
|
51
|
+
// render: (text) => <Typography typography="type-b2-400">{text}</Typography>,
|
|
52
|
+
// },
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @typedef {import('../../components/oa-component-drawer/CustomDrawer').CustomDrawerProps} CustomDrawerProps
|
|
57
|
+
* @typedef {import('../../components/oa-component-table/CustomTable').CustomTableProps} CustomTableProps
|
|
58
|
+
* @typedef {import('../../components/oa-component-upload-download/UploadDownloadWidget').UploadDownloadWidgetProps} UploadDownloadWidgetProps
|
|
59
|
+
*
|
|
60
|
+
* @typedef ViewHistoryWidgetProps
|
|
61
|
+
* @property {Object} currentDocument - The current document data.
|
|
62
|
+
* @property {UploadDownloadWidgetProps} currentDocument.docDetails - The docDetails property of currentDocument.
|
|
63
|
+
* @property {string} 'data-test' - The data-test attribute for the component.
|
|
64
|
+
* @property {Array<Object>} previousDocuments - The previous documents data.
|
|
65
|
+
* @property {UploadDownloadWidgetProps} previousDocuments.docDetails - The docDetails property of each element in previousDocuments.
|
|
66
|
+
* @property {string} name - The name of the document.
|
|
67
|
+
* @property {() => void} onClose - The callback to close the drawer.
|
|
68
|
+
* @property {boolean} open - Whether the drawer is open or not.
|
|
69
|
+
* @property {CustomDrawerProps & CustomTableProps} - All other props are passed to the CustomDrawer and CustomTable components.
|
|
70
|
+
*
|
|
71
|
+
* @summary A widget to view the history of a document.
|
|
72
|
+
*/
|
|
73
|
+
function ViewHistoryWidget(_ref) {
|
|
74
|
+
var _currentDocument$docD, _currentDocument$docD2;
|
|
75
|
+
let {
|
|
76
|
+
currentDocument,
|
|
77
|
+
'data-test': dataTest,
|
|
78
|
+
previousDocuments,
|
|
79
|
+
name,
|
|
80
|
+
onClose,
|
|
81
|
+
open
|
|
82
|
+
} = _ref,
|
|
83
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
84
|
+
/*
|
|
85
|
+
Setting how to render the `File` column in the table,
|
|
86
|
+
based on whether a data-test attribute was passed to the `ViewHistoryWidget` or not
|
|
87
|
+
*/
|
|
88
|
+
columns[0].render = (_, _ref2) => {
|
|
89
|
+
let {
|
|
90
|
+
key,
|
|
91
|
+
docDetails
|
|
92
|
+
} = _ref2,
|
|
93
|
+
otherColumnValues = _objectWithoutProperties(_ref2, _excluded2);
|
|
94
|
+
const {
|
|
95
|
+
uploadedDocuments
|
|
96
|
+
} = docDetails,
|
|
97
|
+
remainingProps = _objectWithoutProperties(docDetails, _excluded3);
|
|
98
|
+
return /*#__PURE__*/_react.default.createElement(_UploadDownloadWidget.default, _extends({
|
|
99
|
+
"data-test": dataTest ? "".concat(dataTest, "--upload-download-widget-").concat(key) : undefined,
|
|
100
|
+
uploadedDocuments: uploadedDocuments
|
|
101
|
+
}, remainingProps));
|
|
102
|
+
};
|
|
103
|
+
const copyOfPreviousDocuments = [...previousDocuments];
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Sorts two documents in descending order of their `dateUploaded` field.
|
|
107
|
+
* @param {Object} document1 - The first document.
|
|
108
|
+
* @param {Object} document2 - The second document.
|
|
109
|
+
* @returns {number} The result of comparing the two dates.
|
|
110
|
+
*/
|
|
111
|
+
const sortByDescendingDate = (document1, document2) => new Date(document2.dateUploaded) - new Date(document1.dateUploaded);
|
|
112
|
+
copyOfPreviousDocuments.sort(sortByDescendingDate);
|
|
113
|
+
return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, _extends({
|
|
114
|
+
"data-test": dataTest ? "".concat(dataTest, "--drawer") : undefined,
|
|
115
|
+
onClose: onClose,
|
|
116
|
+
open: open,
|
|
117
|
+
placement: "right",
|
|
118
|
+
title: "VIEW HISTORY",
|
|
119
|
+
width: "860"
|
|
120
|
+
}, props), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
121
|
+
color: "primary-content",
|
|
122
|
+
typography: "type-b1-400"
|
|
123
|
+
}, name ? "".concat(name, ": ") : null, "Current File"), /*#__PURE__*/_react.default.createElement(_styles.TableContainer, null, /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
|
|
124
|
+
columns: columns,
|
|
125
|
+
dataSource: currentDocument !== null && currentDocument !== void 0 && (_currentDocument$docD = currentDocument.docDetails) !== null && _currentDocument$docD !== void 0 && (_currentDocument$docD = _currentDocument$docD.uploadedDocuments) !== null && _currentDocument$docD !== void 0 && (_currentDocument$docD = _currentDocument$docD[0]) !== null && _currentDocument$docD !== void 0 && _currentDocument$docD.name && currentDocument !== null && currentDocument !== void 0 && (_currentDocument$docD2 = currentDocument.docDetails) !== null && _currentDocument$docD2 !== void 0 && (_currentDocument$docD2 = _currentDocument$docD2.uploadedDocuments) !== null && _currentDocument$docD2 !== void 0 && (_currentDocument$docD2 = _currentDocument$docD2[0]) !== null && _currentDocument$docD2 !== void 0 && _currentDocument$docD2.onDownload ? [currentDocument] : [],
|
|
126
|
+
rowKey: "key",
|
|
127
|
+
size: "middle",
|
|
128
|
+
pagination: false
|
|
129
|
+
})), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
130
|
+
color: "primary-content",
|
|
131
|
+
typography: "type-b1-400"
|
|
132
|
+
}, "History"), /*#__PURE__*/_react.default.createElement(_styles.TableContainer, null, /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
|
|
133
|
+
columns: columns,
|
|
134
|
+
dataSource: copyOfPreviousDocuments,
|
|
135
|
+
rowKey: "key",
|
|
136
|
+
size: "middle",
|
|
137
|
+
pagination: false
|
|
138
|
+
})));
|
|
139
|
+
}
|
|
140
|
+
ViewHistoryWidget.propTypes = {
|
|
141
|
+
currentDocument: _propTypes.default.shape({
|
|
142
|
+
docDetails: _propTypes.default.shape({
|
|
143
|
+
onUpload: _propTypes.default.func,
|
|
144
|
+
multiple: _propTypes.default.bool,
|
|
145
|
+
uploadedDocuments: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
146
|
+
name: _propTypes.default.string,
|
|
147
|
+
onDownload: _propTypes.default.func,
|
|
148
|
+
onDelete: _propTypes.default.func
|
|
149
|
+
}))
|
|
150
|
+
}),
|
|
151
|
+
dateUploaded: _propTypes.default.string.isRequired,
|
|
152
|
+
description: _propTypes.default.string,
|
|
153
|
+
rejectedBy: _propTypes.default.string
|
|
154
|
+
}),
|
|
155
|
+
'data-test': _propTypes.default.string,
|
|
156
|
+
previousDocuments: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
157
|
+
docDetails: _propTypes.default.shape({
|
|
158
|
+
onUpload: _propTypes.default.func,
|
|
159
|
+
multiple: _propTypes.default.bool,
|
|
160
|
+
uploadedDocuments: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
161
|
+
name: _propTypes.default.string,
|
|
162
|
+
onDownload: _propTypes.default.func,
|
|
163
|
+
onDelete: _propTypes.default.func
|
|
164
|
+
}))
|
|
165
|
+
}),
|
|
166
|
+
dateUploaded: _propTypes.default.string,
|
|
167
|
+
description: _propTypes.default.string,
|
|
168
|
+
rejectedBy: _propTypes.default.string
|
|
169
|
+
})),
|
|
170
|
+
name: _propTypes.default.string,
|
|
171
|
+
onClose: _propTypes.default.func,
|
|
172
|
+
open: _propTypes.default.bool
|
|
173
|
+
};
|
|
174
|
+
ViewHistoryWidget.defaultProps = {
|
|
175
|
+
currentDocument: null,
|
|
176
|
+
'data-test': null,
|
|
177
|
+
previousDocuments: [],
|
|
178
|
+
name: null,
|
|
179
|
+
onClose: () => {},
|
|
180
|
+
open: true
|
|
181
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.TableContainer = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject;
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
var _default = exports.default = {};
|
|
12
|
+
const TableContainer = exports.TableContainer = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 16px 0 32px;\n"])));
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = ViewPreviousDescriptionWidget;
|
|
9
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
10
|
+
require("core-js/modules/es.array.sort.js");
|
|
11
|
+
require("core-js/modules/es.symbol.description.js");
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _utils = require("../../utils");
|
|
15
|
+
var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
|
|
16
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
17
|
+
var _CustomToggle = _interopRequireDefault(require("../../components/oa-component-toggle/CustomToggle"));
|
|
18
|
+
var _styles = require("./styles");
|
|
19
|
+
const _excluded = ["currentDescription", "data-test", "previousDescriptions", "onClose", "onTranslate", "open", "translationDefaultValue"];
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
24
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
25
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
|
+
/**
|
|
27
|
+
* This component displays the current description and previous descriptions
|
|
28
|
+
* of an object. It also allows the user to toggle on/off the translation
|
|
29
|
+
* of the descriptions.
|
|
30
|
+
*
|
|
31
|
+
* @param {Object} currentDescription - The current description of the object.
|
|
32
|
+
* @param {string} currentDescription.description - The description of the object.
|
|
33
|
+
* @param {string} currentDescription.dateSubmitted - The date the description was submitted.
|
|
34
|
+
* @param {Object[]} previousDescriptions - The previous descriptions of the object.
|
|
35
|
+
* @param {string} previousDescriptions.description - The description of the object.
|
|
36
|
+
* @param {string} previousDescriptions.dateSubmitted - The date the description was submitted.
|
|
37
|
+
* @param {Function} onClose - The function to be called when the user closes the drawer.
|
|
38
|
+
* @param {Function} onTranslate - The function to be called when the user wants to translate the descriptions.
|
|
39
|
+
* @param {boolean} open - Whether the drawer is open or not.
|
|
40
|
+
* @param {boolean} translationDefaultValue - Whether the translation is on by default or not.
|
|
41
|
+
*
|
|
42
|
+
* @returns {ReactElement} A drawer containing the current and previous descriptions
|
|
43
|
+
* of the object, with the option to toggle on/off the translation.
|
|
44
|
+
*/
|
|
45
|
+
function ViewPreviousDescriptionWidget(_ref) {
|
|
46
|
+
var _translatedText$, _translatedText$2, _currentDescription$d;
|
|
47
|
+
let {
|
|
48
|
+
currentDescription,
|
|
49
|
+
'data-test': dataTest,
|
|
50
|
+
previousDescriptions,
|
|
51
|
+
onClose,
|
|
52
|
+
onTranslate,
|
|
53
|
+
open,
|
|
54
|
+
translationDefaultValue
|
|
55
|
+
} = _ref,
|
|
56
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
57
|
+
const copyOfPreviousDescriptions = [...previousDescriptions];
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Sorts two documents in descending order of their `dateUploaded` field.
|
|
61
|
+
* @param {Object} document1 - The first document.
|
|
62
|
+
* @param {Object} document2 - The second document.
|
|
63
|
+
* @returns {number} The result of comparing the two dates.
|
|
64
|
+
*/
|
|
65
|
+
const sortByDescendingDate = (document1, document2) => new Date(document2.dateSubmitted) - new Date(document1.dateSubmitted);
|
|
66
|
+
copyOfPreviousDescriptions.sort(sortByDescendingDate);
|
|
67
|
+
const [isTranslationOn, setIsTranslationOn] = (0, _react.useState)(translationDefaultValue);
|
|
68
|
+
const [translatedText, setTranslatedText] = (0, _react.useState)([]);
|
|
69
|
+
// Initially setting the translated text as a 0 length array
|
|
70
|
+
|
|
71
|
+
// This is for when the translation toggle is clicked on.
|
|
72
|
+
(0, _react.useEffect)(() => {
|
|
73
|
+
if (isTranslationOn) {
|
|
74
|
+
// Passing an array of strings to this for translation,
|
|
75
|
+
// only if preferredLanguage is not 'english'
|
|
76
|
+
|
|
77
|
+
// API call for translation has NOT been made yet.
|
|
78
|
+
if (!(translatedText.length > 0)) {
|
|
79
|
+
var _onTranslate;
|
|
80
|
+
const payloadArr = copyOfPreviousDescriptions.map(prevDesc => prevDesc.description);
|
|
81
|
+
payloadArr.unshift(currentDescription.description);
|
|
82
|
+
(_onTranslate = onTranslate(payloadArr)) === null || _onTranslate === void 0 || _onTranslate.then(responseArr => setTranslatedText(responseArr),
|
|
83
|
+
// Setting the translated array as part of the state of the component.
|
|
84
|
+
() => setIsTranslationOn(false)
|
|
85
|
+
// Since the translation wasn't successful, set translation toggle back to off.
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, [isTranslationOn]);
|
|
90
|
+
|
|
91
|
+
// Set default value of translation
|
|
92
|
+
(0, _react.useEffect)(() => {
|
|
93
|
+
setIsTranslationOn(translationDefaultValue);
|
|
94
|
+
}, [translationDefaultValue]);
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
This is for when any of the descriptions changes,
|
|
98
|
+
so fresh translations are made to represent the new descriptions.
|
|
99
|
+
*/
|
|
100
|
+
(0, _react.useEffect)(() => {
|
|
101
|
+
if (onTranslate) {
|
|
102
|
+
var _onTranslate2;
|
|
103
|
+
// Passing an array of strings to this for translation,
|
|
104
|
+
// only if preferredLanguage is not 'english'
|
|
105
|
+
|
|
106
|
+
// API call for translation has NOT been made yet.
|
|
107
|
+
const payloadArr = copyOfPreviousDescriptions.map(prevDesc => prevDesc.description);
|
|
108
|
+
payloadArr.unshift(currentDescription.description);
|
|
109
|
+
(_onTranslate2 = onTranslate(payloadArr)) === null || _onTranslate2 === void 0 || (_onTranslate2 = _onTranslate2.then(responseArr => setTranslatedText(responseArr))
|
|
110
|
+
// Since the translation wasn't successful,
|
|
111
|
+
) === null || _onTranslate2 === void 0 || _onTranslate2.catch(() => setIsTranslationOn(false));
|
|
112
|
+
}
|
|
113
|
+
}, [currentDescription === null || currentDescription === void 0 ? void 0 : currentDescription.description, ...previousDescriptions.map(prevDesc => prevDesc.description)]);
|
|
114
|
+
const onToggleChange = toggleValue => {
|
|
115
|
+
setIsTranslationOn(toggleValue);
|
|
116
|
+
};
|
|
117
|
+
return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, _extends({
|
|
118
|
+
"data-test": dataTest ? "".concat(dataTest, "--drawer") : undefined,
|
|
119
|
+
onClose: onClose,
|
|
120
|
+
open: open,
|
|
121
|
+
placement: "right",
|
|
122
|
+
title: "DESCRIPTION HISTORY",
|
|
123
|
+
width: "480"
|
|
124
|
+
}, props), onTranslate && /*#__PURE__*/_react.default.createElement(_styles.TranslateContainer, null, /*#__PURE__*/_react.default.createElement(_styles.ToggleContainer, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
125
|
+
typography: "type-b2-400"
|
|
126
|
+
}, "Show translated text"), /*#__PURE__*/_react.default.createElement(_CustomToggle.default, {
|
|
127
|
+
"data-test": dataTest ? "".concat(dataTest, "--translate-toggle") : undefined,
|
|
128
|
+
checked: isTranslationOn,
|
|
129
|
+
onClick: onToggleChange,
|
|
130
|
+
size: "small"
|
|
131
|
+
})), isTranslationOn && /*#__PURE__*/_react.default.createElement("p", {
|
|
132
|
+
className: "type-b3-400"
|
|
133
|
+
}, "Note: These responses are auto-translated. Please read the answers carefully as there might be minor typo.")), /*#__PURE__*/_react.default.createElement(_styles.UnderlinedContainer, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
134
|
+
color: "positive",
|
|
135
|
+
typography: "type-t1-500"
|
|
136
|
+
}, "Current Description"), /*#__PURE__*/_react.default.createElement(_styles.Descriptions, null, /*#__PURE__*/_react.default.createElement(_styles.Description, null, /*#__PURE__*/_react.default.createElement(_Typography.default
|
|
137
|
+
// This data-test attribute helps in checking if the translation took place
|
|
138
|
+
, {
|
|
139
|
+
"data-test": dataTest ? "".concat(dataTest, "--current-description") : undefined,
|
|
140
|
+
typography: "type-b2-400"
|
|
141
|
+
}, "".concat(isTranslationOn && ((_translatedText$ = translatedText[0]) === null || _translatedText$ === void 0 ? void 0 : _translatedText$.length) > 0 ? (_translatedText$2 = translatedText[0]) !== null && _translatedText$2 !== void 0 ? _translatedText$2 : 'No description submitted yet.' : (_currentDescription$d = currentDescription.description) !== null && _currentDescription$d !== void 0 ? _currentDescription$d : 'No description submitted yet.')), currentDescription.dateSubmitted && /*#__PURE__*/_react.default.createElement("p", {
|
|
142
|
+
className: "type-b2-400"
|
|
143
|
+
}, "Updated on:", ' ', "".concat(currentDescription.dateSubmitted)))), /*#__PURE__*/_react.default.createElement("hr", null)), /*#__PURE__*/_react.default.createElement(_styles.Container, null, /*#__PURE__*/_react.default.createElement("h3", {
|
|
144
|
+
className: "type-t1-500"
|
|
145
|
+
}, "Previous Descriptions"), /*#__PURE__*/_react.default.createElement(_styles.Descriptions, null, copyOfPreviousDescriptions.length > 0 ? copyOfPreviousDescriptions.filter(previousDescription => {
|
|
146
|
+
var _previousDescription$;
|
|
147
|
+
return (previousDescription === null || previousDescription === void 0 || (_previousDescription$ = previousDescription.description) === null || _previousDescription$ === void 0 ? void 0 : _previousDescription$.length) > 0;
|
|
148
|
+
}).map((previousDescription, index) => {
|
|
149
|
+
var _translatedText;
|
|
150
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
|
151
|
+
key: (0, _utils.getUUID)()
|
|
152
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.Description, null, /*#__PURE__*/_react.default.createElement(_Typography.default
|
|
153
|
+
// This data-test attribute helps in checking if the translation took place
|
|
154
|
+
, {
|
|
155
|
+
"data-test": dataTest ? "".concat(dataTest, "--previous-description-").concat(index) : undefined,
|
|
156
|
+
typography: "type-b2-400"
|
|
157
|
+
}, "".concat(isTranslationOn && ((_translatedText = translatedText[index + 1]) === null || _translatedText === void 0 ? void 0 : _translatedText.length) > 0 ? translatedText[index + 1] : previousDescription.description)), previousDescription.dateSubmitted && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
158
|
+
color: "secondary-content",
|
|
159
|
+
typography: "type-b2-400"
|
|
160
|
+
}, "Updated on:", ' ', "".concat(previousDescription.dateSubmitted))));
|
|
161
|
+
}) : /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
162
|
+
typography: "type-button-500"
|
|
163
|
+
}, "No more descriptions to display"))));
|
|
164
|
+
}
|
|
165
|
+
ViewPreviousDescriptionWidget.propTypes = {
|
|
166
|
+
currentDescription: _propTypes.default.shape({
|
|
167
|
+
dateSubmitted: _propTypes.default.string,
|
|
168
|
+
description: _propTypes.default.string
|
|
169
|
+
}),
|
|
170
|
+
'data-test': _propTypes.default.string,
|
|
171
|
+
previousDescriptions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
172
|
+
dateSubmitted: _propTypes.default.string,
|
|
173
|
+
description: _propTypes.default.string
|
|
174
|
+
})),
|
|
175
|
+
onClose: _propTypes.default.func,
|
|
176
|
+
onTranslate: _propTypes.default.func,
|
|
177
|
+
open: _propTypes.default.bool,
|
|
178
|
+
translationDefaultValue: _propTypes.default.bool
|
|
179
|
+
};
|
|
180
|
+
ViewPreviousDescriptionWidget.defaultProps = {
|
|
181
|
+
currentDescription: {},
|
|
182
|
+
'data-test': null,
|
|
183
|
+
previousDescriptions: [],
|
|
184
|
+
onClose: () => {},
|
|
185
|
+
onTranslate: null,
|
|
186
|
+
open: true,
|
|
187
|
+
translationDefaultValue: false
|
|
188
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UnderlinedContainer = exports.TranslateContainer = exports.ToggleContainer = exports.Descriptions = exports.Description = exports.Container = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
+
const Container = exports.Container = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\nh3{\n color: var(--color-primary-content);\n}\n"])));
|
|
12
|
+
const UnderlinedContainer = exports.UnderlinedContainer = (0, _styledComponents.default)(Container)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n hr{\n height: 1px;\n background: var(--color-divider);\n width: 100%;\n margin: 16px 0 32px;\n border: none;\n }\n"])));
|
|
13
|
+
const TranslateContainer = exports.TranslateContainer = (0, _styledComponents.default)(Container)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n \n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 0 0 8px;\n p{\n color: var(--color-secondary-content);\n padding: 0 0 32px;\n }\n\n"])));
|
|
14
|
+
const Descriptions = exports.Descriptions = _styledComponents.default.section(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding-top: 12px;\n \n display: flex;\n flex-direction: column;\n gap: 32px;\n"])));
|
|
15
|
+
const Description = exports.Description = _styledComponents.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n p{\n color: var(--color-secondary-content);\n }\n"])));
|
|
16
|
+
const ToggleContainer = exports.ToggleContainer = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n gap: 8px;\n align-items: center;\n"])));
|
package/package.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "oa-componentbook",
|
|
3
|
+
"version": "0.0.0-sit1.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Reusable components",
|
|
6
|
+
"main": "build/index.js",
|
|
7
|
+
"module": "build/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"build",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@ant-design/icons": "^5.2.6",
|
|
17
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
18
|
+
"@material-ui/system": "^4.12.2",
|
|
19
|
+
"@storybook/addon-actions": "^7.6.3",
|
|
20
|
+
"@storybook/addon-styling": "^1.3.7",
|
|
21
|
+
"@storybook/cli": "^7.6.3",
|
|
22
|
+
"antd": "^5.11.4",
|
|
23
|
+
"d3": "^7.8.5",
|
|
24
|
+
"dayjs": "^1.11.10",
|
|
25
|
+
"immer": "^10.1.1",
|
|
26
|
+
"pdfjs-dist": "^2.6.347",
|
|
27
|
+
"react-google-maps": "^9.4.5",
|
|
28
|
+
"react-intersection-observer": "^8.32.5",
|
|
29
|
+
"react-markdown": "^8.0.7",
|
|
30
|
+
"react-pattern-lock": "^12.0.12",
|
|
31
|
+
"react-pdf": "^5.3.0",
|
|
32
|
+
"react-zoom-pan-pinch": "^3.7.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@babel/cli": "^7.22.9",
|
|
36
|
+
"@babel/core": "^7.6.0",
|
|
37
|
+
"@babel/preset-env": "^7.6.0",
|
|
38
|
+
"@storybook/addon-essentials": "^7.6.3",
|
|
39
|
+
"@storybook/addon-interactions": "^7.6.3",
|
|
40
|
+
"@storybook/addon-links": "^7.6.3",
|
|
41
|
+
"@storybook/addon-mdx-gfm": "^7.6.3",
|
|
42
|
+
"@storybook/addon-onboarding": "^1.0.9",
|
|
43
|
+
"@storybook/blocks": "^7.6.3",
|
|
44
|
+
"@storybook/preset-create-react-app": "^7.6.3",
|
|
45
|
+
"@storybook/react": "^7.6.3",
|
|
46
|
+
"@storybook/react-webpack5": "^7.6.3",
|
|
47
|
+
"@storybook/testing-library": "^0.2.2",
|
|
48
|
+
"@webpack-cli/generators": "^3.0.7",
|
|
49
|
+
"babel-plugin-named-exports-order": "^0.0.2",
|
|
50
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
51
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
52
|
+
"onchange": "^6.1.0",
|
|
53
|
+
"pre-commit": "^1.2.2",
|
|
54
|
+
"react-scripts": "^5.0.1",
|
|
55
|
+
"storybook": "^7.6.3",
|
|
56
|
+
"webpack": "^5.88.2",
|
|
57
|
+
"webpack-cli": "^5.1.4"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"@material-ui/core": "^4.12.4",
|
|
61
|
+
"@material-ui/icons": "^4.11.3",
|
|
62
|
+
"core-js": "^3.32.2",
|
|
63
|
+
"prop-types": "^15.8.1",
|
|
64
|
+
"react": "^16.9.0",
|
|
65
|
+
"react-dom": "^16.9.0",
|
|
66
|
+
"react-router-dom": "^5.3.4",
|
|
67
|
+
"styled-components": "^6.0.7"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"start": "react-scripts start",
|
|
71
|
+
"build": "rm -rf build && NODE_ENV=production babel src/lib --out-dir build --copy-files",
|
|
72
|
+
"publish:local": "npm run build && yalc push --force",
|
|
73
|
+
"watch:publish": "onchange 'src/lib/**/*' -- npm run publish:local",
|
|
74
|
+
"storybook": "storybook dev -p 6006",
|
|
75
|
+
"build-storybook": "storybook build",
|
|
76
|
+
"update-package-lock": "npm i --package-lock-only",
|
|
77
|
+
"lint": "eslint src/** --ext .js,.jsx",
|
|
78
|
+
"lint-fix": "npm run lint -- --fix",
|
|
79
|
+
"lint-fix-quiet": "npm run lint-fix -- --quiet",
|
|
80
|
+
"pre-commit": "./pre-commit.sh"
|
|
81
|
+
},
|
|
82
|
+
"pre-commit": {
|
|
83
|
+
"run": [
|
|
84
|
+
"pre-commit"
|
|
85
|
+
],
|
|
86
|
+
"silent": true
|
|
87
|
+
},
|
|
88
|
+
"browserslist": {
|
|
89
|
+
"production": [
|
|
90
|
+
">0.2%",
|
|
91
|
+
"not dead",
|
|
92
|
+
"not op_mini all"
|
|
93
|
+
],
|
|
94
|
+
"development": [
|
|
95
|
+
"last 1 chrome version",
|
|
96
|
+
"last 1 firefox version",
|
|
97
|
+
"last 1 safari version"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}
|