Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/wrappid/core into WR…
Browse files Browse the repository at this point in the history
…PD-enhancement-421
  • Loading branch information
PritamBag committed Nov 18, 2024
2 parents 5fd5460 + 15d74e2 commit 096f27d
Show file tree
Hide file tree
Showing 19 changed files with 837 additions and 883 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.0.585](https://github.com/wrappid/core/compare/v0.0.584...v0.0.585) (2024-11-18)


### Bug Fixes

* **core:** :ambulance: remove sanity functions from core ([da3809e](https://github.com/wrappid/core/commit/da3809e553adfd49ac0e70b6e79b041a5514b4e6))

### [0.0.584](https://github.com/wrappid/core/compare/v0.0.583...v0.0.584) (2024-11-18)


### Bug Fixes

* **core:** :bug: fix core related issues and cleanup ([7ff1787](https://github.com/wrappid/core/commit/7ff1787d736e1cf2aa2686861d87c782a79737f1))

### [0.0.583](https://github.com/wrappid/core/compare/v0.0.582...v0.0.583) (2024-11-16)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wrappid/core",
"version": "0.0.583",
"version": "0.0.585",
"description": "Multi platform app builder core package.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion package/components/dataDisplay/dataTable/CoreDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export default function CoreDataTable(props) {
currentRows : (rows && rows.length) || 0,
maxRowInPage: DATA_TABLE_CONST.MAX_ROWS_IN_PAGE,
page : 0,
pagesToCache: pagesToCache,
pagesToCache: pagesToCache
},
} = dataStore[tableUUID] || {};

Expand Down
19 changes: 19 additions & 0 deletions package/components/dataDisplay/dataTable/ModelData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// eslint-disable-next-line no-unused-vars, unused-imports/no-unused-imports
import React from "react";

import CoreDataTable from "./CoreDataTable";
import { coreUseParams } from "../../../helper/routerHelper";
import CoreLayoutItem from "../../../layout/CoreLayoutItem";
import AppContainerLayout from "../../layouts/_system/AppContainerLayout";

export default function ModelData() {
const { model } = coreUseParams();

return (
<>
<CoreLayoutItem id={AppContainerLayout.PLACEHOLDER.CONTENT}>
{model && <CoreDataTable entity={model} />}
</CoreLayoutItem>
</>
);
}
249 changes: 94 additions & 155 deletions package/components/inputs/forms/coreFormConstants.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,4 @@
import {
SanAddEmailOrPhone,
SanAddEmailOrPhoneRemoveConfirmPassword,
SanBasicEditUrlChange,
SanChangePrimaryContact,
SanClinicAddUrlChange,
SanClinicDeleteUrlChange,
SanClinicEditUrlChange,
SanClinicReadUrlChange,
SanContactEmailsCreate,
SanContactPhonesCreate,
SanContactsRead,
SanContactsReadUrlChange,
SanContactWapCreate,
SanCoreFormCancelFormId,
SanCreateAppointment,
SanDoctorCreate,
SanEditAppointment,
SanEducationAddUrlChange,
SanEducationEditUrlChange,
SanEducationReadUrlChange,
SanExperienceAddUrlChange,
SanExperienceEditUrlChange,
SanExperienceReadUrlChange,
SanPatientCreate,
SanPatientRelativeCreate,
SanPrescription,
SanProfileBasicRead,
SanProfileClinicRead,
SanProfileEducationRead,
SanProfileExperienceRead,
SanProfileRegistrationRead,
SanReadPrimaryEmail,
SanReadPrimaryPhone,
SanRegistrationReadUrlChange,
SanRxRexharge,
San_URL_ADD_PATH_PARAM_ID,
SanStringValueAdd,
SanStringValueEdit,
DefaultLangEditDel,
SanChemDeptReadMap,
SanChemDeptMap,
SanRolePermissionReadMap,
SanRolePermission,
SanCreateCommunicationTemplate,
SanEditCommunicationTemplate,
SanTestCommunicationTemplate,
SanStatusUpdate,
getBmi,
SanReadAppointment
} from "../../../utils/formSubmitSanitizations";
import { } from "../../../utils/formSubmitSanitizations";

export const FORM_EDIT_MODE = "edit";
export const FORM_VIEW_MODE = "view";
Expand Down Expand Up @@ -315,112 +265,101 @@ export const FORM_ARRAY_EDIT_DEL_FUNCTION_IDS = { __DEFAULT_LANG_NOT_EDIT_DELETE

export const FORM_SELECT_DATA_FUNCTION_IDS = { __SPECILIZATION: "SanAddEmailOrPhone" };

// eslint-disable-next-line object-curly-newline
export const FORM_SANITIZATOIN_FUNCTION_MAP = {
[FORM_SANITIZATION_FUNCTION_IDS.__URL_ADD_PATH_PARAM_ID]:
San_URL_ADD_PATH_PARAM_ID,
[FORM_SANITIZATION_FUNCTION_IDS.__ADD_EMAIL_OR_PHONE]: SanAddEmailOrPhone,
[FORM_SANITIZATION_FUNCTION_IDS.__ADD_EMAIL_OR_PHONE_REMOVE_CONFIRM_PASSWORD]:
SanAddEmailOrPhoneRemoveConfirmPassword,

[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_CLINIC_ADD_URL_CHANGE]:
SanClinicAddUrlChange,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_CLINIC_EDIT_URL_CHANGE]:
SanClinicEditUrlChange,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_CLINIC_DELETE_URL_CHANGE]:
SanClinicDeleteUrlChange,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_CLINIC_READ]: SanProfileClinicRead,

[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EDUCATION_ADD_URL_CHANGE]:
SanEducationAddUrlChange,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EDUCATION_EDIT_URL_CHANGE]:
SanEducationEditUrlChange,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EDUCATION_READ_URL_CHANGE]:
SanEducationReadUrlChange,

