@dexteel/mesf-core 4.19.0 → 4.20.0

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.
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "4.19.0"
2
+ ".": "4.20.0"
3
3
  }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # Changelog
2
+
3
+ ## [4.20.0](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v4.19.0...@dexteel/mesf-core-v4.20.0) (2024-09-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * **Shift Navigator:** Return shift in methods of hook ([52aece5](https://github.com/dexteel/mesf-core-frontend/commit/52aece5e9c9ad67e7cdf078792aa1024af1861a4))
9
+
10
+ ## [4.19.0] - 2024-08-12
11
+
12
+
13
+
1
14
  # Changelog
2
15
 
3
16
  ## [4.19.0](https://github.com/dexteel/mesf-core-frontend/compare/@dexteel/mesf-core-v4.18.1...@dexteel/mesf-core-v4.19.0) (2024-08-12)
@@ -2,13 +2,13 @@ import { ShiftNavigatorDirection } from "../component/shift-navigator.control";
2
2
  import { ShiftInfo } from "../models/shift-navigator.model";
3
3
  export declare const useShiftNavigatorManager: () => {
4
4
  shiftInfo: ShiftInfo | null;
5
- moveShift: (direction: ShiftNavigatorDirection) => Promise<void>;
6
- getShiftDataFromAPI: (productionDate: Date | null, shiftId: number) => Promise<void>;
7
- initShiftNavigator: () => Promise<void>;
5
+ moveShift: (direction: ShiftNavigatorDirection) => Promise<ShiftInfo | void>;
6
+ getShiftDataFromAPI: (productionDate: Date | null, shiftId: number) => Promise<ShiftInfo | void>;
7
+ initShiftNavigator: () => Promise<ShiftInfo | void>;
8
8
  };
9
9
  export type ShiftNavigatorManagerResult = {
10
10
  shiftInfo: ShiftInfo | null;
11
- moveShift: (direction: ShiftNavigatorDirection) => Promise<void>;
12
- getShiftDataFromAPI: (productionDate: Date | null, shiftId: number) => Promise<void>;
13
- initShiftNavigator: () => Promise<void>;
11
+ moveShift: (direction: ShiftNavigatorDirection) => Promise<ShiftInfo | void>;
12
+ getShiftDataFromAPI: (productionDate: Date | null, shiftId: number) => Promise<ShiftInfo | void>;
13
+ initShiftNavigator: () => Promise<ShiftInfo | void>;
14
14
  };
package/dist/index.esm.js CHANGED
@@ -7890,7 +7890,7 @@ var useShiftNavigatorManager = function () {
7890
7890
  var _b = useState(false); _b[0]; var setIsShiftInfoLoading = _b[1];
7891
7891
  var _c = useState(""); _c[0]; var setError = _c[1];
7892
7892
  var moveShift = function (direction) { return __awaiter(void 0, void 0, void 0, function () {
7893
- var shiftId, resp;
7893
+ var shiftId, resp, shift;
7894
7894
  return __generator(this, function (_a) {
7895
7895
  switch (_a.label) {
7896
7896
  case 0:
@@ -7916,11 +7916,13 @@ var useShiftNavigatorManager = function () {
7916
7916
  case 1:
7917
7917
  resp = _a.sent();
7918
7918
  if (resp.ok) {
7919
- setShiftInfo(__assign(__assign({}, resp.data), { CurrentProductionDate: moment$1
7919
+ shift = __assign(__assign({}, resp.data), { CurrentProductionDate: moment$1
7920
7920
  .utc(resp.data.CurrentProductionDate)
7921
7921
  .toDate(), CurrentStart: moment$1.utc(resp.data.CurrentStart).toDate(), CurrentEnd: moment$1.utc(resp.data.CurrentEnd).toDate(), PreviousProductionDate: moment$1
7922
7922
  .utc(resp.data.PreviousProductionDate)
7923
- .toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() }));
7923
+ .toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() });
7924
+ setShiftInfo(shift);
7925
+ return [2 /*return*/, shift];
7924
7926
  }
7925
7927
  _a.label = 2;
7926
7928
  case 2: return [2 /*return*/];
@@ -7928,7 +7930,7 @@ var useShiftNavigatorManager = function () {
7928
7930
  });
7929
7931
  }); };
7930
7932
  var getShiftDataFromAPI = function (productionDate, shiftId) { return __awaiter(void 0, void 0, void 0, function () {
7931
- var resp, e_1;
7933
+ var resp, shift, e_1;
7932
7934
  return __generator(this, function (_a) {
7933
7935
  switch (_a.label) {
7934
7936
  case 0:
@@ -7943,11 +7945,13 @@ var useShiftNavigatorManager = function () {
7943
7945
  case 2:
7944
7946
  resp = _a.sent();
7945
7947
  if (resp.ok) {
7946
- setShiftInfo(__assign(__assign({}, resp.data), { CurrentProductionDate: moment$1
7948
+ shift = __assign(__assign({}, resp.data), { CurrentProductionDate: moment$1
7947
7949
  .utc(resp.data.CurrentProductionDate)
7948
7950
  .toDate(), CurrentStart: moment$1.utc(resp.data.CurrentStart).toDate(), CurrentEnd: moment$1.utc(resp.data.CurrentEnd).toDate(), PreviousProductionDate: moment$1
7949
7951
  .utc(resp.data.PreviousProductionDate)
7950
- .toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() }));
7952
+ .toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() });
7953
+ setShiftInfo(shift);
7954
+ return [2 /*return*/, shift];
7951
7955
  }
7952
7956
  return [3 /*break*/, 4];
7953
7957
  case 3:
@@ -7961,7 +7965,7 @@ var useShiftNavigatorManager = function () {
7961
7965
  });
7962
7966
  }); };
7963
7967
  var initShiftNavigator = function () { return __awaiter(void 0, void 0, void 0, function () {
7964
- var resp;
7968
+ var resp, shift;
7965
7969
  return __generator(this, function (_a) {
7966
7970
  switch (_a.label) {
7967
7971
  case 0: return [4 /*yield*/, getShiftByParameters({
@@ -7971,11 +7975,13 @@ var useShiftNavigatorManager = function () {
7971
7975
  case 1:
7972
7976
  resp = _a.sent();
7973
7977
  if (resp.ok) {
7974
- setShiftInfo(__assign(__assign({}, resp.data), { CurrentProductionDate: moment$1
7978
+ shift = __assign(__assign({}, resp.data), { CurrentProductionDate: moment$1
7975
7979
  .utc(resp.data.CurrentProductionDate)
7976
7980
  .toDate(), CurrentStart: moment$1.utc(resp.data.CurrentStart).toDate(), CurrentEnd: moment$1.utc(resp.data.CurrentEnd).toDate(), PreviousProductionDate: moment$1
7977
7981
  .utc(resp.data.PreviousProductionDate)
7978
- .toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() }));
7982
+ .toDate(), PreviousStart: moment$1.utc(resp.data.PreviousStart).toDate(), PreviousEnd: moment$1.utc(resp.data.PreviousEnd).toDate(), LastProductionDate: moment$1.utc(resp.data.LastProductionDate).toDate(), LastStart: moment$1.utc(resp.data.LastStart).toDate(), LastEnd: moment$1.utc(resp.data.LastEnd).toDate() });
7983
+ setShiftInfo(shift);
7984
+ return [2 /*return*/, shift];
7979
7985
  }
7980
7986
  return [2 /*return*/];
7981
7987
  }