Skip to content

Commit

Permalink
Release 24.02.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fm3 committed Feb 22, 2024
1 parent ac69fa0 commit dbc0d20
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 28 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.released.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Calendar Versioning](http://calver.org/) `0Y.0M.MICRO`.
For upgrade instructions, please check the [migration guide](MIGRATIONS.released.md).

## [24.02.3](https://github.com/scalableminds/webknossos/releases/tag/24.02.3) - 2024-02-22
[Commits](https://github.com/scalableminds/webknossos/compare/24.02.2...24.02.3)

### Fixed
- Fixed a bug where the user list view would show duplicate team roles, and user changes (e.g. giving experience) would sometimes fail. [#7646](https://github.com/scalableminds/webknossos/pull/7646)

### Removed

### Breaking Changes


## [24.02.2](https://github.com/scalableminds/webknossos/releases/tag/24.02.2) - 2024-02-15
[Commits](https://github.com/scalableminds/webknossos/compare/24.02.1...24.02.2)

Expand Down Expand Up @@ -2300,4 +2311,4 @@ Also the data viewing and tracing workflow is smoothed further:

## [18.07.0](https://github.com/scalableminds/webknossos/releases/tag/18.07.0) - 2018-07-05

First release
First release
2 changes: 1 addition & 1 deletion CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ and this project adheres to [Calendar Versioning](http://calver.org/) `0Y.0M.MIC
For upgrade instructions, please check the [migration guide](MIGRATIONS.released.md).

## Unreleased
[Commits](https://github.com/scalableminds/webknossos/compare/24.02.2...HEAD)
[Commits](https://github.com/scalableminds/webknossos/compare/24.02.3...HEAD)

### Added

Expand Down
8 changes: 7 additions & 1 deletion MIGRATIONS.released.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ See `MIGRATIONS.unreleased.md` for the changes which are not yet part of an offi
This project adheres to [Calendar Versioning](http://calver.org/) `0Y.0M.MICRO`.
User-facing changes are documented in the [changelog](CHANGELOG.released.md).

## [24.02.3](https://github.com/scalableminds/webknossos/releases/tag/24.02.3) - 2024-02-22
[Commits](https://github.com/scalableminds/webknossos/compare/24.02.2...24.02.3)

### Postgres Evolutions:


## [24.02.2](https://github.com/scalableminds/webknossos/releases/tag/24.02.2) - 2024-02-15
[Commits](https://github.com/scalableminds/webknossos/compare/24.02.1...24.02.2)

Expand Down Expand Up @@ -669,4 +675,4 @@ No migrations necessary.


## [18.07.0](https://github.com/scalableminds/webknossos/releases/tag/18.07.0) - 2018-07-05
First release
First release
2 changes: 1 addition & 1 deletion MIGRATIONS.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ This project adheres to [Calendar Versioning](http://calver.org/) `0Y.0M.MICRO`.
User-facing changes are documented in the [changelog](CHANGELOG.released.md).

## Unreleased
[Commits](https://github.com/scalableminds/webknossos/compare/24.02.2...HEAD)
[Commits](https://github.com/scalableminds/webknossos/compare/24.02.3...HEAD)

### Postgres Evolutions:
72 changes: 48 additions & 24 deletions app/models/user/User.scala
Original file line number Diff line number Diff line change
Expand Up @@ -247,50 +247,74 @@ class UserDAO @Inject()(sqlClient: SqlClient)(implicit ec: ExecutionContext)
isEditableAttribute = q"""
(u._id IN
(SELECT _id AS editableUsers FROM webknossos.users WHERE _organization IN
(SELECT _organization FROM webknossos.users WHERE _id = ${requestingUser._id} AND isadmin)
(SELECT _organization FROM webknossos.users WHERE _id = ${requestingUser._id} AND isAdmin)
UNION
SELECT _user AS editableUsers FROM webknossos.user_team_roles WHERE _team in
(SELECT _team FROM webknossos.user_team_roles WHERE _user = ${requestingUser._id} AND isteammanager)
(SELECT _team FROM webknossos.user_team_roles WHERE _user = ${requestingUser._id} AND isTeamManager)
)
)
OR COUNT(t._id) = 0
OR COUNT(autr.team_ids) = 0
AS iseditable
"""
r <- run(q"""
WITH
agg_experiences AS (
SELECT
u._id AS _user,
ARRAY_REMOVE(ARRAY_AGG(ux.domain), null) AS experience_domains,
ARRAY_REMOVE(ARRAY_AGG(ux.value), null) AS experience_values
FROM webknossos.users AS u
LEFT JOIN webknossos.user_experiences ux on ux._user = u._id
GROUP BY u._id
),
agg_user_team_roles AS (
SELECT
u._id AS _user,
ARRAY_REMOVE(ARRAY_AGG(t._id), null) AS team_ids,
ARRAY_REMOVE(ARRAY_AGG(t.name), null) AS team_names,
ARRAY_REMOVE(ARRAY_AGG(utr.isteammanager :: TEXT), null) AS team_managers
FROM webknossos.users AS u
LEFT JOIN webknossos.user_team_roles utr on utr._user = u._id
INNER JOIN webknossos.teams t on t._id = utr._team
GROUP BY u._id
)
SELECT
u._id,
m._id,
m.email,
u.firstname,
u.lastname,
u.firstName,
u.lastName,
u.userConfiguration,
u.isadmin,
u.isorganizationowner,
u.isdatasetmanager,
u.isdeactivated,
ARRAY_REMOVE(ARRAY_AGG(t._id), null) AS team_ids,
ARRAY_REMOVE(ARRAY_AGG(t.name), null) AS team_names,
ARRAY_REMOVE(ARRAY_AGG(utr.isteammanager :: TEXT), null) AS team_managers,
ARRAY_REMOVE(ARRAY_AGG(ux.value), null) AS experience_values,
ARRAY_REMOVE(ARRAY_AGG(ux.domain), null) AS experience_domains,
u.lastactivity,
u.isAdmin,
u.isOrganizationOwner,
u.isDatasetManager,
u.isDeactivated,
autr.team_ids,
autr.team_names,
autr.team_managers,
aux.experience_values,
aux.experience_domains,
u.lastActivity,
o._id,
o.name,
m.noveluserexperienceinfos,
m.selectedtheme,
m.novelUserExperienceinfos,
m.selectedTheme,
u.created,
u.lasttasktypeid,
m.issuperuser,
m.isemailverified,
u.lastTaskTypeId,
m.isSuperUser,
m.isEmailVerified,
$isEditableAttribute
FROM webknossos.users AS u
INNER JOIN webknossos.organizations o on o._id = u._organization
INNER JOIN webknossos.multiusers m on u._multiuser = m._id
INNER JOIN webknossos.user_team_roles utr on utr._user = u._id
INNER JOIN webknossos.teams t on t._id = utr._team
LEFT JOIN webknossos.user_experiences ux on ux._user = u._id
INNER JOIN agg_user_team_roles autr on autr._user = u._id
INNER JOIN agg_experiences aux on aux._user = u._id
WHERE $selectionPredicates
GROUP BY u._id, o._id, m._id, m.email, m.noveluserexperienceinfos, m.selectedtheme, m.issuperuser, m.isemailverified
GROUP BY
u._id, u.firstname, u.lastname, u.userConfiguration, u.isAdmin, u.isOrganizationOwner, u.isDatasetManager,
u.isDeactivated, u.lastActivity, u.created, u.lastTaskTypeId, o._id,
m._id, m.email, m.novelUserExperienceinfos, m.selectedTheme, m.isSuperUser, m.isEmailVerified,
autr.team_ids, autr.team_names, autr.team_managers, aux.experience_values, aux.experience_domains
""".as[UserCompactInfo])
users <- Fox.combined(r.toList.map(_.toUser))
compactInfos = r.toList
Expand Down

0 comments on commit dbc0d20

Please sign in to comment.