Skip to content
Merged

Dev #224

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
Binary file removed api/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions api/src/config/dev.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ export const devConfig = {
NA: "https://stag-api.csnonprod.com/v3",
EU: "https://stag-eu-api.csnonprod.com/v3",
AZURE_NA: "https://stag-azure-na-api.csnonprod.com/v3",
GCP_NA: "https://stag-gcp-na-api.csnonprod.com/v3",
},
CS_URL: {
NA: "https://app.contentstack.com/#!",
EU: "https://eu-app.contentstack.com/#!",
AZURE_NA: "https://azure-na-app.contentstack.com/#!",
AZURE_EU: "https://azure-eu-app.contentstack.com/#!",
GCP_NA: "https://gcp-na-app.contentstack.com/#!",
},
LOG_FILE_PATH:
process.platform === "win32" ? ".\\combine.log" : "./combine.log", // Replace with the actual path to your log file
Expand Down
2 changes: 2 additions & 0 deletions api/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ export type ConfigType = {
EU: string;
AZURE_NA: string;
AZURE_EU?: string;
GCP_NA?: string;
};
CS_URL: {
NA: string;
EU: string;
AZURE_NA: string;
AZURE_EU?: string;
GCP_NA?: string;
};
};

Expand Down
2 changes: 2 additions & 0 deletions api/src/config/prod.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ export const prodConfig = {
EU: "https://eu-api.contentstack.com/v3",
AZURE_NA: "https://azure-na-api.contentstack.com/v3",
AZURE_EU: "https://azure-eu-api.contentstack.com/v3",
GCP_NA: "https://gcp-na-api.contentstack.com/v3",
},
CS_URL: {
NA: "https://app.contentstack.com/#!",
EU: "https://eu-app.contentstack.com/#!",
AZURE_NA: "https://azure-na-app.contentstack.com/#!",
AZURE_EU: "https://azure-eu-app.contentstack.com/#!",
GCP_NA: "https://gcp-na-app.contentstack.com/#!",
},
LOG_FILE_PATH:
process.platform === "win32" ? ".\\combine.log" : "./combine.log", // Replace with the actual path to your log file
Expand Down
2 changes: 1 addition & 1 deletion api/src/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const CS_REGIONS = ["NA", "EU", "AZURE_NA", "AZURE_EU"];
export const CS_REGIONS = ["NA", "EU", "AZURE_NA", "AZURE_EU", "GCP_NA"];
export const MODULES = [
"Project",
"Migration",
Expand Down
2 changes: 1 addition & 1 deletion api/src/validators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default (route: string = "") =>
affix: affixValidator,
affix_confirmation_validator: affixConfirmationValidator,
fileformat_confirmation_validator: fileformatConfirmationValidator,
stack: stackValidator
stack: stackValidator,
};

const validator = appValidators[route as keyof typeof appValidators];
Expand Down
1 change: 1 addition & 0 deletions api/src/validators/project.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { VALIDATION_ERRORS } from "../constants/index.js";
*
* @returns {Object} The validation schema for the project data.
*/

export default checkSchema({
name: {
in: "body",
Expand Down
4 changes: 2 additions & 2 deletions api/src/validators/stack.validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ export default checkSchema({
isLength: {
errorMessage: VALIDATION_ERRORS.LENGTH_LIMIT.replace("$", "Description"),
options: {
min: 1,
min: 0,
max: 512,
},
bail: true,
},
},
});
});
2 changes: 1 addition & 1 deletion ui/src/cmsData/add_stack.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"secondary_cta": { "title": "Cancel" },
"stack_description": "Description",
"stack_description_placeholder": "Enter a description",
"stack_locale_description": "Select a Language",
"stack_locale_description": "Select a language",
"stack_locales": "Set Master Language",
"stack_name": "Name",
"stack_name_placeholder": "Enter stack Name",
Expand Down
30 changes: 29 additions & 1 deletion ui/src/cmsData/region_login.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"title": "Account Login",
"url": "/region-login",
"heading": "Account Login",
"description": "Please select Contentstack <strong>North America (AWS or Azure)</strong> or Contentstack <strong>Europe (AWS or Azure)</strong> to continue.",
"description": "Please select Contentstack <strong>North America (AWS, Azure or GCP)</strong> or Contentstack <strong>Europe (AWS or Azure)</strong> to continue.",
"regions": [
{
"service_icon": {
Expand Down Expand Up @@ -50,6 +50,34 @@
"cta": { "title": "Continue", "url": "/login" },
"_metadata": { "uid": "cs77a3bf15c456afbb" }
},
{
"service_icon": {
"uid": "blt57dafa9c1472b46f",
"created_at": "2024-07-29T10:57:59.058Z",
"updated_at": "2024-07-29T10:57:59.058Z",
"created_by": "blt181afddb6080e3df",
"updated_by": "blt181afddb6080e3df",
"content_type": "image/svg+xml",
"file_size": "1622",
"tags": [],
"filename": "google-cloud_1.svg",
"url": "https://images.contentstack.io/v3/assets/bltd3620ec6418ad3ad/blt57dafa9c1472b46f/66a775b7d14106640a554ec7/google-cloud_1.svg",
"ACL": [],
"is_dir": false,
"parent_uid": null,
"_version": 1,
"title": "google-cloud_1.svg"
},
"service_title": "Google Cloud Platform",
"region_title": "North America",
"cta": {
"title": "Continue",
"url": "/login"
},
"_metadata": {
"uid": "cs14bce3c329a87986"
}
},
{
"service_icon": {
"uid": "bltbe45879eac0025d8",
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 @@ -149,20 +149,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;
}
34 changes: 31 additions & 3 deletions ui/src/components/Common/ProgressBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,56 @@ import React from 'react'
import './progressBar.scss'
import cn from 'classnames'


/**
* Props for the ProgressBar component.
*/
type ProgressBarProps = {
/**
* The percentage value for the progress.
*/
percentage: number
/**
* The color of the progress bar.
*/
color?: string
/**
* Height of the Progress bar in pixel
* The height of the progress bar in pixels.
*/
height?: number
/**
* Border radius in pixel
* The border radius of the progress bar in pixels.
*/
borderRadius?: number
/**
* The type of progress bar. Can be 'bar' or 'circle'.
*/
type?: 'bar' | 'circle',
/**
* The stroke width of the circle progress bar.
*/
stroke?: number
/**
* The radius of the circle progress bar.
*/
radius?: number | undefined
/**
* The background color of the circle progress bar.
*/
bgColor?: string
}

/**
* Interface for defining CSS styles.
*/
type IStyle = {
[key: string]: string
}

/**
* A customizable progress bar component.
* @param props - The props for the ProgressBar component.
* @returns The rendered ProgressBar component.
*/
const ProgressBar = (props: ProgressBarProps) => {
const { percentage, color, height, borderRadius, type, radius, stroke, bgColor } = props

Expand Down
3 changes: 3 additions & 0 deletions ui/src/components/Common/SaveChangesModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface Props {
saveContentType: () => void;
openContentType?: () => void;
changeStep?: () => void;
dropdownStateChange: () => void;
}

const SaveChangesModal = (props: Props) => {
Expand All @@ -37,6 +38,7 @@ const SaveChangesModal = (props: Props) => {
</Button>
<Button buttonType="secondary"version={"v2"} onClick={() => {
props.closeModal();
props?.dropdownStateChange();
props.openContentType?.();
props.isopen(false);
props?.changeStep?.();
Expand All @@ -45,6 +47,7 @@ const SaveChangesModal = (props: Props) => {
Don&apos;t Save
</Button>
<Button version={"v2"} onClick={() => {
props?.dropdownStateChange();
props.saveContentType();
props.closeModal();
props.openContentType?.();
Expand Down
Loading