Skip to content

Commit

Permalink
Fixes #27965 - Show errors in template import (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
xprazak2 authored and ares committed Oct 11, 2019
1 parent 8afab7c commit 52cad13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Expand Up @@ -7,7 +7,8 @@ import EmptyInfoItem from './EmptyInfoItem';
import StringInfoItem from './StringInfoItem';
import LinkInfoItem from './LinkInfoItem';

export const itemIteratorId = (template, attr) => `${template.name}-${attr}`;
export const itemIteratorId = (template, attr) =>
`${template.templateFile}-${attr}`;

export const additionalInfo = (template, editPath) => {
const infoAttrs = [
Expand Down Expand Up @@ -115,8 +116,8 @@ export const templateErrors = template => {

const aggregatedErrors = template => {
const err = { ...template.errors } || {};
if (template.additional_errors) {
err.additional = template.additional_errors;
if (template.additionalErrors) {
err.additional = template.additionalErrors;
}

return err;
Expand Down
Expand Up @@ -86,7 +86,7 @@ exports[`SyncedTemplate should render template with invalid metadata 1`] = `
initExpanded={false}
leftContent={
<Icon
name="ok"
name="error-circle-o"
size="sm"
type="pf"
/>
Expand All @@ -96,9 +96,13 @@ exports[`SyncedTemplate should render template with invalid metadata 1`] = `
onExpandClose={[Function]}
stacked={true}
>
<span>
There were no errors.
</span>
<ul>
<li
key="random_template.erb-additional"
>
No "name" found in metadata
</li>
</ul>
</ListViewItem>
`;

Expand Down Expand Up @@ -265,7 +269,7 @@ exports[`SyncedTemplate should render template with validation errors 1`] = `
>
<ul>
<li
key="EPEL-base"
key="epel.erb-base"
>
This template is locked
</li>
Expand Down

0 comments on commit 52cad13

Please sign in to comment.