//function to transform response data to form specific data
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EDUCATION_READ]:
SanProfileEducationRead,

[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EXPERIENCE_ADD_URL_CHANGE]:
SanExperienceAddUrlChange,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EXPERIENCE_EDIT_URL_CHANGE]:
SanExperienceEditUrlChange,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EXPERIENCE_READ_URL_CHANGE]:
SanExperienceReadUrlChange,

//function to transform response data to form specific data
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EXPERIENCE_READ]:
SanProfileExperienceRead,

//FORM RELATED
[FORM_SANITIZATION_FUNCTION_IDS.__CORE_FORM_CANCEL_FORM_ID]:
SanCoreFormCancelFormId,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_CLINIC_READ_URL_CHANGE]:
SanClinicReadUrlChange,

[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_BASIC_EDIT_URL_CHANGE]:
SanBasicEditUrlChange,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_BASIC_READ]: SanProfileBasicRead,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_REGISTRATION_READ]:
SanProfileRegistrationRead,
[FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_REGISTRATION_READ_URL_CHANGE]:
SanRegistrationReadUrlChange,
[FORM_SANITIZATION_FUNCTION_IDS.__PRESCRIPTION_DATA]: SanPrescription,

//settings related
[FORM_SANITIZATION_FUNCTION_IDS.__ADD_EMAILS]: SanContactEmailsCreate,
[FORM_SANITIZATION_FUNCTION_IDS.__ADD_PHONES]: SanContactPhonesCreate,
[FORM_SANITIZATION_FUNCTION_IDS.__ADD_WAP] : SanContactWapCreate,

[FORM_SANITIZATION_FUNCTION_IDS.__READ_CONTACTS]: SanContactsRead,
[FORM_SANITIZATION_FUNCTION_IDS.__READ_CONTACTS_URL_CHANGE]:
SanContactsReadUrlChange,
[FORM_SANITIZATION_FUNCTION_IDS.__PRIMARY_CONTACT_CHANGE]:
SanChangePrimaryContact,
[FORM_SANITIZATION_FUNCTION_IDS.__READ_PRIMARY_PHONE]: SanReadPrimaryPhone,
[FORM_SANITIZATION_FUNCTION_IDS.__READ_PRIMARY_EMAIL]: SanReadPrimaryEmail,
[FORM_SANITIZATION_FUNCTION_IDS.__PATIENT_CREATE] : SanPatientCreate,
[FORM_SANITIZATION_FUNCTION_IDS.__PATIENT_RELATIVE_CREATE]:
SanPatientRelativeCreate,
[FORM_SANITIZATION_FUNCTION_IDS.__DOCTOR_CREATE]: SanDoctorCreate,
[FORM_SANITIZATION_FUNCTION_IDS.__RX_RECHARGE] : SanRxRexharge,

