Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added control for the arrayRenderer, consolidate module, added styles #2011

Merged
merged 2 commits into from
Sep 8, 2022

Conversation

rsoika
Copy link
Contributor

@rsoika rsoika commented Aug 25, 2022

also removed the file ArrayControl tsx and consolidated in ArrayControlRenderer.tsx

Signed-off-by: Ralph Soika <ralph.soika@imixs.com>
@rsoika
Copy link
Contributor Author

rsoika commented Aug 25, 2022

This is the new layout example:

image

@rsoika
Copy link
Contributor Author

rsoika commented Sep 4, 2022

Hi @sdirix I don't want to be impatient, but what did you think about my last pull request?

@sdirix
Copy link
Member

sdirix commented Sep 5, 2022

Hi @rsoika, we'll take a look 👍

@coveralls
Copy link

coveralls commented Sep 5, 2022

Coverage Status

Coverage remained the same at 84.356% when pulling ae01740 on rsoika:master into 852057c on eclipsesource:master.

Copy link
Contributor

@lucas-koehler lucas-koehler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @rsoika ,
thank you very much for your pull request. In general, this already works great. I tested the changes with the vanilla dev example and did not run into any issues.

I added some comments regarding formatting and I think we should still export the ArrayControl to allow adopters to use it in their custom renderers and to not break the API in this regard.


const { convertToValidClassName } = Helpers;

const ArrayControl = ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should export the ArrayControl, too, in case adopters want to use it in custom renderers.

}}>Up</button>
<button
className={buttonClassDown}
aria-label={`Down`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please align the indentation with the button's other props. Please also make sure to only uses spaces but not tabs

Comment on lines 115 to 117
if (window.confirm('Are you sure you wish to delete this item?')) {
removeItems(path,[index])();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the indentation. The if should be indentated 2 spaces further than the onClick. E.g. see the onClick handler of the Up button.

{
name: 'array.control',
classNames: ['array-control-layout', 'control']
},
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the whitespace following the comma

Comment on lines 31 to 32
import { ArrayControl } from './ArrayControl';

export { ArrayControl, ArrayControlRenderer };
export { ArrayControlRenderer };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarily to the comment in ArrayControlRenderer.tsx, I think we should export ArrayControl here.
You can get import it together with the ArrayControlRenderer like this:
import ArrayControlRenderer, { ArrayControl } from './ArrayControlRenderer';
and the change the export to
export { ArrayControlRenderer, ArrayControl };

range(0, data.length).map(index => {
const childPath = composePaths(path, `${index}`);
return (
<div key={index}><JsonFormsDispatch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a new line before <JsonFormsDispatch to increase readability

Signed-off-by: Ralph Soika <ralph.soika@imixs.com>
@rsoika
Copy link
Contributor Author

rsoika commented Sep 7, 2022

Hi @lucas-koehler, I have fixed now the issues you mentioned.

Copy link
Contributor

@lucas-koehler lucas-koehler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rsoika Thank you for the updates and thanks again for your contribution. LGTM now :)

@lucas-koehler lucas-koehler merged commit 79e1c56 into eclipsesource:master Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants