Skip to content

Commit

Permalink
fix: make use of fieldprops and add translation
Browse files Browse the repository at this point in the history
  • Loading branch information
FritzHoing committed Sep 17, 2024
1 parent d35c1bb commit 3e6df75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/DisplayField/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ describe('<DisplayField />', () => {

for (const linkValue of linkValues) {
render(<DisplayField value={linkValue} />);
const links = screen.getAllByRole('link', { name: 'Link' });
const links = screen.getAllByRole('link');

const link = links.find(l => l.getAttribute('href') === linkValue);

Expand Down
5 changes: 4 additions & 1 deletion src/components/DisplayField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type DisplayFieldProps = {
value?: ValueType | ValueType[];
label?: string;
referenceConfig?: ReferenceConfig;
maskedUrl?: string;
};

export const DisplayField: React.FC<DisplayFieldProps> = ({
Expand Down Expand Up @@ -135,7 +136,9 @@ export const DisplayField: React.FC<DisplayFieldProps> = ({
target="_blank"
rel='noreferrer'
>
Link
{passThroughProps?.hasOwnProperty('maskedUrl') ?
passThroughProps.maskedUrl :
value?.toString()}
</a>
);
}
Expand Down

0 comments on commit 3e6df75

Please sign in to comment.