//Appointment related
[FORM_SANITIZATION_FUNCTION_IDS.__CREATE_APPOINTMENT] : SanCreateAppointment,
[FORM_SANITIZATION_FUNCTION_IDS.__RESCHEDULE_APPOINTMENT]: SanEditAppointment,
[FORM_SANITIZATION_FUNCTION_IDS.__READ_APPOINTMENT] : SanReadAppointment,

//language
[FORM_SANITIZATION_FUNCTION_IDS.__CREATE_LOCALE]: SanStringValueAdd,
[FORM_SANITIZATION_FUNCTION_IDS.__UPDATE_LOCALE]: SanStringValueEdit,

//chem department
[FORM_SANITIZATION_FUNCTION_IDS.__SAN_CHEM_DEPT_READ_MAP]: SanChemDeptReadMap,
[FORM_SANITIZATION_FUNCTION_IDS.__SAN_CHEM_DEPT_MAP] : SanChemDeptMap,

//Role Permission
[FORM_SANITIZATION_FUNCTION_IDS.__ROLE_PERMISSION_READ_MAP]:
SanRolePermissionReadMap,
[FORM_SANITIZATION_FUNCTION_IDS.__ROLE_PERMISSION_MAP]: SanRolePermission,

[FORM_SANITIZATION_FUNCTION_IDS.__COMMUNICATION_TEMPLATE_CREATE]:
SanCreateCommunicationTemplate,
[FORM_SANITIZATION_FUNCTION_IDS.__COMMUNICATION_TEMPLATE_EDIT]:
SanEditCommunicationTemplate,
[FORM_SANITIZATION_FUNCTION_IDS.__COMMUNICATION_TEMPLATE_TEST]:
SanTestCommunicationTemplate,

// app builder status update form
[FORM_SANITIZATION_FUNCTION_IDS.__STATUS_UPDATE_APP_BUILDER_ENTITY]: SanStatusUpdate,

/**
* form dependency functions
*/
[FORM_SANITIZATION_FUNCTION_IDS.__GET_BMI]: getBmi

