Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

feat(id): allow hidden option #43

Merged
merged 2 commits into from
May 7, 2020
Merged

feat(id): allow hidden option #43

merged 2 commits into from
May 7, 2020

Conversation

d4rekanguok
Copy link
Owner

close #38

It's not possible to hide a widget completely, as it doesn't control the styling of its label & its wrapper.

This is a hack: I'm literally accessing the widget's parent DOM node on mount & adding display: none to it. It'll definitely break if NetlifyCMS's control pane's structure changes. Also, it's just not good practice!

However.. (a) this is a much desirable feature and (b) this widget has always meant to be an in-between solution while NetlifyCMS comes up with its own ID solution, so I think it's reasonable to allow users to opt-in via hidden: true with a warning.

@magomimmo
Copy link

However.. (a) this is a much desirable feature and (b) this widget has always meant to be an in-between solution while NetlifyCMS comes up with its own ID solution, so I think it's reasonable to allow users to opt-in via hidden: true with a warning.

I can't believe the NetlifyCMS community did not think about a unique id generator from the very beginning while developing the relation widget. In most cases you do not have a natural primary key for a folder collection resembling an SQL table and you don't even have a composite key as well. In all these cases you need a synthetic unique id (the infamous auto-increment in DB parlance) and you're perfectly right: they need to add their own ID solution to be used instead of the default title one. So go ahead and thanks so much.

@d4rekanguok d4rekanguok merged commit 6e3a1ab into master May 7, 2020
@d4rekanguok
Copy link
Owner Author

Thanks @magomimmo, I agree an auto-generated permanent id for each entry would had been great. There's much discussion about this in this issue (with concern similar to yours): decaporg/decap-cms#1975. Hope things would move forward soon!

(Hi @gurkodil! How have you been?)

@d4rekanguok d4rekanguok deleted the feat/id branch May 7, 2020 12:44
@gurkodil
Copy link
Collaborator

gurkodil commented May 7, 2020

Hi @d4rekanguok! I've been fine, following this project silently. 😅 But would be fun to contribute if anything comes up! What about you? How have u been?

@d4rekanguok
Copy link
Owner Author

d4rekanguok commented May 11, 2020

@gurkodil I'm good! Do you use slack/discord often? if so join the new netlifyCMS slack so we can chat time to time! Nevermind, just sent you a message on gitter 💪

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hidden option for ncw-id widget
3 participants