Skip to content
Merged

Dev #191

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
Next Next commit
added comments on some UI files and looger windows functionality
  • Loading branch information
RohitKini committed Jul 11, 2024
commit d0aa37930cd2dca46aa9b4adec140f86f54fea76
3 changes: 2 additions & 1 deletion api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ try {
logger.info(`Server listening at port ${config.PORT}`)
);
// Chokidar - Watch for log file changes
const logFilePath = "/Users/sayali.joshi/Projects/migration-v2-node-server/api/combine.log"; // Replace with the actual path to your log file
///Users/rohit/migration-v2-node-server/api/combine.log
const logFilePath = "/Users/rohit/migration-v2-node-server/api/combine.log"; // Replace with the actual path to your log file
const watcher = chokidar.watch(logFilePath);
// Socket.IO - Send logs to client
const io = new Server(
Expand Down
4 changes: 4 additions & 0 deletions ui/src/common/assets/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* This file contains the definition of the SVG icon component.
*/
export const NO_PROJECTS_SEARCH = (
<svg
width="300"
Expand Down Expand Up @@ -408,6 +411,7 @@ export const NO_PROJECTS_SEARCH = (
</svg>
);


export const NO_PROJECTS = (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down
3 changes: 3 additions & 0 deletions ui/src/common/assets/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/**
* This module exports all the icons from the './icons' module.
*/
export * from './icons';
3 changes: 3 additions & 0 deletions ui/src/components/AccountPage/accountPage.interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { LoginType } from '../../pages/Login/login.interface';

/**
* Represents an account object.
*/
export interface AccountObj {
children: React.ReactNode;
data: LoginType;
Expand Down
28 changes: 28 additions & 0 deletions ui/src/components/AccountPage/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
/**
* Styles for the AccountPage component.
*
* This SCSS file contains styles for the AccountPage component, which is a container component
* that displays the account page of the application. It includes styles for the layout, logo,
* background image, action section, content section, heading, circles, and copyright text.
*
* @import '../../scss/variables'; - Imports the SCSS variables file.
*
* CSS Classes:
* - .AccountPage - The main container for the account page.
* - &__logo - The logo section within the account page.
* - &__intro - The introduction section within the account page.
* - &__action - The action section within the account page.
* - &__content - The content section within the account page.
* - &__heading - The heading section within the account page.
* - &_title - The title within the heading section.
* - &_subtitle - The subtitle within the heading section.
* - &__circle - The circle elements within the account page.
* - &_one - The first circle element.
* - &_two - The second circle element.
* - &_three - The third circle element.
* - &_four - The fourth circle element.
* - &_five - The fifth circle element.
* - &_six - The sixth circle element.
* - &_seven - The seventh circle element.
* - .copyright_text - The copyright text.
*/
@import '../../scss/variables';

.AccountPage {
Expand Down
7 changes: 7 additions & 0 deletions ui/src/components/AccountPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ import { AccountObj } from './accountPage.interface';
// Styles
import './index.scss';

/**
* Renders the AccountPage component.
*
* @param {AccountObj} props - The props object containing data for the component.
* @returns {JSX.Element} The rendered AccountPage component.
*/

const AccountPage = (props: AccountObj): JSX.Element => {
const { heading, copyrightText } = props.data;

Expand Down
62 changes: 62 additions & 0 deletions ui/src/components/AdvancePropertise/advanceProperties.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,82 @@ export interface Props {
handleToggle?: (field: string, value: boolean, checkBoxChanged: boolean) => void;
}

/**
* Represents the state type for advanced properties.
*/
export interface StateType {
/**
* The minimum number of characters allowed.
*/
minChars?: string;

/**
* The maximum number of characters allowed.
*/
maxChars?: number;

/**
* The minimum range allowed.
*/
minRange?: number;

/**
* The maximum range allowed.
*/
maxRange?: number;

/**
* The minimum size allowed.
*/
minSize?: string;

/**
* The maximum size allowed.
*/
maxSize?: number;

/**
* The default value.
*/
defaultValue?: string;

/**
* The validation regular expression.
*/
validationRegex?: string;

/**
* The title.
*/
title?: string;

/**
* The URL.
*/
url?: string;

/**
* Indicates if the field is mandatory.
*/
mandatory?: boolean;

/**
* Indicates if only images are allowed.
*/
allowImagesOnly?: boolean;

/**
* Indicates if the field is non-localizable.
*/
nonLocalizable?: boolean;

/**
* Indicates if the object should be embedded.
*/
embedObject?: boolean;

/**
* Indicates if the assets should be embedded.
*/
embedAssests?: boolean;
}
31 changes: 26 additions & 5 deletions ui/src/components/AdvancePropertise/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* Styles for the AdvancePropertise component.
*/

@import '../../scss/variables';

.options-class {
Expand All @@ -9,54 +13,68 @@
grid-template-columns: 1fr;
gap: 20px;
}

.option-label {
margin-bottom: $px-10;
}

.non-localizable-message {
margin-top: 0;
margin-left: 30px;
}

.modal-data {
padding: 0.75rem;

.radio-field {
margin-bottom: 0.75rem;
}

.Radio {
width: calc(33.33333% - .66667rem);
padding: .5rem;
margin: 0 !important;
}

.FieldLabel {
margin-bottom: $px-8;
}

.info-style {
margin-top: .75rem;
margin-bottom: 1.5rem;

.Info__border {
border-left-color: #0469e3;
}
}

.options-class {
line-height: $line-height-reset;
}

.nl-note {
color: $color-font-base;
font-size: $size-font-large;
line-height: $line-height-default;
margin-left: 2.75rem;
margin-top: -.25rem !important;
}

.ToggleWrap {
margin-top: 0.5rem;
padding: 0 0.5rem
padding: 0 0.5rem;
}

.Field {
margin-bottom: $px-24;
}

.fields-group-separator {
color: $color-base-black-base;
margin: 0 16px;
}

.Select {
.Select__menu {
.Select__menu-list {
Expand All @@ -65,20 +83,23 @@
align-items: center;
display: flex;
}

.Checkbox__label {
height: auto;
}
}
}
}
}
}
}
}

.Select__menu {
position: relative;
z-index: 10000;
}

.Select__control--menu-is-open {
position: relative;
border: 2px solid red;
z-index: 10000;
}
}
}
27 changes: 25 additions & 2 deletions ui/src/components/AdvancePropertise/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ import { ContentType } from '../ContentMapper/contentMapper.interface';
// Styles
import './index.scss';

