feat: Option for separate edit mode (#4203)

* stash

* wip

* cleanup

* Remove collaborativeEditing toggle, it will always be on in next release.
Flip separateEdit -> seamlessEdit

* Clarify language, hide toggle when collaborative editing is disabled

* Flip boolean to match, easier to reason about
This commit is contained in:
Tom Moor
2022-10-02 17:58:33 +02:00
committed by GitHub
parent b9bf2e58cb
commit 933fbb2578
20 changed files with 172 additions and 124 deletions

View File

@@ -1,4 +1,6 @@
import { has } from "lodash";
import { Transaction } from "sequelize";
import { TeamPreference } from "@shared/types";
import { sequelize } from "@server/database/sequelize";
import env from "@server/env";
import { Event, Team, TeamDomain, User } from "@server/models";
@@ -24,6 +26,7 @@ const teamUpdater = async ({ params, user, team, ip }: TeamUpdaterProps) => {
defaultUserRole,
inviteRequired,
allowedDomains,
preferences,
} = params;
const transaction: Transaction = await sequelize.transaction();
@@ -101,6 +104,13 @@ const teamUpdater = async ({ params, user, team, ip }: TeamUpdaterProps) => {
team.allowedDomains = newAllowedDomains;
}
if (preferences) {
for (const value of Object.values(TeamPreference)) {
if (has(preferences, value)) {
team.setPreference(value, Boolean(preferences[value]));
}
}
}
const changes = team.changed();