feat(secret-sync): add re2 on replacements

This commit is contained in:
carlosmonastyrski
2025-06-27 14:03:59 -03:00
parent defe7b8f0b
commit f4779de051
6 changed files with 30 additions and 13 deletions
@@ -5,6 +5,8 @@ import { GenericFieldLabel } from "@app/components/v2";
import { ZabbixSyncScope } from "@app/hooks/api/appConnections/zabbix";
import { SecretSync } from "@app/hooks/api/secretSyncs";
const isTextMacro = (macroType: number) => macroType === 0;
export const ZabbixSyncReviewFields = () => {
const { watch } = useFormContext<TSecretSyncForm & { destination: SecretSync.Zabbix }>();
const scope = watch("destinationConfig.scope");
@@ -22,7 +24,7 @@ export const ZabbixSyncReviewFields = () => {
</>
)}
<GenericFieldLabel label="Macro Type">
{macroType === 0 ? "Text" : "Secret"}
{isTextMacro(macroType) ? "Text" : "Secret"}
</GenericFieldLabel>
</>
);
@@ -6,6 +6,8 @@ type Props = {
secretSync: TZabbixSync;
};
const isTextMacro = (macroType: number) => macroType === 0;
export const ZabbixSyncDestinationSection = ({ secretSync }: Props) => {
const {
destinationConfig: { macroType }
@@ -24,7 +26,7 @@ export const ZabbixSyncDestinationSection = ({ secretSync }: Props) => {
</>
)}
<GenericFieldLabel label="Macro Type">
{macroType === 0 ? "Text" : "Secret"}
{isTextMacro(macroType) ? "Text" : "Secret"}
</GenericFieldLabel>
</>
);