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

Support for list features #190

Merged
merged 10 commits into from
Mar 19, 2024
Merged

Support for list features #190

merged 10 commits into from
Mar 19, 2024

Conversation

BertrandRenault
Copy link
Contributor

@BertrandRenault BertrandRenault commented Feb 28, 2024

Issue

Fixes #81

Description

Allow user to define restricted list of values for features (attributes)
Define in db.json "features_values"
exemple:

  "features_values": {
    "main": {
      "quality": {
        "restricted": true,
        "values": ["good", "bad"]
      },
      "quantity": {
        "restricted": true,
        "values": ["few", "standard", "many"]
      }
    },
    "objects": {
      "category": {
        "restricted": false,
        "values": ["apple", "banana", "orange"]
      }
    }
  }

If a feature is not defined here, or not restricted, then Pixano(back) will look for existing values in corresponding table(s) and merge with existing defined values.

Features are considered as not restricted if not explicitly defined as restricted

  • remove "categories" in db.json
  • replace "categories" in tests
  • manage "supercategory": filled if exists, else ""
  • replace "categories" in importers
  • replace "categories" in storybook

@BertrandRenault BertrandRenault self-assigned this Feb 28, 2024
@BertrandRenault BertrandRenault changed the title Manage list features Support for list features Feb 28, 2024
@BertrandRenault BertrandRenault marked this pull request as ready for review March 1, 2024 15:37
@@ -24,6 +24,7 @@
export let value: string = "";
export let autofocus: boolean = false;
export let className = "";
export let isInputEnabled: boolean = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if isSearchInputEnabled or just isSearchEnabled would be more relevant here?

Copy link
Member

@cpvannier cpvannier left a comment

Choose a reason for hiding this comment

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

With the ongoing backend refactor, I wonder if it is worth it to merge this PR now, as it will likely create some merge conflicts.

Also, renaming scene and sceneFeatures into main and mainFeatures in the frontend is not really relevant anymore, as the refactor replaced main by item in the backend.

@timothee-LJN
Copy link
Contributor

ok, we put it on hold then?

@BertrandRenault
Copy link
Contributor Author

With the ongoing backend refactor, I wonder if it is worth it to merge this PR now, as it will likely create some merge conflicts.

Backend refactor will have merge conflict, for sure. But postponing this PR will not really change that. And merging this PR after backend refactor would cause too much new merge conflict for this PR, that we can avoid by merging now. This way there will be one conflict resolution instead of 2, and the added functionality too.

Also, renaming scene and sceneFeatures into main and mainFeatures in the frontend is not really relevant anymore, as the refactor replaced main by item in the backend.

this PR await since 3 weeks... there is plenty of "main" everywhere... Why not open a "naming refactor" PR ?

@BertrandRenault BertrandRenault merged commit d88fd29 into develop Mar 19, 2024
5 checks passed
export const mapFeatureList = (featureList: FeatureList = []) =>
featureList
export const mapFeatureList = (featureList: FeatureList = { restricted: false, values: [] }) => {
return featureList.values
.sort((a, b) => a.localeCompare(b))
Copy link
Contributor

Choose a reason for hiding this comment

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

I have an error here when I'm editing the image :
image

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.

Add support for list features
3 participants