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

Add GUI support to DataFileNew #362

Merged
merged 15 commits into from
May 10, 2017
Merged

Conversation

ashmaroli
Copy link
Member

@ashmaroli ashmaroli commented May 4, 2017

  • add GUI to DataFileNew
  • update spec file for view
  • lock GUI support to just YAML and JSON files
    • Either listen to InputPath value and disable createButton,
    • or add a form component to select the file extension.
  • update documentation

  - separate elements for basename and extension
  - normalize file extensions: all data files created via the GUI will
    either have `.yml` or `.json` extension
@mertkahyaoglu
Copy link
Member

There is one issue I encountered. When you change a field type in the gui mode, for example making it list, Create button is disabled. I think we should pass || fieldChanged to create button's active prop.

// Prevent the default event from bubbling
preventDefault(e);

let filename;
if (datafileChanged) {
Copy link
Member

Choose a reason for hiding this comment

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

What about fieldChanged? Save action won't be dispatched if users directly edit in the gui mode.

Copy link
Member Author

Choose a reason for hiding this comment

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

Its an interface for Create. Enter the path in InputPath and viola!

Copy link
Member

Choose a reason for hiding this comment

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

Once you fix the below bug, you will face this one 😬

Copy link
Member

Choose a reason for hiding this comment

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

Create button is active but clicking it won't create anything.

Copy link
Member Author

Choose a reason for hiding this comment

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

we're not sending a data object to the put action via the GUI, so this shouldn't matter..

Copy link
Member

Choose a reason for hiding this comment

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

But I can't create the datafile 😄 I'm copy-pasting steps below;

  1. Click New Data File
  2. Switch to GUI mode.
  3. Enter filename as test
  4. Select extension
  5. Change first field type to list
  6. Add some array items.
  7. Try to Create datafile.
  8. Nothing happens.

Copy link
Member Author

Choose a reason for hiding this comment

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

forgive my nearsightedness, Master.. 🙏
pushed a patch..

@ashmaroli
Copy link
Member Author

I think we should pass || fieldChanged to create button's active prop.

No, that was intentional.. The Create button will be activated only if the path has been entered..

@mertkahyaoglu
Copy link
Member

Could you try the following steps;

  1. Click New Data File
  2. Switch to GUI mode.
  3. Enter filename as test
  4. Select extension
  5. Change first field type to list
  6. Expect Create button to be disabled.

@ashmaroli
Copy link
Member Author

Uh-oh.. didn't expect that bug..
Thanks.. will update 👍

@ashmaroli
Copy link
Member Author

I've made a minor change in the save button behavior: It'll get disabled when the GUI input value for the file's basename becomes nil.This is required because the GUI for this view would otherwise send a request with filename: .yml thereby bypassing the Errors component

@mertkahyaoglu
Copy link
Member

Awesome 👍 Thanks @ashmaroli .

@mertkahyaoglu mertkahyaoglu merged commit 0c3d410 into jekyll:master May 10, 2017
@ashmaroli ashmaroli deleted the data-create-gui branch May 12, 2017 11:21
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.

None yet

2 participants