Skip to content
Merged

Dev #117

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a11d0ad
Precommit changes
sayalijoshi27 May 15, 2024
0322120
Merge branch 'dev' of https://github.com/contentstack/migration-v2-no…
sayalijoshi27 May 15, 2024
210505a
refactor:changed stack select dropdown to asyncselect
AishDani May 15, 2024
46ec28e
refactor:code formatted by precommit
AishDani May 15, 2024
700d5f4
refactor:resolved PR comment
AishDani May 16, 2024
a3fea8f
Merge pull request #112 from contentstack/feature/project-dashboard
snehalsankhe May 16, 2024
058a350
fetch Single ContentType API
shristi-sinha May 16, 2024
8fd7ba3
Merge pull request #113 from contentstack/feature/CMG-100
sayalijoshi27 May 17, 2024
78d2b53
work around for group field uncheck
sayalijoshi27 May 17, 2024
617a92e
refactor:resolved empty selectcms issue
AishDani May 17, 2024
4f4a3b3
refactor:removed commented code
AishDani May 17, 2024
580a016
Merge pull request #114 from contentstack/feature/project-dashboard
snehalsankhe May 17, 2024
52378a9
[CMG-101] - UI for Fetch API
sayalijoshi27 May 20, 2024
49caa80
Merge branch 'dev' of https://github.com/contentstack/migration-v2-no…
sayalijoshi27 May 20, 2024
95e9149
[CMG-103] - On group uncheck child elements also get unchecked
sayalijoshi27 May 20, 2024
56826dd
Merge pull request #115 from contentstack/feature/CMG-101
AishDani May 20, 2024
d1a0a82
Merge branch 'dev' of https://github.com/contentstack/migration-v2-no…
sayalijoshi27 May 20, 2024
b55c3ca
Merge pull request #116 from contentstack/bugfix/projects
AishDani May 20, 2024
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
Precommit changes
  • Loading branch information
sayalijoshi27 committed May 15, 2024
commit a11d0ade06e40f76e4b265c8706551949a027efb
20 changes: 10 additions & 10 deletions api/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export const HTTP_TEXTS = {
"Reseting the content mapping is restricted. Please verify the status and review preceding actions.",
CONTENTMAPPER_NOT_FOUND:
"Sorry, the requested content mapper id does not exists.",
ADMIN_LOGIN_ERROR:
"Sorry, You Don't have admin access in any of the Organisation"
ADMIN_LOGIN_ERROR:
"Sorry, You Don't have admin access in any of the Organisation",
};

