(core) Removing error styles from user messages

Summary:
Removing error styles from user messages. Only unexpected errors are styled with red icon and border.
Removing reportSuccess message - leaving it for another diff.

Test Plan: manual tests

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3063
This commit is contained in:
Jarosław Sadziński
2021-10-06 17:50:29 +02:00
parent a2e066176c
commit 26766fd4ab
5 changed files with 25 additions and 36 deletions

View File

@@ -1,5 +1,5 @@
import {DocPageModel} from 'app/client/models/DocPageModel';
import {reportError, UserError} from 'app/client/models/errors';
import {reportWarning} from 'app/client/models/errors';
import {normalizeEmail} from 'app/common/emails';
import {GristLoadConfig} from 'app/common/gristUrls';
import * as roles from 'app/common/roles';
@@ -207,9 +207,7 @@ export class UserManagerModelImpl extends Disposable implements UserManagerModel
if (m === this.publicMember && access === roles.EDITOR &&
this._docPageModel?.gristDoc.get()?.hasGranularAccessRules()) {
access = roles.VIEWER;
reportError(new UserError(
'Public "Editor" access is incompatible with Access Rules. Reduced to "Viewer".'
));
reportWarning('Public "Editor" access is incompatible with Access Rules. Reduced to "Viewer".');
}
if (!roles.isValidRole(access)) {
throw new Error(`Cannot update user to invalid role ${access}`);