// eslint-disable-next-line etc/no-commented-out-code
// [FORM_SANITIZATION_FUNCTION_IDS.__URL_ADD_PATH_PARAM_ID]:
// San_URL_ADD_PATH_PARAM_ID,
// [FORM_SANITIZATION_FUNCTION_IDS.__ADD_EMAIL_OR_PHONE]: SanAddEmailOrPhone,
// [FORM_SANITIZATION_FUNCTION_IDS.__ADD_EMAIL_OR_PHONE_REMOVE_CONFIRM_PASSWORD]:
// SanAddEmailOrPhoneRemoveConfirmPassword,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_CLINIC_ADD_URL_CHANGE]:
// SanClinicAddUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_CLINIC_EDIT_URL_CHANGE]:
// SanClinicEditUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_CLINIC_DELETE_URL_CHANGE]:
// SanClinicDeleteUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_CLINIC_READ]: SanProfileClinicRead,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EDUCATION_ADD_URL_CHANGE]:
// SanEducationAddUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EDUCATION_EDIT_URL_CHANGE]:
// SanEducationEditUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EDUCATION_READ_URL_CHANGE]:
// SanEducationReadUrlChange,
// //function to transform response data to form specific data
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EDUCATION_READ]:
// SanProfileEducationRead,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EXPERIENCE_ADD_URL_CHANGE]:
// SanExperienceAddUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EXPERIENCE_EDIT_URL_CHANGE]:
// SanExperienceEditUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EXPERIENCE_READ_URL_CHANGE]:
// SanExperienceReadUrlChange,
// //function to transform response data to form specific data
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_EXPERIENCE_READ]:
// SanProfileExperienceRead,
// //FORM RELATED
// [FORM_SANITIZATION_FUNCTION_IDS.__CORE_FORM_CANCEL_FORM_ID]:
// SanCoreFormCancelFormId,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_CLINIC_READ_URL_CHANGE]:
// SanClinicReadUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_BASIC_EDIT_URL_CHANGE]:
// SanBasicEditUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_BASIC_READ]: SanProfileBasicRead,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_REGISTRATION_READ]:
// SanProfileRegistrationRead,
// [FORM_SANITIZATION_FUNCTION_IDS.__PROFILE_REGISTRATION_READ_URL_CHANGE]:
// SanRegistrationReadUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PRESCRIPTION_DATA]: SanPrescription,
// //settings related
// [FORM_SANITIZATION_FUNCTION_IDS.__ADD_EMAILS]: SanContactEmailsCreate,
// [FORM_SANITIZATION_FUNCTION_IDS.__ADD_PHONES]: SanContactPhonesCreate,
// [FORM_SANITIZATION_FUNCTION_IDS.__ADD_WAP] : SanContactWapCreate,
// [FORM_SANITIZATION_FUNCTION_IDS.__READ_CONTACTS]: SanContactsRead,
// [FORM_SANITIZATION_FUNCTION_IDS.__READ_CONTACTS_URL_CHANGE]:
// SanContactsReadUrlChange,
// [FORM_SANITIZATION_FUNCTION_IDS.__PRIMARY_CONTACT_CHANGE]:
// SanChangePrimaryContact,
// [FORM_SANITIZATION_FUNCTION_IDS.__READ_PRIMARY_PHONE]: SanReadPrimaryPhone,
// [FORM_SANITIZATION_FUNCTION_IDS.__READ_PRIMARY_EMAIL]: SanReadPrimaryEmail,
// [FORM_SANITIZATION_FUNCTION_IDS.__PATIENT_CREATE] : SanPatientCreate,
// [FORM_SANITIZATION_FUNCTION_IDS.__PATIENT_RELATIVE_CREATE]:
// SanPatientRelativeCreate,
// [FORM_SANITIZATION_FUNCTION_IDS.__DOCTOR_CREATE]: SanDoctorCreate,
// [FORM_SANITIZATION_FUNCTION_IDS.__RX_RECHARGE] : SanRxRexharge,
// //Appointment related
// [FORM_SANITIZATION_FUNCTION_IDS.__CREATE_APPOINTMENT] : SanCreateAppointment,
// [FORM_SANITIZATION_FUNCTION_IDS.__RESCHEDULE_APPOINTMENT]: SanEditAppointment,
// [FORM_SANITIZATION_FUNCTION_IDS.__READ_APPOINTMENT] : SanReadAppointment,
// //language
// [FORM_SANITIZATION_FUNCTION_IDS.__CREATE_LOCALE]: SanStringValueAdd,
// [FORM_SANITIZATION_FUNCTION_IDS.__UPDATE_LOCALE]: SanStringValueEdit,
// //chem department
// [FORM_SANITIZATION_FUNCTION_IDS.__SAN_CHEM_DEPT_READ_MAP]: SanChemDeptReadMap,
// [FORM_SANITIZATION_FUNCTION_IDS.__SAN_CHEM_DEPT_MAP] : SanChemDeptMap,
// //Role Permission
// [FORM_SANITIZATION_FUNCTION_IDS.__ROLE_PERMISSION_READ_MAP]:
// SanRolePermissionReadMap,
// [FORM_SANITIZATION_FUNCTION_IDS.__ROLE_PERMISSION_MAP]: SanRolePermission,
// [FORM_SANITIZATION_FUNCTION_IDS.__COMMUNICATION_TEMPLATE_CREATE]:
// SanCreateCommunicationTemplate,
// [FORM_SANITIZATION_FUNCTION_IDS.__COMMUNICATION_TEMPLATE_EDIT]:
// SanEditCommunicationTemplate,
// [FORM_SANITIZATION_FUNCTION_IDS.__COMMUNICATION_TEMPLATE_TEST]:
// SanTestCommunicationTemplate,
// // app builder status update form
// [FORM_SANITIZATION_FUNCTION_IDS.__STATUS_UPDATE_APP_BUILDER_ENTITY]: SanStatusUpdate,
// /**
// * form dependency functions
// */
// [FORM_SANITIZATION_FUNCTION_IDS.__GET_BMI]: getBmi
// eslint-disable-next-line object-curly-newline
};

