Skip to content

Replace plain input fields with NcTextField fields and NcMultiSelect … - #38839

Merged
Pytal merged 3 commits into
masterfrom
fix/36976-_9.1.4.11/8.2_-_The_frames_of_the_input_fields_do_not_meet_the_contrast_requirements
Jun 29, 2023
Merged

Replace plain input fields with NcTextField fields and NcMultiSelect …#38839
Pytal merged 3 commits into
masterfrom
fix/36976-_9.1.4.11/8.2_-_The_frames_of_the_input_fields_do_not_meet_the_contrast_requirements

Conversation

@JuliaKirschenheuter

@JuliaKirschenheuterJuliaKirschenheuter commented Jun 15, 2023

Copy link
Copy Markdown
Contributor

Replace plain input fields with NcTextField fields and NcMultiSelect fields with NcSelect fields

Summary

Before:
old1

After:
new

Also added notifications after displaty name, password and email were changed.

TODO

  • Make possible to create a new group for availableGroups
  • Create item limitation for subAdminsGroups and availableGroups NcSelect (:limit prop on NcSelect is just not working)

Checklist

@JuliaKirschenheuter

JuliaKirschenheuter commented Jun 15, 2023

Copy link
Copy Markdown
ContributorAuthor

@Pytal@susnux@artonge
how can i resolve this todo point: Make possible to create a new group for availableGroups?
and this one: Create item limitation for subAdminsGroups and availableGroups NcSelect (:limit prop on NcSelect is just not working)?

@JuliaKirschenheuter

Copy link
Copy Markdown
ContributorAuthor

@jancborchardt@nimishavijay
is it ok design-wise?

@Pytal

Copy link
Copy Markdown
Member

@Pytal@susnux@artonge how can i resolve this todo point: Make possible to create a new group for availableGroups?

I believe the name needs to be destructured with something like 👇

