Skip to content

Conversation

@skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented May 27, 2021

In IAccountManager multivalue properties are declared as constants prefixed COLLECTION. One such constant was added: COLLECTION_EMAIL

The IAccountPropertyCollection is introduced which is a container for IAccountProperties.

IAccount was extended with three methods. Two that are there for setting and getting property collections. The thought behind this is to keep the API stable and is oriented on the existing methods for consistency. Another, getAllProperties() was introduced in order to deprecate getProperties which is left untouched for backports compatibility. Both methods return IAccountProperty[], but the old method uses the property name as index, which is not possible with multiple values. The new method flattens the Collections and returns each value as its own IAccountProperty for simplicity.

Contrary getFilteredProperties was adjusted to return all values matching the criteria also from collections (also flattened). The resulting array structure was not documented before and was therefore adjusted (associative, index names of collections are appended by #0, #1…). This is backwards compatible.

And of course the concrete implementations are adjusted.

contributes to #26866

(fwiw, this is @blizzz writing and owning it, not @skjnldsv)

@skjnldsv skjnldsv added this to the Nextcloud 22 milestone May 27, 2021
@blizzz blizzz changed the title Extend AccountManager API with collection const Extend Accounts with multivalue properties (PropertyCollection) May 27, 2021
@blizzz blizzz mentioned this pull request Jun 2, 2021
57 tasks
@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 3, 2021
@blizzz blizzz mentioned this pull request Jun 3, 2021
9 tasks
@blizzz blizzz force-pushed the feat/26866/account-collection-properties branch from 510f6ba to 44827e3 Compare June 3, 2021 18:49
@blizzz blizzz marked this pull request as ready for review June 3, 2021 18:49
blizzz added 8 commits June 3, 2021 20:49
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
- in fact the API could be done in a nicer way and it might be possible to
  work without IAccountPropertyCollection, but only with the
  IAccountProperties.
- To keep it simple at first and not overengineer the blunt attempt is
  followed
- If necessary helpful in the further cause of development adjustements or
  extensions can be done quickly with this base


Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jun 3, 2021
@blizzz
Copy link
Member

blizzz commented Jun 3, 2021

need to convince psalm tomorrow

@Pytal
Copy link
Member

Pytal commented Jun 4, 2021

@blizzz I'll be working on frontend integration so any more helper functions would be great 🙌, on the backend I'll leave the nitty-gritty logic for you to work on though I'll probably be working on the UsersController as we're using the provisioning_api :)

@Pytal Pytal force-pushed the feat/26866/account-collection-properties branch from e4e8e36 to 8235d90 Compare June 4, 2021 17:20
@blizzz blizzz force-pushed the feat/26866/account-collection-properties branch from 8235d90 to 35d5395 Compare June 4, 2021 17:56
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>

psalm happiness

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 4, 2021
@blizzz blizzz requested a review from Pytal June 4, 2021 18:09
@blizzz blizzz requested a review from MorrisJobke June 7, 2021 21:40
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
@blizzz blizzz requested review from ChristophWurst and artonge June 7, 2021 21:41
@Pytal Pytal mentioned this pull request Jun 8, 2021
26 tasks
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

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

approving myself on behalf of @skjnldsv

@blizzz blizzz merged commit 662ab93 into master Jun 8, 2021
@blizzz blizzz deleted the feat/26866/account-collection-properties branch June 8, 2021 12:25
@MorrisJobke MorrisJobke mentioned this pull request Jun 10, 2021
59 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants