mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
Add optional i18n keys for violations and make path optional
This commit is contained in:
@@ -56,7 +56,8 @@ class BackendErrorNotification extends React.Component<Props> {
|
|||||||
{error.violations.map((violation, index) => {
|
{error.violations.map((violation, index) => {
|
||||||
return (
|
return (
|
||||||
<li key={index}>
|
<li key={index}>
|
||||||
<strong>{violation.path}:</strong> {violation.message}
|
{violation.path && <strong>{violation.path}:</strong>} {violation.message}{" "}
|
||||||
|
{violation.key && t(violation.key)}
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ type Context = {
|
|||||||
type: string;
|
type: string;
|
||||||
id: string;
|
id: string;
|
||||||
}[];
|
}[];
|
||||||
type Violation = {
|
export type Violation = {
|
||||||
path: string;
|
path?: string;
|
||||||
message: string;
|
message: string;
|
||||||
|
key?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type BackendErrorContent = {
|
export type BackendErrorContent = {
|
||||||
|
|||||||
Reference in New Issue
Block a user