-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Sync capabilities to output format customization
- Loading branch information
1 parent
c1125c4
commit 248eb9b
Showing
13 changed files
with
141 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
apps/api/src/app/template/usecases/sync-customization/sync-customization.usecase.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Injectable } from '@nestjs/common'; | ||
|
||
import { CONSTANTS } from '@shared/constants'; | ||
import { createRecordFormat, updateCombinedFormat } from '@impler/shared'; | ||
import { CustomizationRepository } from '@impler/dal'; | ||
|
||
@Injectable() | ||
export class SyncCustomization { | ||
constructor(private customizationRepository: CustomizationRepository) {} | ||
|
||
async execute(_templateId: string) { | ||
const customization = await this.customizationRepository.findOne({ | ||
_templateId, | ||
}); | ||
customization.isChunkFormatUpdated = false; | ||
customization.isRecordFormatUpdated = false; | ||
customization.isCombinedFormatUpdated = false; | ||
|
||
customization.recordFormat = createRecordFormat(customization.recordVariables); | ||
customization.combinedFormat = updateCombinedFormat(CONSTANTS.COMBINED_FORMAT, customization.recordVariables); | ||
|
||
await this.customizationRepository.update({ _templateId }, customization); | ||
|
||
return customization; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { IconType } from '@types'; | ||
import { IconSizes } from 'config'; | ||
|
||
export const WarningIcon = ({ size = 'sm', color }: IconType) => { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="-2 -2 24 24" | ||
fill="currentColor" | ||
width={IconSizes[size]} | ||
height={IconSizes[size]} | ||
color={color} | ||
> | ||
<path d="M10 20C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-13a1 1 0 0 1 1 1v5a1 1 0 0 1-2 0V6a1 1 0 0 1 1-1zm0 10a1 1 0 1 1 0-2 1 1 0 0 1 0 2z" /> | ||
</svg> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createStyles } from '@mantine/core'; | ||
|
||
const getWrapperStyles = (): React.CSSProperties => ({ | ||
alignItems: 'center', | ||
}); | ||
|
||
export default createStyles((): Record<string, any> => { | ||
return { | ||
wrapper: getWrapperStyles(), | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Alert as MantineAlert, AlertProps as MantineAlertProps } from '@mantine/core'; | ||
|
||
import useStyles from './Alert.styles'; | ||
|
||
type AlertProps = MantineAlertProps; | ||
|
||
export function Alert(props: AlertProps) { | ||
const { classes } = useStyles(); | ||
|
||
return <MantineAlert classNames={classes} {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Alert'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters