mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Adding colors to toast notification
Summary: Styling toast notification. Adding colors and icons. In Grist, changed the default style for errors (will be shown in red), and a style for Linked copied to clipboard (will be shown in Green). All other colors are not used currently, left for another diff. Test Plan: manual Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3053
This commit is contained in:
@@ -17,7 +17,7 @@ var commands = require('./commands');
|
||||
var BackboneEvents = require('backbone').Events;
|
||||
const {LinkingState} = require('./LinkingState');
|
||||
const {ClientColumnGetters} = require('app/client/models/ClientColumnGetters');
|
||||
const {reportError, UserError} = require('app/client/models/errors');
|
||||
const {reportError, reportSuccess} = require('app/client/models/errors');
|
||||
const {urlState} = require('app/client/models/gristUrlState');
|
||||
const {SectionFilter} = require('app/client/models/SectionFilter');
|
||||
const {copyToClipboard} = require('app/client/lib/copyToClipboard');
|
||||
@@ -318,7 +318,7 @@ BaseView.prototype.copyLink = async function() {
|
||||
const link = urlState().makeUrl({ hash: { sectionId, rowId, colRef } });
|
||||
await copyToClipboard(link);
|
||||
setTestState({clipboard: link});
|
||||
reportError(new UserError('Link copied to clipboard', {key: 'clipboard'}));
|
||||
reportSuccess('Link copied to clipboard', {key: 'clipboard'});
|
||||
} catch (e) {
|
||||
throw new Error('cannot copy to clipboard');
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ class NotificationAdapter extends Disposable implements Notification {
|
||||
}
|
||||
public showUndoDiscard() {
|
||||
const notifier = this._doc.app.topAppModel.notifier;
|
||||
const notification = notifier.createUserError("Undo discard", {
|
||||
const notification = notifier.createUserMessage("Undo discard", {
|
||||
message: () =>
|
||||
discardNotification(
|
||||
dom.on("click", () => {
|
||||
|
||||
Reference in New Issue
Block a user