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>RcuvP`gipP#&x`S1N-
zuLCe7`FnZ;w(u&`hTVrkJh@BA1L4Kxx6h&1_xOVrB(C@2?$!6+Rnqq{BWaM^elN_9
z+%HMjL*?juRj&86#65eC3Gu(#l25_H-W_QO2?QzrYQ=ijJhe|7y=zWXP+>@PF~g!O-5e^bqV
zd+fj88voWZkMw5`erox7hy16OKX0{uYw>-0nSXzepIUz2as8>~&r0WSEmhb*wfslj
z^S6foE1decKQ;VSiu!j~{#lIrZ5a4Z*zeNRZ@d5f?D1Q{{8N4F>HUA7M1Dj6uP#ec
z{3BWT4f|Kz{>UnRTXgs*>|Z&?pXfh#w%=&lSN|~j*FN_r{Lkh4H#~^y?{NP`9aWHq
U{yFb4ATS`5o<`
createStyles({
@@ -64,13 +65,17 @@ export default function ShiftTab(): JSX.Element {
}
const dispatcher = useDispatch();
const handleChangeItem = (createdShift: Shift): void => {
- if (mode === ShiftDrawerMode.ADD_NEW) {
- dispatcher(ScheduleDataActionCreator.addNewShift(createdShift));
+ if (!ParserHelper.shiftPassesDayStart(createdShift)) {
+ if (mode === ShiftDrawerMode.ADD_NEW) {
+ dispatcher(ScheduleDataActionCreator.addNewShift(createdShift));
+ } else {
+ dispatcher(ScheduleDataActionCreator.modifyShift(createdShift, selectedShift));
+ }
+
+ toggleClose();
} else {
- dispatcher(ScheduleDataActionCreator.modifyShift(createdShift, selectedShift));
+ // TODO. Handle unappropriately created shift
}
-
- toggleClose();
};
const handleRemoveItem = (shift: Shift): void => {
diff --git a/src/helpers/parser.helper.ts b/src/helpers/parser.helper.ts
index bed26caf2..ce5930c07 100644
--- a/src/helpers/parser.helper.ts
+++ b/src/helpers/parser.helper.ts
@@ -2,6 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
+import { Shift } from "../common-models/shift-info.model";
+import { DEFAULT_FROM } from "../logic/schedule-parser/shifts-types-info.parser";
+
export const EMPTY_ROW_SIZE = 40;
export const EMPTY_ROW = Array(EMPTY_ROW_SIZE).fill("");
@@ -106,4 +109,12 @@ export class ParserHelper {
public static getShiftColorHeaderIndex(): number {
return this.getShiftHeaderIndex(KOLOR);
}
+
+ public static shiftPassesDayStart(shift: Shift): boolean {
+ return shift.isWorkingShift
+ ? shift.from <= shift.to
+ ? shift.from < DEFAULT_FROM && DEFAULT_FROM < shift.to
+ : DEFAULT_FROM < shift.to || shift.from < DEFAULT_FROM
+ : false;
+ }
}
diff --git a/src/logic/schedule-exporter/shift-export.logic.ts b/src/logic/schedule-exporter/shift-export.logic.ts
index 69cdc3954..fa719c977 100644
--- a/src/logic/schedule-exporter/shift-export.logic.ts
+++ b/src/logic/schedule-exporter/shift-export.logic.ts
@@ -66,8 +66,8 @@ export class ShiftExportLogic {
shifts.push([
name.name,
name.code,
- name.from,
- name.to,
+ name.isWorkingShift ? name.from : "-",
+ name.isWorkingShift ? name.to : "-",
ParserHelper.translateBooleanToString(name.isWorkingShift).toUpperCase(),
name.color,
])
diff --git a/src/logic/schedule-parser/shifts-types-info.parser.ts b/src/logic/schedule-parser/shifts-types-info.parser.ts
index 3b3874e23..e36a6d749 100644
--- a/src/logic/schedule-parser/shifts-types-info.parser.ts
+++ b/src/logic/schedule-parser/shifts-types-info.parser.ts
@@ -7,8 +7,10 @@ import { AcronymGenerator } from "../../helpers/acronym-generator.helper";
import { ParserHelper } from "../../helpers/parser.helper";
const DEFAULT_SHIFT_NAME = "Zmiana";
-const DEFAULT_FROM = 7;
+export const DEFAULT_FROM = 7;
+const DEFAULT_NON_WORKING_FROM = 0;
const DEFAULT_TO = 7;
+const DEFAULT_NON_WORKING_TO = 24;
const DEFAULT_IS_WORKING = false;
const DEFAULT_COLOR = { name: "czerwony", value: "FF0000" };
@@ -21,7 +23,11 @@ export class ShiftsTypesInfoParser {
this.namelessShifts = 0;
data.forEach((a) => {
const shift = this.mapShift(a);
- this._shiftsInfoRows[shift.code] = shift;
+ if (!ParserHelper.shiftPassesDayStart(shift)) {
+ this._shiftsInfoRows[shift.code] = shift;
+ } else {
+ this.logLoadFileError("Nie dodano zmiany " + shift.name + ". Przecina godzinę 7:00.");
+ }
});
}
@@ -71,10 +77,20 @@ export class ShiftsTypesInfoParser {
}
}
- private parseShiftFrom(shiftRow: string[], name: string): number {
+ private parseShiftFrom(shiftRow: string[], name: string, isWorkingShift: boolean): number {
const index = ParserHelper.getShiftStartHeaderIndex();
if (index >= 0 && shiftRow[index]) {
+ if (!isWorkingShift) {
+ const from = shiftRow[index].trim();
+ if (from !== "" && from !== "-") {
+ this.logLoadFileError(
+ "Nieoczekiwana wartość dla początku dla niepracującej zmiany: " + name
+ );
+ }
+ return DEFAULT_NON_WORKING_FROM;
+ }
+
const number = parseInt(shiftRow[index].trim());
if (isNaN(number) || number < 0 || number > 24) {
this.logLoadFileError(
@@ -84,31 +100,42 @@ export class ShiftsTypesInfoParser {
return number;
}
} else {
- this.logLoadFileError(
- "Nie ustawiono początku zmiany: " + name + ". Ustawiono: " + DEFAULT_FROM
- );
+ if (isWorkingShift) {
+ this.logLoadFileError(
+ "Nie ustawiono początku zmiany: " + name + ". Ustawiono: " + DEFAULT_FROM
+ );
+ }
}
- return DEFAULT_FROM;
+ return isWorkingShift ? DEFAULT_FROM : DEFAULT_NON_WORKING_FROM;
}
- private parseShiftTo(shiftRow: string[], name: string): number {
+ private parseShiftTo(shiftRow: string[], name: string, isWorkingShift: boolean): number {
const index = ParserHelper.getShiftEndHeaderIndex();
if (index >= 0 && shiftRow[index]) {
+ if (!isWorkingShift) {
+ const to = shiftRow[index].trim();
+ if (to !== "" && to !== "-") {
+ this.logLoadFileError(
+ "Nieoczekiwana wartość dla końca dla niepracującej zmiany: " + name
+ );
+ }
+ return DEFAULT_NON_WORKING_TO;
+ }
const number = parseInt(shiftRow[index].trim());
if (isNaN(number) || number < 0 || number > 24) {
this.logLoadFileError(
- "Nieoczekiwana wartość dla początku zmiany: " + name + ". Ustawiono: " + DEFAULT_TO
+ "Nieoczekiwana wartość dla końca zmiany: " + name + ". Ustawiono: " + DEFAULT_TO
);
} else {
return number;
}
} else {
- this.logLoadFileError(
- "Nie ustawiono początku zmiany: " + name + ". Ustawiono: " + DEFAULT_TO
- );
+ if (isWorkingShift) {
+ this.logLoadFileError("Nie ustawiono końca zmiany: " + name + ". Ustawiono: " + DEFAULT_TO);
+ }
}
- return DEFAULT_TO;
+ return isWorkingShift ? DEFAULT_TO : DEFAULT_NON_WORKING_TO;
}
private parseShiftIsWorking(shiftRow: string[], name: string): boolean {
@@ -152,9 +179,9 @@ export class ShiftsTypesInfoParser {
private mapShift(row: string[]): Shift {
const name = this.parseShiftName(row);
const code = this.parseShiftCode(row, name);
- const from = this.parseShiftFrom(row, name);
- const to = this.parseShiftTo(row, name);
const isWorkingShift = this.parseShiftIsWorking(row, name);
+ const from = this.parseShiftFrom(row, name, isWorkingShift);
+ const to = this.parseShiftTo(row, name, isWorkingShift);
const color = this.parseShiftColor(row, name);
return {
From 76ad3f475a9f843b6b13a768e14018e3c25b4dce Mon Sep 17 00:00:00 2001
From: Bohdan
Date: Tue, 6 Apr 2021 08:00:24 +0200
Subject: [PATCH 03/54] Task 438 new app structure (#340)
---
cypress/fixtures/schedule.ts | 7 +-
.../worker-data/march-2021-raw-worker-data.ts | 1 +
.../worker-data/worker-data-preprocessor.ts | 4 +-
.../schedule-errors.spec.ts | 6 +-
.../e2e/table/load-schedule.spec.ts | 5 +-
.../e2e/table/range-selection.spec.ts | 5 +-
.../e2e/table/schedule-modes.spec.ts | 2 +-
.../integration/e2e/table/undo-redo.spec.ts | 2 +-
.../e2e/table/update-workhours-info.spec.ts | 2 +-
.../unit/helpers/file.helper.spec.ts | 4 +-
.../unit/helpers/shift.helper.spec.ts | 20 +++--
.../unit/helpers/worker-hours-info.spec.ts | 23 ++----
.../unit/helpers/working-time.helper.spec.ts | 2 +-
.../schedule-parser/schedule.parser.spec.ts | 14 ++--
.../schedule-parser/shift-info.parser.spec.ts | 8 +-
.../schedule-preprocess.spec.ts | 2 +-
.../validation/month-info-validation.spec.ts | 43 ++++++----
.../schedule-key-validation.spec.ts | 2 +-
.../schedule-display-requirement.spec.ts | 4 +-
.../schedule-editing-requirement.spec.ts | 2 +-
cypress/support/commands.ts | 25 +++---
cypress/support/index.d.ts | 2 +-
package-lock.json | 33 ++++----
src/api/backend.ts | 6 +-
src/api/server.middleware.ts | 6 +-
src/app.tsx | 36 ++++----
src/assets/devMode/schedule.ts | 4 +-
.../styles/styles/custom/_dropdown.scss | 2 +-
.../app-error-boundary.component.tsx | 2 +-
.../header.component.tsx | 20 ++---
.../button-component/button.component.tsx | 0
.../dropdown-buttons.component.tsx | 2 +-
.../dropdown-colors.component.tsx | 2 +-
.../empty-month-buttons.tsx | 18 ++--
.../import-buttons/hooks/use-file-reader.ts | 0
.../hooks/use-schedule-converter.ts | 23 ++----
.../import-buttons.component.tsx | 9 +-
.../import-buttons/import-modal-context.tsx | 10 +--
.../route-buttons/route-buttons.component.tsx | 0
src/components/common-components/index.ts | 12 +--
.../drawer/drawer-header.component.tsx | 0
.../drawer/drawer.component.tsx | 0
.../drawer/persistent-drawer-context.tsx} | 17 ++--
.../drawer/persistent-drawer.component.tsx} | 10 +--
.../error-container-drawer.component.tsx} | 18 ++--
.../loading-errors-view.component.tsx} | 21 +++--
.../worker-drawer.component.tsx | 10 +--
.../combined-worknorm-selector.component.tsx | 2 +-
.../form-field-error-label.component.tsx | 0
.../worker-drawer}/worker-edit/index.ts | 0
...-contract-work-norm-selector.component.tsx | 4 +-
...orker-contract-type-selector.component.tsx | 4 +-
.../worker-edit/worker-edit.component.tsx | 12 ++-
.../worker-edit/worker-edit.models.ts | 10 +--
...-contract-work-norm-selector.component.tsx | 8 +-
.../worker-group-selector.component.tsx | 6 +-
.../worker-name-edit-field.components.tsx | 2 +-
.../worker-position-selector.component.tsx | 4 +-
.../worker-info}/export-to-pdf.ts | 2 +-
.../worker-info}/worker-info.component.tsx | 18 ++--
.../error-list-item.component.tsx | 12 +--
.../error-list.component.tsx | 4 +-
.../span-errors.component.tsx | 3 +-
.../footer.component.tsx} | 6 +-
.../undoable.component.tsx | 5 +-
.../app-error.modal.component.tsx | 10 ++-
.../delete-worker.modal.component.tsx | 6 +-
.../error.modal.list.component.tsx | 2 +-
.../error.modal.list.item.component.tsx | 8 +-
.../error-modal/errors.modal.component.tsx | 10 +--
.../export-modal/export.modal.component.tsx | 15 ++--
.../modal => modals}/modal.component.tsx | 2 +-
.../report-issue-modal.component.tsx | 4 +-
.../save-changes-modal.component.tsx | 8 +-
.../month-switch/month-switch.component.tsx | 6 +-
.../notification/alert.component.tsx | 4 +-
.../notification-snackbar.component.tsx | 0
.../notification/notification.context.tsx | 0
.../notification/types.ts | 0
.../error-popper/error-popper.component.tsx} | 21 ++---
.../base-cell => poppers}/popper.tsx | 0
.../date-section/date-section.component.tsx | 11 ---
.../base-cell/base-cell-input.component.tsx | 2 +-
.../base}/base-cell/base-cell.component.tsx | 18 ++--
.../base}/base-cell/base-cell.models.ts | 8 +-
.../cell-blockable-input.component.tsx | 2 +-
.../base/base-row}/base-row.component.tsx | 6 +-
.../base/base-row}/base-row.models.ts | 6 +-
.../base-section/base-section.component.tsx | 16 ++--
.../base-section/use-selection-matrix.ts | 0
.../foundation-info.component.tsx | 24 +++---
.../hooks/use-cell-highlight.ts | 7 +-
.../hooks/use-cell-selection.ts | 0
.../schedule-folding-section.component.tsx | 0
.../overtime-header-cell.component.tsx | 0
.../overtime-header-row.component.tsx | 2 +-
.../overtime-header.component.tsx | 1 +
.../timetable/timetable-cell.component.tsx | 18 ++--
.../timetable/timetable-row.component.tsx | 11 +--
.../timetable/timetable-section.component.tsx | 2 +
.../timetable/timetable.component.tsx | 1 +
.../schedule/schedule-state.model.ts | 0
.../schedule/schedule.component.tsx | 16 ++--
.../nametable-section.component.tsx | 31 +++----
.../name-table}/nametable.component.tsx | 8 +-
.../cell-details-content.component.tsx | 4 +-
.../shift-autocomplete.component.tsx | 11 ++-
.../shifts-section}/shift-cell.component.tsx | 82 +++++++++----------
.../shifts-section}/shift-row.component.tsx | 14 ++--
.../shifts-section.component.tsx | 23 +++---
.../summarytable-cell.component.tsx | 0
.../summarytable-cell.models.ts | 2 +-
.../summarytable-row.component.tsx | 2 +-
.../summary-table}/summarytable-row.models.ts | 2 +-
.../summarytable-section.component.tsx | 2 +-
.../summarytable-section.models.tsx | 0
.../summary-table}/summarytable.component.tsx | 4 +-
.../worker-info-section.component.tsx | 19 ++---
.../worker-info-section.models.tsx | 0
.../shift-drawer.component.tsx | 4 +-
.../shift-edit-drawer.component.tsx | 10 +--
.../snackbar/snackbar.component.tsx | 0
.../worker-calendar-cell.component.tsx | 10 +--
.../workers-calendar.component.tsx | 6 +-
src/helpers/acronym-generator.helper.ts | 2 +-
src/helpers/contract-type.helper.ts | 24 ++++++
src/helpers/data-row.helper.ts | 2 +-
src/helpers/error-message.helper.ts | 6 +-
src/helpers/file.helper.ts | 6 +-
src/helpers/month.helper.ts | 2 +-
src/helpers/parser.helper.ts | 2 +-
src/helpers/shifts.helper.ts | 25 ++----
src/helpers/verbose-date.helper.ts | 4 +-
src/helpers/worker-hours-info.model.ts | 20 ++---
src/helpers/worker-type.helper.ts | 24 ++++++
.../working-time.helper.tsx | 0
.../use-actual-month.tsx | 6 +-
.../use-component-visible.tsx | 0
.../use-foundation-info.ts | 7 +-
.../use-month-info.ts} | 6 +-
.../use-schedule-styling.ts | 4 +-
.../use-temporary-schedule.ts | 6 +-
.../base-cell => hooks}/use-timeout.tsx | 0
.../schedule => hooks}/use-worker-groups.ts | 17 ++--
.../use-worker-hours-info.ts | 17 ++--
.../namestable => hooks}/use-worker-info.ts | 10 +--
.../local-storage-provider.model.ts | 30 ++++---
.../data-access}/persistance-store.model.ts | 9 +-
src/logic/month-copy/month-copy.logic.ts | 22 +++--
.../schedule-container-converter.ts} | 37 +++++----
.../schedule-export.logic.ts | 6 +-
.../schedule-info-export.logic.ts | 12 +--
.../schedule-exporter/shift-export.logic.ts | 2 +-
.../schedule-exporter/worker-export.logic.ts | 7 +-
src/logic/schedule-logic/data-row.ts | 2 +-
src/logic/schedule-logic/month-info.logic.ts | 5 +-
.../schedule-parser/children-info.parser.ts | 7 +-
.../extra-workers-info.parser.ts | 7 +-
.../schedule-parser/extra-workers.parser.ts | 4 +-
.../foundation-info.parser.tsx | 2 +-
src/logic/schedule-parser/metadata.parser.ts | 9 +-
src/logic/schedule-parser/schedule.parser.ts | 12 ++-
.../schedule-parser/shifts-info.parser.ts | 8 +-
.../shifts-types-info.parser.ts | 7 +-
.../schedule-parser/workers-info.parser.ts | 11 ++-
.../children-info-provider.model.ts | 2 +-
.../day-workers-info-provider.ts | 2 +-
.../extra-workers-info-provider.model.ts | 2 +-
.../foundation-info-provider.model.ts | 2 +-
.../metadata-provider.model.ts | 4 +-
.../schedule-provider.model.ts | 6 +-
.../shifts-provider.model.ts | 6 +-
.../management-page.component.tsx | 2 +-
.../enhanced-table-header.component.tsx | 6 +-
.../shifts-tab/shifts-tab.component.tsx | 14 ++--
.../enhanced-table-header.component.tsx | 6 +-
.../workers-tab/workers-tab.component.tsx | 20 +++--
.../corrupted-schedule.component.tsx | 14 ++--
.../edit-tab}/edit-page-toolbar.component.tsx | 37 +++++----
.../edit-tab}/schedule-edit.page.tsx | 8 +-
.../new-month-tab}/new-schedule.component.tsx | 4 +-
.../read-only-tab/read-only-toolbar.tsx} | 15 ++--
.../schedule-read-only.page.tsx} | 14 ++--
.../schedule-container.component.tsx | 11 +--
.../schedule-page/schedule-page.component.tsx | 18 ++--
.../mode-info-reducer.ts | 4 +-
src/state/app.reducer.tsx | 16 ++--
.../{models => }/application-state.model.ts | 10 +--
.../schedule-data-initial-state.ts | 51 ------------
.../schedule-data/schedule.reducer.ts | 28 -------
.../foundation-info.action-creator.ts | 6 +-
.../foundation-info.initial-state.ts | 15 ++++
.../foundation-info/foundation-info.model.ts} | 28 ++++---
.../foundation-info.reducer.ts} | 17 ++--
.../month-info/month-info.initial-state.ts | 11 +++
.../month-info/month-info.model.ts} | 12 +--
.../month-info/month-info.reducer.ts} | 16 ++--
.../month-switch.action-creator.ts | 16 ++--
.../primary-revision.initial-state.ts | 13 +++
.../primary-revision.reducer.ts} | 6 +-
.../corrupted-info.reducer.ts | 6 +-
.../generation-info.reducer.ts | 4 +-
.../revision-info.reducer.ts | 8 +-
.../schedule-data-initial-state.ts | 21 +++++
.../schedule-data.action-creator.ts | 28 ++++---
.../schedule-data}/schedule-data.model.ts | 41 +++++-----
.../schedule-error-message.model.ts | 0
.../schedule-errors}/schedule-error.model.ts | 6 +-
.../schedule-errors.reducer.ts | 10 +--
.../schedule-data/schedule.actions.ts | 10 +--
src/state/schedule-data/schedule.reducer.ts | 28 +++++++
.../shifts-types/shift-types.model.ts} | 30 +------
.../shifts-types}/shifts-model.reducer.ts | 8 +-
.../shifts-types}/shifts.action-creator.ts | 14 ++--
.../undoable.action-creator.ts | 4 +-
.../worker-info/worker-info.initial-state.ts | 13 +++
.../worker-info}/worker-info.model.ts | 46 +----------
.../worker-info/worker-info.reducer.ts} | 12 +--
.../worker-info}/worker.action-creator.ts | 39 ++++-----
.../worker-shifts.action-creator.ts | 21 +++++
.../worker-shifts.initial-state.ts} | 6 +-
.../workers-shifts/worker-shifts.model.ts | 31 +++++++
.../workers-shifts/worker-shifts.reducer.ts} | 23 +++---
src/{state/models => utils}/action.model.ts | 0
.../data-row.model.ts | 0
src/{common-models => utils}/type-utils.ts | 0
src/{common-models => utils}/utils.ts | 0
227 files changed, 1168 insertions(+), 1101 deletions(-)
rename src/components/{common-components/header => app-header}/header.component.tsx (87%)
rename src/components/{common-components => buttons}/button-component/button.component.tsx (100%)
rename src/components/{common-components => buttons}/dropdown-buttons/dropdown-buttons.component.tsx (97%)
rename src/components/{common-components => buttons}/dropdown-buttons/dropdown-colors.component.tsx (98%)
rename src/components/{schedule-page => buttons/empty-month-buttons}/empty-month-buttons.tsx (79%)
rename src/components/{schedule-page => buttons}/import-buttons/hooks/use-file-reader.ts (100%)
rename src/components/{schedule-page => buttons}/import-buttons/hooks/use-schedule-converter.ts (91%)
rename src/components/{schedule-page => buttons}/import-buttons/import-buttons.component.tsx (84%)
rename src/components/{schedule-page => buttons}/import-buttons/import-modal-context.tsx (80%)
rename src/components/{common-components => buttons}/route-buttons/route-buttons.component.tsx (100%)
rename src/components/{common-components => drawers}/drawer/drawer-header.component.tsx (100%)
rename src/components/{common-components => drawers}/drawer/drawer.component.tsx (100%)
rename src/components/{common-components/drawer/jira-like-drawer-context.tsx => drawers/drawer/persistent-drawer-context.tsx} (62%)
rename src/components/{common-components/drawer/jira-like-drawer.component.tsx => drawers/drawer/persistent-drawer.component.tsx} (78%)
rename src/components/{schedule-page/validation-drawer/validation-drawer.component.tsx => drawers/error-container-drawer/error-container-drawer.component.tsx} (77%)
rename src/components/{schedule-page/validation-drawer/error-loader.component.tsx => drawers/error-container-drawer/loading-errors-view.component.tsx} (80%)
rename src/components/{workers-page/workers-tab => drawers/worker-drawer}/worker-drawer.component.tsx (80%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/combined-worknorm-selector.component.tsx (92%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/form-field-error-label.component.tsx (100%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/index.ts (100%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/worker-civil-contract-work-norm-selector.component.tsx (94%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/worker-contract-type-selector.component.tsx (93%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/worker-edit.component.tsx (92%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/worker-edit.models.ts (81%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/worker-employment-contract-work-norm-selector.component.tsx (91%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/worker-group-selector.component.tsx (85%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/worker-name-edit-field.components.tsx (97%)
rename src/components/{namestable => drawers/worker-drawer}/worker-edit/worker-position-selector.component.tsx (93%)
rename src/components/{namestable => drawers/worker-drawer/worker-info}/export-to-pdf.ts (97%)
rename src/components/{namestable => drawers/worker-drawer/worker-info}/worker-info.component.tsx (79%)
rename src/components/{schedule-page/validation-drawer => error-list}/error-list-item.component.tsx (83%)
rename src/components/{schedule-page/validation-drawer => error-list}/error-list.component.tsx (96%)
rename src/components/{schedule-page/validation-drawer => error-list}/span-errors.component.tsx (81%)
rename src/components/{common-components/netlify-pro-footer/netlify-pro-footer.component.tsx => footer/footer.component.tsx} (87%)
rename src/components/{common-components/tools => global-hotkeys}/undoable.component.tsx (90%)
rename src/components/{common-components/modal => modals}/app-error-modal/app-error.modal.component.tsx (90%)
rename src/components/{common-components/modal => modals}/delete-worker-modal/delete-worker.modal.component.tsx (84%)
rename src/components/{common-components/modal => modals}/error-modal/error.modal.list.component.tsx (86%)
rename src/components/{common-components/modal => modals}/error-modal/error.modal.list.item.component.tsx (83%)
rename src/components/{common-components/modal => modals}/error-modal/errors.modal.component.tsx (80%)
rename src/components/{common-components/modal => modals}/export-modal/export.modal.component.tsx (87%)
rename src/components/{common-components/modal => modals}/modal.component.tsx (97%)
rename src/components/{common-components/modal => modals}/report-issue-modal/report-issue-modal.component.tsx (96%)
rename src/components/{common-components/modal => modals}/save-changes-modal/save-changes-modal.component.tsx (89%)
rename src/components/{common-components => }/month-switch/month-switch.component.tsx (89%)
rename src/components/{common-components => }/notification/alert.component.tsx (90%)
rename src/components/{common-components => }/notification/notification-snackbar.component.tsx (100%)
rename src/components/{common-components => }/notification/notification.context.tsx (100%)
rename src/components/{common-components => }/notification/types.ts (100%)
rename src/components/{schedule-page/table/schedule/schedule-parts/error-tooltip-provider.component.tsx => poppers/error-popper/error-popper.component.tsx} (87%)
rename src/components/{schedule-page/table/schedule/schedule-parts/base-cell => poppers}/popper.tsx (100%)
delete mode 100644 src/components/schedule-page/table/schedule/sections/date-section/date-section.component.tsx
rename src/components/{schedule-page/table/schedule/schedule-parts => schedule/base}/base-cell/base-cell-input.component.tsx (93%)
rename src/components/{schedule-page/table/schedule/schedule-parts => schedule/base}/base-cell/base-cell.component.tsx (74%)
rename src/components/{schedule-page/table/schedule/schedule-parts => schedule/base}/base-cell/base-cell.models.ts (83%)
rename src/components/{schedule-page/table/schedule/schedule-parts => schedule/base/base-cell}/cell-blockable-input.component.tsx (93%)
rename src/components/{schedule-page/table/schedule/schedule-parts => schedule/base/base-row}/base-row.component.tsx (91%)
rename src/components/{schedule-page/table/schedule/schedule-parts => schedule/base/base-row}/base-row.models.ts (86%)
rename src/components/{schedule-page/table/schedule/sections => schedule/base}/base-section/base-section.component.tsx (88%)
rename src/components/{schedule-page/table/schedule/sections => schedule/base}/base-section/use-selection-matrix.ts (100%)
rename src/components/{schedule-page/table/schedule/sections => schedule}/foundation-info-section/foundation-info.component.tsx (66%)
rename src/components/{schedule-page/table/schedule/schedule-parts => schedule}/hooks/use-cell-highlight.ts (82%)
rename src/components/{schedule-page/table/schedule/schedule-parts => schedule}/hooks/use-cell-selection.ts (100%)
rename src/components/{schedule-page/table/schedule/schedule-parts => schedule}/schedule-folding-section.component.tsx (100%)
rename src/components/{ => schedule/schedule-header}/overtime-header-table/overtime-header-cell.component.tsx (100%)
rename src/components/{ => schedule/schedule-header}/overtime-header-table/overtime-header-row.component.tsx (92%)
rename src/components/{ => schedule/schedule-header}/overtime-header-table/overtime-header.component.tsx (94%)
rename src/components/{ => schedule/schedule-header}/timetable/timetable-cell.component.tsx (80%)
rename src/components/{ => schedule/schedule-header}/timetable/timetable-row.component.tsx (80%)
rename src/components/{ => schedule/schedule-header}/timetable/timetable-section.component.tsx (92%)
rename src/components/{ => schedule/schedule-header}/timetable/timetable.component.tsx (92%)
rename src/components/{schedule-page/table => }/schedule/schedule-state.model.ts (100%)
rename src/components/{schedule-page/table => }/schedule/schedule.component.tsx (69%)
rename src/components/{namestable => schedule/worker-info-section/name-table}/nametable-section.component.tsx (76%)
rename src/components/{namestable => schedule/worker-info-section/name-table}/nametable.component.tsx (78%)
rename src/components/{schedule-page/table/schedule/schedule-parts/base-cell => schedule/worker-info-section/shifts-section}/cell-details-content.component.tsx (92%)
rename src/components/{schedule-page/table/schedule/schedule-parts/shift-cell => schedule/worker-info-section/shifts-section}/shift-autocomplete.component.tsx (94%)
rename src/components/{schedule-page/table/schedule/schedule-parts/shift-cell => schedule/worker-info-section/shifts-section}/shift-cell.component.tsx (75%)
rename src/components/{schedule-page/table/schedule/schedule-parts => schedule/worker-info-section/shifts-section}/shift-row.component.tsx (65%)
rename src/components/{schedule-page/table/schedule/sections => schedule/worker-info-section}/shifts-section/shifts-section.component.tsx (71%)
rename src/components/{summarytable => schedule/worker-info-section/summary-table}/summarytable-cell.component.tsx (100%)
rename src/components/{summarytable => schedule/worker-info-section/summary-table}/summarytable-cell.models.ts (78%)
rename src/components/{summarytable => schedule/worker-info-section/summary-table}/summarytable-row.component.tsx (91%)
rename src/components/{summarytable => schedule/worker-info-section/summary-table}/summarytable-row.models.ts (79%)
rename src/components/{summarytable => schedule/worker-info-section/summary-table}/summarytable-section.component.tsx (93%)
rename src/components/{summarytable => schedule/worker-info-section/summary-table}/summarytable-section.models.tsx (100%)
rename src/components/{summarytable => schedule/worker-info-section/summary-table}/summarytable.component.tsx (84%)
rename src/components/{schedule-page/table/schedule/sections => schedule}/worker-info-section/worker-info-section.component.tsx (72%)
rename src/components/{schedule-page/table/schedule/sections => schedule}/worker-info-section/worker-info-section.models.tsx (100%)
rename src/components/{workers-page/shifts-tab => shifts-drawer}/shift-drawer.component.tsx (87%)
rename src/components/{workers-page/shifts-tab => shifts-drawer}/shift-edit-drawer.component.tsx (94%)
rename src/components/{common-components => }/snackbar/snackbar.component.tsx (100%)
rename src/components/{workers-page => }/workers-calendar/worker-calendar-cell.component.tsx (83%)
rename src/components/{workers-page => }/workers-calendar/workers-calendar.component.tsx (88%)
create mode 100644 src/helpers/contract-type.helper.ts
create mode 100644 src/helpers/worker-type.helper.ts
rename src/{components/namestable => helpers}/working-time.helper.tsx (100%)
rename src/{components/common-components/month-switch => hooks}/use-actual-month.tsx (81%)
rename src/{components/schedule-page/table/schedule/schedule-parts/base-cell => hooks}/use-component-visible.tsx (100%)
rename src/{components/schedule-page/table/schedule/sections/foundation-info-section => hooks}/use-foundation-info.ts (81%)
rename src/{components/schedule-page/validation-drawer/use-verbose-dates.ts => hooks/use-month-info.ts} (83%)
rename src/{components/common-components => hooks}/use-schedule-styling/use-schedule-styling.ts (84%)
rename src/{components/schedule-page/edit-page => hooks}/use-temporary-schedule.ts (74%)
rename src/{components/schedule-page/table/schedule/schedule-parts/base-cell => hooks}/use-timeout.tsx (100%)
rename src/{components/schedule-page/table/schedule => hooks}/use-worker-groups.ts (79%)
rename src/{components/schedule-page/table/schedule => hooks}/use-worker-hours-info.ts (83%)
rename src/{components/namestable => hooks}/use-worker-info.ts (89%)
rename src/{api => logic/data-access}/local-storage-provider.model.ts (95%)
rename src/{api => logic/data-access}/persistance-store.model.ts (91%)
rename src/logic/{schedule-container-convertion/schedule-container-convertion.ts => schedule-container-converter/schedule-container-converter.ts} (80%)
rename src/logic/{providers => schedule-providers}/children-info-provider.model.ts (78%)
rename src/logic/{providers => schedule-providers}/day-workers-info-provider.ts (78%)
rename src/logic/{providers => schedule-providers}/extra-workers-info-provider.model.ts (80%)
rename src/logic/{providers => schedule-providers}/foundation-info-provider.model.ts (92%)
rename src/logic/{providers => schedule-providers}/metadata-provider.model.ts (79%)
rename src/logic/{providers => schedule-providers}/schedule-provider.model.ts (90%)
rename src/logic/{providers => schedule-providers}/shifts-provider.model.ts (68%)
rename src/{components/workers-page => pages/management-page}/management-page.component.tsx (92%)
rename src/{components/workers-page => pages/management-page}/shifts-tab/enhanced-table-header.component.tsx (89%)
rename src/{components/workers-page => pages/management-page}/shifts-tab/shifts-tab.component.tsx (89%)
rename src/{components/workers-page => pages/management-page}/workers-tab/enhanced-table-header.component.tsx (92%)
rename src/{components/workers-page => pages/management-page}/workers-tab/workers-tab.component.tsx (90%)
rename src/{components/schedule-page => pages/schedule-page/corrupted-month-tab}/corrupted-schedule.component.tsx (80%)
rename src/{components/schedule-page/edit-page => pages/schedule-page/edit-tab}/edit-page-toolbar.component.tsx (76%)
rename src/{components/schedule-page/edit-page => pages/schedule-page/edit-tab}/schedule-edit.page.tsx (79%)
rename src/{components/schedule-page => pages/schedule-page/new-month-tab}/new-schedule.component.tsx (74%)
rename src/{components/schedule-page/view-only-page/view-only-toolbar.tsx => pages/schedule-page/read-only-tab/read-only-toolbar.tsx} (85%)
rename src/{components/schedule-page/view-only-page/schedule-view-only.page.tsx => pages/schedule-page/read-only-tab/schedule-read-only.page.tsx} (67%)
rename src/{components => pages}/schedule-page/schedule-container.component.tsx (72%)
rename src/{components => pages}/schedule-page/schedule-page.component.tsx (73%)
rename src/state/{reducers/month-state => app-condition}/mode-info-reducer.ts (83%)
rename src/state/{models => }/application-state.model.ts (64%)
delete mode 100644 src/state/reducers/month-state/schedule-data/schedule-data-initial-state.ts
delete mode 100644 src/state/reducers/month-state/schedule-data/schedule.reducer.ts
rename src/state/{reducers/month-state/schedule-data => schedule-data/foundation-info}/foundation-info.action-creator.ts (83%)
create mode 100644 src/state/schedule-data/foundation-info/foundation-info.initial-state.ts
rename src/{common-models/month-info.model.ts => state/schedule-data/foundation-info/foundation-info.model.ts} (72%)
rename src/state/{reducers/month-state/month-info.reducer.ts => schedule-data/foundation-info/foundation-info.reducer.ts} (73%)
create mode 100644 src/state/schedule-data/month-info/month-info.initial-state.ts
rename src/{common-models/schedule.model.ts => state/schedule-data/month-info/month-info.model.ts} (57%)
rename src/state/{reducers/month-state/schedule-info.reducer.ts => schedule-data/month-info/month-info.reducer.ts} (67%)
rename src/state/{reducers/month-state => }/schedule-data/month-switch.action-creator.ts (81%)
create mode 100644 src/state/schedule-data/primary-revision/primary-revision.initial-state.ts
rename src/state/{reducers/base-revision.reducer.ts => schedule-data/primary-revision/primary-revision.reducer.ts} (79%)
rename src/state/{reducers/month-state => schedule-data/schedule-condition}/corrupted-info.reducer.ts (82%)
rename src/state/{reducers/month-state => schedule-data/schedule-condition}/generation-info.reducer.ts (86%)
rename src/state/{reducers/month-state => schedule-data/schedule-condition}/revision-info.reducer.ts (82%)
create mode 100644 src/state/schedule-data/schedule-data-initial-state.ts
rename src/state/{reducers/month-state => }/schedule-data/schedule-data.action-creator.ts (87%)
rename src/{common-models => state/schedule-data}/schedule-data.model.ts (82%)
rename src/{common-models => state/schedule-data/schedule-errors}/schedule-error-message.model.ts (100%)
rename src/{common-models => state/schedule-data/schedule-errors}/schedule-error.model.ts (95%)
rename src/state/{reducers/month-state => schedule-data/schedule-errors}/schedule-errors.reducer.ts (79%)
rename src/state/{reducers/month-state => }/schedule-data/schedule.actions.ts (84%)
create mode 100644 src/state/schedule-data/schedule.reducer.ts
rename src/{common-models/shift-info.model.ts => state/schedule-data/shifts-types/shift-types.model.ts} (82%)
rename src/state/{reducers/month-state => schedule-data/shifts-types}/shifts-model.reducer.ts (78%)
rename src/state/{reducers => schedule-data/shifts-types}/shifts.action-creator.ts (77%)
rename src/state/{reducers => schedule-data}/undoable.action-creator.ts (89%)
create mode 100644 src/state/schedule-data/worker-info/worker-info.initial-state.ts
rename src/{common-models => state/schedule-data/worker-info}/worker-info.model.ts (64%)
rename src/state/{reducers/month-state/employee-info.reducer.ts => schedule-data/worker-info/worker-info.reducer.ts} (85%)
rename src/state/{reducers => schedule-data/worker-info}/worker.action-creator.ts (81%)
create mode 100644 src/state/schedule-data/workers-shifts/worker-shifts.action-creator.ts
rename src/{components/workers-page/constraints-tab/constraints-tab.component.tsx => state/schedule-data/workers-shifts/worker-shifts.initial-state.ts} (62%)
create mode 100644 src/state/schedule-data/workers-shifts/worker-shifts.model.ts
rename src/state/{reducers/month-state/shifts-info.reducer.ts => schedule-data/workers-shifts/worker-shifts.reducer.ts} (71%)
rename src/{state/models => utils}/action.model.ts (100%)
rename src/{common-models => utils}/data-row.model.ts (100%)
rename src/{common-models => utils}/type-utils.ts (100%)
rename src/{common-models => utils}/utils.ts (100%)
diff --git a/cypress/fixtures/schedule.ts b/cypress/fixtures/schedule.ts
index 76127aedf..f33ba07f7 100644
--- a/cypress/fixtures/schedule.ts
+++ b/cypress/fixtures/schedule.ts
@@ -3,8 +3,11 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
/* eslint-disable @typescript-eslint/camelcase */
-import { ContractType, WorkerGroup } from "../../src/common-models/worker-info.model";
-import { ScheduleDataModel } from "../../src/common-models/schedule-data.model";
+import { ScheduleDataModel } from "../../src/state/schedule-data/schedule-data.model";
+import {
+ ContractType,
+ WorkerGroup,
+} from "../../src/state/schedule-data/worker-info/worker-info.model";
export default {
schedule_info: { UUID: "0", month_number: 1, year: 2021 },
diff --git a/cypress/fixtures/worker-data/march-2021-raw-worker-data.ts b/cypress/fixtures/worker-data/march-2021-raw-worker-data.ts
index db6e53677..ae3428379 100644
--- a/cypress/fixtures/worker-data/march-2021-raw-worker-data.ts
+++ b/cypress/fixtures/worker-data/march-2021-raw-worker-data.ts
@@ -2,6 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
+
/**
Data completed based on schedules
marzec_2021_wersja_bazowa
diff --git a/cypress/fixtures/worker-data/worker-data-preprocessor.ts b/cypress/fixtures/worker-data/worker-data-preprocessor.ts
index 70a0fe028..114b7a088 100644
--- a/cypress/fixtures/worker-data/worker-data-preprocessor.ts
+++ b/cypress/fixtures/worker-data/worker-data-preprocessor.ts
@@ -1,9 +1,9 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import { ShiftCode } from "../../../src/common-models/shift-info.model";
-import { ContractType } from "../../../src/common-models/worker-info.model";
import { MonthDataArray } from "../../../src/helpers/shifts.helper";
+import { ShiftCode } from "../../../src/state/schedule-data/shifts-types/shift-types.model";
+import { ContractType } from "../../../src/state/schedule-data/worker-info/worker-info.model";
import { monthWorkerData } from "./march-2021-raw-worker-data";
const MARCH_DAY_COUNT = 31;
diff --git a/cypress/integration/e2e/app-error-handling/schedule-errors.spec.ts b/cypress/integration/e2e/app-error-handling/schedule-errors.spec.ts
index 1c6627132..dfde69219 100644
--- a/cypress/integration/e2e/app-error-handling/schedule-errors.spec.ts
+++ b/cypress/integration/e2e/app-error-handling/schedule-errors.spec.ts
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import { WorkerType } from "../../../../src/common-models/worker-info.model";
+import { WorkerType } from "../../../../src/state/schedule-data/worker-info/worker-info.model";
const addWorker = (workerName: string, position: WorkerType): void => {
cy.get('[data-cy="btn-management-tab"]').click();
@@ -36,9 +36,9 @@ context("Schedule errors", () => {
addWorker(Cypress.env("REACT_APP_ERROR_WORKER"), WorkerType.NURSE);
cy.get('[data-cy="btn-schedule-tab"]').click({ force: true });
Cypress.on("uncaught:exception", () => {
- cy.get('[data-cy="btn-ok-app-error"]').click();
+ cy.get('[data-cy="btn-reload-app-error"]').click();
cy.get('[data-cy="timetable-row"]').should("be.visible");
- cy.get('[data-cy="btn-ok-app-error"]').click();
+ cy.get('[data-cy="btn-reload-app-error"]').click();
cy.get('[data-cy="restore-prev-version"]').click();
cy.contains("testUser");
return false;
diff --git a/cypress/integration/e2e/table/load-schedule.spec.ts b/cypress/integration/e2e/table/load-schedule.spec.ts
index 33a52ab3d..64fa95961 100644
--- a/cypress/integration/e2e/table/load-schedule.spec.ts
+++ b/cypress/integration/e2e/table/load-schedule.spec.ts
@@ -2,8 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import { ShiftCode } from "../../../../src/common-models/shift-info.model";
-import { shiftSectionDataCy } from "../../../../src/components/schedule-page/table/schedule/sections/worker-info-section/worker-info-section.models";
+
+import { shiftSectionDataCy } from "../../../../src/components/schedule/worker-info-section/worker-info-section.models";
+import { ShiftCode } from "../../../../src/state/schedule-data/shifts-types/shift-types.model";
import { FoundationInfoRowType } from "../../../support/commands";
//#region Test data
interface CheckFoundationInfoReadCorrectly {
diff --git a/cypress/integration/e2e/table/range-selection.spec.ts b/cypress/integration/e2e/table/range-selection.spec.ts
index 3d4fa3752..c359fd51f 100644
--- a/cypress/integration/e2e/table/range-selection.spec.ts
+++ b/cypress/integration/e2e/table/range-selection.spec.ts
@@ -2,10 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import * as _ from "lodash";
-import { ShiftCode } from "../../../../src/common-models/shift-info.model";
-import { shiftSectionDataCy } from "../../../../src/components/schedule-page/table/schedule/sections/worker-info-section/worker-info-section.models";
+import { shiftSectionDataCy } from "../../../../src/components/schedule/worker-info-section/worker-info-section.models";
+import { ShiftCode } from "../../../../src/state/schedule-data/shifts-types/shift-types.model";
import { GetWorkerShiftOptions } from "../../../support/commands";
+
const prevMonthDays = 6;
interface WorkerTestCase {
diff --git a/cypress/integration/e2e/table/schedule-modes.spec.ts b/cypress/integration/e2e/table/schedule-modes.spec.ts
index f467e948a..9d5d69463 100644
--- a/cypress/integration/e2e/table/schedule-modes.spec.ts
+++ b/cypress/integration/e2e/table/schedule-modes.spec.ts
@@ -1,7 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import { ShiftCode } from "../../../../src/common-models/shift-info.model";
+import { ShiftCode } from "../../../../src/state/schedule-data/shifts-types/shift-types.model";
const testedCell = {
workerGroupIdx: 0,
diff --git a/cypress/integration/e2e/table/undo-redo.spec.ts b/cypress/integration/e2e/table/undo-redo.spec.ts
index 447660fd6..d8fc25e42 100644
--- a/cypress/integration/e2e/table/undo-redo.spec.ts
+++ b/cypress/integration/e2e/table/undo-redo.spec.ts
@@ -4,7 +4,7 @@
///
import { GetWorkerShiftOptions } from "../../../support/commands";
-import { ShiftCode } from "../../../../src/common-models/shift-info.model";
+import { ShiftCode } from "../../../../src/state/schedule-data/shifts-types/shift-types.model";
interface TestCase {
testedShiftCell: GetWorkerShiftOptions;
diff --git a/cypress/integration/e2e/table/update-workhours-info.spec.ts b/cypress/integration/e2e/table/update-workhours-info.spec.ts
index 5cdd55f57..920392671 100644
--- a/cypress/integration/e2e/table/update-workhours-info.spec.ts
+++ b/cypress/integration/e2e/table/update-workhours-info.spec.ts
@@ -1,7 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import { ShiftCode } from "../../../../src/common-models/shift-info.model";
+import { ShiftCode } from "../../../../src/state/schedule-data/shifts-types/shift-types.model";
import { GetWorkerShiftOptions, HoursInfo, HoursInfoCells } from "../../../support/commands";
const nurseInitialWorkHours: HoursInfo[] = [
diff --git a/cypress/integration/unit/helpers/file.helper.spec.ts b/cypress/integration/unit/helpers/file.helper.spec.ts
index 28dd0b260..caeee3db1 100644
--- a/cypress/integration/unit/helpers/file.helper.spec.ts
+++ b/cypress/integration/unit/helpers/file.helper.spec.ts
@@ -2,9 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import { FileHelper } from "../../../../src/helpers/file.helper";
-import { ScheduleDataModel } from "../../../../src/common-models/schedule-data.model";
+import { ScheduleDataModel } from "../../../../src/state/schedule-data/schedule-data.model";
import schedule from "../../../fixtures/schedule";
-import { cropScheduleDMToMonthDM } from "../../../../src/logic/schedule-container-convertion/schedule-container-convertion";
+import { cropScheduleDMToMonthDM } from "../../../../src/logic/schedule-container-converter/schedule-container-converter";
describe("FileHelper", () => {
it(`Should properly create directory name based on filename`, () => {
diff --git a/cypress/integration/unit/helpers/shift.helper.spec.ts b/cypress/integration/unit/helpers/shift.helper.spec.ts
index 38d0ca2cb..25b9c6a11 100644
--- a/cypress/integration/unit/helpers/shift.helper.spec.ts
+++ b/cypress/integration/unit/helpers/shift.helper.spec.ts
@@ -1,38 +1,42 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import { VerboseDate } from "../../../../src/common-models/month-info.model";
-import { ShiftCode, ShiftInfoModel, SHIFTS } from "../../../../src/common-models/shift-info.model";
+import { VerboseDate } from "../../../../src/state/schedule-data/foundation-info/foundation-info.model";
+import {
+ ShiftCode,
+ SHIFTS,
+} from "../../../../src/state/schedule-data/shifts-types/shift-types.model";
import { ShiftHelper } from "../../../../src/helpers/shifts.helper";
import { WorkerHourInfo } from "../../../../src/helpers/worker-hours-info.model";
+import { WorkerShiftsModel } from "../../../../src/state/schedule-data/workers-shifts/worker-shifts.model";
//#region getWorkersCount data
-type GetWorkersCountTestCase = { arr: ShiftInfoModel; exp: Array };
+type GetWorkersCountTestCase = { arr: WorkerShiftsModel; exp: Array };
-const testData1: ShiftInfoModel = {
+const testData1: WorkerShiftsModel = {
"0": ["R", "DN", "W"].map((d) => ShiftCode[d]),
"1": ["P", "D", "W"].map((d) => ShiftCode[d]),
"2": ["D", "W", "W"].map((d) => ShiftCode[d]),
};
-const testData2: ShiftInfoModel = {
+const testData2: WorkerShiftsModel = {
"0": ["W", "W", "W"].map((d) => ShiftCode[d]),
"1": ["W", "W", "W"].map((d) => ShiftCode[d]),
"2": ["W", "W", "W"].map((d) => ShiftCode[d]),
};
-const testData3: ShiftInfoModel = {
+const testData3: WorkerShiftsModel = {
"0": ["R", "R", "R"].map((d) => ShiftCode[d]),
"1": ["R", "R", "R"].map((d) => ShiftCode[d]),
"2": ["R", "R", "R"].map((d) => ShiftCode[d]),
};
-const testData4: ShiftInfoModel = {
+const testData4: WorkerShiftsModel = {
"0": ["R", "W", "R", "W"].map((d) => ShiftCode[d]),
"1": ["R", "R", "R", "W"].map((d) => ShiftCode[d]),
"2": ["R", "W", "R", "R"].map((d) => ShiftCode[d]),
};
-const testData5: ShiftInfoModel = {
+const testData5: WorkerShiftsModel = {
"0": ["R", "W", "R", "W"].map((d) => ShiftCode[d]),
"1": ["R", "R", "R", "W"].map((d) => ShiftCode[d]),
"2": ["P", "R", "R", "R"].map((d) => ShiftCode[d]),
diff --git a/cypress/integration/unit/helpers/worker-hours-info.spec.ts b/cypress/integration/unit/helpers/worker-hours-info.spec.ts
index 832f9f95e..46f172841 100644
--- a/cypress/integration/unit/helpers/worker-hours-info.spec.ts
+++ b/cypress/integration/unit/helpers/worker-hours-info.spec.ts
@@ -2,23 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import * as _ from "lodash";
-import {
- NotWorkingShift,
- NotWorkingShiftType,
- Shift,
- ShiftCode,
- SHIFTS,
-} from "../../../../src/common-models/shift-info.model";
-import { ContractType } from "../../../../src/common-models/worker-info.model";
-import { MonthDataArray, ShiftHelper } from "../../../../src/helpers/shifts.helper";
-import {
- DEFAULT_NORM_SUBTRACTION,
- WorkerHourInfo,
-} from "../../../../src/helpers/worker-hours-info.model";
-import {
- workerTestData,
- WorkerTestDataInstance,
-} from "../../../fixtures/worker-data/worker-data-preprocessor";
+import { ShiftHelper, MonthDataArray } from "../../../../src/helpers/shifts.helper";
+import { DEFAULT_NORM_SUBTRACTION, WorkerHourInfo } from "../../../../src/helpers/worker-hours-info.model";
+import { SHIFTS, ShiftCode, Shift, NotWorkingShift, NotWorkingShiftType } from "../../../../src/state/schedule-data/shifts-types/shift-types.model";
+import { ContractType } from "../../../../src/state/schedule-data/worker-info/worker-info.model";
+import { workerTestData, WorkerTestDataInstance } from "../../../fixtures/worker-data/worker-data-preprocessor";
+
describe("Worker hours info", () => {
workerTestData.forEach((workerInstance) => {
diff --git a/cypress/integration/unit/helpers/working-time.helper.spec.ts b/cypress/integration/unit/helpers/working-time.helper.spec.ts
index c53fe0c28..c0f1ca2ec 100644
--- a/cypress/integration/unit/helpers/working-time.helper.spec.ts
+++ b/cypress/integration/unit/helpers/working-time.helper.spec.ts
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import { WorkingTimeHelper } from "../../../../src/components/namestable/working-time.helper";
+import { WorkingTimeHelper } from "../../../../src/helpers/working-time.helper";
describe("WorkingTimeHelper", () => {
describe("fromHoursToFraction", () => {
diff --git a/cypress/integration/unit/logic/schedule-parser/schedule.parser.spec.ts b/cypress/integration/unit/logic/schedule-parser/schedule.parser.spec.ts
index 68d161eaa..dcd4cd38e 100644
--- a/cypress/integration/unit/logic/schedule-parser/schedule.parser.spec.ts
+++ b/cypress/integration/unit/logic/schedule-parser/schedule.parser.spec.ts
@@ -4,12 +4,16 @@
/* eslint-disable @typescript-eslint/camelcase */
///
import { ScheduleParser } from "../../../../../src/logic/schedule-parser/schedule.parser";
-// import { ScheduleDataModel } from "../../../../../src/common-models/schedule-data.model";
-import { ShiftCode, ShiftInfoModel } from "../../../../../src/common-models/shift-info.model";
-import { WorkersInfoModel, WorkerType } from "../../../../../src/common-models/worker-info.model";
+import { ShiftCode } from "../../../../../src/state/schedule-data/shifts-types/shift-types.model";
+import {
+ WorkersInfoModel,
+ WorkerType,
+} from "../../../../../src/state/schedule-data/worker-info/worker-info.model";
+import { WorkerShiftsModel } from "../../../../../src/state/schedule-data/workers-shifts/worker-shifts.model";
+// import { ScheduleDataModel } from "../../../../../src/schedule-data.model";
function fillWorkerInfo(
- shifts: ShiftInfoModel,
+ shifts: WorkerShiftsModel,
employeeInfo: WorkersInfoModel,
section: string[][],
sectionType: WorkerType
@@ -47,7 +51,7 @@ const exampleData = [
babysitterSection,
];
-const shifts: ShiftInfoModel = {};
+const shifts: WorkerShiftsModel = {};
const employee_info: WorkersInfoModel = { type: {}, time: {}, workerGroup: {} };
fillWorkerInfo(shifts, employee_info, nurseSection, WorkerType.NURSE);
diff --git a/cypress/integration/unit/logic/schedule-parser/shift-info.parser.spec.ts b/cypress/integration/unit/logic/schedule-parser/shift-info.parser.spec.ts
index b570ecd50..2077f319c 100644
--- a/cypress/integration/unit/logic/schedule-parser/shift-info.parser.spec.ts
+++ b/cypress/integration/unit/logic/schedule-parser/shift-info.parser.spec.ts
@@ -5,7 +5,7 @@
// import { DataRowParser } from "../../../../../src/logic/schedule-parser/data-row.parser";
// import { MetaDataParser } from "../../../../../src/logic/schedule-parser/metadata.parser";
// import { ShiftsInfoParser } from "../../../../../src/logic/schedule-parser/shifts-info.parser";
-// import { WorkerType } from "../../../../../src/common-models/worker-info.model";
+// import { WorkerType } from "../../../../../src/worker-info.model";
//#region data declaration
@@ -48,11 +48,11 @@ const metaData: MetaDataParser = new MetaDataParser(2020, 10, [
describe("ShifstInfo parser", () => {
//todo update test
- // context("Testing detection of errors", () => {
+ // context("Testing detection of error-list", () => {
// TestCases.forEach((element) => {
// const shiftsInfoParser = new ShiftsInfoParser(WorkerType.OTHER, metaData, element.data);
- // const result = shiftsInfoParser.errors;
- // it(`should have exaclty ${element.errorCount} errors`, () => {
+ // const result = shiftsInfoParser.error-list;
+ // it(`should have exaclty ${element.errorCount} error-list`, () => {
// expect(result).have.lengthOf(element.errorCount);
// });
// });
diff --git a/cypress/integration/unit/logic/schedule-preprocess/schedule-preprocess.spec.ts b/cypress/integration/unit/logic/schedule-preprocess/schedule-preprocess.spec.ts
index 57a888bf3..58a93d8b1 100644
--- a/cypress/integration/unit/logic/schedule-preprocess/schedule-preprocess.spec.ts
+++ b/cypress/integration/unit/logic/schedule-preprocess/schedule-preprocess.spec.ts
@@ -1,7 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import { ScheduleKey } from "../../../../../src/api/persistance-store.model";
+import { ScheduleKey } from "../../../../../src/logic/data-access/persistance-store.model";
import { MonthHelper } from "../../../../../src/helpers/month.helper";
interface TestCase {
diff --git a/cypress/integration/unit/validation/month-info-validation.spec.ts b/cypress/integration/unit/validation/month-info-validation.spec.ts
index c21d660b0..06329b0ca 100644
--- a/cypress/integration/unit/validation/month-info-validation.spec.ts
+++ b/cypress/integration/unit/validation/month-info-validation.spec.ts
@@ -2,74 +2,81 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import * as _ from "lodash";
-import { MonthInfoModel, validateMonthInfo } from "../../../../src/common-models/month-info.model";
import {
- ScheduleContainerType,
+ validateFoundationInfo,
+ FoundationInfoModel,
+} from "../../../../src/state/schedule-data/foundation-info/foundation-info.model";
+import {
SCHEDULE_CONTAINERS_LENGTH,
-} from "../../../../src/common-models/schedule-data.model";
-
+ ScheduleContainerType,
+} from "../../../../src/state/schedule-data/schedule-data.model";
describe("Month info validation", () => {
it("Should throw when length of dates in month info model is not allowed length for schedule data model", () => {
const invalidScheduleLenghth = SCHEDULE_CONTAINERS_LENGTH.SCHEDULE_DM[0] + 1;
- const invalidScheduleModel = createMonthInfoModel(invalidScheduleLenghth);
+ const invalidScheduleModel = createFoundationInfoModel(invalidScheduleLenghth);
const action = (): void =>
- validateMonthInfo(invalidScheduleModel, ScheduleContainerType.SCHEDULE_DM);
+ validateFoundationInfo(invalidScheduleModel, ScheduleContainerType.SCHEDULE_DM);
expect(action).to.throw();
});
it("Should throw when length of dates in month info model is not allowed length for month data model ", () => {
const invalidMOnthDayCount = 32;
- const invalidMonthModel = createMonthInfoModel(invalidMOnthDayCount);
- const action = (): void => validateMonthInfo(invalidMonthModel, ScheduleContainerType.MONTH_DM);
+ const invalidMonthModel = createFoundationInfoModel(invalidMOnthDayCount);
+ const action = (): void =>
+ validateFoundationInfo(invalidMonthModel, ScheduleContainerType.MONTH_DM);
expect(action).to.throw();
});
it("Should not throw when dates have valid length and defined", () => {
const validMonthDayCount = SCHEDULE_CONTAINERS_LENGTH.SCHEDULE_DM[0];
- const validMonthModel = createMonthInfoModel(validMonthDayCount);
+ const validMonthModel = createFoundationInfoModel(validMonthDayCount);
const action = (): void =>
- validateMonthInfo(validMonthModel, ScheduleContainerType.SCHEDULE_DM);
+ validateFoundationInfo(validMonthModel, ScheduleContainerType.SCHEDULE_DM);
expect(action).to.not.throw();
});
it("Should throw when length of children info is different than length of dates in schedule data model", () => {
const validLength = SCHEDULE_CONTAINERS_LENGTH.SCHEDULE_DM[0];
const invalidChildrenCount = validLength - 1;
- const invalidMonthInfoModel = createMonthInfoModel(validLength, invalidChildrenCount);
+ const invalidFoundationInfoModel = createFoundationInfoModel(validLength, invalidChildrenCount);
const action = (): void =>
- validateMonthInfo(invalidMonthInfoModel, ScheduleContainerType.SCHEDULE_DM);
+ validateFoundationInfo(invalidFoundationInfoModel, ScheduleContainerType.SCHEDULE_DM);
expect(action).to.throw();
});
it("Should throw when length of extra worker info is different than length of dates in schedule data model", () => {
const validLength = SCHEDULE_CONTAINERS_LENGTH.SCHEDULE_DM[0];
const invalidExtraWorkersCount = validLength - 1;
- const invalidMonthInfoModel = createMonthInfoModel(
+ const invalidFoundationInfoModel = createFoundationInfoModel(
validLength,
validLength,
invalidExtraWorkersCount
);
const action = (): void =>
- validateMonthInfo(invalidMonthInfoModel, ScheduleContainerType.SCHEDULE_DM);
+ validateFoundationInfo(invalidFoundationInfoModel, ScheduleContainerType.SCHEDULE_DM);
expect(action).to.throw();
});
it("Should not throw when month info is valid", () => {
const validLength = SCHEDULE_CONTAINERS_LENGTH.SCHEDULE_DM[0];
- const invalidMonthInfoModel = createMonthInfoModel(validLength, validLength, validLength);
+ const invalidFoundationInfoModel = createFoundationInfoModel(
+ validLength,
+ validLength,
+ validLength
+ );
const action = (): void =>
- validateMonthInfo(invalidMonthInfoModel, ScheduleContainerType.SCHEDULE_DM);
+ validateFoundationInfo(invalidFoundationInfoModel, ScheduleContainerType.SCHEDULE_DM);
expect(action).to.throw();
});
});
//#region Helper functions
/* eslint-disable @typescript-eslint/camelcase */
-const createMonthInfoModel = (
+const createFoundationInfoModel = (
dayCount: number,
childrenCount?: number,
extraWorkersCount?: number
-): MonthInfoModel => ({
+): FoundationInfoModel => ({
dates: _.range(1, dayCount + 1),
children_number: !_.isNil(childrenCount) ? _.range(1, childrenCount + 1) : undefined,
extra_workers: !_.isNil(extraWorkersCount) ? _.range(1, extraWorkersCount) : undefined,
diff --git a/cypress/integration/unit/validation/schedule-key-validation.spec.ts b/cypress/integration/unit/validation/schedule-key-validation.spec.ts
index 2d159b49e..0c2a63741 100644
--- a/cypress/integration/unit/validation/schedule-key-validation.spec.ts
+++ b/cypress/integration/unit/validation/schedule-key-validation.spec.ts
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import * as _ from "lodash";
-import { ScheduleKey } from "../../../../src/api/persistance-store.model";
+import { ScheduleKey } from "../../../../src/logic/data-access/persistance-store.model";
describe("Schedule key validation", () => {
const validYear = 2020;
diff --git a/cypress/integration/user-acceptance/schedule-display-requirement.spec.ts b/cypress/integration/user-acceptance/schedule-display-requirement.spec.ts
index d7658dfa1..37aa5cb01 100644
--- a/cypress/integration/user-acceptance/schedule-display-requirement.spec.ts
+++ b/cypress/integration/user-acceptance/schedule-display-requirement.spec.ts
@@ -1,8 +1,8 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import { ShiftCode } from "../../../src/common-models/shift-info.model";
-import { shiftSectionDataCy } from "../../../src/components/schedule-page/table/schedule/sections/worker-info-section/worker-info-section.models";
+import { shiftSectionDataCy } from "../../../src/components/schedule/worker-info-section/worker-info-section.models";
+import { ShiftCode } from "../../../src/state/schedule-data/shifts-types/shift-types.model";
context("Display schedule", () => {
it("Should be able to load and display schedule", () => {
diff --git a/cypress/integration/user-acceptance/schedule-editing-requirement.spec.ts b/cypress/integration/user-acceptance/schedule-editing-requirement.spec.ts
index a7c40f41b..1cdc36127 100644
--- a/cypress/integration/user-acceptance/schedule-editing-requirement.spec.ts
+++ b/cypress/integration/user-acceptance/schedule-editing-requirement.spec.ts
@@ -1,7 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import { ShiftCode } from "../../../src/common-models/shift-info.model";
+import { ShiftCode } from "../../../src/state/schedule-data/shifts-types/shift-types.model";
import {
ChangeFoundationInfoCellOptions,
FoundationInfoRowType,
diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts
index 56a10f63b..fe6d0ee5c 100644
--- a/cypress/support/commands.ts
+++ b/cypress/support/commands.ts
@@ -2,19 +2,20 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import "cypress-file-upload";
-import { LocalStorageProvider } from "../../src/api/local-storage-provider.model";
-import { ShiftCode } from "../../src/common-models/shift-info.model";
import {
baseCellDataCy,
- CellType,
-} from "../../src/components/schedule-page/table/schedule/schedule-parts/base-cell/base-cell.models";
-import { baseRowDataCy } from "../../src/components/schedule-page/table/schedule/schedule-parts/base-row.models";
-import { shiftSectionDataCy } from "../../src/components/schedule-page/table/schedule/sections/worker-info-section/worker-info-section.models";
-import { summaryCellDataCy } from "../../src/components/summarytable/summarytable-cell.models";
-import { summaryRowDataCy } from "../../src/components/summarytable/summarytable-row.models";
-import { summaryTableSectionDataCy } from "../../src/components/summarytable/summarytable-section.models";
-require("@cypress/snapshot").register();
+ CellType
+} from "../../src/components/schedule/base/base-cell/base-cell.models";
+import { baseRowDataCy } from "../../src/components/schedule/base/base-row/base-row.models";
+import { shiftSectionDataCy } from "../../src/components/schedule/worker-info-section/worker-info-section.models";
+import { summaryCellDataCy } from "../../src/components/schedule/worker-info-section/summary-table/summarytable-cell.models";
+import { summaryRowDataCy } from "../../src/components//schedule/worker-info-section/summary-table/summarytable-row.models";
+import { summaryTableSectionDataCy } from "../../src/components//schedule/worker-info-section/summary-table/summarytable-section.models";
+import { LocalStorageProvider } from "../../src/logic/data-access/local-storage-provider.model";
+import { ShiftCode } from "../../src/state/schedule-data/shifts-types/shift-types.model";
+
+require("@cypress/snapshot").register();
export type CypressScreenshotOptions = Partial<
Cypress.Loggable & Cypress.Timeoutable & Cypress.ScreenshotOptions
>;
@@ -139,10 +140,10 @@ Cypress.Commands.add(
if (Cypress.env("makeScreenshots") !== "true") {
return cy;
}
- cy.get("#header").invoke("css", "position", "absolute");
+ cy.get("#app-header").invoke("css", "position", "absolute");
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.screenshot(cyScreenshotOptions).wait(awaitTime);
- return cy.get("#header").invoke("css", "position", null);
+ return cy.get("#app-header").invoke("css", "position", null);
}
);
diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts
index 12d233472..c397bce8e 100644
--- a/cypress/support/index.d.ts
+++ b/cypress/support/index.d.ts
@@ -10,7 +10,7 @@ declare namespace Cypress {
): Chainable;
useAutocomplete(
- newShiftCode: import("../../src/common-models/shift-info.model").ShiftCode
+ newShiftCode: import("../../src/shift-info.model").ShiftCode
): Chainable;
getWorkerShift(
diff --git a/package-lock.json b/package-lock.json
index fa79954b4..11a4a0123 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "nurse-scheduling-problem",
- "version": "1.0.0",
+ "version": "2.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "nurse-scheduling-problem",
- "version": "1.0.0",
+ "version": "2.0.0",
"dependencies": {
"@date-io/date-fns": "^1.3.13",
"@material-ui/core": "^4.11.0",
@@ -5447,7 +5447,7 @@
},
"node_modules/@semantic-release/npm/node_modules/npm/node_modules/lodash._baseindexof": {
"version": "3.1.0",
- "extraneous": true,
+ "dev": true,
"inBundle": true,
"license": "MIT"
},
@@ -5463,19 +5463,19 @@
},
"node_modules/@semantic-release/npm/node_modules/npm/node_modules/lodash._bindcallback": {
"version": "3.0.1",
- "extraneous": true,
+ "dev": true,
"inBundle": true,
"license": "MIT"
},
"node_modules/@semantic-release/npm/node_modules/npm/node_modules/lodash._cacheindexof": {
"version": "3.0.2",
- "extraneous": true,
+ "dev": true,
"inBundle": true,
"license": "MIT"
},
"node_modules/@semantic-release/npm/node_modules/npm/node_modules/lodash._createcache": {
"version": "3.1.2",
- "extraneous": true,
+ "dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
@@ -5490,7 +5490,7 @@
},
"node_modules/@semantic-release/npm/node_modules/npm/node_modules/lodash._getnative": {
"version": "3.9.1",
- "extraneous": true,
+ "dev": true,
"inBundle": true,
"license": "MIT"
},
@@ -5508,7 +5508,7 @@
},
"node_modules/@semantic-release/npm/node_modules/npm/node_modules/lodash.restparam": {
"version": "3.6.1",
- "extraneous": true,
+ "dev": true,
"inBundle": true,
"license": "MIT"
},
@@ -25574,6 +25574,11 @@
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
},
+ "bin": {
+ "sshpk-conv": "bin/sshpk-conv",
+ "sshpk-sign": "bin/sshpk-sign",
+ "sshpk-verify": "bin/sshpk-verify"
+ },
"engines": {
"node": ">=0.10.0"
}
@@ -38763,7 +38768,7 @@
"lodash._baseindexof": {
"version": "3.1.0",
"bundled": true,
- "extraneous": true
+ "dev": true
},
"lodash._baseuniq": {
"version": "4.6.0",
@@ -38777,17 +38782,17 @@
"lodash._bindcallback": {
"version": "3.0.1",
"bundled": true,
- "extraneous": true
+ "dev": true
},
"lodash._cacheindexof": {
"version": "3.0.2",
"bundled": true,
- "extraneous": true
+ "dev": true
},
"lodash._createcache": {
"version": "3.1.2",
"bundled": true,
- "extraneous": true,
+ "dev": true,
"requires": {
"lodash._getnative": "^3.0.0"
}
@@ -38800,7 +38805,7 @@
"lodash._getnative": {
"version": "3.9.1",
"bundled": true,
- "extraneous": true
+ "dev": true
},
"lodash._root": {
"version": "3.0.1",
@@ -38815,7 +38820,7 @@
"lodash.restparam": {
"version": "3.6.1",
"bundled": true,
- "extraneous": true
+ "dev": true
},
"lodash.union": {
"version": "4.6.0",
diff --git a/src/api/backend.ts b/src/api/backend.ts
index c03b40543..556e975cf 100644
--- a/src/api/backend.ts
+++ b/src/api/backend.ts
@@ -2,9 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import axios, { AxiosInstance, AxiosRequestConfig } from "axios";
-import { ScheduleDataModel } from "../common-models/schedule-data.model";
-import { ScheduleError } from "../common-models/schedule-error.model";
-import { PrimaryMonthRevisionDataModel } from "../state/models/application-state.model";
+import { ScheduleDataModel } from "../state/schedule-data/schedule-data.model";
+import { ScheduleError } from "../state/schedule-data/schedule-errors/schedule-error.model";
+import { PrimaryMonthRevisionDataModel } from "../state/application-state.model";
import { ServerMiddleware } from "./server.middleware";
interface BackendErrorObject extends Omit {
diff --git a/src/api/server.middleware.ts b/src/api/server.middleware.ts
index 62d23ebb6..88eab1d22 100644
--- a/src/api/server.middleware.ts
+++ b/src/api/server.middleware.ts
@@ -3,15 +3,15 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import * as _ from "lodash";
import { v4 as uuidv4 } from "uuid";
-import { ScheduleDataModel } from "../common-models/schedule-data.model";
+import { ScheduleDataModel } from "../state/schedule-data/schedule-data.model";
import {
AlgorithmErrorCode,
ScheduleError,
WorkerOvertime,
WorkerUnderTime,
-} from "../common-models/schedule-error.model";
+} from "../state/schedule-data/schedule-errors/schedule-error.model";
import { WorkerHourInfo } from "../helpers/worker-hours-info.model";
-import { PrimaryMonthRevisionDataModel } from "../state/models/application-state.model";
+import { PrimaryMonthRevisionDataModel } from "../state/application-state.model";
type NameUuidMapper = {
[name: string]: string;
diff --git a/src/app.tsx b/src/app.tsx
index 485d757c3..0dff1ff28 100644
--- a/src/app.tsx
+++ b/src/app.tsx
@@ -5,27 +5,27 @@ import React, { useCallback, useEffect, useMemo, useState } from "react";
import { Route, Switch } from "react-router-dom";
import { useDispatch, useSelector } from "react-redux";
import schedule from "./assets/devMode/schedule";
-import { ScheduleDataModel } from "./common-models/schedule-data.model";
+import { ScheduleDataModel } from "./state/schedule-data/schedule-data.model";
import { HeaderComponent } from "./components/common-components";
import RouteButtonsComponent, {
Tabs,
-} from "./components/common-components/route-buttons/route-buttons.component";
-import { SchedulePage } from "./components/schedule-page/schedule-page.component";
-import ManagementPage from "./components/workers-page/management-page.component";
-import { ScheduleDataActionCreator } from "./state/reducers/month-state/schedule-data/schedule-data.action-creator";
-import { NotificationProvider } from "./components/common-components/notification/notification.context";
-import { NetlifyProFooter } from "./components/common-components/netlify-pro-footer/netlify-pro-footer.component";
+} from "./components/buttons/route-buttons/route-buttons.component";
+import { SchedulePage } from "./pages/schedule-page/schedule-page.component";
+import ManagementPage from "./pages/management-page/management-page.component";
+import { ScheduleDataActionCreator } from "./state/schedule-data/schedule-data.action-creator";
+import { NotificationProvider } from "./components/notification/notification.context";
+import { Footer } from "./components/footer/footer.component";
import { Box } from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
-import JiraLikeDrawer from "./components/common-components/drawer/jira-like-drawer.component";
-import { JiraLikeDrawerProvider } from "./components/common-components/drawer/jira-like-drawer-context";
+import PersistentDrawer from "./components/drawers/drawer/persistent-drawer.component";
+import { PersistentDrawerProvider } from "./components/drawers/drawer/persistent-drawer-context";
import ScssVars from "./assets/styles/styles/custom/_variables.module.scss";
-import { ApplicationStateModel } from "./state/models/application-state.model";
-import { ScheduleKey } from "./api/persistance-store.model";
+import { ApplicationStateModel } from "./state/application-state.model";
import { AppMode, useAppConfig } from "./state/app-config-context";
-import { cropScheduleDMToMonthDM } from "./logic/schedule-container-convertion/schedule-container-convertion";
-import { ImportModalProvider } from "./components/schedule-page/import-buttons/import-modal-context";
-import { LocalStorageProvider } from "./api/local-storage-provider.model";
+import { cropScheduleDMToMonthDM } from "./logic/schedule-container-converter/schedule-container-converter";
+import { ImportModalProvider } from "./components/buttons/import-buttons/import-modal-context";
+import { LocalStorageProvider } from "./logic/data-access/local-storage-provider.model";
+import { ScheduleKey } from "./logic/data-access/persistance-store.model";
const useStyles = makeStyles(() => ({
root: {
@@ -109,7 +109,7 @@ function App(): JSX.Element {
return (
-
+
@@ -117,16 +117,16 @@ function App(): JSX.Element {
-
+
-
+
-
+
);
}
diff --git a/src/assets/devMode/schedule.ts b/src/assets/devMode/schedule.ts
index 103fb44e7..b5a671370 100644
--- a/src/assets/devMode/schedule.ts
+++ b/src/assets/devMode/schedule.ts
@@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
/* eslint-disable @typescript-eslint/camelcase */
-import { ContractType, WorkerGroup } from "../../common-models/worker-info.model";
-import { ScheduleDataModel } from "../../common-models/schedule-data.model";
+import { ContractType, WorkerGroup } from "../../state/schedule-data/worker-info/worker-info.model";
+import { ScheduleDataModel } from "../../state/schedule-data/schedule-data.model";
export default {
schedule_info: { UUID: "0", month_number: 1, year: 2021 },
diff --git a/src/assets/styles/styles/custom/_dropdown.scss b/src/assets/styles/styles/custom/_dropdown.scss
index e0d6a6604..84a47e762 100644
--- a/src/assets/styles/styles/custom/_dropdown.scss
+++ b/src/assets/styles/styles/custom/_dropdown.scss
@@ -110,7 +110,7 @@
width: 100%;
justify-content: space-between;
//background-color: #55dcf8;
- //&[data-popper-placement^='bottom'] > .colorSample {
+ //&[data-poppers-placement^='bottom'] > .colorSample {
// background-color: #1d8cf8;
//}
}
diff --git a/src/components/app-error-boundary/app-error-boundary.component.tsx b/src/components/app-error-boundary/app-error-boundary.component.tsx
index 337bbd24e..bfd943896 100644
--- a/src/components/app-error-boundary/app-error-boundary.component.tsx
+++ b/src/components/app-error-boundary/app-error-boundary.component.tsx
@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React, { ReactNode, useCallback, useState } from "react";
-import AppErrorModal from "../common-components/modal/app-error-modal/app-error.modal.component";
+import AppErrorModal from "../modals/app-error-modal/app-error.modal.component";
import * as Sentry from "@sentry/react";
interface AppErrorBoundaryOptions {
diff --git a/src/components/common-components/header/header.component.tsx b/src/components/app-header/header.component.tsx
similarity index 87%
rename from src/components/common-components/header/header.component.tsx
rename to src/components/app-header/header.component.tsx
index 5ebd0cb6f..1a8bfa8ce 100644
--- a/src/components/common-components/header/header.component.tsx
+++ b/src/components/app-header/header.component.tsx
@@ -1,20 +1,20 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
+import { Button as MaterialButton } from "@material-ui/core";
import AssignmentIndIcon from "@material-ui/icons/AssignmentInd";
+import HelpOutlineIcon from "@material-ui/icons/HelpOutline";
+import SettingsIcon from "@material-ui/icons/Settings";
+import classNames from "classnames/bind";
import React, { useCallback, useContext, useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
-import { ApplicationStateModel } from "../../../state/models/application-state.model";
-import { MonthSwitchActionCreator } from "../../../state/reducers/month-state/schedule-data/month-switch.action-creator";
-import { Button } from "../button-component/button.component";
+import { AppConfigContext, AppConfigOptions, AppMode } from "../../state/app-config-context";
+import { ApplicationStateModel } from "../../state/application-state.model";
+import { MonthSwitchActionCreator } from "../../state/schedule-data/month-switch.action-creator";
+import ReportIssueModal from "../modals/report-issue-modal/report-issue-modal.component";
import { MonthSwitchComponent } from "../month-switch/month-switch.component";
-import classNames from "classnames/bind";
-import { Button as MaterialButton } from "@material-ui/core";
-import ReportIssueModal from "../modal/report-issue-modal/report-issue-modal.component";
-import SettingsIcon from "@material-ui/icons/Settings";
-import HelpOutlineIcon from "@material-ui/icons/HelpOutline";
-import { AppConfigContext, AppConfigOptions, AppMode } from "../../../state/app-config-context";
-import { ScheduleMode } from "../../schedule-page/table/schedule/schedule-state.model";
+import { ScheduleMode } from "../schedule/schedule-state.model";
+import { Button } from "../buttons/button-component/button.component";
function monthDiff(d1: Date, d2: Date): number {
let months: number;
diff --git a/src/components/common-components/button-component/button.component.tsx b/src/components/buttons/button-component/button.component.tsx
similarity index 100%
rename from src/components/common-components/button-component/button.component.tsx
rename to src/components/buttons/button-component/button.component.tsx
diff --git a/src/components/common-components/dropdown-buttons/dropdown-buttons.component.tsx b/src/components/buttons/dropdown-buttons/dropdown-buttons.component.tsx
similarity index 97%
rename from src/components/common-components/dropdown-buttons/dropdown-buttons.component.tsx
rename to src/components/buttons/dropdown-buttons/dropdown-buttons.component.tsx
index 00ac06774..353436f76 100644
--- a/src/components/common-components/dropdown-buttons/dropdown-buttons.component.tsx
+++ b/src/components/buttons/dropdown-buttons/dropdown-buttons.component.tsx
@@ -5,7 +5,7 @@ import ClickAwayListener from "@material-ui/core/ClickAwayListener";
import Popper from "@material-ui/core/Popper";
import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown";
import React, { useRef, useState } from "react";
-import { Button, ButtonVariant } from "..";
+import { Button, ButtonVariant } from "../../common-components";
export interface ButtonData {
label: string;
diff --git a/src/components/common-components/dropdown-buttons/dropdown-colors.component.tsx b/src/components/buttons/dropdown-buttons/dropdown-colors.component.tsx
similarity index 98%
rename from src/components/common-components/dropdown-buttons/dropdown-colors.component.tsx
rename to src/components/buttons/dropdown-buttons/dropdown-colors.component.tsx
index 242a59ecb..54d40adce 100644
--- a/src/components/common-components/dropdown-buttons/dropdown-colors.component.tsx
+++ b/src/components/buttons/dropdown-buttons/dropdown-colors.component.tsx
@@ -6,7 +6,7 @@ import ClickAwayListener from "@material-ui/core/ClickAwayListener";
import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown";
import Popper from "@material-ui/core/Popper";
import classNames from "classnames/bind";
-import { Button, ButtonVariant } from "..";
+import { Button, ButtonVariant } from "../../common-components";
interface DropdownColorsOptions {
shiftType: string;
diff --git a/src/components/schedule-page/empty-month-buttons.tsx b/src/components/buttons/empty-month-buttons/empty-month-buttons.tsx
similarity index 79%
rename from src/components/schedule-page/empty-month-buttons.tsx
rename to src/components/buttons/empty-month-buttons/empty-month-buttons.tsx
index 91b4c317a..834540fa2 100644
--- a/src/components/schedule-page/empty-month-buttons.tsx
+++ b/src/components/buttons/empty-month-buttons/empty-month-buttons.tsx
@@ -3,15 +3,15 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React, { useEffect, useRef, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
-import { TranslationHelper } from "../../helpers/translations.helper";
-import { ApplicationStateModel } from "../../state/models/application-state.model";
-import { Button } from "../common-components";
-import { ScheduleKey } from "../../api/persistance-store.model";
-import { MonthSwitchActionCreator } from "../../state/reducers/month-state/schedule-data/month-switch.action-creator";
-import { LocalStorageProvider } from "../../api/local-storage-provider.model";
-import { MonthDataModel } from "../../common-models/schedule-data.model";
-import { MonthHelper } from "../../helpers/month.helper";
-import { useImportModal } from "./import-buttons/import-modal-context";
+import { TranslationHelper } from "../../../helpers/translations.helper";
+import { ApplicationStateModel } from "../../../state/application-state.model";
+import { Button } from "../../common-components";
+import { ScheduleKey } from "../../../logic/data-access/persistance-store.model";
+import { MonthSwitchActionCreator } from "../../../state/schedule-data/month-switch.action-creator";
+import { LocalStorageProvider } from "../../../logic/data-access/local-storage-provider.model";
+import { MonthDataModel } from "../../../state/schedule-data/schedule-data.model";
+import { MonthHelper } from "../../../helpers/month.helper";
+import { useImportModal } from "../import-buttons/import-modal-context";
export function EmptyMonthButtons(): JSX.Element {
const { month_number: currentMonth, year: currentYear } = useSelector(
diff --git a/src/components/schedule-page/import-buttons/hooks/use-file-reader.ts b/src/components/buttons/import-buttons/hooks/use-file-reader.ts
similarity index 100%
rename from src/components/schedule-page/import-buttons/hooks/use-file-reader.ts
rename to src/components/buttons/import-buttons/hooks/use-file-reader.ts
diff --git a/src/components/schedule-page/import-buttons/hooks/use-schedule-converter.ts b/src/components/buttons/import-buttons/hooks/use-schedule-converter.ts
similarity index 91%
rename from src/components/schedule-page/import-buttons/hooks/use-schedule-converter.ts
rename to src/components/buttons/import-buttons/hooks/use-schedule-converter.ts
index 54a7d7d8c..0374697e1 100644
--- a/src/components/schedule-page/import-buttons/hooks/use-schedule-converter.ts
+++ b/src/components/buttons/import-buttons/hooks/use-schedule-converter.ts
@@ -2,24 +2,19 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import Excel, { FillPattern } from "exceljs";
-import { fromBuffer } from "file-type/browser";
-import { useCallback, useEffect, useReducer } from "react";
+import { fromBuffer } from "file-type";
+import { useReducer, useCallback, useEffect } from "react";
import { useSelector } from "react-redux";
-import { MonthDataModel } from "../../../../common-models/schedule-data.model";
-import { InputFileErrorCode, ScheduleError } from "../../../../common-models/schedule-error.model";
-import {
- ParserHelper,
- SHIFTS_WORKSHEET_NAME,
- SHIFT_HEADERS,
- WORKERS_WORKSHEET_NAME,
- WORKSHEET_NAME,
-} from "../../../../helpers/parser.helper";
-import { cropScheduleDMToMonthDM } from "../../../../logic/schedule-container-convertion/schedule-container-convertion";
+import { WORKERS_WORKSHEET_NAME, ParserHelper, SHIFTS_WORKSHEET_NAME, SHIFT_HEADERS, WORKSHEET_NAME } from "../../../../helpers/parser.helper";
+import { cropScheduleDMToMonthDM } from "../../../../logic/schedule-container-converter/schedule-container-converter";
import { ScheduleParser } from "../../../../logic/schedule-parser/schedule.parser";
-import { ApplicationStateModel } from "../../../../state/models/application-state.model";
-import { useNotification } from "../../../common-components/notification/notification.context";
+import { ApplicationStateModel } from "../../../../state/application-state.model";
+import { MonthDataModel } from "../../../../state/schedule-data/schedule-data.model";
+import { ScheduleError, InputFileErrorCode } from "../../../../state/schedule-data/schedule-errors/schedule-error.model";
+import { useNotification } from "../../../notification/notification.context";
import { useFileReader } from "./use-file-reader";
+
interface ScheduleConverterState {
monthModel?: MonthDataModel;
scheduleErrors: ScheduleError[];
diff --git a/src/components/schedule-page/import-buttons/import-buttons.component.tsx b/src/components/buttons/import-buttons/import-buttons.component.tsx
similarity index 84%
rename from src/components/schedule-page/import-buttons/import-buttons.component.tsx
rename to src/components/buttons/import-buttons/import-buttons.component.tsx
index 545fca7de..d36922654 100644
--- a/src/components/schedule-page/import-buttons/import-buttons.component.tsx
+++ b/src/components/buttons/import-buttons/import-buttons.component.tsx
@@ -4,12 +4,9 @@
import React, { useRef } from "react";
import { useSelector } from "react-redux";
-import { ApplicationStateModel } from "../../../state/models/application-state.model";
-import {
- ButtonData,
- DropdownButtons,
-} from "../../common-components/dropdown-buttons/dropdown-buttons.component";
-import ExportModal from "../../common-components/modal/export-modal/export.modal.component";
+import { ApplicationStateModel } from "../../../state/application-state.model";
+import { ButtonData, DropdownButtons } from "../dropdown-buttons/dropdown-buttons.component";
+import ExportModal from "../../modals/export-modal/export.modal.component";
import { useImportModal } from "./import-modal-context";
export function ImportButtonsComponent(): JSX.Element {
diff --git a/src/components/schedule-page/import-buttons/import-modal-context.tsx b/src/components/buttons/import-buttons/import-modal-context.tsx
similarity index 80%
rename from src/components/schedule-page/import-buttons/import-modal-context.tsx
rename to src/components/buttons/import-buttons/import-modal-context.tsx
index 5a04d95a7..465d70f7f 100644
--- a/src/components/schedule-page/import-buttons/import-modal-context.tsx
+++ b/src/components/buttons/import-buttons/import-modal-context.tsx
@@ -5,11 +5,11 @@
import React, { ChangeEvent, createContext, useContext, useEffect } from "react";
import { useDispatch } from "react-redux";
import { useScheduleConverter } from "./hooks/use-schedule-converter";
-import { ScheduleDataActionCreator } from "../../../state/reducers/month-state/schedule-data/schedule-data.action-creator";
-import { ScheduleErrorActionType } from "../../../state/reducers/month-state/schedule-errors.reducer";
-import { ActionModel } from "../../../state/models/action.model";
-import { ScheduleError } from "../../../common-models/schedule-error.model";
-import ParseErrorModal from "../../common-components/modal/error-modal/errors.modal.component";
+import { ScheduleDataActionCreator } from "../../../state/schedule-data/schedule-data.action-creator";
+import { ScheduleErrorActionType } from "../../../state/schedule-data/schedule-errors/schedule-errors.reducer";
+import { ActionModel } from "../../../utils/action.model";
+import { ScheduleError } from "../../../state/schedule-data/schedule-errors/schedule-error.model";
+import ParseErrorModal from "../../modals/error-modal/errors.modal.component";
export interface ImportModalContextValues {
handleImport: (e: React.ChangeEvent) => void;
diff --git a/src/components/common-components/route-buttons/route-buttons.component.tsx b/src/components/buttons/route-buttons/route-buttons.component.tsx
similarity index 100%
rename from src/components/common-components/route-buttons/route-buttons.component.tsx
rename to src/components/buttons/route-buttons/route-buttons.component.tsx
diff --git a/src/components/common-components/index.ts b/src/components/common-components/index.ts
index 3eeb9e210..cf6e96aae 100644
--- a/src/components/common-components/index.ts
+++ b/src/components/common-components/index.ts
@@ -1,10 +1,10 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-export * from "./header/header.component";
-export * from "./button-component/button.component";
-export * from "./month-switch/month-switch.component";
-export * from "./snackbar/snackbar.component";
-export * from "./tools/undoable.component";
-export * from "./drawer/drawer.component";
+export * from "../app-header/header.component";
+export * from "../buttons/button-component/button.component";
+export * from "../month-switch/month-switch.component";
+export * from "../snackbar/snackbar.component";
+export * from "../global-hotkeys/undoable.component";
+export * from "../drawers/drawer/drawer.component";
export * from "./folding-section/folding-section.component";
diff --git a/src/components/common-components/drawer/drawer-header.component.tsx b/src/components/drawers/drawer/drawer-header.component.tsx
similarity index 100%
rename from src/components/common-components/drawer/drawer-header.component.tsx
rename to src/components/drawers/drawer/drawer-header.component.tsx
diff --git a/src/components/common-components/drawer/drawer.component.tsx b/src/components/drawers/drawer/drawer.component.tsx
similarity index 100%
rename from src/components/common-components/drawer/drawer.component.tsx
rename to src/components/drawers/drawer/drawer.component.tsx
diff --git a/src/components/common-components/drawer/jira-like-drawer-context.tsx b/src/components/drawers/drawer/persistent-drawer-context.tsx
similarity index 62%
rename from src/components/common-components/drawer/jira-like-drawer-context.tsx
rename to src/components/drawers/drawer/persistent-drawer-context.tsx
index 5611e38e7..44c35d6d7 100644
--- a/src/components/common-components/drawer/jira-like-drawer-context.tsx
+++ b/src/components/drawers/drawer/persistent-drawer-context.tsx
@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React, { createContext, useContext, useState } from "react";
-export interface JiraLikeDrawerContextValues {
+export interface PersistentDrawerContextValues {
title: string | undefined;
setTitle: (title: string) => void;
open: boolean | undefined;
@@ -12,15 +12,15 @@ export interface JiraLikeDrawerContextValues {
setChildrenComponent: (component: JSX.Element) => void;
}
-export const JiraLikeDrawerContext = createContext(null);
+export const PersistentDrawerContext = createContext(null);
-export function JiraLikeDrawerProvider({ children }): JSX.Element {
+export function PersistentDrawerProvider({ children }): JSX.Element {
const [title, setTitle] = useState();
const [open, setOpen] = useState();
const [childrenComponent, setChildrenComponent] = useState();
return (
-
{children}
-
+
);
}
-export function useJiraLikeDrawer(): JiraLikeDrawerContextValues {
- const context = useContext(JiraLikeDrawerContext);
+export function usePersistentDrawer(): PersistentDrawerContextValues {
+ const context = useContext(PersistentDrawerContext);
- if (!context) throw new Error("useJiraLikeDrawer have to be used within JiraLikeDrawerProvider");
+ if (!context)
+ throw new Error("usePersistentDrawer have to be used within PersistentDrawerProvider");
return context;
}
diff --git a/src/components/common-components/drawer/jira-like-drawer.component.tsx b/src/components/drawers/drawer/persistent-drawer.component.tsx
similarity index 78%
rename from src/components/common-components/drawer/jira-like-drawer.component.tsx
rename to src/components/drawers/drawer/persistent-drawer.component.tsx
index 03aae204e..aafc7558e 100644
--- a/src/components/common-components/drawer/jira-like-drawer.component.tsx
+++ b/src/components/drawers/drawer/persistent-drawer.component.tsx
@@ -5,11 +5,11 @@ import React, { useEffect } from "react";
import DrawerHeader from "./drawer-header.component";
import { Box } from "@material-ui/core";
import { makeStyles, Theme } from "@material-ui/core/styles";
-import { useJiraLikeDrawer } from "./jira-like-drawer-context";
+import { usePersistentDrawer } from "./persistent-drawer-context";
import ScssVars from "../../../assets/styles/styles/custom/_variables.module.scss";
import { useSelector } from "react-redux";
-import { ApplicationStateModel } from "../../../state/models/application-state.model";
-import { ScheduleMode } from "../../schedule-page/table/schedule/schedule-state.model";
+import { ApplicationStateModel } from "../../../state/application-state.model";
+import { ScheduleMode } from "../../schedule/schedule-state.model";
export interface StyleProps {
width: number;
@@ -26,12 +26,12 @@ const useStyles = makeStyles({
},
});
-export default function JiraLikeDrawer(width): JSX.Element {
+export default function PersistentDrawer(width): JSX.Element {
const isEditMode = useSelector(
(state: ApplicationStateModel) => state.actualState.mode === ScheduleMode.Edit
);
const classes = useStyles(width);
- const { title, open, setOpen, childrenComponent } = useJiraLikeDrawer();
+ const { title, open, setOpen, childrenComponent } = usePersistentDrawer();
useEffect(() => {
if (!isEditMode) setOpen(false);
diff --git a/src/components/schedule-page/validation-drawer/validation-drawer.component.tsx b/src/components/drawers/error-container-drawer/error-container-drawer.component.tsx
similarity index 77%
rename from src/components/schedule-page/validation-drawer/validation-drawer.component.tsx
rename to src/components/drawers/error-container-drawer/error-container-drawer.component.tsx
index 79c8af448..a44ca1f92 100644
--- a/src/components/schedule-page/validation-drawer/validation-drawer.component.tsx
+++ b/src/components/drawers/error-container-drawer/error-container-drawer.component.tsx
@@ -4,13 +4,13 @@
import React, { useEffect, useState } from "react";
import { useSelector } from "react-redux";
-import { ApplicationStateModel } from "../../../state/models/application-state.model";
-import { ScheduleErrorMessageModel } from "../../../common-models/schedule-error-message.model";
-import ErrorLoader from "./error-loader.component";
-import { NetworkErrorCode } from "../../../common-models/schedule-error.model";
+import { ApplicationStateModel } from "../../../state/application-state.model";
+import { ScheduleErrorMessageModel } from "../../../state/schedule-data/schedule-errors/schedule-error-message.model";
+import ErrorLoader from "./loading-errors-view.component";
+import { NetworkErrorCode } from "../../../state/schedule-data/schedule-errors/schedule-error.model";
import { ErrorMessageHelper } from "../../../helpers/error-message.helper";
-export interface ValidationDrawerContentOptions {
+export interface ErrorContainerDrawerComponentOptions {
setOpen: (boolean) => void;
loadingErrors?: boolean;
}
@@ -21,14 +21,14 @@ export enum ErrorLoaderState {
ERRORS = "ERRORS",
}
-export interface ValidationDrawerContentState {
+export interface ErrorContainerDrawerComponentState {
state: ErrorLoaderState;
}
-export type Props = ValidationDrawerContentState;
+export type Props = ErrorContainerDrawerComponentState;
-export default function ValidationDrawerContentComponent(
- options: ValidationDrawerContentOptions
+export default function ErrorContainerDrawerComponent(
+ options: ErrorContainerDrawerComponentOptions
): JSX.Element {
const [mappedErrors, setMappedErrors] = useState();
const [loadingState, setLoadingState] = useState();
diff --git a/src/components/schedule-page/validation-drawer/error-loader.component.tsx b/src/components/drawers/error-container-drawer/loading-errors-view.component.tsx
similarity index 80%
rename from src/components/schedule-page/validation-drawer/error-loader.component.tsx
rename to src/components/drawers/error-container-drawer/loading-errors-view.component.tsx
index a5a4a1ff9..cfae3c0aa 100644
--- a/src/components/schedule-page/validation-drawer/error-loader.component.tsx
+++ b/src/components/drawers/error-container-drawer/loading-errors-view.component.tsx
@@ -6,15 +6,18 @@ import { useDispatch, useSelector } from "react-redux";
import backend from "../../../api/backend";
import ok from "../../../assets/images/ok.svg";
import warning from "../../../assets/images/warning.svg";
-import { ScheduleErrorMessageModel } from "../../../common-models/schedule-error-message.model";
-import { NetworkErrorCode, ScheduleError } from "../../../common-models/schedule-error.model";
-import { ActionModel } from "../../../state/models/action.model";
-import { ApplicationStateModel } from "../../../state/models/application-state.model";
-import { ScheduleErrorActionType } from "../../../state/reducers/month-state/schedule-errors.reducer";
+import { ScheduleErrorMessageModel } from "../../../state/schedule-data/schedule-errors/schedule-error-message.model";
+import {
+ NetworkErrorCode,
+ ScheduleError,
+} from "../../../state/schedule-data/schedule-errors/schedule-error.model";
+import { ActionModel } from "../../../utils/action.model";
+import { ApplicationStateModel } from "../../../state/application-state.model";
+import { ScheduleErrorActionType } from "../../../state/schedule-data/schedule-errors/schedule-errors.reducer";
import { Button } from "../../common-components";
-import ErrorList from "./error-list.component";
-import { SpanErrors } from "./span-errors.component";
-import { ErrorLoaderState, Props } from "./validation-drawer.component";
+import ErrorList from "../../error-list/error-list.component";
+import { SpanErrors } from "../../error-list/span-errors.component";
+import { ErrorLoaderState, Props } from "./error-container-drawer.component";
interface ErrorLoaderOptions {
state?: Props;
@@ -23,7 +26,7 @@ interface ErrorLoaderOptions {
setOpen: (boolean) => void;
}
-export default function ErrorLoaderComponent(options: ErrorLoaderOptions): JSX.Element {
+export default function LoadingErrorsViewComponent(options: ErrorLoaderOptions): JSX.Element {
const { setOpen, isNetworkError } = options;
const [spinnerAgain, setSpinnerAgain] = useState(false);
const { primaryRevision } = useSelector((app: ApplicationStateModel) => app.actualState);
diff --git a/src/components/workers-page/workers-tab/worker-drawer.component.tsx b/src/components/drawers/worker-drawer/worker-drawer.component.tsx
similarity index 80%
rename from src/components/workers-page/workers-tab/worker-drawer.component.tsx
rename to src/components/drawers/worker-drawer/worker-drawer.component.tsx
index d073e07c2..ea7cf2cc3 100644
--- a/src/components/workers-page/workers-tab/worker-drawer.component.tsx
+++ b/src/components/drawers/worker-drawer/worker-drawer.component.tsx
@@ -2,11 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React from "react";
-import { WorkerInfoModel } from "../../../common-models/worker-info.model";
-import Drawer, { DrawerOptions } from "../../common-components/drawer/drawer.component";
-import { WorkerEditComponent, WorkerEditComponentMode } from "../../namestable/worker-edit";
-import { WorkerInfoComponent } from "../../namestable/worker-info.component";
-import { useWorkerHoursInfo } from "../../schedule-page/table/schedule/use-worker-hours-info";
+import { WorkerInfoModel } from "../../../state/schedule-data/worker-info/worker-info.model";
+import Drawer, { DrawerOptions } from "../drawer/drawer.component";
+import { WorkerEditComponent, WorkerEditComponentMode } from "./worker-edit";
+import { WorkerInfoComponent } from "./worker-info/worker-info.component";
+import { useWorkerHoursInfo } from "../../../hooks/use-worker-hours-info";
export enum WorkerDrawerMode {
EDIT,
diff --git a/src/components/namestable/worker-edit/combined-worknorm-selector.component.tsx b/src/components/drawers/worker-drawer/worker-edit/combined-worknorm-selector.component.tsx
similarity index 92%
rename from src/components/namestable/worker-edit/combined-worknorm-selector.component.tsx
rename to src/components/drawers/worker-drawer/worker-edit/combined-worknorm-selector.component.tsx
index ab96774ad..1578e2ac2 100644
--- a/src/components/namestable/worker-edit/combined-worknorm-selector.component.tsx
+++ b/src/components/drawers/worker-drawer/worker-edit/combined-worknorm-selector.component.tsx
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React from "react";
-import { ContractType } from "../../../common-models/worker-info.model";
+import { ContractType } from "../../../../state/schedule-data/worker-info/worker-info.model";
import { FormFieldOptions } from "./worker-edit.models";
import { WorkerEmploymentContractWorkNormSelector } from "./worker-employment-contract-work-norm-selector.component";
import { WorkerCivilContractWorkNormSelector } from "./worker-civil-contract-work-norm-selector.component";
diff --git a/src/components/namestable/worker-edit/form-field-error-label.component.tsx b/src/components/drawers/worker-drawer/worker-edit/form-field-error-label.component.tsx
similarity index 100%
rename from src/components/namestable/worker-edit/form-field-error-label.component.tsx
rename to src/components/drawers/worker-drawer/worker-edit/form-field-error-label.component.tsx
diff --git a/src/components/namestable/worker-edit/index.ts b/src/components/drawers/worker-drawer/worker-edit/index.ts
similarity index 100%
rename from src/components/namestable/worker-edit/index.ts
rename to src/components/drawers/worker-drawer/worker-edit/index.ts
diff --git a/src/components/namestable/worker-edit/worker-civil-contract-work-norm-selector.component.tsx b/src/components/drawers/worker-drawer/worker-edit/worker-civil-contract-work-norm-selector.component.tsx
similarity index 94%
rename from src/components/namestable/worker-edit/worker-civil-contract-work-norm-selector.component.tsx
rename to src/components/drawers/worker-drawer/worker-edit/worker-civil-contract-work-norm-selector.component.tsx
index 44b5ac554..3278b5a55 100644
--- a/src/components/namestable/worker-edit/worker-civil-contract-work-norm-selector.component.tsx
+++ b/src/components/drawers/worker-drawer/worker-edit/worker-civil-contract-work-norm-selector.component.tsx
@@ -4,8 +4,8 @@
import { Grid, TextField, Typography } from "@material-ui/core";
import * as _ from "lodash";
import React, { useCallback, useEffect, useState } from "react";
-import { WorkerHourInfo } from "../../../helpers/worker-hours-info.model";
-import { useMonthInfo } from "../../schedule-page/validation-drawer/use-verbose-dates";
+import { WorkerHourInfo } from "../../../../helpers/worker-hours-info.model";
+import { useMonthInfo } from "../../../../hooks/use-month-info";
import { WorkNormSelectorOptions } from "./combined-worknorm-selector.component";
import { FormFieldErrorLabel } from "./form-field-error-label.component";
import { useFormFieldStyles } from "./worker-edit.models";
diff --git a/src/components/namestable/worker-edit/worker-contract-type-selector.component.tsx b/src/components/drawers/worker-drawer/worker-edit/worker-contract-type-selector.component.tsx
similarity index 93%
rename from src/components/namestable/worker-edit/worker-contract-type-selector.component.tsx
rename to src/components/drawers/worker-drawer/worker-edit/worker-contract-type-selector.component.tsx
index 021ff3115..b9ed3b8b6 100644
--- a/src/components/namestable/worker-edit/worker-contract-type-selector.component.tsx
+++ b/src/components/drawers/worker-drawer/worker-edit/worker-contract-type-selector.component.tsx
@@ -3,11 +3,11 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import { Grid, Typography } from "@material-ui/core";
import React, { useCallback, useEffect, useState } from "react";
-import { ContractType } from "../../../common-models/worker-info.model";
+import { ContractType } from "../../../../state/schedule-data/worker-info/worker-info.model";
import {
ButtonData,
DropdownButtons,
-} from "../../common-components/dropdown-buttons/dropdown-buttons.component";
+} from "../../../buttons/dropdown-buttons/dropdown-buttons.component";
import { FormFieldErrorLabel } from "./form-field-error-label.component";
import {
FormFieldOptions,
diff --git a/src/components/namestable/worker-edit/worker-edit.component.tsx b/src/components/drawers/worker-drawer/worker-edit/worker-edit.component.tsx
similarity index 92%
rename from src/components/namestable/worker-edit/worker-edit.component.tsx
rename to src/components/drawers/worker-drawer/worker-edit/worker-edit.component.tsx
index f5c7fd6b4..3dec686cd 100644
--- a/src/components/namestable/worker-edit/worker-edit.component.tsx
+++ b/src/components/drawers/worker-drawer/worker-edit/worker-edit.component.tsx
@@ -6,10 +6,14 @@ import { makeStyles } from "@material-ui/core/styles";
import classNames from "classnames/bind";
import React, { useEffect, useState } from "react";
import { useDispatch } from "react-redux";
-import { ContractType, WorkerGroup, WorkerType } from "../../../common-models/worker-info.model";
-import { WorkerActionCreator } from "../../../state/reducers/worker.action-creator";
-import { Button } from "../../common-components";
-import { useWorkerInfo, WorkerInfo } from "../use-worker-info";
+import {
+ ContractType,
+ WorkerGroup,
+ WorkerType,
+} from "../../../../state/schedule-data/worker-info/worker-info.model";
+import { WorkerActionCreator } from "../../../../state/schedule-data/worker-info/worker.action-creator";
+import { Button } from "../../../common-components";
+import { useWorkerInfo, WorkerInfo } from "../../../../hooks/use-worker-info";
import { CombinedWorkNormSelector } from "./combined-worknorm-selector.component";
import { WorkerContractTypeSelector } from "./worker-contract-type-selector.component";
import { WorkerEditComponentOptions, WorkerEditComponentMode } from "./worker-edit.models";
diff --git a/src/components/namestable/worker-edit/worker-edit.models.ts b/src/components/drawers/worker-drawer/worker-edit/worker-edit.models.ts
similarity index 81%
rename from src/components/namestable/worker-edit/worker-edit.models.ts
rename to src/components/drawers/worker-drawer/worker-edit/worker-edit.models.ts
index f69f08604..6b7b874c7 100644
--- a/src/components/namestable/worker-edit/worker-edit.models.ts
+++ b/src/components/drawers/worker-drawer/worker-edit/worker-edit.models.ts
@@ -4,14 +4,14 @@
import { makeStyles } from "@material-ui/core";
import {
ContractType,
- ContractTypeHelper,
WorkerGroup,
WorkerInfoModel,
WorkerType,
- WorkerTypeHelper,
-} from "../../../common-models/worker-info.model";
-import { StringHelper } from "../../../helpers/string.helper";
-import ScssVars from "../../../assets/styles/styles/custom/_variables.module.scss";
+} from "../../../../state/schedule-data/worker-info/worker-info.model";
+import { ContractTypeHelper } from "../../../../helpers/contract-type.helper";
+import { WorkerTypeHelper } from "../../../../helpers/worker-type.helper";
+import { StringHelper } from "../../../../helpers/string.helper";
+import ScssVars from "../../../../assets/styles/styles/custom/_variables.module.scss";
export interface FormFieldOptions {
setIsFieldValid?: (status: boolean) => void;
diff --git a/src/components/namestable/worker-edit/worker-employment-contract-work-norm-selector.component.tsx b/src/components/drawers/worker-drawer/worker-edit/worker-employment-contract-work-norm-selector.component.tsx
similarity index 91%
rename from src/components/namestable/worker-edit/worker-employment-contract-work-norm-selector.component.tsx
rename to src/components/drawers/worker-drawer/worker-edit/worker-employment-contract-work-norm-selector.component.tsx
index 0af121718..f0b45d917 100644
--- a/src/components/namestable/worker-edit/worker-employment-contract-work-norm-selector.component.tsx
+++ b/src/components/drawers/worker-drawer/worker-edit/worker-employment-contract-work-norm-selector.component.tsx
@@ -4,13 +4,13 @@
import { Grid, Input, Typography } from "@material-ui/core";
import * as _ from "lodash";
import React, { useState } from "react";
-import { TimeDrawerType } from "../../../common-models/worker-info.model";
+import { TimeDrawerType } from "../../../../state/schedule-data/worker-info/worker-info.model";
import {
ButtonData,
DropdownButtons,
-} from "../../common-components/dropdown-buttons/dropdown-buttons.component";
-import { TextMaskCustom } from "../../common-components/text-mask-custom/text-mask-custom.component";
-import { WorkingTimeHelper } from "../working-time.helper";
+} from "../../../buttons/dropdown-buttons/dropdown-buttons.component";
+import { TextMaskCustom } from "../../../common-components/text-mask-custom/text-mask-custom.component";
+import { WorkingTimeHelper } from "../../../../helpers/working-time.helper";
import { WorkNormSelectorOptions } from "./combined-worknorm-selector.component";
import { FormFieldErrorLabel } from "./form-field-error-label.component";
import { useFormFieldStyles } from "./worker-edit.models";
diff --git a/src/components/namestable/worker-edit/worker-group-selector.component.tsx b/src/components/drawers/worker-drawer/worker-edit/worker-group-selector.component.tsx
similarity index 85%
rename from src/components/namestable/worker-edit/worker-group-selector.component.tsx
rename to src/components/drawers/worker-drawer/worker-edit/worker-group-selector.component.tsx
index dff3bdc04..704e31047 100644
--- a/src/components/namestable/worker-edit/worker-group-selector.component.tsx
+++ b/src/components/drawers/worker-drawer/worker-edit/worker-group-selector.component.tsx
@@ -4,12 +4,12 @@
import { Grid, Typography } from "@material-ui/core";
import * as _ from "lodash";
import React from "react";
-import { WorkerGroup } from "../../../common-models/worker-info.model";
-import { WORKER_GROUP_PREFIX } from "../../../logic/schedule-parser/workers-info.parser";
+import { WorkerGroup } from "../../../../state/schedule-data/worker-info/worker-info.model";
+import { WORKER_GROUP_PREFIX } from "../../../../logic/schedule-parser/workers-info.parser";
import {
ButtonData,
DropdownButtons,
-} from "../../common-components/dropdown-buttons/dropdown-buttons.component";
+} from "../../../buttons/dropdown-buttons/dropdown-buttons.component";
import { FormFieldOptions, useFormFieldStyles } from "./worker-edit.models";
interface WorkerGroupSelectorOptions extends FormFieldOptions {
setWorkerGroup: (workerGroup: WorkerGroup) => void;
diff --git a/src/components/namestable/worker-edit/worker-name-edit-field.components.tsx b/src/components/drawers/worker-drawer/worker-edit/worker-name-edit-field.components.tsx
similarity index 97%
rename from src/components/namestable/worker-edit/worker-name-edit-field.components.tsx
rename to src/components/drawers/worker-drawer/worker-edit/worker-name-edit-field.components.tsx
index 2c906d74c..518205090 100644
--- a/src/components/namestable/worker-edit/worker-name-edit-field.components.tsx
+++ b/src/components/drawers/worker-drawer/worker-edit/worker-name-edit-field.components.tsx
@@ -5,7 +5,7 @@ import { Grid, TextField, Typography } from "@material-ui/core";
import React, { useCallback, useEffect } from "react";
import { useState } from "react";
import { useSelector } from "react-redux";
-import { ApplicationStateModel } from "../../../state/models/application-state.model";
+import { ApplicationStateModel } from "../../../../state/application-state.model";
import {
FormFieldErrorLabelOptions,
FormFieldErrorLabelStack,
diff --git a/src/components/namestable/worker-edit/worker-position-selector.component.tsx b/src/components/drawers/worker-drawer/worker-edit/worker-position-selector.component.tsx
similarity index 93%
rename from src/components/namestable/worker-edit/worker-position-selector.component.tsx
rename to src/components/drawers/worker-drawer/worker-edit/worker-position-selector.component.tsx
index 4005a8c79..1afc05544 100644
--- a/src/components/namestable/worker-edit/worker-position-selector.component.tsx
+++ b/src/components/drawers/worker-drawer/worker-edit/worker-position-selector.component.tsx
@@ -3,11 +3,11 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import { Grid, Typography } from "@material-ui/core";
import React, { useCallback, useEffect, useState } from "react";
-import { WorkerType } from "../../../common-models/worker-info.model";
+import { WorkerType } from "../../../../state/schedule-data/worker-info/worker-info.model";
import {
ButtonData,
DropdownButtons,
-} from "../../common-components/dropdown-buttons/dropdown-buttons.component";
+} from "../../../buttons/dropdown-buttons/dropdown-buttons.component";
import { FormFieldErrorLabel } from "./form-field-error-label.component";
import {
FormFieldOptions,
diff --git a/src/components/namestable/export-to-pdf.ts b/src/components/drawers/worker-drawer/worker-info/export-to-pdf.ts
similarity index 97%
rename from src/components/namestable/export-to-pdf.ts
rename to src/components/drawers/worker-drawer/worker-info/export-to-pdf.ts
index e3358ea13..26c0798de 100644
--- a/src/components/namestable/export-to-pdf.ts
+++ b/src/components/drawers/worker-drawer/worker-info/export-to-pdf.ts
@@ -8,7 +8,7 @@ import {
hasNextShiftClassName,
keepOnShiftClassName,
leftBorderClassName,
-} from "../schedule-page/table/schedule/schedule-parts/base-cell/base-cell.models";
+} from "../../../schedule/base/base-cell/base-cell.models";
interface ExportToPdfOptions {
workerInfoExport: string;
diff --git a/src/components/namestable/worker-info.component.tsx b/src/components/drawers/worker-drawer/worker-info/worker-info.component.tsx
similarity index 79%
rename from src/components/namestable/worker-info.component.tsx
rename to src/components/drawers/worker-drawer/worker-info/worker-info.component.tsx
index 08b5a4adf..fb97d75db 100644
--- a/src/components/namestable/worker-info.component.tsx
+++ b/src/components/drawers/worker-drawer/worker-info/worker-info.component.tsx
@@ -4,17 +4,15 @@
import { Divider } from "@material-ui/core";
import classNames from "classnames/bind";
import React from "react";
-import {
- ContractTypeHelper,
- WorkerInfoModel,
- WorkerTypeHelper,
-} from "../../common-models/worker-info.model";
-import { StringHelper } from "../../helpers/string.helper";
-import { useWorkerHoursInfo } from "../schedule-page/table/schedule/use-worker-hours-info";
-import WorkersCalendar from "../workers-page/workers-calendar/workers-calendar.component";
-import { Button } from "../common-components";
+import { WorkerInfoModel } from "../../../../state/schedule-data/worker-info/worker-info.model";
+import { ContractTypeHelper } from "../../../../helpers/contract-type.helper";
+import { WorkerTypeHelper } from "../../../../helpers/worker-type.helper";
+import { StringHelper } from "../../../../helpers/string.helper";
+import { useWorkerHoursInfo } from "../../../../hooks/use-worker-hours-info";
+import WorkersCalendar from "../../../workers-calendar/workers-calendar.component";
+import { Button } from "../../../common-components";
import { exportToPdf } from "./export-to-pdf";
-import { useWorkerInfo } from "./use-worker-info";
+import { useWorkerInfo } from "../../../../hooks/use-worker-info";
export function WorkerInfoComponent(info: WorkerInfoModel): JSX.Element {
const workerHoursInfo = useWorkerHoursInfo(info.name);
diff --git a/src/components/schedule-page/validation-drawer/error-list-item.component.tsx b/src/components/error-list/error-list-item.component.tsx
similarity index 83%
rename from src/components/schedule-page/validation-drawer/error-list-item.component.tsx
rename to src/components/error-list/error-list-item.component.tsx
index 99b270742..6c64876cf 100644
--- a/src/components/schedule-page/validation-drawer/error-list-item.component.tsx
+++ b/src/components/error-list/error-list-item.component.tsx
@@ -3,12 +3,12 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React from "react";
import { useDispatch } from "react-redux";
-import { VerboseDate } from "../../../common-models/month-info.model";
-import { ScheduleErrorMessageModel } from "../../../common-models/schedule-error-message.model";
-import { TranslationHelper } from "../../../helpers/translations.helper";
-import { ScheduleDataActionCreator } from "../../../state/reducers/month-state/schedule-data/schedule-data.action-creator";
-import { Button } from "../../common-components";
-import { useMonthInfo } from "./use-verbose-dates";
+import { TranslationHelper } from "../../helpers/translations.helper";
+import { useMonthInfo } from "../../hooks/use-month-info";
+import { VerboseDate } from "../../state/schedule-data/foundation-info/foundation-info.model";
+import { ScheduleDataActionCreator } from "../../state/schedule-data/schedule-data.action-creator";
+import { ScheduleErrorMessageModel } from "../../state/schedule-data/schedule-errors/schedule-error-message.model";
+import { Button } from "../common-components";
interface Options {
error: ScheduleErrorMessageModel;
diff --git a/src/components/schedule-page/validation-drawer/error-list.component.tsx b/src/components/error-list/error-list.component.tsx
similarity index 96%
rename from src/components/schedule-page/validation-drawer/error-list.component.tsx
rename to src/components/error-list/error-list.component.tsx
index b0031f859..3daa29d07 100644
--- a/src/components/schedule-page/validation-drawer/error-list.component.tsx
+++ b/src/components/error-list/error-list.component.tsx
@@ -5,8 +5,8 @@ import React from "react";
import {
ScheduleErrorMessageModel,
ScheduleErrorType,
-} from "../../../common-models/schedule-error-message.model";
-import { FoldingSection } from "../../common-components";
+} from "../../state/schedule-data/schedule-errors/schedule-error-message.model";
+import { FoldingSection } from "../common-components";
import ErrorListItem from "./error-list-item.component";
interface Options {
diff --git a/src/components/schedule-page/validation-drawer/span-errors.component.tsx b/src/components/error-list/span-errors.component.tsx
similarity index 81%
rename from src/components/schedule-page/validation-drawer/span-errors.component.tsx
rename to src/components/error-list/span-errors.component.tsx
index 67910ad49..a8830616b 100644
--- a/src/components/schedule-page/validation-drawer/span-errors.component.tsx
+++ b/src/components/error-list/span-errors.component.tsx
@@ -2,13 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React from "react";
-import { ScheduleErrorMessageModel } from "../../../common-models/schedule-error-message.model";
+import { ScheduleErrorMessageModel } from "../../state/schedule-data/schedule-errors/schedule-error-message.model";
interface SpanErrorOptions {
errors?: ScheduleErrorMessageModel[];
}
export function SpanErrors({ errors = [] }: SpanErrorOptions): JSX.Element {
+ //TODO Get rid of this file
return (
<>
diff --git a/src/components/common-components/netlify-pro-footer/netlify-pro-footer.component.tsx b/src/components/footer/footer.component.tsx
similarity index 87%
rename from src/components/common-components/netlify-pro-footer/netlify-pro-footer.component.tsx
rename to src/components/footer/footer.component.tsx
index 82c4d7035..40d4c9f55 100644
--- a/src/components/common-components/netlify-pro-footer/netlify-pro-footer.component.tsx
+++ b/src/components/footer/footer.component.tsx
@@ -4,8 +4,8 @@
import React from "react";
import { Grid } from "@material-ui/core";
import { makeStyles } from "@material-ui/core/styles";
-import ScssVars from "../../../assets/styles/styles/custom/_variables.module.scss";
-import gliderLogo from "../../../assets/images/gliderLogo.png";
+import ScssVars from "../../assets/styles/styles/custom/_variables.module.scss";
+import gliderLogo from "../../assets/images/gliderLogo.png";
const useStyles = makeStyles({
footer: {
@@ -22,7 +22,7 @@ const useStyles = makeStyles({
},
});
-export function NetlifyProFooter(): JSX.Element {
+export function Footer(): JSX.Element {
const classes = useStyles();
return (
diff --git a/src/components/common-components/tools/undoable.component.tsx b/src/components/global-hotkeys/undoable.component.tsx
similarity index 90%
rename from src/components/common-components/tools/undoable.component.tsx
rename to src/components/global-hotkeys/undoable.component.tsx
index 603db26f2..19d028e57 100644
--- a/src/components/common-components/tools/undoable.component.tsx
+++ b/src/components/global-hotkeys/undoable.component.tsx
@@ -4,7 +4,10 @@
import { GlobalHotKeys } from "react-hotkeys";
import React from "react";
import { useDispatch } from "react-redux";
-import { UndoableConfig, UndoActionCreator } from "../../../state/reducers/undoable.action-creator";
+import {
+ UndoableConfig,
+ UndoActionCreator,
+} from "../../state/schedule-data/undoable.action-creator";
interface UndoableHotkeysOptions {
config: UndoableConfig
;
diff --git a/src/components/common-components/modal/app-error-modal/app-error.modal.component.tsx b/src/components/modals/app-error-modal/app-error.modal.component.tsx
similarity index 90%
rename from src/components/common-components/modal/app-error-modal/app-error.modal.component.tsx
rename to src/components/modals/app-error-modal/app-error.modal.component.tsx
index 059de7e66..a14d4a34f 100644
--- a/src/components/common-components/modal/app-error-modal/app-error.modal.component.tsx
+++ b/src/components/modals/app-error-modal/app-error.modal.component.tsx
@@ -1,11 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import React, { useEffect, useState } from "react";
-import { Button } from "../../button-component/button.component";
+
+import React, { useState, useEffect } from "react";
+import { FileHelper } from "../../../helpers/file.helper";
+import { LocalStorageProvider } from "../../../logic/data-access/local-storage-provider.model";
+import { Button } from "../../common-components";
import DefaultModal from "../modal.component";
-import { LocalStorageProvider } from "../../../../api/local-storage-provider.model";
-import { FileHelper } from "../../../../helpers/file.helper";
+
interface AppErrorModalOptions {
onClick: () => void;
diff --git a/src/components/common-components/modal/delete-worker-modal/delete-worker.modal.component.tsx b/src/components/modals/delete-worker-modal/delete-worker.modal.component.tsx
similarity index 84%
rename from src/components/common-components/modal/delete-worker-modal/delete-worker.modal.component.tsx
rename to src/components/modals/delete-worker-modal/delete-worker.modal.component.tsx
index 87246398c..49c228796 100644
--- a/src/components/common-components/modal/delete-worker-modal/delete-worker.modal.component.tsx
+++ b/src/components/modals/delete-worker-modal/delete-worker.modal.component.tsx
@@ -2,11 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React from "react";
-import { Button } from "../../button-component/button.component";
+import { Button } from "../../buttons/button-component/button.component";
import DefaultModal from "../modal.component";
-import { WorkerInfoModel } from "../../../../common-models/worker-info.model";
+import { WorkerInfoModel } from "../../../state/schedule-data/worker-info/worker-info.model";
import { useDispatch } from "react-redux";
-import { WorkerActionCreator } from "../../../../state/reducers/worker.action-creator";
+import { WorkerActionCreator } from "../../../state/schedule-data/worker-info/worker.action-creator";
interface DeleteWorkerModalOptions {
setOpen: (open: boolean) => void;
diff --git a/src/components/common-components/modal/error-modal/error.modal.list.component.tsx b/src/components/modals/error-modal/error.modal.list.component.tsx
similarity index 86%
rename from src/components/common-components/modal/error-modal/error.modal.list.component.tsx
rename to src/components/modals/error-modal/error.modal.list.component.tsx
index 9495fbaad..a35de22db 100644
--- a/src/components/common-components/modal/error-modal/error.modal.list.component.tsx
+++ b/src/components/modals/error-modal/error.modal.list.component.tsx
@@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React from "react";
-import { ScheduleErrorMessageModel } from "../../../../common-models/schedule-error-message.model";
+import { ScheduleErrorMessageModel } from "../../../state/schedule-data/schedule-errors/schedule-error-message.model";
import ModalErrorListItem from "./error.modal.list.item.component";
interface Options {
diff --git a/src/components/common-components/modal/error-modal/error.modal.list.item.component.tsx b/src/components/modals/error-modal/error.modal.list.item.component.tsx
similarity index 83%
rename from src/components/common-components/modal/error-modal/error.modal.list.item.component.tsx
rename to src/components/modals/error-modal/error.modal.list.item.component.tsx
index 5095a778e..a6d0e2df9 100644
--- a/src/components/common-components/modal/error-modal/error.modal.list.item.component.tsx
+++ b/src/components/modals/error-modal/error.modal.list.item.component.tsx
@@ -3,10 +3,10 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React from "react";
-import { VerboseDate } from "../../../../common-models/month-info.model";
-import { ScheduleErrorMessageModel } from "../../../../common-models/schedule-error-message.model";
-import { TranslationHelper } from "../../../../helpers/translations.helper";
-import { useMonthInfo } from "../../../schedule-page/validation-drawer/use-verbose-dates";
+import { VerboseDate } from "../../../state/schedule-data/foundation-info/foundation-info.model";
+import { ScheduleErrorMessageModel } from "../../../state/schedule-data/schedule-errors/schedule-error-message.model";
+import { TranslationHelper } from "../../../helpers/translations.helper";
+import { useMonthInfo } from "../../../hooks/use-month-info";
interface Options {
error: ScheduleErrorMessageModel;
diff --git a/src/components/common-components/modal/error-modal/errors.modal.component.tsx b/src/components/modals/error-modal/errors.modal.component.tsx
similarity index 80%
rename from src/components/common-components/modal/error-modal/errors.modal.component.tsx
rename to src/components/modals/error-modal/errors.modal.component.tsx
index 9a0a61b04..1c072cadb 100644
--- a/src/components/common-components/modal/error-modal/errors.modal.component.tsx
+++ b/src/components/modals/error-modal/errors.modal.component.tsx
@@ -4,13 +4,13 @@
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
-import { Button } from "../..";
-import { ScheduleErrorMessageModel } from "../../../../common-models/schedule-error-message.model";
-import { ErrorMessageHelper } from "../../../../helpers/error-message.helper";
-import { ApplicationStateModel } from "../../../../state/models/application-state.model";
+import { Button } from "../../common-components";
+import { ScheduleErrorMessageModel } from "../../../state/schedule-data/schedule-errors/schedule-error-message.model";
+import { ErrorMessageHelper } from "../../../helpers/error-message.helper";
+import { ApplicationStateModel } from "../../../state/application-state.model";
import DefaultModal from "../modal.component";
import ModalErrorList from "./error.modal.list.component";
-import { ScheduleDataActionCreator } from "../../../../state/reducers/month-state/schedule-data/schedule-data.action-creator";
+import { ScheduleDataActionCreator } from "../../../state/schedule-data/schedule-data.action-creator";
export interface ErrorsModalComponent {
setOpen: (open: boolean) => void;
diff --git a/src/components/common-components/modal/export-modal/export.modal.component.tsx b/src/components/modals/export-modal/export.modal.component.tsx
similarity index 87%
rename from src/components/common-components/modal/export-modal/export.modal.component.tsx
rename to src/components/modals/export-modal/export.modal.component.tsx
index fe90667d4..c4038a204 100644
--- a/src/components/common-components/modal/export-modal/export.modal.component.tsx
+++ b/src/components/modals/export-modal/export.modal.component.tsx
@@ -12,12 +12,15 @@ import {
import { blue } from "@material-ui/core/colors";
import React from "react";
import { useSelector } from "react-redux";
-import { Button } from "../..";
-import { ScheduleDataModel } from "../../../../common-models/schedule-data.model";
-import { cropScheduleDMToMonthDM } from "../../../../logic/schedule-container-convertion/schedule-container-convertion";
-import { ScheduleExportLogic } from "../../../../logic/schedule-exporter/schedule-export.logic";
-import { ApplicationStateModel } from "../../../../state/models/application-state.model";
-import { ButtonData, DropdownButtons } from "../../dropdown-buttons/dropdown-buttons.component";
+import { Button } from "../../common-components";
+import { ScheduleDataModel } from "../../../state/schedule-data/schedule-data.model";
+import { cropScheduleDMToMonthDM } from "../../../logic/schedule-container-converter/schedule-container-converter";
+import { ScheduleExportLogic } from "../../../logic/schedule-exporter/schedule-export.logic";
+import { ApplicationStateModel } from "../../../state/application-state.model";
+import {
+ ButtonData,
+ DropdownButtons,
+} from "../../buttons/dropdown-buttons/dropdown-buttons.component";
import DefaultModal from "../modal.component";
export interface ExportModalComponent {
diff --git a/src/components/common-components/modal/modal.component.tsx b/src/components/modals/modal.component.tsx
similarity index 97%
rename from src/components/common-components/modal/modal.component.tsx
rename to src/components/modals/modal.component.tsx
index c3d145b58..da9195219 100644
--- a/src/components/common-components/modal/modal.component.tsx
+++ b/src/components/modals/modal.component.tsx
@@ -9,7 +9,7 @@ import Backdrop from "@material-ui/core/Backdrop";
import Fade from "@material-ui/core/Fade";
import { Box, Divider, Grid, IconButton } from "@material-ui/core";
import { MdClose } from "react-icons/md";
-import ScssVars from "../../../assets/styles/styles/custom/_variables.module.scss";
+import ScssVars from "../../assets/styles/styles/custom/_variables.module.scss";
const useStyles = (
height: number,
diff --git a/src/components/common-components/modal/report-issue-modal/report-issue-modal.component.tsx b/src/components/modals/report-issue-modal/report-issue-modal.component.tsx
similarity index 96%
rename from src/components/common-components/modal/report-issue-modal/report-issue-modal.component.tsx
rename to src/components/modals/report-issue-modal/report-issue-modal.component.tsx
index a02cee7a4..6f0b25dc3 100644
--- a/src/components/common-components/modal/report-issue-modal/report-issue-modal.component.tsx
+++ b/src/components/modals/report-issue-modal/report-issue-modal.component.tsx
@@ -4,9 +4,9 @@
import { TextField } from "@material-ui/core";
import React, { useState } from "react";
-import { Button } from "../../button-component/button.component";
+import { Button } from "../../buttons/button-component/button.component";
import { makeStyles, createStyles } from "@material-ui/core/styles";
-import ScssVars from "../../../../assets/styles/styles/custom/_variables.module.scss";
+import ScssVars from "../../../assets/styles/styles/custom/_variables.module.scss";
import DefaultModal from "../modal.component";
import { send } from "emailjs-com";
import { useNotification } from "../../notification/notification.context";
diff --git a/src/components/common-components/modal/save-changes-modal/save-changes-modal.component.tsx b/src/components/modals/save-changes-modal/save-changes-modal.component.tsx
similarity index 89%
rename from src/components/common-components/modal/save-changes-modal/save-changes-modal.component.tsx
rename to src/components/modals/save-changes-modal/save-changes-modal.component.tsx
index 7b991fa0f..2ec6f3b47 100644
--- a/src/components/common-components/modal/save-changes-modal/save-changes-modal.component.tsx
+++ b/src/components/modals/save-changes-modal/save-changes-modal.component.tsx
@@ -6,10 +6,10 @@ import { createStyles, makeStyles } from "@material-ui/core/styles";
import React from "react";
import { useDispatch, useSelector } from "react-redux";
import { Link } from "react-router-dom";
-import ScssVars from "../../../../assets/styles/styles/custom/_variables.module.scss";
-import { ApplicationStateModel } from "../../../../state/models/application-state.model";
-import { ScheduleDataActionCreator } from "../../../../state/reducers/month-state/schedule-data/schedule-data.action-creator";
-import { Button } from "../../button-component/button.component";
+import ScssVars from "../../../assets/styles/styles/custom/_variables.module.scss";
+import { ApplicationStateModel } from "../../../state/application-state.model";
+import { ScheduleDataActionCreator } from "../../../state/schedule-data/schedule-data.action-creator";
+import { Button } from "../../buttons/button-component/button.component";
import DefaultModal from "../modal.component";
const useStyles = makeStyles(() =>
diff --git a/src/components/common-components/month-switch/month-switch.component.tsx b/src/components/month-switch/month-switch.component.tsx
similarity index 89%
rename from src/components/common-components/month-switch/month-switch.component.tsx
rename to src/components/month-switch/month-switch.component.tsx
index 7f34ef98b..16a0ede83 100644
--- a/src/components/common-components/month-switch/month-switch.component.tsx
+++ b/src/components/month-switch/month-switch.component.tsx
@@ -4,10 +4,10 @@
import { MdChevronLeft, MdChevronRight } from "react-icons/md";
import React, { useEffect, useState } from "react";
import { useDispatch } from "react-redux";
-import { useActualMonth } from "./use-actual-month";
-import { MonthSwitchActionCreator } from "../../../state/reducers/month-state/schedule-data/month-switch.action-creator";
+import { useActualMonth } from "../../hooks/use-actual-month";
+import { MonthSwitchActionCreator } from "../../state/schedule-data/month-switch.action-creator";
import { IconButton } from "@material-ui/core";
-import { AppMode, useAppConfig } from "../../../state/app-config-context";
+import { AppMode, useAppConfig } from "../../state/app-config-context";
interface MonthSwitchComponentOptions {
isInViewMode: boolean;
diff --git a/src/components/common-components/notification/alert.component.tsx b/src/components/notification/alert.component.tsx
similarity index 90%
rename from src/components/common-components/notification/alert.component.tsx
rename to src/components/notification/alert.component.tsx
index fdec45f27..9b9d8f39f 100644
--- a/src/components/common-components/notification/alert.component.tsx
+++ b/src/components/notification/alert.component.tsx
@@ -4,8 +4,8 @@
import React from "react";
import { makeStyles } from "@material-ui/core/styles";
import { createStyles, Grid, Theme } from "@material-ui/core";
-import { ReactComponent as Done } from "../../../assets/images/done.svg";
-import ScssVars from "../../../assets/styles/styles/custom/_variables.module.scss";
+import { ReactComponent as Done } from "../../assets/images/done.svg";
+import ScssVars from "../../assets/styles/styles/custom/_variables.module.scss";
const useStyles = makeStyles((theme: Theme) =>
createStyles({
diff --git a/src/components/common-components/notification/notification-snackbar.component.tsx b/src/components/notification/notification-snackbar.component.tsx
similarity index 100%
rename from src/components/common-components/notification/notification-snackbar.component.tsx
rename to src/components/notification/notification-snackbar.component.tsx
diff --git a/src/components/common-components/notification/notification.context.tsx b/src/components/notification/notification.context.tsx
similarity index 100%
rename from src/components/common-components/notification/notification.context.tsx
rename to src/components/notification/notification.context.tsx
diff --git a/src/components/common-components/notification/types.ts b/src/components/notification/types.ts
similarity index 100%
rename from src/components/common-components/notification/types.ts
rename to src/components/notification/types.ts
diff --git a/src/components/schedule-page/table/schedule/schedule-parts/error-tooltip-provider.component.tsx b/src/components/poppers/error-popper/error-popper.component.tsx
similarity index 87%
rename from src/components/schedule-page/table/schedule/schedule-parts/error-tooltip-provider.component.tsx
rename to src/components/poppers/error-popper/error-popper.component.tsx
index c8eed453a..a70dfa52f 100644
--- a/src/components/schedule-page/table/schedule/schedule-parts/error-tooltip-provider.component.tsx
+++ b/src/components/poppers/error-popper/error-popper.component.tsx
@@ -6,17 +6,14 @@ import classNames from "classnames/bind";
import React, { ReactNode, useRef, useState } from "react";
import { usePopper } from "react-popper";
import { useDispatch, useSelector } from "react-redux";
-import {
- GroupedScheduleErrors,
- ScheduleError,
-} from "../../../../../common-models/schedule-error.model";
-import { ErrorMessageHelper } from "../../../../../helpers/error-message.helper";
-import { ApplicationStateModel } from "../../../../../state/models/application-state.model";
-import { ScheduleDataActionCreator } from "../../../../../state/reducers/month-state/schedule-data/schedule-data.action-creator";
-import ErrorListItem from "../../../validation-drawer/error-list-item.component";
-import { Popper } from "./base-cell/popper";
+import { ErrorMessageHelper } from "../../../helpers/error-message.helper";
+import { ApplicationStateModel } from "../../../state/application-state.model";
+import { ScheduleDataActionCreator } from "../../../state/schedule-data/schedule-data.action-creator";
+import { GroupedScheduleErrors, ScheduleError } from "../../../state/schedule-data/schedule-errors/schedule-error.model";
+import ErrorListItem from "../../error-list/error-list-item.component";
+import { Popper } from "../popper";
-export interface ErrorTooltipOptions {
+export interface ErrorPopperOptions {
children: ReactNode;
errorSelector: (scheduleErrors: GroupedScheduleErrors) => ScheduleError[];
className?: string;
@@ -26,14 +23,14 @@ export interface ErrorTooltipOptions {
showTooltip?: boolean;
}
-export function ErrorTooltipProvider({
+export function ErrorPopper({
showErrorTitle,
children,
errorSelector,
className,
id,
tooltipClassname,
-}: ErrorTooltipOptions): JSX.Element {
+}: ErrorPopperOptions): JSX.Element {
const errors = useSelector((state: ApplicationStateModel) =>
errorSelector(state.actualState.scheduleErrors)
);
diff --git a/src/components/schedule-page/table/schedule/schedule-parts/base-cell/popper.tsx b/src/components/poppers/popper.tsx
similarity index 100%
rename from src/components/schedule-page/table/schedule/schedule-parts/base-cell/popper.tsx
rename to src/components/poppers/popper.tsx
diff --git a/src/components/schedule-page/table/schedule/sections/date-section/date-section.component.tsx b/src/components/schedule-page/table/schedule/sections/date-section/date-section.component.tsx
deleted file mode 100644
index 5561adba5..000000000
--- a/src/components/schedule-page/table/schedule/sections/date-section/date-section.component.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-import React from "react";
-import { BaseSectionComponent, BaseSectionOptions } from "../base-section/base-section.component";
-
-export type DateSectionOptions = Omit;
-
-export function DateSectionComponent(options: DateSectionOptions): JSX.Element {
- return ;
-}
diff --git a/src/components/schedule-page/table/schedule/schedule-parts/base-cell/base-cell-input.component.tsx b/src/components/schedule/base/base-cell/base-cell-input.component.tsx
similarity index 93%
rename from src/components/schedule-page/table/schedule/schedule-parts/base-cell/base-cell-input.component.tsx
rename to src/components/schedule/base/base-cell/base-cell-input.component.tsx
index f897e993d..12628ed28 100644
--- a/src/components/schedule-page/table/schedule/schedule-parts/base-cell/base-cell-input.component.tsx
+++ b/src/components/schedule/base/base-cell/base-cell-input.component.tsx
@@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import React from "react";
-import { CellManagementKeys } from "../cell-blockable-input.component";
+import { CellManagementKeys } from "./cell-blockable-input.component";
export interface BaseCellInputOptions {
className: string;
diff --git a/src/components/schedule-page/table/schedule/schedule-parts/base-cell/base-cell.component.tsx b/src/components/schedule/base/base-cell/base-cell.component.tsx
similarity index 74%
rename from src/components/schedule-page/table/schedule/schedule-parts/base-cell/base-cell.component.tsx
rename to src/components/schedule/base/base-cell/base-cell.component.tsx
index 71e02491d..12b4c68e9 100644
--- a/src/components/schedule-page/table/schedule/schedule-parts/base-cell/base-cell.component.tsx
+++ b/src/components/schedule/base/base-cell/base-cell.component.tsx
@@ -3,11 +3,11 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
import classNames from "classnames/bind";
import React from "react";
-import { ScheduleError } from "../../../../../../common-models/schedule-error.model";
-import { CellInput } from "../cell-blockable-input.component";
-import { ErrorTooltipProvider } from "../error-tooltip-provider.component";
-import { useCellBackgroundHighlight } from "../hooks/use-cell-highlight";
-import { useCellSelection } from "../hooks/use-cell-selection";
+import { ScheduleError } from "../../../../state/schedule-data/schedule-errors/schedule-error.model";
+import { CellInput } from "./cell-blockable-input.component";
+import { ErrorPopper } from "../../../poppers/error-popper/error-popper.component";
+import { useCellBackgroundHighlight } from "../../hooks/use-cell-highlight";
+import { useCellSelection } from "../../hooks/use-cell-selection";
import { BaseCellInputComponent } from "./base-cell-input.component";
import { baseCellDataCy, BaseCellOptions } from "./base-cell.models";
@@ -35,11 +35,7 @@ export function BaseCellComponent(options: BaseCellOptions): JSX.Element {
id={id}
onBlur={onBlur}
>
-
+
{
@@ -56,7 +52,7 @@ export function BaseCellComponent(options: BaseCellOptions): JSX.Element {
)}
-
+