Skip to content
Merged

Dev #866

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
4 changes: 4 additions & 0 deletions ui/src/components/AdvancePropertise/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,10 @@ const AdvancePropertise = (props: SchemaProps) => {
props?.updateFieldSettings(
props?.rowId,
{
...props?.value,
mandatory: toggleStates?.mandatory,
nonLocalizable: toggleStates?.nonLocalizable,
referenedItems: toggleStates?.referenedItems,
validationRegex: toggleStates?.validationRegex ?? '',
embedObjects: embedObject,
embedObject: !shouldToggleOff
Expand Down
3 changes: 1 addition & 2 deletions ui/src/components/ContentMapper/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
overflow-x: hidden;
}
.ct-list {
border-right: 1px solid $color-brand-secondary-lightest;
list-style-type: none;
padding: 15px 0 15px 0;
li {
Expand Down Expand Up @@ -151,7 +150,7 @@
}
.Table {
border-left: 0 none;
min-height: 26.25rem;
min-height: 24.25rem;
.Table__body__row {
.Table-select-body {
>.checkbox-wrapper {
Expand Down
25 changes: 8 additions & 17 deletions ui/src/components/ContentMapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1324,20 +1324,15 @@ const ContentMapper = forwardRef(({ handleStepChange }: contentMapperProps, ref:
options={option}
menuPlacement="auto"
isDisabled={
data?.contentstackFieldType === 'group' ||
(data?.contentstackFieldType === 'text') ||
(data?.contentstackFieldType === 'url') ||
data?.backupFieldType === 'reference' ||
data?.contentstackFieldType === "global_field" ||
!(data?.contentstackFieldType === 'single_line_text' ||
data?.contentstackFieldType === 'multi_line_text' || data?.contentstackFieldType === 'html' || data?.contentstackFieldType === 'json') ||
data?.otherCmsType === undefined ||
newMigrationData?.project_current_step > 4 ||
data?.backupFieldType === 'extension' ||
data?.backupFieldType === 'app'
newMigrationData?.project_current_step > 4
}
/>
</div>
{!(
data?.contentstackFieldType === 'Group' ||
data?.contentstackFieldType === 'group' ||
data?.contentstackFieldType === 'text' ||
data?.contentstackFieldType === 'url' ||
data?.contentstackFieldType === 'global_field' ||
Expand Down Expand Up @@ -1792,14 +1787,10 @@ const ContentMapper = forwardRef(({ handleStepChange }: contentMapperProps, ref:
? {
label: Fields[data?.contentstackFieldType]?.label ?? 'No Option',
value: Fields[data?.contentstackFieldType]?.label ?? 'No Option',
isDisabled: data?.contentstackFieldType === 'text' ||
data?.contentstackFieldType === 'group' ||
data?.contentstackFieldType === 'url' ||
data?.backupFieldType === "reference" ||
data?.contentstackFieldType === "global_field" ||
data?.otherCmsType === undefined ||
data?.backupFieldType === 'app' ||
data?.backupFieldType === 'extension'
isDisabled: !(data?.contentstackFieldType === 'single_line_text' ||
data?.contentstackFieldType === 'multi_line_text' || data?.contentstackFieldType === 'html' || data?.contentstackFieldType === 'json') ||
data?.otherCmsType === undefined

}
: {
label: `${selectedOption} matches`,
Expand Down
16 changes: 15 additions & 1 deletion upload-api/src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,21 @@ router.get('/validator', express.json(), fileOperationLimiter, async function (r
res.status(data?.status || 200).json(data);

if (data?.status === 200) {
const filePath = path.join(__dirname, '..', '..', 'extracted_files', name);
let filePath = path.join(__dirname, '..', '..', 'extracted_files', name);

// Define excluded directories that should not be used in file paths
const EXCLUDED_DIRECTORIES = ['blob', 'installer', 'items', 'metadata', 'properties'];

// Check if data.file is a valid, non-excluded directory
const isValidFile = data?.file &&
typeof data?.file === 'string' &&
data?.file?.trim() !== '' &&
!EXCLUDED_DIRECTORIES.includes(data?.file?.toLowerCase());

if (isValidFile && data?.file) {
filePath = path.join(__dirname, '..', '..', 'extracted_files', name, data?.file);
}

createMapper(filePath, projectId, app_token, affix, config);
}
} catch (error) {
Expand Down