assemblee-virtuelle / archipelago

Fostering interconnections between communities by creating synergies between their platforms
Apache License 2.0
14 stars 6 forks source link

Pannel to add a new theme from organization show using "+" doesn't show Add button #189

Open fluidlog opened 1 month ago

fluidlog commented 1 month ago

Décrivez le bug Add a new theme from organization show using "+" does'nt work directly.

image

Etapes pour reproduire

  1. On a organisation panel
  2. click on "+" (if there is a theme on the right)
  3. A pannel appear, but we can create new theme

Possible solution If I press on two letter, I can see the "Add" button image

Then, I can create a new theme.

image

And the theme is well created image

I would not like to type 2 letters to have the "Add" button.

I use Archipelago 2.1.0.

fluidlog commented 1 month ago

Moreover, when the pannel appear, I can't select theme in the list when I click on sur line.

image

SlyRock commented 2 weeks ago

Seems to me there are two issues at stake here, both related to the QuickAppendReferenceArrayField component from @semapps/field-components package :

  1. The need to be able to create a theme without first having to search the existing ones, when using that component

I wouldn't call that one "a bug", looks like an evolution request to me and I think it would need to be processed as such to address properly the related use cases. For example : Should we allow users to create a new referenced resource without checking beforehand that it doesn't already exist ? Could lead to duplicates. Analyzing this also led to highlighting another issue : The Theme resource is using a LexiconImportForm component from @semapps/interop-components that link themes to a dictionary in the Create form. The QuickAppendReferenceArrayField compoenent doesn't seem do that which allows to create Themes unrelated to the dictionary.

  1. The fact that a specific state of an Organization resource makes it impossible to append an existing theme using that component

To be precise : When an organization has Members (which is a reified relation), the edit page produces a correct value for the pair:organizationOfMembership node of the payload for the put operation on the resource, in the same situation the QuickAppendReferenceArrayField produces an incorrect value :

Value produced by the edit page :

"pair:organizationOfMembership":[
      {
         "pair:membershipActor":"http://localhost:3000/users/sylvain.roquebert",
         "pair:membershipRole":"http://localhost:3000/membership-roles/developper",
         "type":"pair:MembershipAssociation"
      }
   ],

Value produced by the QuickAppendReferenceArrayField component:

    "pair:organizationOfMembership": [
        "http://localhost:3000/membership-associations/ea0881ec-6ede-4d12-ac10-3942be3abf82"
    ],

It seems related to the dataprovider.

At my level of onboarding on this project this clearly something I need help sorting out :)