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

Selection and configuration additional settings #3

Open
sambaptista opened this issue Jul 3, 2018 · 2 comments
Open

Selection and configuration additional settings #3

sambaptista opened this issue Jul 3, 2018 · 2 comments
Labels
enhancement New feature or request natural-search

Comments

@sambaptista
Copy link
Member

sambaptista commented Jul 3, 2018

A user may need extra settings on configurations and selections :

Configuration settings :

  • visible [boolean] : hides a configuration from the configuration selection menu. Useful to allow some pre-defined selections without allowing the user to add it himself.
  • unique [boolean] : allow to had a configuration to selections list. Once added, should be hidden from the menu Localizable components #7

Preselection settings :

  • visible [boolean] : hides a selection from the inputs list, but it's considered for output
  • forced [boolean]: prevents user to remove a selection from the input list (implicit if matching configuration has visible=false, see additional notes)
  • readonly : prevent user to change value and open dropdown (focus should still be available for deletion if allowed). Is not duplicate of a flag configuration.

See more about contexts #15

Forced : additional notes :
If a user can remove (or add) a selection, I must be available to do the opposite action to prevent some "irreversible" action.

Use case : if a configuration is not visible from menu and a pre-defined selection is provided, the user should not be able to remove it, because he can't add it afterwards. The "forced" option would be implicit.

@PowerKiKi
Copy link
Member

PowerKiKi commented Jul 4, 2018

Sound mostly good to me. So that would mean something like that for the selection:

export interface BasicConfiguration {
    // Old stuff
    display: string;
    field: string;
    transform?: (Selection) => Selection;

    // New stuff
    visible: boolean = true;
    unique: boolean = isFlag();
}

See https://github.com/Ecodev/natural-search/issues/15#issuecomment-402357359 for the preselection.

But I am a bit confused about forced and readonly. I'd say that a preselection is always readonly. If you want to make it editable, then you must must make the configuration visible, and thus allow adding, removing and editing. And if you want to be non-editable, then you hide the configuration (and thus automatically force the preselection). I don't see a reasonable use-case where the preselection must editable, but the configuration hidden...

@PowerKiKi PowerKiKi transferred this issue from Ecodev/natural-search Apr 21, 2019
@PowerKiKi PowerKiKi added enhancement New feature or request natural-search labels Apr 21, 2019
@sambaptista
Copy link
Member Author

But I am a bit confused about forced and readonly. I'd say that a preselection is always readonly

Forced prevent the selection to be removed, but allow edition.
Readonly prevent to change the value, but allow removal.

Take dilps/tiresias usecase : we will add a default selection "databaseSource" with default value on dilps/tiresias. User can change and can remove the filter. It's a preselection that is not forced, neither readonly.

readonly : prevent user to change value and open dropdown (focus should still be available for deletion if allowed). Is not duplicate of a flag configuration.

Maybe I was wrong, it seems a duplicate for flagged facet. Don't remember the difference.

Use case : if a configuration is not visible from menu and a pre-defined selection is provided, the user should not be able to remove it, because he can't add it afterwards. The "forced" option would be implicit.

I don't see a reasonable use-case where the preselection must editable, but the configuration hidden...

Neither do I, but it's an implementation remark, not a feature. It's a combination we have to manage to prevent blocked situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request natural-search
Projects
None yet
Development

No branches or pull requests

2 participants