Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/controllers/org.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { orgService } from "../services/org.service.js";

/**
* Retrieves all stacks.
*
*
* @param {Request} req - The request object.
* @param {Response} res - The response object.
* @returns {Promise<void>} - A promise that resolves when the operation is complete.
Expand Down
10 changes: 5 additions & 5 deletions api/src/controllers/projects.contentMapper.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Request, Response } from "express";
import { contentMapperService } from "../services/contentMapper.service.js";
/**
* Handles the PUT request to update test data.
*
*
* @param req - The request object.
* @param res - The response object.
* @returns A Promise that resolves to void.
Expand All @@ -14,7 +14,7 @@ const putTestData = async (req: Request, res: Response): Promise<void> => {

/**
* Retrieves the content types from the content mapper service and sends the response as JSON.
*
*
* @param req - The Express request object.
* @param res - The Express response object.
* @returns A Promise that resolves to void.
Expand All @@ -25,7 +25,7 @@ const getContentTypes = async (req: Request, res: Response): Promise<void> => {
};
/**
* Retrieves the field mapping for a given request and sends the response as JSON.
*
*
* @param req - The request object.
* @param res - The response object.
* @returns A Promise that resolves to void.
Expand Down Expand Up @@ -64,7 +64,7 @@ const putContentTypeFields = async (
};
/**
* Resets the content type to its initial mapping.
*
*
* @param req - The request object.
* @param res - The response object.
* @returns A Promise that resolves to void.
Expand Down Expand Up @@ -96,7 +96,7 @@ const removeContentMapper = async (

/**
* Retrieves single content types.
*
*
* @param req - The request object.
* @param res - The response object.
* @returns A Promise that resolves to void.
Expand Down
8 changes: 4 additions & 4 deletions api/src/controllers/projects.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { projectService } from "../services/projects.service.js";

/**
* Retrieves all projects.
*
*
* @param req - The request object.
* @param res - The response object.
* @returns A promise that resolves to void.
Expand All @@ -27,7 +27,7 @@ const getProject = async (req: Request, res: Response): Promise<void> => {

/**
* Creates a new project.
*
*
* @param req - The request object.
* @param res - The response object.
* @returns A Promise that resolves to void.
Expand Down Expand Up @@ -74,7 +74,7 @@ const updateAffix = async (req: Request, res: Response) => {

/**
* Handles the affix confirmation request.
*
*
* @param req - The request object.
* @param res - The response object.
* @returns A Promise that resolves to the response data.
Expand Down Expand Up @@ -132,7 +132,7 @@ const updateCurrentStep = async (req: Request, res: Response) => {

/**
* Deletes a project.
*
*
* @param req - The request object.
* @param res - The response object.
* @returns A Promise that resolves to void.
Expand Down
4 changes: 2 additions & 2 deletions api/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { HTTP_CODES } from "../constants/index.js";

/**
* Middleware function to authenticate the user.
*
*
* @param req - The Express request object.
* @param res - The Express response object.
* @param next - The next middleware function.
Expand All @@ -24,7 +24,7 @@ export const authenticateUser = (
.status(status)
.json({ status, message: "Unauthorized - Token missing" });

/* this middleware function verifies the provided JWT token,
/* this middleware function verifies the provided JWT token,
handles any errors that may occur during verification,
attaches the decoded token payload to the request object,
and then passes control to the next middleware or request handler.
Expand Down
2 changes: 1 addition & 1 deletion api/src/middlewares/req-headers.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Request, Response, NextFunction } from "express";
/**
* Middleware function to handle request headers.
* Adds necessary headers for CORS support and handles OPTIONS requests.
*
*
* @param req - The Express Request object.
* @param res - The Express Response object.
* @param next - The next middleware function.
Expand Down
2 changes: 1 addition & 1 deletion api/src/middlewares/unmatched-routes.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { HTTP_CODES, HTTP_TEXTS } from "../constants/index.js";

/**
* Middleware function to handle unmatched routes.
*
*
* @param req - The Express request object.
* @param res - The Express response object.
*/
Expand Down
2 changes: 1 addition & 1 deletion api/src/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface User {
* The email address of the user.
*/
email: string;

/**
* The password of the user.
*/
Expand Down
4 changes: 2 additions & 2 deletions api/src/routes/auth.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const router = express.Router();

/**
* Route for user login.
*
*
* @route POST /user-session
* @group Authentication
* @param {object} req.body - The request body containing user credentials.
Expand All @@ -26,7 +26,7 @@ router.post(

/**
* Route for requesting SMS token.
*
*
* @route POST /request-token-sms
* @group Authentication
* @param {object} req.body - The request body containing user information.
Expand Down
15 changes: 8 additions & 7 deletions api/src/services/contentMapper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ const putTestData = async (req: Request) => {
*/
contentTypes.map((type: any, index: any) => {
const fieldIds: string[] = [];
const fields = type?.fieldMapping?.map?.((field: any) => {
const id = field?.id || uuidv4();
fieldIds.push(id);
return { id, isDeleted: true, ...field };
}) ?? [];
const fields =
type?.fieldMapping?.map?.((field: any) => {
const id = field?.id || uuidv4();
fieldIds.push(id);
return { id, isDeleted: true, ...field };
}) ?? [];
FieldMapperModel.update((data: any) => {
data.field_mapper = [...(data?.field_mapper ?? []), ...fields];
});
Expand Down Expand Up @@ -433,7 +434,7 @@ const updateContentType = async (req: Request) => {
};
/**
* Resets the field mapping and content mapping for a specific content type in a project.
*
*
* @param req - The request object containing the parameters and body.
* @returns An object with a message indicating the success of the reset operation.
* @throws {BadRequestError} If the project status or current step is not valid for resetting the content mapping.
Expand Down Expand Up @@ -550,7 +551,7 @@ const resetToInitialMapping = async (req: Request) => {
};
/**
* Resets all the content types mapping for a specific project.
*
*
* @param projectId - The ID of the project.
* @returns The project details after resetting the content types mapping.
* @throws {BadRequestError} If the content mapper or project is not found.
Expand Down
2 changes: 1 addition & 1 deletion api/src/services/org.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ const getStackStatus = async (req: Request) => {
*/
const getStackLocal = async (token_payload: any, data: any) => {
const srcFun = "getStackLocal";
return new Promise( async (resolve) => {
return new Promise(async (resolve) => {
const authtoken = await getAuthtoken(
token_payload?.region,
token_payload?.user_id
Expand Down
18 changes: 10 additions & 8 deletions api/src/services/projects.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,11 @@ const updateProject = async (req: Request) => {
ProjectModelLowdb.update((data: any) => {
data.projects[projectIndex].name = updateData?.name;
data.projects[projectIndex].description = updateData?.description;
if(data.projects[projectIndex].isNewStack === false && updateData?.isNewStack === true){
data.projects[projectIndex].isNewStack = updateData?.isNewStack ;
if (
data.projects[projectIndex].isNewStack === false &&
updateData?.isNewStack === true
) {
data.projects[projectIndex].isNewStack = updateData?.isNewStack;
data.projects[projectIndex].newStackId = updateData?.newStackId;
}
data.projects[projectIndex].updated_by = user_id;
Expand Down Expand Up @@ -243,7 +246,7 @@ const updateProject = async (req: Request) => {

/**
* Updates the legacy CMS for a project.
*
*
* @param req - The request object containing the parameters and body.
* @returns An object with the status and data of the update operation.
* @throws BadRequestError if the project status is invalid.
Expand Down Expand Up @@ -329,7 +332,7 @@ const updateLegacyCMS = async (req: Request) => {

/**
* Updates the affix of a project.
*
*
* @param req - The request object containing the parameters and body.
* @returns An object with the status and data properties.
*/
Expand Down Expand Up @@ -366,7 +369,7 @@ const updateAffix = async (req: Request) => {

/**
* Affixes the confirmation to a project in the database.
*
*
* @param req - The request object containing the parameters and body.
* @returns An object with the status and data properties.
*/
Expand Down Expand Up @@ -544,7 +547,7 @@ const fileformatConfirmation = async (req: Request) => {

/**
* Updates the destination stack for a project.
*
*
* @param req - The request object containing the parameters and body.
* @returns An object with the status and data of the update operation.
* @throws BadRequestError if the project status is invalid or the destination stack is not found.
Expand Down Expand Up @@ -855,7 +858,7 @@ const deleteProject = async (req: Request) => {

/**
* Reverts a project by setting its 'isDeleted' property to false.
*
*
* @param req - The request object containing the parameters and body.
* @returns An object with the status and data of the reverted project.
* @throws {NotFoundError} If the project is not found.
Expand Down Expand Up @@ -903,7 +906,6 @@ const revertProject = async (req: Request) => {
}
};


export const projectService = {
getAllProjects,
getProject,
Expand Down
2 changes: 1 addition & 1 deletion api/src/validators/cms.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { VALIDATION_ERRORS } from "../constants/index.js";

/**
* Validates the 'legacy_cms' field in the request body.
*
*
* @returns {Object} The validation schema for 'legacy_cms' field.
*/
export default checkSchema({
Expand Down
72 changes: 58 additions & 14 deletions ui/src/common/assets/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* SVG component for the "NO_PROJECTS_SEARCH" icon.
*
* @remarks
* This SVG represents an icon used for indicating no search results in a project.
*
* @returns The SVG component.
*/
export const NO_PROJECTS_SEARCH = (
<svg
width="300"
Expand Down Expand Up @@ -408,6 +416,11 @@ export const NO_PROJECTS_SEARCH = (
</svg>
);

/**
* This file contains the definition of the NO_PROJECTS SVG icon.
* The icon represents a graphic illustration of a folder with no projects.
* It is used as a visual representation when there are no projects available.
*/
export const NO_PROJECTS = (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -717,6 +730,12 @@ export const NO_PROJECTS = (
</svg>
);

/**
* SVG icon component for a caret pointing right.
*
* @component
* @name CARET_RIGHT
*/
export const CARET_RIGHT = (
<svg
width="10"
Expand All @@ -734,6 +753,10 @@ export const CARET_RIGHT = (
</svg>
);

/**
* SVG icon component for the trash icon.
* @constant
*/
export const TRASH = (
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<path
Expand All @@ -753,6 +776,9 @@ export const TRASH = (
</svg>
);

/**
* SVG icon for search.
*/
export const SEARCH_ICON = (
<svg width="52" height="52" viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
Expand All @@ -764,27 +790,45 @@ export const SEARCH_ICON = (
</svg>
);

export const LOG_OUT = (
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fillRule="evenodd" clipRule="evenodd" d="M15.9148 7.66475C16.1344 7.44508 16.4906 7.44508 16.7102 7.66475L20.6477 11.6023C20.8674 11.8219 20.8674 12.1781 20.6477 12.3977L16.7102 16.3352C16.4906 16.5549 16.1344 16.5549 15.9148 16.3352C15.6951 16.1156 15.6951 15.7594 15.9148 15.5398L19.4545 12L15.9148 8.46025C15.6951 8.24058 15.6951 7.88442 15.9148 7.66475Z" fill="#475161"/>
<path fillRule="evenodd" clipRule="evenodd" d="M9.1875 12C9.1875 11.6893 9.43934 11.4375 9.75 11.4375H20.25C20.5607 11.4375 20.8125 11.6893 20.8125 12C20.8125 12.3107 20.5607 12.5625 20.25 12.5625H9.75C9.43934 12.5625 9.1875 12.3107 9.1875 12Z" fill="#475161"/>
<path fillRule="evenodd" clipRule="evenodd" d="M4.5 4.3125C4.45027 4.3125 4.40258 4.33225 4.36742 4.36742C4.33225 4.40258 4.3125 4.45027 4.3125 4.5V19.5C4.3125 19.5497 4.33225 19.5974 4.36742 19.6326C4.40258 19.6677 4.45027 19.6875 4.5 19.6875H9.75C10.0607 19.6875 10.3125 19.9393 10.3125 20.25C10.3125 20.5607 10.0607 20.8125 9.75 20.8125H4.5C4.1519 20.8125 3.81806 20.6742 3.57192 20.4281C3.32578 20.1819 3.1875 19.8481 3.1875 19.5V4.5C3.1875 4.1519 3.32578 3.81806 3.57192 3.57192C3.81806 3.32578 4.1519 3.1875 4.5 3.1875H9.75C10.0607 3.1875 10.3125 3.43934 10.3125 3.75C10.3125 4.06066 10.0607 4.3125 9.75 4.3125H4.5Z" fill="#475161"/>
/**
* SVG icon for logging out.
*/
export const LOG_OUT = (
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fillRule="evenodd" clipRule="evenodd" d="M15.9148 7.66475C16.1344 7.44508 16.4906 7.44508 16.7102 7.66475L20.6477 11.6023C20.8674 11.8219 20.8674 12.1781 20.6477 12.3977L16.7102 16.3352C16.4906 16.5549 16.1344 16.5549 15.9148 16.3352C15.6951 16.1156 15.6951 15.7594 15.9148 15.5398L19.4545 12L15.9148 8.46025C15.6951 8.24058 15.6951 7.88442 15.9148 7.66475Z" fill="#475161"/>
<path fillRule="evenodd" clipRule="evenodd" d="M9.1875 12C9.1875 11.6893 9.43934 11.4375 9.75 11.4375H20.25C20.5607 11.4375 20.8125 11.6893 20.8125 12C20.8125 12.3107 20.5607 12.5625 20.25 12.5625H9.75C9.43934 12.5625 9.1875 12.3107 9.1875 12Z" fill="#475161"/>
<path fillRule="evenodd" clipRule="evenodd" d="M4.5 4.3125C4.45027 4.3125 4.40258 4.33225 4.36742 4.36742C4.33225 4.40258 4.3125 4.45027 4.3125 4.5V19.5C4.3125 19.5497 4.33225 19.5974 4.36742 19.6326C4.40258 19.6677 4.45027 19.6875 4.5 19.6875H9.75C10.0607 19.6875 10.3125 19.9393 10.3125 20.25C10.3125 20.5607 10.0607 20.8125 9.75 20.8125H4.5C4.1519 20.8125 3.81806 20.6742 3.57192 20.4281C3.32578 20.1819 3.1875 19.8481 3.1875 19.5V4.5C3.1875 4.1519 3.32578 3.81806 3.57192 3.57192C3.81806 3.32578 4.1519 3.1875 4.5 3.1875H9.75C10.0607 3.1875 10.3125 3.43934 10.3125 3.75C10.3125 4.06066 10.0607 4.3125 9.75 4.3125H4.5Z" fill="#475161"/>
</svg>
);
);

/**
* SVG icon component for the magnify icon.
*
* @remarks
* This component renders an SVG icon for the magnify icon.
*
* @returns The SVG icon component.
*/
export const MAGNIFY = (
<svg width="20" height="20" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.625 11.25C13.625 11.0429 13.4571 10.875 13.25 10.875C13.0429 10.875 12.875 11.0429 12.875 11.25V12.875H11.25C11.0429 12.875 10.875 13.0429 10.875 13.25C10.875 13.4571 11.0429 13.625 11.25 13.625H12.875V15.25C12.875 15.4571 13.0429 15.625 13.25 15.625C13.4571 15.625 13.625 15.4571 13.625 15.25V13.625H15.25C15.4571 13.625 15.625 13.4571 15.625 13.25C15.625 13.0429 15.4571 12.875 15.25 12.875H13.625V11.25Z" fill="#475161"/>
<path fillRule="evenodd" clipRule="evenodd" d="M7.625 13.25C7.625 10.1434 10.1434 7.625 13.25 7.625C16.3566 7.625 18.875 10.1434 18.875 13.25C18.875 14.6683 18.3501 15.9641 17.4838 16.9535L20.2652 19.7349C20.4116 19.8813 20.4116 20.1187 20.2652 20.2652C20.1187 20.4116 19.8813 20.4116 19.7349 20.2652L16.9535 17.4838C15.9641 18.3501 14.6683 18.875 13.25 18.875C10.1434 18.875 7.625 16.3566 7.625 13.25ZM13.25 8.375C10.5576 8.375 8.375 10.5576 8.375 13.25C8.375 15.9424 10.5576 18.125 13.25 18.125C15.9424 18.125 18.125 15.9424 18.125 13.25C18.125 10.5576 15.9424 8.375 13.25 8.375Z" fill="#475161"/>
</svg>
<svg width="20" height="20" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.625 11.25C13.625 11.0429 13.4571 10.875 13.25 10.875C13.0429 10.875 12.875 11.0429 12.875 11.25V12.875H11.25C11.0429 12.875 10.875 13.0429 10.875 13.25C10.875 13.4571 11.0429 13.625 11.25 13.625H12.875V15.25C12.875 15.4571 13.0429 15.625 13.25 15.625C13.4571 15.625 13.625 15.4571 13.625 15.25V13.625H15.25C15.4571 13.625 15.625 13.4571 15.625 13.25C15.625 13.0429 15.4571 12.875 15.25 12.875H13.625V11.25Z" fill="#475161"/>
<path fillRule="evenodd" clipRule="evenodd" d="M7.625 13.25C7.625 10.1434 10.1434 7.625 13.25 7.625C16.3566 7.625 18.875 10.1434 18.875 13.25C18.875 14.6683 18.3501 15.9641 17.4838 16.9535L20.2652 19.7349C20.4116 19.8813 20.4116 20.1187 20.2652 20.2652C20.1187 20.4116 19.8813 20.4116 19.7349 20.2652L16.9535 17.4838C15.9641 18.3501 14.6683 18.875 13.25 18.875C10.1434 18.875 7.625 16.3566 7.625 13.25ZM13.25 8.375C10.5576 8.375 8.375 10.5576 8.375 13.25C8.375 15.9424 10.5576 18.125 13.25 18.125C15.9424 18.125 18.125 15.9424 18.125 13.25C18.125 10.5576 15.9424 8.375 13.25 8.375Z" fill="#475161"/>
</svg>
);

/**
* SVG icon component for DEMAGNIFY.
*
* @remarks
* This component renders an SVG icon for the DEMAGNIFY action.
*
* @returns The SVG icon component.
*/
export const DEMAGNIFY = (
<svg width="20" height="20" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.25 13.625H15.25C15.4571 13.625 15.625 13.4571 15.625 13.25C15.625 13.0429 15.4571 12.875 15.25 12.875H11.25C11.0429 12.875 10.875 13.0429 10.875 13.25C10.875 13.4571 11.0429 13.625 11.25 13.625Z" fill="#475161"/>
<path fillRule="evenodd" clipRule="evenodd" d="M7.625 13.25C7.625 10.1434 10.1434 7.625 13.25 7.625C16.3566 7.625 18.875 10.1434 18.875 13.25C18.875 14.6683 18.3501 15.9641 17.4838 16.9535L20.2652 19.7349C20.4116 19.8813 20.4116 20.1187 20.2652 20.2652C20.1187 20.4116 19.8813 20.4116 19.7349 20.2652L16.9535 17.4838C15.9641 18.3501 14.6683 18.875 13.25 18.875C10.1434 18.875 7.625 16.3566 7.625 13.25ZM13.25 8.375C10.5576 8.375 8.375 10.5576 8.375 13.25C8.375 15.9424 10.5576 18.125 13.25 18.125C15.9424 18.125 18.125 15.9424 18.125 13.25C18.125 10.5576 15.9424 8.375 13.25 8.375Z" fill="#475161"/>
</svg>

<path d="M11.25 13.625H15.25C15.4571 13.625 15.625 13.4571 15.625 13.25C15.625 13.0429 15.4571 12.875 15.25 12.875H11.25C11.0429 12.875 10.875 13.0429 10.875 13.25C10.875 13.4571 11.0429 13.625 11.25 13.625Z" fill="#475161"/>
<path fillRule="evenodd" clipRule="evenodd" d="M7.625 13.25C7.625 10.1434 10.1434 7.625 13.25 7.625C16.3566 7.625 18.875 10.1434 18.875 13.25C18.875 14.6683 18.3501 15.9641 17.4838 16.9535L20.2652 19.7349C20.4116 19.8813 20.4116 20.1187 20.2652 20.2652C20.1187 20.4116 19.8813 20.4116 19.7349 20.2652L16.9535 17.4838C15.9641 18.3501 14.6683 18.875 13.25 18.875C10.1434 18.875 7.625 16.3566 7.625 13.25ZM13.25 8.375C10.5576 8.375 8.375 10.5576 8.375 13.25C8.375 15.9424 10.5576 18.125 13.25 18.125C15.9424 18.125 18.125 15.9424 18.125 13.25C18.125 10.5576 15.9424 8.375 13.25 8.375Z" fill="#475161"/>
</svg>
);


Loading