kui-crm_actions 0.0.82 → 0.0.84

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/index.d.ts CHANGED
@@ -517,7 +517,9 @@ declare const apartmentFields: {
517
517
  lng: number;
518
518
  } | null;
519
519
  getObjectRoomsImages(images: InspectionRoomPhotoModel[]): RoomImagesParams[];
520
- getInspectionFillingParams(filling: InspectionFillingModel): {
520
+ getInspectionFillingParams(filling: InspectionFillingModel, withChecking?: boolean | undefined): {
521
+ check?: boolean | undefined;
522
+ wasMissing?: boolean | undefined;
521
523
  id: number;
522
524
  name: string;
523
525
  tag: {
package/index.js CHANGED
@@ -539,25 +539,21 @@ var apartmentFields = {
539
539
  : 0,
540
540
  }); });
541
541
  },
542
- getInspectionFillingParams: function (filling) {
542
+ getInspectionFillingParams: function (filling, withChecking) {
543
543
  var _a;
544
- return {
545
- id: filling.id,
546
- name: filling.description || "",
547
- tag: {
544
+ return __assign({ id: filling.id, name: filling.description || "", tag: {
548
545
  id: filling.feature.id,
549
546
  name: filling.feature.name,
550
- },
551
- images: (_a = filling.photos) === null || _a === void 0 ? void 0 : _a.map(function (image) {
547
+ }, images: (_a = filling.photos) === null || _a === void 0 ? void 0 : _a.map(function (image) {
552
548
  return ImageStore.initFromImageModel(image);
553
- }),
554
- serialNumber: filling.serial_code,
555
- numberOfSubjects: Number(filling.amount),
556
- instruction: filling.instruction
549
+ }), serialNumber: filling.serial_code, numberOfSubjects: Number(filling.amount), instruction: filling.instruction
557
550
  ? FileStore.initFromDocumentModel(filling.instruction)
558
- : null,
559
- type: matchesAPIFillingTypes[filling.feature.feature_type],
560
- };
551
+ : null, type: matchesAPIFillingTypes[filling.feature.feature_type] }, (withChecking && filling.feature.feature_type === "appliance"
552
+ ? {
553
+ check: !filling.is_absent,
554
+ wasMissing: filling.previously_absent,
555
+ }
556
+ : {}));
561
557
  },
562
558
  getApartmentDescriptionWithMetro: function (apartment) {
563
559
  return __assign(__assign({}, this.getApartmentDescriptionInfo(apartment)), { metroStations: this.getMetroStationsParams(apartment === null || apartment === void 0 ? void 0 : apartment.metro_stations) });
@@ -963,7 +959,7 @@ var templateObject_1$6;
963
959
 
964
960
  var FillingCardContent = function (props) {
965
961
  var filling = props.filling, warningLabel = props.warningLabel;
966
- return (jsxs(Grid, __assign({ container: true, alignItems: "center" }, { children: [!filling.wasMissing && (jsx(Tooltip, __assign({ content: jsx(Caption, __assign({ size: "xs" }, { children: warningLabel })) }, { children: jsx(StyledWarningIcon, { width: 17, height: 17 }) }))), jsxs(StyledLabelWrapper, { children: [jsx(Caption, __assign({ size: "s" }, { children: filling.name })), jsxs(StyledSubtitle, __assign({ size: "xs", color: "fiftyP" }, { children: [filling.numberOfSubjects ? "".concat(filling.numberOfSubjects, " pieces") : "", filling.numberOfSubjects && filling.serialNumber ? " \u2022 " : "", filling.serialNumber] }))] })] })));
962
+ return (jsxs(Grid, __assign({ container: true, alignItems: "center" }, { children: [filling.wasMissing && (jsx(Tooltip, __assign({ content: jsx(Caption, __assign({ size: "xs" }, { children: warningLabel })) }, { children: jsx(StyledWarningIcon, { width: 17, height: 17 }) }))), jsxs(StyledLabelWrapper, { children: [jsx(Caption, __assign({ size: "s" }, { children: filling.name })), jsxs(StyledSubtitle, __assign({ size: "xs", color: "fiftyP" }, { children: [filling.numberOfSubjects ? "".concat(filling.numberOfSubjects, " pieces") : "", filling.numberOfSubjects && filling.serialNumber ? " \u2022 " : "", filling.serialNumber] }))] })] })));
967
963
  };
968
964
  var StyledWarningIcon = styled(WarningIcon)(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n margin-left: 4px;\n path {\n fill: ", ";\n }\n"], ["\n margin-left: 4px;\n path {\n fill: ", ";\n }\n"])), theme.palette.red.fiftyP);
969
965
  var StyledLabelWrapper = styled.div(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n margin-left: 8px;\n"], ["\n margin-left: 8px;\n"])));
@@ -1036,10 +1032,7 @@ var useFillingList = function (apartmentId, formStore, fillingStore) {
1036
1032
  var _a, _b;
1037
1033
  if (!fillingStore.loader.isLoading && !((_b = (_a = formStore.fields) === null || _a === void 0 ? void 0 : _a.filling) === null || _b === void 0 ? void 0 : _b.length)) {
1038
1034
  formStore.updateFormFields({
1039
- fillingList: fillingStore.fillingList.map(function (filling) { return ({
1040
- id: filling.id,
1041
- check: false,
1042
- }); }),
1035
+ fillingList: fillingStore.fillingList.map(function (filling) { return (__assign(__assign({}, filling), { check: false })); }),
1043
1036
  });
1044
1037
  }
1045
1038
  }, [fillingStore.fillingList, fillingStore.loader.isLoading]);