// eslint-disable-next-line object-curly-newline
export const FORM_ARRAY_EDIT_DELETE_FUNCTION_MAP = {
[FORM_ARRAY_EDIT_DEL_FUNCTION_IDS.__DEFAULT_LANG_NOT_EDIT_DELETE]:
DefaultLangEditDel,
// eslint-disable-next-line etc/no-commented-out-code
// [FORM_ARRAY_EDIT_DEL_FUNCTION_IDS.__DEFAULT_LANG_NOT_EDIT_DELETE]:
// DefaultLangEditDel,
// eslint-disable-next-line object-curly-newline
};
5 changes: 4 additions & 1 deletion package/components/layouts/_system/AppContainerLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import CoreRequestProgressBar from "../../feedback/CoreRequestProgressBar";
import CoreAppBar from "../../surfaces/CoreAppBar";
import CoreDrawer from "../../surfaces/CoreDrawer";
import CoreFooter from "../../surfaces/CoreFooter";
import CoreBox from "../CoreBox";

export default function AppContainerLayout() {
const dispatch = useDispatch();
Expand Down Expand Up @@ -188,7 +189,9 @@ export default function AppContainerLayout() {
>
<CoreRequestProgressBar />

<CoreLayoutPlaceholder id={AppContainerLayout.PLACEHOLDER.CONTENT} />
<CoreBox styleClasses={[CoreClasses.LAYOUT.MAIN_CONTAINER]}>
<CoreLayoutPlaceholder id={AppContainerLayout.PLACEHOLDER.CONTENT} />
</CoreBox>
</NativeAppContainer>

</>
Expand Down
16 changes: 8 additions & 8 deletions package/components/surfaces/CoreFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React from "react";
// eslint-disable-next-line import/order, import/no-unresolved
import { WrappidDataContext } from "@wrappid/styles";
import CoreClasses from "../../styles/CoreClasses";
import ThemeSelector from "../../theme/ThemeSelector";
import CoreTypographyCaption from "../dataDisplay/CoreTypographyCaption";
import CoreBox from "../layouts/CoreBox";
import CoreGrid from "../layouts/CoreGrid";
Expand All @@ -22,28 +21,29 @@ export default function CoreFooter(props) {
// CoreClasses.FRAMEWORK.CORE_FOOTER
]}>
<CoreBox
gridProps={{ gridSize: { md: 3 } }}
styleClasses={[CoreClasses.ALIGNMENT.JUSTIFY_CONTENT_CENTER]}>
gridProps={{ gridSize: { md: 4 } }}
styleClasses={[CoreClasses.ALIGNMENT.JUSTIFY_CONTENT_FLEX_START]}>
<CoreAppVersion noTitle={true} />
</CoreBox>

<CoreBox
gridProps={{ gridSize: { md: 3 } }}
gridProps={{ gridSize: { md: 4 } }}
styleClasses={[CoreClasses.ALIGNMENT.JUSTIFY_CONTENT_CENTER]}>
<CoreTypographyCaption>
{`${config?.wrappid?.footerText || "Wrappid Default Footer"} © ${new Date().getFullYear()}`}
</CoreTypographyCaption>
</CoreBox>

<CoreBox
{/* eslint-disable-next-line etc/no-commented-out-code */}
{/* <CoreBox
gridProps={{ gridSize: { md: 3 } }}
styleClasses={[CoreClasses.ALIGNMENT.JUSTIFY_CONTENT_CENTER]}>
<ThemeSelector />
</CoreBox>
</CoreBox> */}

<CoreBox
gridProps={{ gridSize: { md: 3 } }}
styleClasses={[CoreClasses.ALIGNMENT.JUSTIFY_CONTENT_CENTER]}>
gridProps={{ gridSize: { md: 4 } }}
styleClasses={[CoreClasses.ALIGNMENT.JUSTIFY_CONTENT_FLEX_END]}>
<CoreTermsPrivacyLink />
</CoreBox>
</CoreGrid>
Expand Down
Loading

0 comments on commit 096f27d

Please sign in to comment.