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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user