/**
* Component for displaying advanced properties.
* @param props - The schema properties.
* @returns The rendered component.
*/
const AdvancePropertise = (props: SchemaProps) => {
// State for toggle states
const [toggleStates, setToggleStates] = useState({
minChars: props?.value?.MinChars,
maxChars: props?.value?.MaxChars,
Expand All @@ -41,20 +47,30 @@ const AdvancePropertise = (props: SchemaProps) => {
embedAssests: true
});

// State for content types
const [contentTypes, setContentTypes] = useState<ContentType[]>([]);
const [ctValue, setCTValue] = useState(null);

useEffect(() => {
fetchContentTypes('');
}, [])

// Fetch content types list
/**
* Fetches the content types list.
* @param searchText - The search text.
*/
const fetchContentTypes = async (searchText: string) => {
const { data } = await getContentTypes(props?.projectId ?? '', 0, 10, searchText || ''); //org id will always present

setContentTypes(data?.contentTypes);
};

/**
* Handles the change event for input fields.
* @param field - The field name.
* @param event - The change event.
* @param checkBoxChanged - Indicates if the checkbox was changed.
*/
const handleOnChange = (field: string, event: React.ChangeEvent<HTMLInputElement>, checkBoxChanged: boolean) => {
setToggleStates((prevStates) => ({
...prevStates,
Expand All @@ -76,6 +92,12 @@ const AdvancePropertise = (props: SchemaProps) => {
);
};

/**
* Handles the toggle change event.
* @param field - The field name.
* @param value - The new value.
* @param checkBoxChanged - Indicates if the checkbox was changed.
*/
const handleToggleChange = (field: string, value: boolean, checkBoxChanged: boolean) => {
setToggleStates((prevStates) => ({
...prevStates,
Expand All @@ -97,13 +119,14 @@ const AdvancePropertise = (props: SchemaProps) => {
);
};

// Option for content types
const option = Array.isArray(contentTypes)
? contentTypes.map((option) => ({ label: option?.otherCmsTitle, value: option?.otherCmsTitle }))
: [{ label: contentTypes, value: contentTypes }];

return (
<>
<ModalHeader title={`${props?.fieldtype} propertise`} closeModal={props?.closeModal} className="text-capitalize" />
<ModalHeader title={`${props?.fieldtype} properties`} closeModal={props?.closeModal} className="text-capitalize" />
<ModalBody>
<div className='modal-data'>
{(props?.fieldtype === 'Single Line Textbox' || props?.fieldtype === 'Multi Line Textbox') && (
Expand Down
3 changes: 3 additions & 0 deletions ui/src/components/Card/card.interface.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ProjectsObj } from '../../pages/Projects/projects.interface';

/**
* Represents the project type.
*/
export interface ProjectType {
project?: ProjectsObj;
}
Loading