asynccreateGroup({name: gid}){

and this one: Create item limitation for subAdminsGroups and availableGroups NcSelect (:limit prop on NcSelect is just not working)?

Since limit for NcSelect applies to dropdown options rather than selected options, as seen in vue-multiselect, you may try https://vue-select.org/guide/selectable.html#limiting-the-number-of-selections

@JuliaKirschenheuter

Copy link
Copy Markdown
ContributorAuthor

Since limit for NcSelect applies to dropdown options rather than selected options, as seen in vue-multiselect, you may try https://vue-select.org/guide/selectable.html#limiting-the-number-of-selections

Thanks! I've tried it before too, but used wrong attr: options instead of value. It works now, but we probably should do something with styles (but not in this PR):
Screenshot from 2023-06-16 08-40-13

@JuliaKirschenheuter

JuliaKirschenheuter commented Jun 16, 2023

Copy link
Copy Markdown
ContributorAuthor

Regarding adding a new group there are several problems:

  1. option:selected returns array of all selected groups. Each new selected group - is a last element of an array.
  2. option:created doesn't allow to use a result like a value of new option. Based on this event, it allows creating a new group on the server, but it won't be added to the list of group options from the server itself. Just { name } will be added.
  3. create-option is used for creating new options but that works only for sync input of each symbol. It is not possible to use it for async adding a group on the server.
  4. After option:created has been fired an option:selected event will follow. But the result of option:selected would have a value like { name } even if we would put manually to event option:created a list of a groups.

Thanks @ShGKme for investigation!

But still have no idea how to fix that problem ;(

@ShGKme

ShGKme commented Jun 16, 2023

Copy link
Copy Markdown
Contributor

Some notes:

1 - option:selected returns array of all selected groups

Not a big problem, just a difference with NcSelect.

We can either call addUserGroup with the last element in the template: @option:selected="addUserGroup($event.at(-1))"...
... or update addUserGroup/create a new method to handle an array.

2 - option:created doesn't allow to use a result like a value of new option

But it won't be added to the list of group options from the server itself

Sorry, I was a bit not accurate. I meant, the internal selected list (selected groups) in NcSelect has an internal { name: <inputted> } value.

Combination of 2 + 3 + 4 - no support of async tag creation

The problem is that @option:selected and its handler addUserGroup is triggered also for a new group before it was created on the server with NcSelect's internal { name: <inputted> } value.


So if don't use v-model, all we need is to ignore this being created value in the option:selected handler.

The simplest solution is to check if it is a real group object, aka

asyncaddUserGroup(group){if(group.id===undefined){// This is NcSelect's internal value for a new inputted group name// Ignorereturn}// Add the user to the group}

This solution should work but looks dirty and implicit. I'd explicitly mark the being inputted option as temp/being created using create-option.

<NcSelect:create-option="(value) => ({ name: value, isCreating: true })"
@option:selected="addGroup($event.at(-1))"
/>
asyncaddUserGroup(group){if(group.isCreating){// This is NcSelect's internal value for a new inputted group name// Ignorereturn}// Add the user to the group}

An alternative solution could be: to drop using option:created and instead of ignorance create the group in the option:selected handler. But the core idea is the same.

@JuliaKirschenheuter
JuliaKirschenheuter marked this pull request as ready for review June 16, 2023 12:10
@JuliaKirschenheuterJuliaKirschenheuter added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 16, 2023
Comment threadapps/settings/src/components/UserList/UserRow.vue
Comment threadapps/settings/src/components/UserList/UserRow.vue
Comment threadapps/settings/src/components/UserList/UserRow.vue
Comment threadapps/settings/src/components/UserList/UserRow.vue
Comment threadapps/settings/src/components/UserList/UserRow.vue
@nimishavijay

Copy link
Copy Markdown
Member

@JuliaKirschenheuter it looks great! Much better now :)

Some minor enhancements:

  • decrease the width of the "Quota", "Language", and "Manager" columns (by around 3-4px each), and increase the width of the email column (by around 12-14px)
  • Show the read only items even in edit mode instead of hiding them. They can be shown in the same way as they are shown in view mode, so just as plain text.

They can also be in a follow up PR! The changes here look good! :)

@JuliaKirschenheuter

JuliaKirschenheuter commented Jun 21, 2023

Copy link
Copy Markdown
ContributorAuthor

Dear @nimishavijay

I'm very sorry, could you please make a new Issue for this 2 improvements? This implementation has already taken more then planned ;( If it would't be so, i would fix them here.

I've created an issue with improvements: #39002

Comment threadapps/settings/src/components/UserList/UserRow.vue Outdated
Comment threadapps/settings/src/components/UserList/UserRow.vue Outdated
Comment threadapps/settings/src/components/UserList/UserRow.vue Outdated
Comment threadapps/settings/src/components/UserList/UserRow.vue Outdated
Comment threadapps/settings/src/components/UserList/UserRow.vue Outdated
@szaimen
szaimen removed their request for review June 21, 2023 18:53

@artongeartonge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nitpick, but good otherwise.

Comment threadapps/settings/src/components/UserList/UserRow.vue
@JuliaKirschenheuter
JuliaKirschenheuterforce-pushed the fix/36976-_9.1.4.11/8.2_-_The_frames_of_the_input_fields_do_not_meet_the_contrast_requirements branch 2 times, most recently from 4448272 to b113afaCompareJune 26, 2023 14:28
Comment threadapps/settings/src/components/Users/UserRow.vue Outdated
Comment threadapps/settings/src/components/Users/UserRow.vue Outdated
@JuliaKirschenheuter
JuliaKirschenheuterforce-pushed the fix/36976-_9.1.4.11/8.2_-_The_frames_of_the_input_fields_do_not_meet_the_contrast_requirements branch from b113afa to cc1498bCompareJune 27, 2023 07:33

@susnuxsusnux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@artongeartonge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This does not look right, is this known?
Probably a matter of z-index somewhere.

Screenshot from 2023-06-27 10-39-51

@susnux

Copy link
Copy Markdown
Contributor

Drone error is related because it looks for the multiselect instead of the select, so the acceptance tests need to be adjusted, this needs to be ported to NcSelect:

return Locator::forThe()->css(".multiselect__single")->

return Locator::forThe()->css(".multiselect__option--highlight")->

@JuliaKirschenheuter

Copy link
Copy Markdown
ContributorAuthor

This does not look right, is this known?

yes, it is known. I've tried to fix that problem here #37870, but still had problems with a table itself and had to revert this PR. But that is known and will be fixed.

@susnux

Copy link
Copy Markdown
Contributor

This does not look right, is this known? Probably a matter of z-index somewhere.

I guess this rule:

@JuliaKirschenheuter

Copy link
Copy Markdown
ContributorAuthor

This does not look right, is this known? Probably a matter of z-index somewhere.

I guess this rule:

no, unfortunately not. Please look in master, there is a same problem.

@JuliaKirschenheuter
JuliaKirschenheuterforce-pushed the fix/36976-_9.1.4.11/8.2_-_The_frames_of_the_input_fields_do_not_meet_the_contrast_requirements branch from dfd5519 to cf82034CompareJune 27, 2023 14:59
@JuliaKirschenheuter

Copy link
Copy Markdown
ContributorAuthor

@susnux, @artonge could you please help me to fix integration tests?

…fields with NcSelect fields
Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com>
@susnux
susnuxforce-pushed the fix/36976-_9.1.4.11/8.2_-_The_frames_of_the_input_fields_do_not_meet_the_contrast_requirements branch from 2cdbbcc to 9b3764dCompareJune 28, 2023 14:57
Comment threadtests/acceptance/features/bootstrap/UsersSettingsContext.php Outdated
Comment threadtests/acceptance/features/bootstrap/UsersSettingsContext.php Outdated
…fields with NcSelect fields
Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com>
@susnux
susnuxforce-pushed the fix/36976-_9.1.4.11/8.2_-_The_frames_of_the_input_fields_do_not_meet_the_contrast_requirements branch from f74f922 to 3fba4c5CompareJune 28, 2023 19:53
@susnux

susnux commented Jun 28, 2023

Copy link
Copy Markdown
Contributor

There is still the issue with the password change, I verified it works locally.
I think the issue is that it does not wait for the password to change:

The loading icon for user user0 was not found after 1 seconds, assumming that it was shown and hidden again before the check started and continuing

(Maybe we should switch the settings tests also to cypress in the future, as it seems to be easier to adjust.)

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finish

Projects

None yet

7 participants

@JuliaKirschenheuter@Pytal@ShGKme@nimishavijay@susnux@artonge@nfebe