diff --git a/client/src/app/editor/models/dynamicExtendedCellValidation.ts b/client/src/app/editor/models/dynamicExtendedCellValidation.ts index 4342eb4..fe4c552 100644 --- a/client/src/app/editor/models/dynamicExtendedCellValidation.ts +++ b/client/src/app/editor/models/dynamicExtendedCellValidation.ts @@ -1,3 +1,7 @@ +/** + * Model for the dynamic cell validation in the editor + * (sending whole row to the backend service and recieving data for the cell dropdown) + */ export interface DynamicExtendedCellValidation { DISPLAY_INDEX: number DISPLAY_TYPE: string diff --git a/client/src/app/editor/models/edit-record/edit-record-events.ts b/client/src/app/editor/models/edit-record/edit-record-events.ts index 0eedbb9..7dcd50e 100644 --- a/client/src/app/editor/models/edit-record/edit-record-events.ts +++ b/client/src/app/editor/models/edit-record/edit-record-events.ts @@ -1,8 +1,14 @@ +/** + * Edit record modal - input has been focused event + */ export interface EditRecordInputFocusedEvent { event: any colName: number } +/** + * Edit record modal - dropdown has been changed event + */ export interface EditRecordDropdownChangeEvent { colName: string col: number diff --git a/client/src/app/editor/models/editor-restrictions.model.ts b/client/src/app/editor/models/editor-restrictions.model.ts index 6fe828b..f16f1d1 100644 --- a/client/src/app/editor/models/editor-restrictions.model.ts +++ b/client/src/app/editor/models/editor-restrictions.model.ts @@ -1,3 +1,6 @@ +/** + * Editor restrictions model (based on the licencing) + */ export interface EditorRestrictions { restrictEditRecord?: boolean // Feature is locked but edit/add record buttons are visible so when user clicks he gets the `locked feature modal` restrictAddRecord?: boolean // Same as editRecord, but for addRecord diff --git a/client/src/app/editor/utils/date.utils.ts b/client/src/app/editor/utils/date.utils.ts index d738201..d5a916e 100644 --- a/client/src/app/editor/utils/date.utils.ts +++ b/client/src/app/editor/utils/date.utils.ts @@ -1,3 +1,6 @@ +/** + * Converting date object to the UTC time string + */ export const dateToUtcTime = (date: Date) => { let timeStr = ('0' + date.getUTCHours()).slice(-2) + ':' timeStr = timeStr + ('0' + date.getUTCMinutes()).slice(-2) + ':' @@ -5,6 +8,9 @@ export const dateToUtcTime = (date: Date) => { return timeStr } +/** + * Converts date object to the time string + */ export const dateToTime = (date: Date) => { let timeStr = ('0' + date.getHours()).slice(-2) + ':' timeStr = timeStr + ('0' + date.getMinutes()).slice(-2) + ':' @@ -12,6 +18,9 @@ export const dateToTime = (date: Date) => { return timeStr } +/** + * Converts date object to the YYYY-MM-DD + */ export const dateFormat = (date: Date) => { return ( date.getFullYear() + diff --git a/client/src/app/editor/utils/grid.utils.ts b/client/src/app/editor/utils/grid.utils.ts index 30b4ad2..b681713 100644 --- a/client/src/app/editor/utils/grid.utils.ts +++ b/client/src/app/editor/utils/grid.utils.ts @@ -1,9 +1,17 @@ import { Col } from 'src/app/shared/dc-validator/models/col.model' +/** + * Converts excel date serial number to JS date + */ export const excelDateToJSDate = (serial: number) => { return new Date(Math.round((serial - 25569) * 86400 * 1000)) } +/** + * Parsing table columns for the HOT in editor + * Converts array of objects into array of strings, every string is column name (key) + * @param data array of objects (columns data) + */ export const parseTableColumns = (data: Col[]): string[] => { const columns: string[] = [] @@ -16,6 +24,12 @@ export const parseTableColumns = (data: Col[]): string[] => { return columns } +/** + * Captures headers that are not found in the current table but is found in the uploaded file data + * @param data + * @param headers + * @returns string array of missing headers + */ export const getMissingHeaders = (data: any, headers: any) => { const missingHeaders: string[] = [] const remainingHeaders: string[] = [] diff --git a/client/src/app/editor/utils/renderers.utils.ts b/client/src/app/editor/utils/renderers.utils.ts index 95bbc96..a5468b3 100644 --- a/client/src/app/editor/utils/renderers.utils.ts +++ b/client/src/app/editor/utils/renderers.utils.ts @@ -1,3 +1,7 @@ +/** + * Custom renderer for HOT cell + * Used to show error icon + */ export const errorRenderer = ( instance: any, td: any, @@ -14,6 +18,10 @@ export const errorRenderer = ( return td } +/** + * Custom renderer for HOT cell + * Used to revert cell back to original state (no spinner, no error) + */ export const noSpinnerRenderer = ( instance: any, td: any, @@ -28,7 +36,11 @@ export const noSpinnerRenderer = ( return td } -// Spinner shown whilst waiting for SAS to respond +/** + * Custom renderer for HOT cell + * Used to show loading spinner in the cell + * (Spinner shown whilst waiting for SAS to respond) + */ export const spinnerRenderer = ( instance: any, td: any,