Skip to content

Commit 92965cb

Browse files
committed
refactor:resolved PR comments
1 parent 41697e1 commit 92965cb

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

.talismanrc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ ignoreconfig:
1111
- Base64Detector
1212

1313
- filename: ui/src/components/ContentMapper/index.tsx
14-
checksum: 938aaf193e830bade84f9d8d385e55942269c3f2e7be82939994d64d76df3fa6
15-
16-
version: "1.0"
14+
checksum: 6743142fce18f945d55fc61d7d774118db400b72ccc7a0b5e089ccc8aed20340
15+
version: "“1.0.1-beta”"

api/src/services/wordpress.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,13 +2332,13 @@ async function extractPosts( packagePath: string, destinationStackId: string, pr
23322332
postdataCombined = { ...postdataCombined, ...chunkPostData };
23332333

23342334
const seenTitles = new Map();
2335-
Object?.entries(postdataCombined)?.forEach(([uid, item]:any) => {
2335+
Object?.entries?.(postdataCombined)?.forEach?.(([uid, item]:any) => {
23362336
const originalTitle = item?.title;
23372337

2338-
if (seenTitles.has(originalTitle)) {
2338+
if (seenTitles?.has(originalTitle)) {
23392339
item.title = `${originalTitle} - ${item?.uid}`;
23402340
}
2341-
seenTitles.set(item?.title, true);
2341+
seenTitles?.set?.(item?.title, true);
23422342
});
23432343

23442344
const message = getLogMessage(

api/src/utils/content-type-creator.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const arrangGroups = ({ schema, newStack }: any) => {
8282
if (et?.contentstackFieldUid?.includes(`${item?.contentstackFieldUid}.`) ||
8383
(newStack === false && et?.uid?.includes(`${item?.uid}.`))) {
8484
const target = groupSchema?.contentstackFieldUid;
85-
const index = et?.contentstackFieldUid?.indexOf(target);
85+
const index = et?.contentstackFieldUid?.indexOf?.(target);
8686

8787
if (index > 0) {
8888
et.contentstackFieldUid = et?.contentstackFieldUid?.substring(index);

ui/src/components/ContentMapper/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2255,7 +2255,7 @@ const ContentMapper = forwardRef(({handleStepChange}: contentMapperProps, ref: R
22552255
}
22562256
}}
22572257
>
2258-
{CONTENT_MAPPING_STATUS[key] && <span className={`${activeFilter === CONTENT_MAPPING_STATUS[key] ? 'filter-status filterButton-color' :'filter-status' }`}>{CONTENT_MAPPING_STATUS[key]}</span> }
2258+
{CONTENT_MAPPING_STATUS[key] && <span className={`${activeFilter === CONTENT_MAPPING_STATUS[key] ? 'filter-status filterButton-color ' :'filter-status' }`}>{CONTENT_MAPPING_STATUS[key]}</span> }
22592259
{STATUS_ICON_Mapping[key] && <Icon size="small" icon={STATUS_ICON_Mapping[key]} className={STATUS_ICON_Mapping[key] === 'CheckedCircle' ? 'mapped-icon' : ''} />}
22602260
</button>
22612261
</li>

ui/src/components/DestinationStack/Actions/LoadLanguageMapper.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const Mapper = ({
111111

112112
// const validLabels = cmsLocaleOptions?.map((item)=> item?.label);
113113

114-
const existingMasterID = Object?.keys(selectedMappings || {})?.find((key) =>
114+
const existingMasterID = Object?.keys?.(selectedMappings || {})?.find((key) =>
115115
key?.includes('-master_locale')
116116
);
117117

@@ -140,7 +140,7 @@ const Mapper = ({
140140
const existingLabel = existingMasterID;
141141
const expectedLabel = `${locale?.label}-master_locale`;
142142

143-
const isLabelMismatch = existingLabel && existingLabel.localeCompare(expectedLabel) !== 0;
143+
const isLabelMismatch = existingLabel && existingLabel?.localeCompare(expectedLabel) !== 0;
144144
if(locale?.value === 'master_locale'){
145145
if (!updatedExistingField?.[index]) {
146146
updatedExistingField[index] = {
@@ -179,7 +179,7 @@ const Mapper = ({
179179
) => {
180180
const selectedLocaleKey = selectedValue?.value;
181181

182-
let existingLabel = existingField[index];
182+
let existingLabel = existingField?.[index];
183183
if (!selectedValue?.label) {
184184
setselectedCsOption((prevSelected) =>
185185
prevSelected?.filter((item) => item !== existingField?.[index]?.label)

0 commit comments

Comments
 (0)