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

feat: Add required and default value options #1193

Merged

Conversation

alencarlucas
Copy link
Contributor

This PR means to add the feature developed in #5835 to Parse-Dashboard, that includes the option to set required fields and default values to the schema. This feature is available for Parse-Server version >= 3.7.0 and all field types, except Relation.

Some screenshots:

  • String
    image

  • Boolean
    image

  • Field creating with an invalid default value
    image

  • Handle error on object creation
    image

@acinader
Copy link
Contributor

wow! I'll leave the review to someone knowledgable, but this is great. Thank you.

Copy link
Contributor

@TomWFox TomWFox left a comment

Choose a reason for hiding this comment

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

I'm loving this! I don't have the expertise to give a full review for this but here are some minor grammar suggestions.

src/dashboard/Data/Browser/AddColumnDialog.react.js Outdated Show resolved Hide resolved
src/dashboard/Data/Browser/AddColumnDialog.react.js Outdated Show resolved Hide resolved
src/dashboard/Data/Browser/AddColumnDialog.react.js Outdated Show resolved Hide resolved
@dplewis
Copy link
Member

dplewis commented Jul 30, 2019

I just pull it down and tested it. Can you add a editColumnDialog with required and default value?

@davimacedo
Copy link
Member

@dplewis it is actually not so easy, because Parse Server does not allow modifying existing fields. We will tackle this issue later, though. But first in Parse Server side, then here. We've discussed some of the next steps in this thread: parse-community/parse-server#5835

I will create a project with each of the tasks.

Do you think that we could go ahead like this and address the modification later? We will also have to decide what to do in the case a not required field becomes a required one...

@dplewis
Copy link
Member

dplewis commented Jul 30, 2019

We can go ahead with this. But I think we should wait until the next server release.
parse-community/parse-server#5868 was just merged.

@davimacedo
Copy link
Member

I agree. I am planning to release a new version of Parse Server as soon as the new version of @parse/push-adapter gets merged to solve the push bug in the latest version. So this one here will probably not seat for a long while.

@davimacedo
Copy link
Member

@dplewis I think we can merge, right?

@kevflynn
Copy link

This is great. It doesn't seem to work for objects as a default value - is that by design? If so, should remove the default value field when specifying an object.
To try it - create a default value of say {"mon": 0} or {mon: 0} - neither works.

@davimacedo
Copy link
Member

@kevflynn do you mind to open an issue about this bug you found?

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

6 participants