export const HTTP_RESPONSE_HEADERS = {
Expand Down Expand Up @@ -127,11 +127,11 @@ export const PREDEFINED_STATUS = [
export const PREDEFINED_STEPS = [1, 2, 3, 4, 5];

export const NEW_PROJECT_STATUS = {
0: 0, //DRAFT
1: 1, //READY_TO_TEST
2: 2, //TESTING_IN_PROGRESS
3: 3, //READY_FOR_MIGRATION
4: 4, //MIGRATION_IN_PROGRESS
5: 5, //MIGRATION_SUCCESSFUL
6: 6 //MIGRATION_TERMINATED
};
0: 0, //DRAFT
1: 1, //READY_TO_TEST
2: 2, //TESTING_IN_PROGRESS
3: 3, //READY_FOR_MIGRATION
4: 4, //MIGRATION_IN_PROGRESS
5: 5, //MIGRATION_SUCCESSFUL
6: 6, //MIGRATION_TERMINATED
};
1 change: 0 additions & 1 deletion api/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const connectToDatabase = async () => {
fs.mkdirSync("./database");
}
logger.info("successfully connecting to Low DB");

} catch (error) {
logger.error("Error while connecting to Low DB:", error);
process.exit(1);
Expand Down
12 changes: 6 additions & 6 deletions api/src/models/FieldMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { JSONFile } from "lowdb/node";
import LowWithLodash from "../utils/lowdb-lodash.utils.js";

interface Advanced {
validationRegex: string,
Mandatory:boolean,
Multiple:boolean,
Unique:boolean,
NonLocalizable:boolean
validationRegex: string;
Mandatory: boolean;
Multiple: boolean;
Unique: boolean;
NonLocalizable: boolean;
}

interface FieldMapper {
Expand All @@ -21,7 +21,7 @@ interface FieldMapper {
isDeleted: boolean;
backupFieldType: string;
refrenceTo: { uid: string; title: string };
advanced:Advanced
advanced: Advanced;
}[];
}

Expand Down
5 changes: 2 additions & 3 deletions api/src/services/contentMapper.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
HTTP_TEXTS,
HTTP_CODES,
STEPPER_STEPS,
NEW_PROJECT_STATUS
NEW_PROJECT_STATUS,
} from "../constants/index.js";
import logger from "../utils/logger.js";
import { config } from "../config/index.js";
Expand Down Expand Up @@ -256,8 +256,7 @@ const updateContentType = async (req: Request) => {
NEW_PROJECT_STATUS[4],
].includes(project.status) ||
project.current_step < STEPPER_STEPS.CONTENT_MAPPING
)
{
) {
logger.error(
getLogMessage(
srcFun,
Expand Down
14 changes: 7 additions & 7 deletions api/src/services/org.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,19 @@ const getStackLocal = async (token_payload: any, data: any) => {
status: err.response.status,
};
}
let localesArr:any =[]
res?.data?.locales.map((lang:any)=>{
let localesArr: any = [];
res?.data?.locales.map((lang: any) => {
return localesArr.push({
code:lang.code,
name:lang.name
})
})
code: lang.code,
name: lang.name,
});
});

let obj = {
name: stack.name,
api_key: stack.api_key,
master_locale: stack.master_locale,
locales: localesArr
locales: localesArr,
};
stacks.push(obj);
}
Expand Down
10 changes: 5 additions & 5 deletions api/src/services/projects.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
HTTP_TEXTS,
HTTP_CODES,
STEPPER_STEPS,
NEW_PROJECT_STATUS
NEW_PROJECT_STATUS,
} from "../constants/index.js";
import { config } from "../config/index.js";
import { getLogMessage, safePromise } from "../utils/index.js";
Expand Down Expand Up @@ -479,8 +479,8 @@ const updateDestinationStack = async (req: Request) => {
);

if (
project.status === NEW_PROJECT_STATUS[4] ||
project.status === NEW_PROJECT_STATUS[5] ||
project.status === NEW_PROJECT_STATUS[4] ||
project.status === NEW_PROJECT_STATUS[5] ||
project.current_step < STEPPER_STEPS.DESTINATION_STACK
) {
logger.error(
Expand Down Expand Up @@ -531,7 +531,7 @@ const updateDestinationStack = async (req: Request) => {
data.projects[projectIndex].destination_stack_id = stack_api_key;
data.projects[projectIndex].current_step =
STEPPER_STEPS.DESTINATION_STACK;
data.projects[projectIndex].status = NEW_PROJECT_STATUS[0];
data.projects[projectIndex].status = NEW_PROJECT_STATUS[0];
data.projects[projectIndex].updated_at = new Date().toISOString();
});

Expand Down Expand Up @@ -590,7 +590,7 @@ const updateCurrentStep = async (req: Request) => {

switch (project.current_step) {
case STEPPER_STEPS.LEGACY_CMS: {
if (project.status !== NEW_PROJECT_STATUS[0] || !isStepCompleted) {
if (project.status !== NEW_PROJECT_STATUS[0] || !isStepCompleted) {
logger.error(
getLogMessage(
srcFunc,
Expand Down
2 changes: 0 additions & 2 deletions api/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

export const throwError = (message: string, statusCode: number) => {
throw Object.assign(new Error(message), { statusCode });
};
Expand Down Expand Up @@ -26,4 +25,3 @@ export const getLogMessage = (
...(error && { error }),
};
};