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

Model: hidden property shortcut #6385

Closed
2 tasks
hacksparrow opened this issue Sep 18, 2020 · 3 comments · Fixed by #6484
Closed
2 tasks

Model: hidden property shortcut #6385

hacksparrow opened this issue Sep 18, 2020 · 3 comments · Fixed by #6484
Assignees
Labels
developer-experience Issues affecting ease of use and overall experience of LB users feature good first issue Hacktoberfest Tasks ready for new contributors to work on Repository Issues related to @loopback/repository package

Comments

@hacksparrow
Copy link
Contributor

hacksparrow commented Sep 18, 2020

Currently, to hide properties of a model we have to do this:

@model({
  settings: {
    hiddenProperties: ['password']
  }
})
class MyUserModel extends Entity {
  ...
   @property({type: 'string'})
  password: string;
  ...
}

Let's provide a shortcut so we can do this instead:

class MyUserModel extends Entity {
  ...
   @property({type: 'string', hidden: true})
  password: string;
  ...
}

Acceptance Criteria

  • Add new property hidden in model property definitions, which should do what hiddenProperties does for the listed properties.
  • Update relevant documentation

Along with #2766, users will now have a more intuitive model definition experience.


🎆 Hacktoberfest 2020

Greetings 👋 to all Hacktoberfest 2020 participants!

Here are few tips 👀 to make your start easier, see also #6456:

  • Before you start working on this issue, please leave a comment to let others know.
  • If you are new to GitHub pull requests, then you can learn about the process in Submitting a pull request to LoopBack 4.
  • If this is your first contribution to LoopBack, then please take a look at our Developer guide.
  • Feel free to ask for help in #loopback-contributors channel, you can join our Slack workspace here.
@bajtos
Copy link
Member

bajtos commented Sep 18, 2020

The benefit of the current model-level design is that child models can hide properties defined in the parent model. I think it is a useful feature we should preserve.

Adding support for property-level hidden metadata as an alternate syntax to model-level hiddenProperties looks reasonable to me 👍🏻

@dhmlau dhmlau added this to the Oct 2020 milestone Sep 18, 2020
@bajtos bajtos added developer-experience Issues affecting ease of use and overall experience of LB users good first issue Repository Issues related to @loopback/repository package labels Sep 21, 2020
@dhmlau dhmlau removed this from the Oct 2020 milestone Sep 21, 2020
@bajtos bajtos added the Hacktoberfest Tasks ready for new contributors to work on label Sep 29, 2020
@mdbetancourt
Copy link
Contributor

i would like to take this one

@hacksparrow
Copy link
Contributor Author

@mdbetancourt great!

@bajtos bajtos assigned bajtos and mdbetancourt and unassigned bajtos Oct 2, 2020
@bajtos bajtos linked a pull request Oct 2, 2020 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer-experience Issues affecting ease of use and overall experience of LB users feature good first issue Hacktoberfest Tasks ready for new contributors to work on Repository Issues related to @loopback/repository package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants