Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Rename most notification to toaster instances (#9765)

Benjamin Bädorf3aaac1c7ce83
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ea6c0caf8f9..22d67a30f12 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -146,7 +146,7 @@ module ApplicationHelper
# Add autohide class to notice flashes if configured
if type.to_s == 'notice' && User.current.pref.auto_hide_popups?
- css_classes << 'autohide-notification'
+ css_classes << 'autohide-toaster'
end
html_options = { class: css_classes.join(' '), role: 'alert' }.merge(html_options)
diff --git a/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb b/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb
index 0bb68a36e1a..15052f86d3f 100644
--- a/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb
+++ b/app/views/admin/settings/work_packages_settings/_enterprise_feature_hint.html.erb
@@ -1,7 +1,7 @@
<% unless EnterpriseToken.allows_to?(ee_feature) %>
<span class="form--field -indented">
- <div class="ee-attribute-highlighting-upsale notification-box -ee-upsale">
- <div class="notification-box--content">
+ <div class="ee-attribute-highlighting-upsale op-toast -ee-upsale">
+ <div class="op-toast--content">
<p><strong><%= title.present? ? title : t('js.upsale.ee_only') %></strong></p>
<p><%= explanation %></p>
<p>
diff --git a/app/views/announcements/_show.html.erb b/app/views/announcements/_show.html.erb
index 0f70b11b58c..36dd257a5db 100644
--- a/app/views/announcements/_show.html.erb
+++ b/app/views/announcements/_show.html.erb
@@ -1,8 +1,8 @@
<% announcement = Announcement.active_and_current %>
<% if announcement.present? %>
<div id="announcement">
- <div class="notification-box -info">
- <div class="notification-box--content op-uc-container">
+ <div class="op-toast -info">
+ <div class="op-toast--content op-uc-container">
<%= format_text announcement.text %>
</div>
</div>
diff --git a/app/views/common/_error_base.html.erb b/app/views/common/_error_base.html.erb
index fc7940c9d9e..2187584baa9 100644
--- a/app/views/common/_error_base.html.erb
+++ b/app/views/common/_error_base.html.erb
@@ -28,10 +28,10 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<div id="errorExplanation"
- class="notification-box errorExplanation -error <%= local_assigns[:classes] || '' %>"
+ class="op-toast errorExplanation -error <%= local_assigns[:classes] || '' %>"
tabindex="0"
role="alert">
- <div class="notification-box--content">
+ <div class="op-toast--content">
<% if content_for?(:error_details) %>
<p>
<strong><%= error_message %></strong>
diff --git a/app/views/common/upsale.html.erb b/app/views/common/upsale.html.erb
index ce86b8010ba..0552c4bcd58 100644
--- a/app/views/common/upsale.html.erb
+++ b/app/views/common/upsale.html.erb
@@ -1,5 +1,5 @@
-<div class="notification-box upsale-notification">
- <div class="notification-box--content">
+<div class="op-toast upsale-notification">
+ <div class="op-toast--content">
<h3><%= t('admin.enterprise.upgrade_to_ee') %></h3>
<%= image_tag "enterprise_edition.png", class: "widget-box--teaser-image" %>
diff --git a/app/views/custom_fields/_tab.html.erb b/app/views/custom_fields/_tab.html.erb
index fe9ed0e1891..aad6b4d4bad 100644
--- a/app/views/custom_fields/_tab.html.erb
+++ b/app/views/custom_fields/_tab.html.erb
@@ -31,8 +31,8 @@ See COPYRIGHT and LICENSE files for more details.
<div class="generic-table--container">
<div class="generic-table--results-container">
<% if tab[:name] == 'WorkPackageCustomField' %>
- <div class="notification-box -info">
- <div class="notification-box--content">
+ <div class="op-toast -info">
+ <div class="op-toast--content">
<p><%= t('text_custom_field_hint_activate_per_project_and_type') %></p>
</div>
</div>
diff --git a/app/views/doorkeeper/authorizations/error.html.erb b/app/views/doorkeeper/authorizations/error.html.erb
index e4639cbbfbd..2cbe0cfd1c3 100644
--- a/app/views/doorkeeper/authorizations/error.html.erb
+++ b/app/views/doorkeeper/authorizations/error.html.erb
@@ -1,5 +1,5 @@
-<div class="notification-box -error">
- <div class="notification-box--content">
+<div class="op-toast -error">
+ <div class="op-toast--content">
<p>
<strong><%= t('oauth.authorization_error') %></strong>
<br/>
diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb
index 77e4ad0cf81..9a89decc563 100644
--- a/app/views/layouts/base.html.erb
+++ b/app/views/layouts/base.html.erb
@@ -53,7 +53,7 @@ See COPYRIGHT and LICENSE files for more details.
</p>
</div>
</noscript>
-<notifications-container></notifications-container>
+<op-toasts-container></op-toasts-container>
<% main_menu = render_main_menu(local_assigns.fetch(:menu_name, nil), @project) %>
<% side_displayed = content_for?(:sidebar) || content_for?(:main_menu) || !main_menu.blank? %>
<% initial_classes = initial_menu_classes(side_displayed, show_decoration) %>
diff --git a/app/views/ldap_auth_sources/_form.html.erb b/app/views/ldap_auth_sources/_form.html.erb
index 6f915394848..c9afd997545 100644
--- a/app/views/ldap_auth_sources/_form.html.erb
+++ b/app/views/ldap_auth_sources/_form.html.erb
@@ -35,9 +35,9 @@ See COPYRIGHT and LICENSE files for more details.
<%= error_messages_for :auth_source %>
<% if @auth_source.new_record? %>
- <div class="notification-box -info">
- <a title="close" class="notification-box--close icon-context icon-close"></a>
- <div class="notification-box--content">
+ <div class="op-toast -info">
+ <a title="close" class="op-toast--close icon-context icon-close"></a>
+ <div class="op-toast--content">
<%= t('ldap_auth_sources.technical_warning_html') %>
</div>
</div>
diff --git a/app/views/members/_common_notice.html.erb b/app/views/members/_common_notice.html.erb
index 10871204d61..d2f3e0244f1 100644
--- a/app/views/members/_common_notice.html.erb
+++ b/app/views/members/_common_notice.html.erb
@@ -27,7 +27,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
-<div class="flash notice icon icon-yes <%= User.current.pref.auto_hide_popups? ? 'autohide-notification' : '' %>"
+<div class="flash notice icon icon-yes <%= User.current.pref.auto_hide_popups? ? 'autohide-toaster' : '' %>"
role="alert">
<%= h message %>
<span class="close-handler" role="button" tabindex="0" aria-label="{{ ::I18n.t('js.close_popup_title') }}">
diff --git a/app/views/members/_member_form.html.erb b/app/views/members/_member_form.html.erb
index a6cf815d6d4..d7f4c5d1552 100644
--- a/app/views/members/_member_form.html.erb
+++ b/app/views/members/_member_form.html.erb
@@ -76,8 +76,8 @@ See COPYRIGHT and LICENSE files for more details.
</div>
</div>
<% if OpenProject::Enterprise.user_limit_reached? %>
- <div class="notification-box -warning icon-warning" id="member-user-limit-warning" style="display: none;">
- <div class="notification-box--content">
+ <div class="op-toast -warning icon-warning" id="member-user-limit-warning" style="display: none;">
+ <div class="op-toast--content">
<p><%= I18n.t(:warning_user_limit_reached, upgrade_url: OpenProject::Enterprise.upgrade_path).html_safe %></p>
</div>
</div>
diff --git a/app/views/repositories/_checkout_instructions.html.erb b/app/views/repositories/_checkout_instructions.html.erb
index 7a23106113d..e1b897bd82f 100644
--- a/app/views/repositories/_checkout_instructions.html.erb
+++ b/app/views/repositories/_checkout_instructions.html.erb
@@ -28,12 +28,12 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% if @instructions.available? %>
<div id="repository--checkout-instructions"
- class="notification-box -info persistent-toggle--notification"
+ class="op-toast -info persistent-toggle--toaster"
hidden>
<a title="{{ ::I18n.t('js.close_popup_title') }}"
- class="notification-box--close icon-context icon-close">
+ class="op-toast--close icon-context icon-close">
</a>
- <div class="notification-box--content">
+ <div class="op-toast--content">
<p>
<%= simple_format instructions.instructions %>
<% if instructions.manages_permissions? %>
@@ -45,11 +45,11 @@ See COPYRIGHT and LICENSE files for more details.
</div>
</div>
<% elsif @instructions.supported_but_not_enabled? %>
-<div class="notification-box -warning">
+<div class="op-toast -warning">
<a title="{{ ::I18n.t('js.close_popup_title') }}"
- class="notification-box--close icon-context icon-close">
+ class="op-toast--close icon-context icon-close">
</a>
- <div class="notification-box--content">
+ <div class="op-toast--content">
<p><%= t('repositories.checkout.not_available') %></p>
</div>
</div>
diff --git a/app/views/repositories/_dir_list_content.html.erb b/app/views/repositories/_dir_list_content.html.erb
index 58d92149f8e..6ecacbd666a 100644
--- a/app/views/repositories/_dir_list_content.html.erb
+++ b/app/views/repositories/_dir_list_content.html.erb
@@ -29,8 +29,8 @@ See COPYRIGHT and LICENSE files for more details.
<% if @entries.truncated? %>
<tr class="<%= h params[:parent_id] %> entry file truncation-warning">
<td colspan="7" style="padding-left: <%= 18 * params[:depth].to_i %>px;">
- <div class="notification-box -warning">
- <div class="notification-box--content">
+ <div class="op-toast -warning">
+ <div class="op-toast--content">
<%= I18n.t "repositories.truncated", limit: @limit, truncated: @entries.truncated %>
</div>
</div>
diff --git a/app/views/repositories/destroy_info.html.erb b/app/views/repositories/destroy_info.html.erb
index 72ea284de83..321ec117a1b 100644
--- a/app/views/repositories/destroy_info.html.erb
+++ b/app/views/repositories/destroy_info.html.erb
@@ -64,8 +64,8 @@ See COPYRIGHT and LICENSE files for more details.
</section>
<% end %>
<% else %>
- <div class="notification-box -warning">
- <div class="notification-box--content">
+ <div class="op-toast -warning">
+ <div class="op-toast--content">
<p><strong><%= t('repositories.destroy.title_not_managed', repository_type: "<em>#{h(@repository.repository_type)} - #{t(:project_module_repository)}</em>").html_safe %></strong><br /></p>
<p>
<%= t('repositories.destroy.subtitle_not_managed',
diff --git a/app/views/types/form/_form_configuration.html.erb b/app/views/types/form/_form_configuration.html.erb
index b34c247e21a..585b50171e0 100644
--- a/app/views/types/form/_form_configuration.html.erb
+++ b/app/views/types/form/_form_configuration.html.erb
@@ -33,8 +33,8 @@ See COPYRIGHT and LICENSE files for more details.
<div>
<div class="grid-block -visible-overflow wrap">
<div class="grid-content -visible-overflow small-12 large-10">
- <div class="notification-box -info">
- <div class="notification-box--content">
+ <div class="op-toast -info">
+ <div class="op-toast--content">
<p><%= t('text_form_configuration') %></p>
<br>
<p><%= t('text_custom_field_hint_activate_per_project') %></p>
@@ -42,8 +42,8 @@ See COPYRIGHT and LICENSE files for more details.
</div>
<% if EnterpriseToken.show_banners? %>
- <div class="notification-box upsale-notification">
- <div class="notification-box--content">
+ <div class="op-toast upsale-notification">
+ <div class="op-toast--content">
<h3><%= t('admin.enterprise.upgrade_to_ee') %></h3>
<%= image_tag "enterprise_edition.png", class: "widget-box--teaser-image" %>
diff --git a/app/views/work_packages/bulk/edit.html.erb b/app/views/work_packages/bulk/edit.html.erb
index 068dd17a7d4..aa3f0c5de3a 100644
--- a/app/views/work_packages/bulk/edit.html.erb
+++ b/app/views/work_packages/bulk/edit.html.erb
@@ -30,9 +30,9 @@ See COPYRIGHT and LICENSE files for more details.
<% html_title t(:label_bulk_edit_selected_work_packages) %>
<% if @bulk_errors.present? %>
- <div class="notification-box -error">
- <a title="close" class="notification-box--close icon-context icon-close"></a>
- <div class="notification-box--content">
+ <div class="op-toast -error">
+ <a title="close" class="op-toast--close icon-context icon-close"></a>
+ <div class="op-toast--content">
<p><strong><%= t('work_packages.bulk.could_not_be_saved') %></strong></p>
<ul>
diff --git a/frontend/src/app/core/apiv3/endpoints/work_packages/work-package-cache.spec.ts b/frontend/src/app/core/apiv3/endpoints/work_packages/work-package-cache.spec.ts
index 7900e6a9323..e5836c7e9f1 100644
--- a/frontend/src/app/core/apiv3/endpoints/work_packages/work-package-cache.spec.ts
+++ b/frontend/src/app/core/apiv3/endpoints/work_packages/work-package-cache.spec.ts
@@ -29,7 +29,7 @@
import { Injector } from '@angular/core';
import { TestBed } from '@angular/core/testing';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
@@ -68,7 +68,7 @@ describe('WorkPackageCache', () => {
{ provide: ConfigurationService, useValue: {} },
{ provide: I18nService, useValue: { t: (...args:any[]) => 'translation' } },
{ provide: WorkPackageResource, useValue: {} },
- { provide: NotificationsService, useValue: {} },
+ { provide: ToastService, useValue: {} },
{ provide: HalResourceNotificationService, useValue: { handleRawError: () => false } },
{ provide: WorkPackageNotificationService, useValue: {} },
{ provide: OpenProjectFileUploadService, useValue: {} },
diff --git a/frontend/src/app/core/routing/openproject.routes.ts b/frontend/src/app/core/routing/openproject.routes.ts
index 685cf518d64..cbb18f5d808 100644
--- a/frontend/src/app/core/routing/openproject.routes.ts
+++ b/frontend/src/app/core/routing/openproject.routes.ts
@@ -34,9 +34,9 @@ import {
UIRouter,
} from '@uirouter/core';
import {
- INotification,
- NotificationsService,
-} from 'core-app/shared/components/notifications/notifications.service';
+ IToast,
+ ToastService,
+} from 'core-app/shared/components/toaster/toast.service';
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
import { Injector } from '@angular/core';
import { FirstRouteService } from 'core-app/core/routing/first-route-service';
@@ -209,7 +209,7 @@ export function uiRouterConfiguration(uiRouter:UIRouter, injector:Injector, modu
export function initializeUiRouterListeners(injector:Injector) {
const $transitions:TransitionService = injector.get(TransitionService);
const stateService = injector.get(StateService);
- const notificationsService:NotificationsService = injector.get(NotificationsService);
+ const toastService:ToastService = injector.get(ToastService);
const currentProject:CurrentProjectService = injector.get(CurrentProjectService);
const firstRoute:FirstRouteService = injector.get(FirstRouteService);
const backRoutingService:BackRoutingService = injector.get(BackRoutingService);
@@ -314,12 +314,12 @@ export function initializeUiRouterListeners(injector:Injector) {
// Clear all notifications when actually moving between states.
if (transition.to().name !== transition.from().name) {
- notificationsService.clear();
+ toastService.clear();
}
// Add new notifications if passed to params
if (toParams.flash_message) {
- notificationsService.add(toParams.flash_message as INotification);
+ toastService.add(toParams.flash_message as IToast);
}
return true;
diff --git a/frontend/src/app/core/setup/global-dynamic-components.const.ts b/frontend/src/app/core/setup/global-dynamic-components.const.ts
index 776a4ac1bcb..41b42dc5070 100644
--- a/frontend/src/app/core/setup/global-dynamic-components.const.ts
+++ b/frontend/src/app/core/setup/global-dynamic-components.const.ts
@@ -34,9 +34,9 @@ import {
globalSearchWorkPackagesSelectorEntry,
} from 'core-app/core/global_search/global-search-work-packages-entry.component';
import {
- NotificationsContainerComponent,
- notificationsContainerSelector,
-} from 'core-app/shared/components/notifications/notifications-container.component';
+ ToastsContainerComponent,
+ toastsContainerSelector,
+} from 'core-app/shared/components/toaster/toasts-container.component';
import {
CkeditorAugmentedTextareaComponent,
ckeditorAugmentedTextareaSelector,
@@ -193,7 +193,7 @@ export const globalDynamicComponents:OptionalBootstrapDefinition[] = [
{ selector: customDateActionAdminSelector, cls: CustomDateActionAdminComponent },
{ selector: boardsMenuSelector, cls: BoardsMenuComponent },
{ selector: globalSearchWorkPackagesSelectorEntry, cls: GlobalSearchWorkPackagesEntryComponent },
- { selector: notificationsContainerSelector, cls: NotificationsContainerComponent },
+ { selector: toastsContainerSelector, cls: ToastsContainerComponent },
{ selector: adminTypeFormConfigurationSelector, cls: TypeFormConfigurationComponent },
{ selector: ckeditorAugmentedTextareaSelector, cls: CkeditorAugmentedTextareaComponent, embeddable: true },
{ selector: persistentToggleSelector, cls: PersistentToggleComponent },
diff --git a/frontend/src/app/core/setup/globals/components/admin/backup.component.ts b/frontend/src/app/core/setup/globals/components/admin/backup.component.ts
index b0a15e87d12..2cc5e0c63ae 100644
--- a/frontend/src/app/core/setup/globals/components/admin/backup.component.ts
+++ b/frontend/src/app/core/setup/globals/components/admin/backup.component.ts
@@ -32,7 +32,7 @@ import {
} from '@angular/core';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { JobStatusModalComponent } from 'core-app/features/job-status/job-status-modal/job-status.modal';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { OpModalService } from 'core-app/shared/components/modal/modal.service';
@@ -80,7 +80,7 @@ export class BackupComponent implements AfterViewInit {
readonly elementRef:ElementRef,
public injector:Injector,
protected i18n:I18nService,
- protected notificationsService:NotificationsService,
+ protected toastService:ToastService,
protected opModalService:OpModalService,
protected pathHelper:PathHelperService,
) {
@@ -126,7 +126,7 @@ export class BackupComponent implements AfterViewInit {
this.opModalService.show(JobStatusModalComponent, 'global', { jobId: resp.jobStatusId });
})
.catch((error:HttpErrorResponse) => {
- this.notificationsService.addError(error.error);
+ this.toastService.addError(error.error);
});
}
}
diff --git a/frontend/src/app/core/setup/globals/global-listeners/setup-server-response.ts b/frontend/src/app/core/setup/globals/global-listeners/setup-server-response.ts
index f0341fb20ec..04afc210dba 100644
--- a/frontend/src/app/core/setup/globals/global-listeners/setup-server-response.ts
+++ b/frontend/src/app/core/setup/globals/global-listeners/setup-server-response.ts
@@ -91,9 +91,9 @@ export function setupServerResponse() {
}
function flashCloseHandler() {
- jQuery('body').on('click keydown touchend', '.close-handler,.notification-box--close', function (e) {
+ jQuery('body').on('click keydown touchend', '.close-handler,.op-toast--close', function (e) {
if (e.type === 'click' || e.which === 13) {
- jQuery(this).parent('.flash, .errorExplanation, .notification-box')
+ jQuery(this).parent('.flash, .errorExplanation, .op-toast')
.not('.persistent-toggle--notification')
.remove();
}
@@ -102,7 +102,7 @@ function flashCloseHandler() {
function autoHideFlashMessage() {
setTimeout(() => {
- jQuery('.flash.autohide-notification').remove();
+ jQuery('.flash.autohide-toaster').remove();
}, 5000);
}
diff --git a/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts b/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts
index c81f585956f..48ed532fc33 100644
--- a/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts
+++ b/frontend/src/app/core/state/in-app-notifications/in-app-notifications.service.ts
@@ -9,7 +9,7 @@ import {
ID,
} from '@datorama/akita';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { IHALCollection } from 'core-app/core/apiv3/types/hal-collection.type';
import { HttpClient } from '@angular/common/http';
import { InAppNotificationsQuery } from 'core-app/core/state/in-app-notifications/in-app-notifications.query';
@@ -45,7 +45,7 @@ export class InAppNotificationsResourceService {
readonly actions$:ActionsService,
private http:HttpClient,
private apiV3Service:APIV3Service,
- private notifications:NotificationsService,
+ private toastService:ToastService,
) {
}
@@ -73,7 +73,7 @@ export class InAppNotificationsResourceService {
});
}),
catchError((error) => {
- this.notifications.addError(error);
+ this.toastService.addError(error);
throw error;
}),
);
diff --git a/frontend/src/app/core/state/projects/projects.service.ts b/frontend/src/app/core/state/projects/projects.service.ts
index f7288dbd8d0..85804e6db8f 100644
--- a/frontend/src/app/core/state/projects/projects.service.ts
+++ b/frontend/src/app/core/state/projects/projects.service.ts
@@ -10,7 +10,7 @@ import {
} from '@datorama/akita';
import { HttpClient } from '@angular/common/http';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { IHALCollection } from 'core-app/core/apiv3/types/hal-collection.type';
import { ProjectsQuery } from 'core-app/core/state/projects/projects.query';
import { Apiv3ListParameters } from 'core-app/core/apiv3/paths/apiv3-list-resource.interface';
@@ -34,7 +34,7 @@ export class ProjectsResourceService {
constructor(
private http:HttpClient,
private apiV3Service:APIV3Service,
- private notifications:NotificationsService,
+ private toastService:ToastService,
) {
}
@@ -61,7 +61,7 @@ export class ProjectsResourceService {
});
}),
catchError((error) => {
- this.notifications.addError(error);
+ this.toastService.addError(error);
throw error;
}),
);
diff --git a/frontend/src/app/features/admin/types/type-form-configuration.component.ts b/frontend/src/app/features/admin/types/type-form-configuration.component.ts
index 03e106d9916..b0a7366de8b 100644
--- a/frontend/src/app/features/admin/types/type-form-configuration.component.ts
+++ b/frontend/src/app/features/admin/types/type-form-configuration.component.ts
@@ -2,7 +2,7 @@ import {
AfterViewInit, Component, ElementRef, OnInit,
} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { ExternalRelationQueryConfigurationService } from 'core-app/features/work-packages/components/wp-table/external-configuration/external-relation-query-configuration.service';
import { DomAutoscrollService } from 'core-app/shared/helpers/drag-and-drop/dom-autoscroll.service';
import { DragulaService, DrakeWithModels } from 'ng2-dragula';
@@ -75,7 +75,7 @@ export class TypeFormConfigurationComponent extends UntilDestroyedMixin implemen
private Gon:GonService,
private dragula:DragulaService,
private confirmDialog:ConfirmDialogService,
- private notificationsService:NotificationsService,
+ private toastService:ToastService,
private externalRelationQuery:ExternalRelationQueryConfigurationService) {
super();
}
diff --git a/frontend/src/app/features/bim/bcf/bcf-wp-attribute-group/bcf-wp-attribute-group.component.ts b/frontend/src/app/features/bim/bcf/bcf-wp-attribute-group/bcf-wp-attribute-group.component.ts
index 63b4d0581a1..380cff069d3 100644
--- a/frontend/src/app/features/bim/bcf/bcf-wp-attribute-group/bcf-wp-attribute-group.component.ts
+++ b/frontend/src/app/features/bim/bcf/bcf-wp-attribute-group/bcf-wp-attribute-group.component.ts
@@ -16,7 +16,7 @@ import idFromLink from 'core-app/features/hal/helpers/id-from-link';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ViewerBridgeService } from 'core-app/features/bim/bcf/bcf-viewer-bridge/viewer-bridge.service';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { WorkPackageCreateService } from 'core-app/features/work-packages/components/wp-new/wp-create.service';
import { BcfAuthorizationService } from 'core-app/features/bim/bcf/api/bcf-authorization.service';
import { ViewpointsService } from 'core-app/features/bim/bcf/helper/viewpoints.service';
@@ -119,7 +119,7 @@ export class BcfWpAttributeGroupComponent extends UntilDestroyedMixin implements
readonly viewerBridge:ViewerBridgeService,
readonly apiV3Service:APIV3Service,
readonly wpCreate:WorkPackageCreateService,
- readonly notifications:NotificationsService,
+ readonly toastService:ToastService,
readonly cdRef:ChangeDetectorRef,
readonly I18n:I18nService,
readonly viewpointsService:ViewpointsService) {
@@ -188,8 +188,8 @@ export class BcfWpAttributeGroupComponent extends UntilDestroyedMixin implements
this.viewpointsService
.deleteViewPoint$(workPackage, index)
- .subscribe(() => {
- this.notifications.addSuccess(this.text.notice_successful_delete);
+ .subscribe((data) => {
+ this.toastService.addSuccess(this.text.notice_successful_delete);
this.gallery.preview.close();
});
}
@@ -198,7 +198,7 @@ export class BcfWpAttributeGroupComponent extends UntilDestroyedMixin implements
this.viewpointsService
.saveViewpoint$(workPackage)
.subscribe((viewpoint) => {
- this.notifications.addSuccess(this.text.notice_successful_create);
+ this.toastService.addSuccess(this.text.notice_successful_create);
this.showIndex = this.viewpoints.length;
});
}
diff --git a/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.html b/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.html
index 2fb651ca1c3..7f5cca765e1 100644
--- a/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.html
+++ b/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.html
@@ -1,8 +1,8 @@
<div #outerContainer
class="op-ifc-viewer">
- <div *ngIf="modelCount === 0" class="notification-box -info">
- <div class="notification-box--content">
+ <div *ngIf="modelCount === 0" class="op-toast -info">
+ <div class="op-toast--content">
<p>
{{ text.empty_warning }}
<br/>
diff --git a/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.sass b/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.sass
index e5499ab878b..52fff7ebbca 100644
--- a/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.sass
+++ b/frontend/src/app/features/bim/ifc_models/ifc-viewer/ifc-viewer.component.sass
@@ -5,7 +5,7 @@
justify-content: stretch
height: 100%
- .notification-box
+ .op-toast
position: absolute
right: 10px
diff --git a/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html b/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html
index ba668fca625..9cf5f8de898 100644
--- a/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html
+++ b/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html
@@ -6,8 +6,8 @@
<div class="op-modal--body">
<div *ngIf="showWarning && warningText"
- class="notification-box -warning">
- <div class="notification-box--content">
+ class="op-toast -warning">
+ <div class="op-toast--content">
<p [innerHTML]="warningText"></p>
</div>
</div>
diff --git a/frontend/src/app/features/boards/board/board-list/board-list.component.html b/frontend/src/app/features/boards/board/board-list/board-list.component.html
index 42f89dfd51a..1b9ba5694da 100644
--- a/frontend/src/app/features/boards/board/board-list/board-list.component.html
+++ b/frontend/src/app/features/boards/board/board-list/board-list.component.html
@@ -58,7 +58,7 @@
</wp-card-view>
</div>
</ng-container>
- <div class="op-board-list--notification-box -error" *ngIf="loadingError">
+ <div class="op-board-list--toaster-box -error" *ngIf="loadingError">
<p>
<span [textContent]="errorMessage"></span>
&ngsp;
diff --git a/frontend/src/app/features/boards/board/board-list/board-list.component.sass b/frontend/src/app/features/boards/board/board-list/board-list.component.sass
index 8042c7ad419..cafea608b1f 100644
--- a/frontend/src/app/features/boards/board/board-list/board-list.component.sass
+++ b/frontend/src/app/features/boards/board/board-list/board-list.component.sass
@@ -28,7 +28,7 @@ $board-list-max-width: 300px
margin-bottom: 0
margin-right: 0.25rem
- &--notification-box
+ &--toaster-box
margin-top: 0
// Avoids having to hide the drag&drop handle of the list
z-index: 100
diff --git a/frontend/src/app/features/boards/board/board-list/board-list.component.ts b/frontend/src/app/features/boards/board/board-list/board-list.component.ts
index 17ac4299977..6fd88e2d41a 100644
--- a/frontend/src/app/features/boards/board/board-list/board-list.component.ts
+++ b/frontend/src/app/features/boards/board/board-list/board-list.component.ts
@@ -19,7 +19,7 @@ import { WorkPackageInlineCreateService } from 'core-app/features/work-packages/
import { BoardInlineCreateService } from 'core-app/features/boards/board/board-list/board-inline-create.service';
import { AbstractWidgetComponent } from 'core-app/shared/components/grids/widgets/abstract-widget.component';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/query-space/isolated-query-space';
import { Board } from 'core-app/features/boards/board/board';
import { AuthorisationService } from 'core-app/core/model-auth/model-auth.service';
@@ -139,7 +139,7 @@ export class BoardListComponent extends AbstractWidgetComponent implements OnIni
readonly cdRef:ChangeDetectorRef,
readonly transitions:TransitionService,
readonly boardFilters:BoardFiltersService,
- readonly notifications:NotificationsService,
+ readonly toastService:ToastService,
readonly querySpace:IsolatedQuerySpace,
readonly halNotification:HalResourceNotificationService,
readonly halEvents:HalEventsService,
@@ -296,7 +296,7 @@ export class BoardListComponent extends AbstractWidgetComponent implements OnIni
.subscribe(
() => {
this.inFlight = false;
- this.notifications.addSuccess(this.text.updateSuccessful);
+ this.toastService.addSuccess(this.text.updateSuccessful);
},
(_error) => this.inFlight = false,
);
diff --git a/frontend/src/app/features/boards/board/board-list/board-lists.service.ts b/frontend/src/app/features/boards/board/board-list/board-lists.service.ts
index 6d2ffdcc49b..0daee30fe9a 100644
--- a/frontend/src/app/features/boards/board/board-list/board-lists.service.ts
+++ b/frontend/src/app/features/boards/board/board-list/board-lists.service.ts
@@ -5,7 +5,7 @@ import { QueryResource } from 'core-app/features/hal/resources/query-resource';
import { Board } from 'core-app/features/boards/board/board';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
import { ApiV3Filter } from 'core-app/shared/helpers/api-v3/api-v3-filter-builder';
import { GridWidgetResource } from 'core-app/features/hal/resources/grid-widget-resource';
@@ -18,7 +18,7 @@ export class BoardListsService {
private readonly pathHelper:PathHelperService,
private readonly apiV3Service:APIV3Service,
private readonly halResourceService:HalResourceService,
- private readonly notifications:NotificationsService,
+ private readonly toastService:ToastService,
private readonly I18n:I18nService) {
}
@@ -88,7 +88,7 @@ export class BoardListsService {
const resource = this.halResourceService.createHalResourceOfClass(GridWidgetResource, source);
board.addQuery(resource);
} catch (e) {
- this.notifications.addError(e);
+ this.toastService.addError(e);
console.error(e);
}
return board;
diff --git a/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.ts b/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.ts
index f7603972028..9a5b00cdca9 100644
--- a/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.ts
+++ b/frontend/src/app/features/boards/board/board-partitioned-page/board-list-container.component.ts
@@ -3,7 +3,7 @@ import { Observable, Subscription } from 'rxjs';
import { QueryResource } from 'core-app/features/hal/resources/query-resource';
import { BoardListComponent } from 'core-app/features/boards/board/board-list/board-list.component';
import { StateService } from '@uirouter/core';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service';
import { BoardListsService } from 'core-app/features/boards/board/board-list/board-lists.service';
import { OpModalService } from 'core-app/shared/components/modal/modal.service';
@@ -75,7 +75,7 @@ export class BoardListContainerComponent extends UntilDestroyedMixin implements
constructor(readonly I18n:I18nService,
readonly state:StateService,
- readonly notifications:NotificationsService,
+ readonly toastService:ToastService,
readonly halNotification:HalResourceNotificationService,
readonly boardComponent:BoardPartitionedPageComponent,
readonly BoardList:BoardListsService,
@@ -179,7 +179,7 @@ export class BoardListContainerComponent extends UntilDestroyedMixin implements
}
private showError(text = this.text.loadingError) {
- this.notifications.addError(text);
+ this.toastService.addError(text);
}
private requestRefreshOfUpdatedLists(queries:QueryResource[]) {
diff --git a/frontend/src/app/features/boards/board/board-partitioned-page/board-partitioned-page.component.ts b/frontend/src/app/features/boards/board/board-partitioned-page/board-partitioned-page.component.ts
index 2ab350757cb..26ce66e2a7f 100644
--- a/frontend/src/app/features/boards/board/board-partitioned-page/board-partitioned-page.component.ts
+++ b/frontend/src/app/features/boards/board/board-partitioned-page/board-partitioned-page.component.ts
@@ -9,7 +9,7 @@ import {
import { StateService, TransitionService } from '@uirouter/core';
import { BoardFilterComponent } from 'core-app/features/boards/board/board-filter/board-filter.component';
import { Board } from 'core-app/features/boards/board/board';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service';
import { BoardService } from 'core-app/features/boards/board/board.service';
import { DragAndDropService } from 'core-app/shared/helpers/drag-and-drop/drag-and-drop.service';
@@ -141,7 +141,7 @@ export class BoardPartitionedPageComponent extends UntilDestroyedMixin {
readonly cdRef:ChangeDetectorRef,
readonly $transitions:TransitionService,
readonly state:StateService,
- readonly notifications:NotificationsService,
+ readonly toastService:ToastService,
readonly halNotification:HalResourceNotificationService,
readonly injector:Injector,
readonly apiV3Service:APIV3Service,
@@ -158,7 +158,7 @@ export class BoardPartitionedPageComponent extends UntilDestroyedMixin {
.observe(componentDestroyed(this))
.subscribe(
() => {
- this.notifications.addSuccess(this.text.updateSuccessful);
+ this.toastService.addSuccess(this.text.updateSuccessful);
},
(error:unknown) => this.halNotification.handleRawError(error),
);
diff --git a/frontend/src/app/features/boards/board/toolbar-menu/boards-toolbar-menu.directive.ts b/frontend/src/app/features/boards/board/toolbar-menu/boards-toolbar-menu.directive.ts
index 260212c2abb..7e02dd39180 100644
--- a/frontend/src/app/features/boards/board/toolbar-menu/boards-toolbar-menu.directive.ts
+++ b/frontend/src/app/features/boards/board/toolbar-menu/boards-toolbar-menu.directive.ts
@@ -37,7 +37,7 @@ import { Board } from 'core-app/features/boards/board/board';
import { BoardConfigurationModalComponent } from 'core-app/features/boards/board/configuration-modal/board-configuration.modal';
import { BoardService } from 'core-app/features/boards/board/board.service';
import { StateService } from '@uirouter/core';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { triggerEditingEvent } from 'core-app/shared/components/editable-toolbar-title/editable-toolbar-title.component';
@Directive({
@@ -54,7 +54,7 @@ export class BoardsToolbarMenuDirective extends OpContextMenuTrigger {
readonly opContextMenu:OPContextMenuService,
readonly opModalService:OpModalService,
readonly boardService:BoardService,
- readonly Notifications:NotificationsService,
+ readonly Notifications:ToastService,
readonly State:StateService,
readonly injector:Injector,
readonly I18n:I18nService) {
diff --git a/frontend/src/app/features/boards/index-page/boards-index-page.component.ts b/frontend/src/app/features/boards/index-page/boards-index-page.component.ts
index 8aca85625eb..02b6ed4fe90 100644
--- a/frontend/src/app/features/boards/index-page/boards-index-page.component.ts
+++ b/frontend/src/app/features/boards/index-page/boards-index-page.component.ts
@@ -5,7 +5,7 @@ import { Observable } from 'rxjs';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { BoardService } from 'core-app/features/boards/board/board.service';
import { Board } from 'core-app/features/boards/board/board';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { OpModalService } from 'core-app/shared/components/modal/modal.service';
import { NewBoardModalComponent } from 'core-app/features/boards/new-board-modal/new-board-modal.component';
import { BannersService } from 'core-app/core/enterprise/banners.service';
@@ -59,7 +59,7 @@ export class BoardsIndexPageComponent extends UntilDestroyedMixin implements OnI
constructor(private readonly boardService:BoardService,
private readonly apiV3Service:APIV3Service,
private readonly I18n:I18nService,
- private readonly notifications:NotificationsService,
+ private readonly toastService:ToastService,
private readonly opModalService:OpModalService,
private readonly loadingIndicatorService:LoadingIndicatorService,
private readonly authorisationService:AuthorisationService,
@@ -94,9 +94,9 @@ export class BoardsIndexPageComponent extends UntilDestroyedMixin implements OnI
this.boardService
.delete(board)
.then(() => {
- this.notifications.addSuccess(this.text.deleteSuccessful);
+ this.toastService.addSuccess(this.text.deleteSuccessful);
})
- .catch((error) => this.notifications.addError(`Deletion failed: ${error}`));
+ .catch((error) => this.toastService.addError(`Deletion failed: ${error}`));
}
public showBoardIndexView() {
diff --git a/frontend/src/app/features/enterprise/enterprise-trial-waiting/ee-trial-waiting.component.ts b/frontend/src/app/features/enterprise/enterprise-trial-waiting/ee-trial-waiting.component.ts
index 94bc0cd14eb..397dd0ea40e 100644
--- a/frontend/src/app/features/enterprise/enterprise-trial-waiting/ee-trial-waiting.component.ts
+++ b/frontend/src/app/features/enterprise/enterprise-trial-waiting/ee-trial-waiting.component.ts
@@ -30,7 +30,7 @@ import { Component, ElementRef, OnInit } from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { EnterpriseTrialService } from 'core-app/features/enterprise/enterprise-trial.service';
import { HttpClient } from '@angular/common/http';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { distinctUntilChanged } from 'rxjs/operators';
import { TimezoneService } from 'core-app/core/datetime/timezone.service';
@@ -61,7 +61,7 @@ export class EETrialWaitingComponent implements OnInit {
constructor(readonly elementRef:ElementRef,
readonly I18n:I18nService,
protected http:HttpClient,
- protected notificationsService:NotificationsService,
+ protected toastService:ToastService,
public eeTrialService:EnterpriseTrialService,
readonly timezoneService:TimezoneService) {
}
@@ -89,7 +89,7 @@ export class EETrialWaitingComponent implements OnInit {
this.http.post(this.eeTrialService.resendLink, {})
.toPromise()
.then(() => {
- this.notificationsService.addSuccess(this.text.resend_success);
+ this.toastService.addSuccess(this.text.resend_success);
this.eeTrialService.retryConfirmation();
})
.catch(() => {
@@ -97,7 +97,7 @@ export class EETrialWaitingComponent implements OnInit {
// Check whether the mail has been confirmed by now
this.eeTrialService.getToken();
} else {
- this.notificationsService.addError(this.text.resend_warning);
+ this.toastService.addError(this.text.resend_warning);
}
});
}
diff --git a/frontend/src/app/features/enterprise/enterprise-trial.service.ts b/frontend/src/app/features/enterprise/enterprise-trial.service.ts
index 9decfa6e4c5..964e20df71b 100644
--- a/frontend/src/app/features/enterprise/enterprise-trial.service.ts
+++ b/frontend/src/app/features/enterprise/enterprise-trial.service.ts
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { FormGroup } from '@angular/forms';
import { input } from 'reactivestates';
@@ -51,7 +51,7 @@ export class EnterpriseTrialService {
constructor(readonly I18n:I18nService,
protected http:HttpClient,
readonly pathHelper:PathHelperService,
- protected notificationsService:NotificationsService) {
+ protected toastService:ToastService) {
const { gon } = window as any;
this.baseUrlAugur = gon.augur_url;
this.tokenVersion = gon.token_version;
@@ -81,7 +81,7 @@ export class EnterpriseTrialService {
if (error.status === 422 || error.status === 400) {
this.error = error;
} else {
- this.notificationsService.addWarning(error.error.description || I18n.t('js.error.internal'));
+ this.toastService.addWarning(error.error.description || I18n.t('js.error.internal'));
}
});
}
@@ -115,9 +115,9 @@ export class EnterpriseTrialService {
this.setMailSubmittedStatus();
this.confirmed = false;
} else if (_.get(error, 'error._type') === 'Error') {
- this.notificationsService.addError(error.error.message);
+ this.toastService.addError(error.error.message);
} else {
- this.notificationsService.addError(error.error || I18n.t('js.error.internal'));
+ this.toastService.addError(error.error || I18n.t('js.error.internal'));
}
});
}
@@ -135,7 +135,7 @@ export class EnterpriseTrialService {
)
.toPromise()
.catch((e:any) => {
- this.notificationsService.addError(e.error.message || e.message || e);
+ this.toastService.addError(e.error.message || e.message || e);
});
}
@@ -165,7 +165,7 @@ export class EnterpriseTrialService {
)
.toPromise();
- this.notificationsService.addError(error.error.description || I18n.t('js.error.internal'));
+ this.toastService.addError(error.error.description || I18n.t('js.error.internal'));
});
}
diff --git a/frontend/src/app/features/hal/resources/mixins/attachable-mixin.ts b/frontend/src/app/features/hal/resources/mixins/attachable-mixin.ts
index a956c3cd542..dbb40608a73 100644
--- a/frontend/src/app/features/hal/resources/mixins/attachable-mixin.ts
+++ b/frontend/src/app/features/hal/resources/mixins/attachable-mixin.ts
@@ -28,7 +28,7 @@
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
import { HttpErrorResponse } from '@angular/common/http';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -44,7 +44,7 @@ export function Attachable<TBase extends Constructor<HalResource>>(Base:TBase) {
return class extends Base {
public attachments:AttachmentCollectionResource;
- private NotificationsService:NotificationsService;
+ private ToastService:ToastService;
private halNotification:HalResourceNotificationService;
@@ -145,11 +145,11 @@ export function Attachable<TBase extends Constructor<HalResource>>(Base:TBase) {
const { uploads, finished } = this.performUpload(files);
const message = I18n.t('js.label_upload_notification');
- const notification = this.NotificationsService.addAttachmentUpload(message, uploads);
+ const notification = this.ToastService.addAttachmentUpload(message, uploads);
return finished
.then((result:{ response:HalResource, uploadUrl:string }[]) => {
- setTimeout(() => this.NotificationsService.remove(notification), 700);
+ setTimeout(() => this.ToastService.remove(notification), 700);
this.attachments.count += result.length;
result.forEach((r) => {
@@ -210,8 +210,8 @@ export function Attachable<TBase extends Constructor<HalResource>>(Base:TBase) {
}
public $initialize(source:any) {
- if (!this.NotificationsService) {
- this.NotificationsService = this.injector.get(NotificationsService);
+ if (!this.ToastService) {
+ this.ToastService = this.injector.get(ToastService);
}
if (!this.halNotification) {
this.halNotification = this.injector.get(HalResourceNotificationService);
diff --git a/frontend/src/app/features/hal/resources/work-package-resource.spec.ts b/frontend/src/app/features/hal/resources/work-package-resource.spec.ts
index 97ac191c7bb..2305c5a55db 100644
--- a/frontend/src/app/features/hal/resources/work-package-resource.spec.ts
+++ b/frontend/src/app/features/hal/resources/work-package-resource.spec.ts
@@ -30,7 +30,6 @@ import { TestBed, waitForAsync } from '@angular/core/testing';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
import { Injector } from '@angular/core';
import { States } from 'core-app/core/states/states.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service';
import { SchemaCacheService } from 'core-app/core/schemas/schema-cache.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
@@ -53,7 +52,6 @@ import isNewResource from 'core-app/features/hal/helpers/is-new-resource';
describe('WorkPackage', () => {
let halResourceService:HalResourceService;
let injector:Injector;
- let notificationsService:NotificationsService;
let halResourceNotification:HalResourceNotificationService;
let source:any;
@@ -75,7 +73,6 @@ describe('WorkPackage', () => {
States,
TimezoneService,
WorkPackagesActivityService,
- NotificationsService,
ConfigurationService,
OpenProjectFileUploadService,
OpenProjectDirectFileUploadService,
@@ -94,7 +91,6 @@ describe('WorkPackage', () => {
.then(() => {
halResourceService = TestBed.inject(HalResourceService);
injector = TestBed.inject(Injector);
- notificationsService = injector.get(NotificationsService);
halResourceNotification = injector.get(HalResourceNotificationService);
halResourceService.registerResource('WorkPackage', { cls: WorkPackageResource });
diff --git a/frontend/src/app/features/hal/resources/work-package-resource.ts b/frontend/src/app/features/hal/resources/work-package-resource.ts
index 0405e9f899b..0dfb60bb926 100644
--- a/frontend/src/app/features/hal/resources/work-package-resource.ts
+++ b/frontend/src/app/features/hal/resources/work-package-resource.ts
@@ -29,7 +29,7 @@
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { States } from 'core-app/core/states/states.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { InputState } from 'reactivestates';
import { WorkPackagesActivityService } from 'core-app/features/work-packages/components/wp-single-view-tabs/activity-panel/wp-activity.service';
import { WorkPackageNotificationService } from 'core-app/features/work-packages/services/notifications/work-package-notification.service';
@@ -136,7 +136,7 @@ export class WorkPackageBaseResource extends HalResource {
@InjectField() apiV3Service:APIV3Service;
- @InjectField() NotificationsService:NotificationsService;
+ @InjectField() ToastService:ToastService;
@InjectField() workPackageNotificationService:WorkPackageNotificationService;
diff --git a/frontend/src/app/features/hal/services/hal-resource-notification.service.ts b/frontend/src/app/features/hal/services/hal-resource-notification.service.ts
index 12bb9a7884a..5232ffb301a 100644
--- a/frontend/src/app/features/hal/services/hal-resource-notification.service.ts
+++ b/frontend/src/app/features/hal/services/hal-resource-notification.service.ts
@@ -30,7 +30,7 @@ import { StateService } from '@uirouter/core';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
import { Injectable, Injector } from '@angular/core';
import { LoadingIndicatorService } from 'core-app/core/loading-indicator/loading-indicator.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { HttpErrorResponse } from '@angular/common/http';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
@@ -47,7 +47,7 @@ export class HalResourceNotificationService {
@InjectField() protected halResourceService:HalResourceService;
- @InjectField() protected NotificationsService:NotificationsService;
+ @InjectField() protected ToastService:ToastService;
@InjectField() protected loadingIndicator:LoadingIndicatorService;
@@ -61,7 +61,7 @@ export class HalResourceNotificationService {
message: this.I18n.t(`js.notice_successful_${isCreate ? 'create' : 'update'}`),
};
- this.NotificationsService.addSuccess(message);
+ this.ToastService.addSuccess(message);
}
/**
@@ -90,12 +90,12 @@ export class HalResourceNotificationService {
}
if (typeof (response) === 'string') {
- this.NotificationsService.addError(response);
+ this.ToastService.addError(response);
return;
}
if (response instanceof Error) {
- this.NotificationsService.addError(response.message);
+ this.ToastService.addError(response.message);
return;
}
@@ -169,11 +169,11 @@ export class HalResourceNotificationService {
error += ` ${(message as any).toString()}`;
}
- this.NotificationsService.addError(error);
+ this.ToastService.addError(error);
}
public showEditingBlockedError(attribute:string) {
- this.NotificationsService.addError(this.I18n.t(
+ this.ToastService.addError(this.I18n.t(
'js.hal.error.edit_prohibited',
{ attribute },
));
@@ -190,7 +190,7 @@ export class HalResourceNotificationService {
return false;
}
- this.NotificationsService.addError(this.I18n.t(i18nString,
+ this.ToastService.addError(this.I18n.t(i18nString,
{ attribute: attributeName }));
return true;
@@ -202,9 +202,9 @@ export class HalResourceNotificationService {
const messages = errorResource.errorMessages;
if (messages.length > 1) {
- this.NotificationsService.addError('', messages);
+ this.ToastService.addError('', messages);
} else {
- this.NotificationsService.addError(messages[0]);
+ this.ToastService.addError(messages[0]);
}
return true;
diff --git a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts
index 4ef8fdeec57..43d321fb3f8 100644
--- a/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts
+++ b/frontend/src/app/features/in-app-notifications/center/in-app-notification-center-page.component.ts
@@ -13,7 +13,6 @@ import {
StateService,
TransitionService,
} from '@uirouter/core';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
import { NotificationSettingsButtonComponent } from 'core-app/features/in-app-notifications/center/toolbar/settings/notification-settings-button.component';
@@ -85,7 +84,6 @@ export class InAppNotificationCenterPageComponent extends UntilDestroyedMixin im
readonly cdRef:ChangeDetectorRef,
readonly $transitions:TransitionService,
readonly state:StateService,
- readonly notifications:NotificationsService,
readonly injector:Injector,
readonly apiV3Service:APIV3Service,
readonly backRoutingService:BackRoutingService,
diff --git a/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts b/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
index 69bafdb92b1..3752729f0fd 100644
--- a/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
+++ b/frontend/src/app/features/in-app-notifications/center/state/ian-center.service.ts
@@ -18,7 +18,7 @@ import {
setLoading,
} from '@datorama/akita';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import {
markNotificationsAsRead,
notificationsMarkedRead,
@@ -89,7 +89,7 @@ export class IanCenterService extends UntilDestroyedMixin {
readonly resourceService:InAppNotificationsResourceService,
readonly actions$:ActionsService,
readonly apiV3Service:APIV3Service,
- readonly notificationsService:NotificationsService,
+ readonly toastService:ToastService,
readonly uiRouterGlobals:UIRouterGlobals,
readonly state:StateService,
) {
@@ -180,7 +180,7 @@ export class IanCenterService extends UntilDestroyedMixin {
return;
}
- this.notificationsService.add({
+ this.toastService.add({
type: 'info',
message: this.I18n.t('js.notifications.center.new_notifications.message'),
link: {
diff --git a/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts b/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts
index 78dc75183ee..35d5fedb61d 100644
--- a/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts
+++ b/frontend/src/app/features/job-status/job-status-modal/job-status.modal.ts
@@ -14,7 +14,7 @@ import {
} from 'core-app/core/loading-indicator/loading-indicator.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { JobStatusEnum, JobStatusInterface } from 'core-app/features/job-status/job-status.interface';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
@Component({
@@ -72,7 +72,7 @@ export class JobStatusModalComponent extends OpModalComponent implements OnInit
readonly pathHelper:PathHelperService,
readonly apiV3Service:APIV3Service,
readonly loadingIndicator:LoadingIndicatorService,
- readonly notifications:NotificationsService,
+ readonly toastService:ToastService,
readonly httpClient:HttpClient) {
super(locals, cdRef, elementRef);
@@ -186,7 +186,7 @@ export class JobStatusModalComponent extends OpModalComponent implements OnInit
this.statusIcon = 'icon-error';
this.message = error?.message || this.I18n.t('js.error.internal');
- this.notifications.addError(this.message);
+ this.toastService.addError(this.message);
}
private get jobUrl():string {
diff --git a/frontend/src/app/features/plugins/plugin-context.ts b/frontend/src/app/features/plugins/plugin-context.ts
index 0014a82adb3..2ef51db0886 100644
--- a/frontend/src/app/features/plugins/plugin-context.ts
+++ b/frontend/src/app/features/plugins/plugin-context.ts
@@ -1,5 +1,5 @@
import { ApplicationRef, Injector, NgZone } from '@angular/core';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ExternalQueryConfigurationService } from 'core-app/features/work-packages/components/wp-table/external-configuration/external-query-configuration.service';
import { OpModalService } from 'core-app/shared/components/modal/modal.service';
@@ -45,7 +45,7 @@ export class OpenProjectPluginContext {
halResource: this.injector.get<HalResourceService>(HalResourceService),
hooks: this.injector.get<HookService>(HookService),
i18n: this.injector.get<I18nService>(I18nService),
- notifications: this.injector.get<NotificationsService>(NotificationsService),
+ notifications: this.injector.get<ToastService>(ToastService),
opModalService: this.injector.get<OpModalService>(OpModalService),
opFileUpload: this.injector.get<OpenProjectFileUploadService>(OpenProjectFileUploadService),
displayField: this.injector.get<DisplayFieldService>(DisplayFieldService),
diff --git a/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts b/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts
index d1bbe8c1b2f..388a84f3798 100644
--- a/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts
+++ b/frontend/src/app/features/user-preferences/notifications-settings/page/notifications-settings-page.component.ts
@@ -20,7 +20,7 @@ import { NotificationSetting } from 'core-app/features/user-preferences/state/no
export const myNotificationsPageComponentSelector = 'op-notifications-page';
-interface INotificationSettingsValue {
+interface IToastSettingsValue {
involved:boolean;
workPackageCreated:boolean;
workPackageProcessed:boolean;
@@ -29,14 +29,14 @@ interface INotificationSettingsValue {
workPackageCommented:boolean;
}
-interface IProjectNotificationSettingsValue extends INotificationSettingsValue {
+interface IProjectNotificationSettingsValue extends IToastSettingsValue {
project:{
title:string;
href:string;
};
}
-interface IFullNotificationSettingsValue extends INotificationSettingsValue {
+interface IFullNotificationSettingsValue extends IToastSettingsValue {
projectSettings:IProjectNotificationSettingsValue[];
}
diff --git a/frontend/src/app/features/user-preferences/state/user-preferences.service.ts b/frontend/src/app/features/user-preferences/state/user-preferences.service.ts
index f7e5e006e59..14c6186f49b 100644
--- a/frontend/src/app/features/user-preferences/state/user-preferences.service.ts
+++ b/frontend/src/app/features/user-preferences/state/user-preferences.service.ts
@@ -1,7 +1,6 @@
-import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { Apiv3UserPreferencesPaths } from 'core-app/core/apiv3/endpoints/users/apiv3-user-preferences-paths';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { UserPreferencesModel } from 'core-app/features/user-preferences/state/user-preferences.model';
@@ -15,9 +14,8 @@ export class UserPreferencesService {
readonly query = new UserPreferencesQuery(this.store);
constructor(
- private http:HttpClient,
private apiV3Service:APIV3Service,
- private notifications:NotificationsService,
+ private toastService:ToastService,
private I18n:I18nService,
) {
}
@@ -28,7 +26,7 @@ export class UserPreferencesService {
.get()
.subscribe(
(prefs) => this.store.update(prefs),
- (error) => this.notifications.addError(error),
+ (error) => this.toastService.addError(error),
)
.add(
() => this.store.setLoading(false),
@@ -43,9 +41,9 @@ export class UserPreferencesService {
.subscribe(
(prefs) => {
this.store.update(prefs);
- this.notifications.addSuccess(this.I18n.t('js.notice_successful_update'));
+ this.toastService.addSuccess(this.I18n.t('js.notice_successful_update'));
},
- (error) => this.notifications.addError(error),
+ (error) => this.toastService.addError(error),
)
.add(() => this.store.setLoading(false));
}
diff --git a/frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts b/frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts
index 1ad1ea5f2e9..3ad27244a86 100644
--- a/frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts
+++ b/frontend/src/app/features/work-packages/components/work-package-comment/work-package-comment.component.ts
@@ -41,7 +41,7 @@ import {
ViewChild,
} from '@angular/core';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { WorkPackageNotificationService } from 'core-app/features/work-packages/services/notifications/work-package-notification.service';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -89,7 +89,7 @@ export class WorkPackageCommentComponent extends WorkPackageCommentFieldHandler
protected loadingIndicator:LoadingIndicatorService,
protected apiV3Service:APIV3Service,
protected workPackageNotificationService:WorkPackageNotificationService,
- protected NotificationsService:NotificationsService,
+ protected toastService:ToastService,
protected cdRef:ChangeDetectorRef,
protected I18n:I18nService) {
super(elementRef, injector);
@@ -150,7 +150,7 @@ export class WorkPackageCommentComponent extends WorkPackageCommentFieldHandler
indicator.promise = this.commentService.createComment(this.workPackage, this.commentValue)
.then(() => {
this.active = false;
- this.NotificationsService.addSuccess(this.I18n.t('js.work_packages.comment_added'));
+ this.toastService.addSuccess(this.I18n.t('js.work_packages.comment_added'));
void this.wpLinkedActivities.require(this.workPackage, true);
void this
@@ -167,7 +167,7 @@ export class WorkPackageCommentComponent extends WorkPackageCommentFieldHandler
if (error instanceof HalError) {
this.workPackageNotificationService.showError(error.resource, this.workPackage);
} else {
- this.NotificationsService.addError(this.I18n.t('js.work_packages.comment_send_failed'));
+ this.toastService.addError(this.I18n.t('js.work_packages.comment_send_failed'));
}
});
diff --git a/frontend/src/app/features/work-packages/components/wp-activity/comment-service.ts b/frontend/src/app/features/work-packages/components/wp-activity/comment-service.ts
index 7c2eaac5b38..e9ccc0de629 100644
--- a/frontend/src/app/features/work-packages/components/wp-activity/comment-service.ts
+++ b/frontend/src/app/features/work-packages/components/wp-activity/comment-service.ts
@@ -28,7 +28,7 @@
import { Injectable } from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { Subject } from 'rxjs';
import { WorkPackageNotificationService } from 'core-app/features/work-packages/services/notifications/work-package-notification.service';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
@@ -43,7 +43,7 @@ export class CommentService {
constructor(
readonly I18n:I18nService,
private workPackageNotificationService:WorkPackageNotificationService,
- private NotificationsService:NotificationsService,
+ private toastService:ToastService,
) {
}
@@ -68,7 +68,7 @@ export class CommentService {
{ comment },
{ 'Content-Type': 'application/json; charset=UTF-8' },
).then((activity:HalResource) => {
- this.NotificationsService.addSuccess(
+ this.toastService.addSuccess(
this.I18n.t('js.work_packages.comment_updated'),
);
diff --git a/frontend/src/app/features/work-packages/components/wp-edit-form/work-package-filter-values.spec.ts b/frontend/src/app/features/work-packages/components/wp-edit-form/work-package-filter-values.spec.ts
index e721a985c6d..23f5efd9819 100644
--- a/frontend/src/app/features/work-packages/components/wp-edit-form/work-package-filter-values.spec.ts
+++ b/frontend/src/app/features/work-packages/components/wp-edit-form/work-package-filter-values.spec.ts
@@ -41,7 +41,7 @@ import { TypeResource } from 'core-app/features/hal/resources/type-resource';
import { HttpClientModule } from '@angular/common/http';
import { States } from 'core-app/core/states/states.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { UIRouterModule } from '@uirouter/angular';
@@ -67,7 +67,7 @@ describe('WorkPackageFilterValues', () => {
function setupTestBed() {
// noinspection JSIgnoredPromiseFromCall
- TestBed.configureTestingModule({
+ void TestBed.configureTestingModule({
imports: [
UIRouterModule.forRoot({}),
HttpClientModule,
@@ -86,7 +86,7 @@ describe('WorkPackageFilterValues', () => {
OpenProjectDirectFileUploadService,
LoadingIndicatorService,
HalResourceService,
- NotificationsService,
+ ToastService,
HalResourceNotificationService,
SchemaCacheService,
WorkPackageNotificationService,
diff --git a/frontend/src/app/features/work-packages/components/wp-list/wp-list.service.ts b/frontend/src/app/features/work-packages/components/wp-list/wp-list.service.ts
index 1f17440cbec..edabe201e1b 100644
--- a/frontend/src/app/features/work-packages/components/wp-list/wp-list.service.ts
+++ b/frontend/src/app/features/work-packages/components/wp-list/wp-list.service.ts
@@ -33,7 +33,7 @@ import { StateService } from '@uirouter/core';
import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/query-space/isolated-query-space';
import { Injectable } from '@angular/core';
import { UrlParamsHelperService } from 'core-app/features/work-packages/components/wp-query/url-params-helper';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { from, Observable, of } from 'rxjs';
import { input } from 'reactivestates';
@@ -84,7 +84,8 @@ export class WorkPackagesListService {
share(),
);
- constructor(protected NotificationsService:NotificationsService,
+ constructor(
+ protected toastService:ToastService,
readonly I18n:I18nService,
protected UrlParamsHelper:UrlParamsHelperService,
protected authorisationService:AuthorisationService,
@@ -96,8 +97,8 @@ export class WorkPackagesListService {
protected configuration:ConfigurationService,
protected wpTablePagination:WorkPackageViewPaginationService,
protected wpStatesInitialization:WorkPackageStatesInitializationService,
- protected wpListInvalidQueryService:WorkPackagesListInvalidQueryService) {
- }
+ protected wpListInvalidQueryService:WorkPackagesListInvalidQueryService,
+ ) { }
/**
* Stream a query request as a HTTP observable. Each request to this method will
@@ -236,9 +237,9 @@ export class WorkPackagesListService {
.post(query, form)
.toPromise();
- promise
+ void promise
.then((query) => {
- this.NotificationsService.addSuccess(this.I18n.t('js.notice_successful_create'));
+ this.toastService.addSuccess(this.I18n.t('js.notice_successful_create'));
// Reload the query, and then reload the menu
this.reloadQuery(query).subscribe(() => {
@@ -264,9 +265,9 @@ export class WorkPackagesListService {
.delete()
.toPromise();
- promise
+ void promise
.then(() => {
- this.NotificationsService.addSuccess(this.I18n.t('js.notice_successful_delete'));
+ this.toastService.addSuccess(this.I18n.t('js.notice_successful_delete'));
let id;
if (query.project) {
@@ -293,15 +294,15 @@ export class WorkPackagesListService {
.patch(query, form)
.toPromise();
- promise
+ void promise
.then(() => {
- this.NotificationsService.addSuccess(this.I18n.t('js.notice_successful_update'));
+ this.toastService.addSuccess(this.I18n.t('js.notice_successful_update'));
this.$state.go('.', { query_id: query!.id, query_props: null }, { reload: true });
this.states.changes.queries.next(query!.id!);
})
.catch((error:ErrorResource) => {
- this.NotificationsService.addError(error.message);
+ this.toastService.addError(error.message);
});
return promise;
@@ -313,10 +314,10 @@ export class WorkPackagesListService {
.queries
.toggleStarred(query);
- promise.then((query:QueryResource) => {
+ void promise.then((query:QueryResource) => {
this.querySpace.query.putValue(query);
- this.NotificationsService.addSuccess(this.I18n.t('js.notice_successful_update'));
+ this.toastService.addSuccess(this.I18n.t('js.notice_successful_update'));
this.states.changes.queries.next(query.id!);
});
@@ -337,7 +338,7 @@ export class WorkPackagesListService {
}
private updateStatesFromQueryOnPromise(promise:Promise<QueryResource>):Promise<QueryResource> {
- promise
+ void promise
.then((query) => {
this.wpStatesInitialization.initialize(query, query.results);
return query;
@@ -351,7 +352,7 @@ export class WorkPackagesListService {
}
private handleQueryLoadingError(error:ErrorResource, queryProps:any, queryId?:string, projectIdentifier?:string|null):Promise<QueryResource> {
- this.NotificationsService.addError(this.I18n.t('js.work_packages.faulty_query.description'), error.message);
+ this.toastService.addError(this.I18n.t('js.work_packages.faulty_query.description'), error.message);
return new Promise((resolve, reject) => {
this
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.html b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.html
index 5805a5de4b3..6a7cd6ae44e 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.html
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.html
@@ -1,7 +1,7 @@
<div id="detail-panel-watchers">
- <div class="notification-box -error"
+ <div class="op-toast -error"
*ngIf="error">
- <div class="notification-box--content">
+ <div class="op-toast--content">
<p [textContent]="text.loadingError"></p>
</div>
</div>
diff --git a/frontend/src/app/features/work-packages/components/wp-table/embedded/wp-embedded-table.html b/frontend/src/app/features/work-packages/components/wp-table/embedded/wp-embedded-table.html
index 546f0ad512f..541970eb0ca 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/embedded/wp-embedded-table.html
+++ b/frontend/src/app/features/work-packages/components/wp-table/embedded/wp-embedded-table.html
@@ -37,7 +37,7 @@
</div>
</ng-container>
- <div class="notification-box -error" *ngIf="error">
+ <div class="op-toast -error" *ngIf="error">
<span [textContent]="error.message || error"></span>
</div>
</div>
diff --git a/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts b/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts
index fd5d24191d2..d64d50ac0e3 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts
+++ b/frontend/src/app/features/work-packages/components/wp-table/timeline/container/wp-timeline-container.directive.ts
@@ -30,7 +30,7 @@ import {
AfterViewInit, Component, ElementRef, Injector,
} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { INotification, NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { IToast, ToastService } from 'core-app/shared/components/toaster/toast.service';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
import * as moment from 'moment';
import { Moment } from 'moment';
@@ -90,7 +90,7 @@ export class WorkPackageTimelineTableController extends UntilDestroyedMixin impl
public timelineBody:JQuery;
- private selectionParams:{ notification:INotification|null } = {
+ private selectionParams:{ notification:IToast|null } = {
notification: null,
};
@@ -124,7 +124,7 @@ export class WorkPackageTimelineTableController extends UntilDestroyedMixin impl
private elementRef:ElementRef,
private states:States,
public wpTableComponent:WorkPackagesTableComponent,
- private NotificationsService:NotificationsService,
+ private toastService:ToastService,
private wpTableTimeline:WorkPackageViewTimelineService,
private notificationService:WorkPackageNotificationService,
private wpRelations:WorkPackageRelationsService,
@@ -315,7 +315,7 @@ export class WorkPackageTimelineTableController extends UntilDestroyedMixin impl
this._viewParameters.selectionModeStart = null;
if (this.selectionParams.notification) {
- this.NotificationsService.remove(this.selectionParams.notification);
+ this.toastService.remove(this.selectionParams.notification);
}
Mousetrap.unbind('esc');
@@ -335,7 +335,7 @@ export class WorkPackageTimelineTableController extends UntilDestroyedMixin impl
this._viewParameters.selectionModeStart = start;
Mousetrap.bind('esc', () => this.resetSelectionMode());
- this.selectionParams.notification = this.NotificationsService.addNotice(this.text.selectionMode);
+ this.selectionParams.notification = this.toastService.addNotice(this.text.selectionMode);
this.$element.addClass('active-selection-mode');
diff --git a/frontend/src/app/features/work-packages/services/notifications/work-package-notification.service.ts b/frontend/src/app/features/work-packages/services/notifications/work-package-notification.service.ts
index a1399dc83c4..8de507b7ab0 100644
--- a/frontend/src/app/features/work-packages/services/notifications/work-package-notification.service.ts
+++ b/frontend/src/app/features/work-packages/services/notifications/work-package-notification.service.ts
@@ -27,7 +27,7 @@
//++
import { Injectable, Injector } from '@angular/core';
-import { INotification } from 'core-app/shared/components/notifications/notifications.service';
+import { IToast } from 'core-app/shared/components/toaster/toast.service';
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -46,12 +46,12 @@ export class WorkPackageNotificationService extends HalResourceNotificationServi
this.addWorkPackageFullscreenLink(message, resource as any);
- this.NotificationsService.addSuccess(message);
+ this.ToastService.addSuccess(message);
}
protected showCustomError(errorResource:any, resource:WorkPackageResource):boolean {
if (errorResource.errorIdentifier === 'urn:openproject-org:api:v3:errors:UpdateConflict') {
- this.NotificationsService.addError({
+ this.ToastService.addError({
message: errorResource.message,
type: 'error',
link: {
@@ -66,7 +66,7 @@ export class WorkPackageNotificationService extends HalResourceNotificationServi
return super.showCustomError(errorResource, resource);
}
- private addWorkPackageFullscreenLink(message:INotification, resource:WorkPackageResource) {
+ private addWorkPackageFullscreenLink(message:IToast, resource:WorkPackageResource) {
// Don't show the 'Show in full screen' link if we're there already
if (!this.$state.includes('work-packages.show')) {
message.link = {
diff --git a/frontend/src/app/features/work-packages/services/work-package.service.ts b/frontend/src/app/features/work-packages/services/work-package.service.ts
index c136bd9b427..358f1eb8110 100644
--- a/frontend/src/app/features/work-packages/services/work-package.service.ts
+++ b/frontend/src/app/features/work-packages/services/work-package.service.ts
@@ -31,7 +31,7 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { UrlParamsHelperService } from 'core-app/features/work-packages/components/wp-query/url-params-helper';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { HalDeletedEvent, HalEventsService } from 'core-app/features/hal/services/hal-events.service';
@@ -45,7 +45,7 @@ export class WorkPackageService {
private readonly $state:StateService,
private readonly PathHelper:PathHelperService,
private readonly UrlParamsHelper:UrlParamsHelperService,
- private readonly NotificationsService:NotificationsService,
+ private readonly toastService:ToastService,
private readonly I18n:I18nService,
private readonly halEvents:HalEventsService) {
}
@@ -64,7 +64,7 @@ export class WorkPackageService {
if (defaultHandling) {
promise
.then(() => {
- this.NotificationsService.addSuccess(this.text.successful_delete);
+ this.toastService.addSuccess(this.text.successful_delete);
ids.forEach((id) => this.halEvents.push({ _type: 'WorkPackage', id }, { eventType: 'deleted' } as HalDeletedEvent));
diff --git a/frontend/src/app/shared/components/attachments/attachments-upload/attachments-upload.component.ts b/frontend/src/app/shared/components/attachments/attachments-upload/attachments-upload.component.ts
index 248a327c5eb..f74bb2fa4f8 100644
--- a/frontend/src/app/shared/components/attachments/attachments-upload/attachments-upload.component.ts
+++ b/frontend/src/app/shared/components/attachments/attachments-upload/attachments-upload.component.ts
@@ -33,7 +33,7 @@ import {
} from '@angular/core';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { UploadFile } from 'core-app/core/file-upload/op-file-upload.service';
@Component({
@@ -55,7 +55,7 @@ export class AttachmentsUploadComponent implements OnInit {
constructor(readonly I18n:I18nService,
readonly ConfigurationService:ConfigurationService,
- readonly notificationsService:NotificationsService,
+ readonly toastService:ToastService,
protected elementRef:ElementRef,
protected halResourceService:HalResourceService) {
this.text = {
@@ -133,7 +133,7 @@ export class AttachmentsUploadComponent implements OnInit {
if (files.length === 0) {
// If we filtered all files as directories, show a notice
if (countBefore > 0) {
- this.notificationsService.addNotice(this.text.foldersWarning);
+ this.toastService.addNotice(this.text.foldersWarning);
}
return;
diff --git a/frontend/src/app/shared/components/calendar/wp-calendar/wp-calendar.component.ts b/frontend/src/app/shared/components/calendar/wp-calendar/wp-calendar.component.ts
index 70ab8420a4c..525a2119f5e 100644
--- a/frontend/src/app/shared/components/calendar/wp-calendar/wp-calendar.component.ts
+++ b/frontend/src/app/shared/components/calendar/wp-calendar/wp-calendar.component.ts
@@ -11,7 +11,7 @@ import * as moment from 'moment';
import { WorkPackagesListService } from 'core-app/features/work-packages/components/wp-list/wp-list.service';
import { StateService } from '@uirouter/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { DomSanitizer } from '@angular/platform-browser';
import { WorkPackagesListChecksumService } from 'core-app/features/work-packages/components/wp-list/wp-list-checksum.service';
import { OpTitleService } from 'core-app/core/html/op-title.service';
@@ -96,7 +96,7 @@ export class WorkPackagesCalendarController extends UntilDestroyedMixin implemen
readonly titleService:OpTitleService,
private element:ElementRef,
readonly i18n:I18nService,
- readonly notificationsService:NotificationsService,
+ readonly toastService:ToastService,
private sanitizer:DomSanitizer,
private configuration:ConfigurationService) {
super();
@@ -332,7 +332,7 @@ export class WorkPackagesCalendarController extends UntilDestroyedMixin implemen
}
if (this.tooManyResultsText && !this.static) {
- this.notificationsService.addNotice(this.tooManyResultsText);
+ this.toastService.addNotice(this.tooManyResultsText);
}
}
diff --git a/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.directive.ts b/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.directive.ts
index 35c02061173..3fc152275f8 100644
--- a/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.directive.ts
+++ b/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.directive.ts
@@ -27,7 +27,7 @@
//++
import { Component, ElementRef, OnInit } from '@angular/core';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
@@ -44,11 +44,12 @@ export class CopyToClipboardDirective implements OnInit {
private target:JQuery;
- constructor(readonly NotificationsService:NotificationsService,
+ constructor(
+ readonly toastService:ToastService,
readonly elementRef:ElementRef,
readonly I18n:I18nService,
- readonly ConfigurationService:ConfigurationService) {
- }
+ readonly ConfigurationService:ConfigurationService,
+ ) { }
ngOnInit() {
const element = this.elementRef.nativeElement;
@@ -63,10 +64,10 @@ export class CopyToClipboardDirective implements OnInit {
}
addNotification(type:'addSuccess'|'addError', message:string) {
- const notification = this.NotificationsService[type](message);
+ const notification = this.toastService[type](message);
// Remove the notification some time later
- setTimeout(() => this.NotificationsService.remove(notification), 5000);
+ setTimeout(() => this.toastService.remove(notification), 5000);
}
onClick($event:JQuery.TriggeredEvent) {
diff --git a/frontend/src/app/shared/components/datepicker/datepicker.modal.html b/frontend/src/app/shared/components/datepicker/datepicker.modal.html
index 9962e8e0169..fce58a89484 100644
--- a/frontend/src/app/shared/components/datepicker/datepicker.modal.html
+++ b/frontend/src/app/shared/components/datepicker/datepicker.modal.html
@@ -119,8 +119,8 @@
</div>
<ng-container *ngIf="!isSchedulable">
- <div class="notification-box -info">
- <div class="notification-box--content">
+ <div class="op-toast -info">
+ <div class="op-toast--content">
<ng-container *ngIf="isParent">
<p [textContent]="text.isParent"></p>
</ng-container>
diff --git a/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.spec.ts b/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.spec.ts
index 75c110f8e79..c399fcdd30e 100644
--- a/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.spec.ts
+++ b/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.spec.ts
@@ -13,7 +13,7 @@ import { DynamicFormService } from 'core-app/shared/components/dynamic-forms/ser
import { DynamicFieldsService } from 'core-app/shared/components/dynamic-forms/services/dynamic-fields/dynamic-fields.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { TextInputComponent } from 'core-app/shared/components/dynamic-forms/components/dynamic-inputs/text-input/text-input.component';
import { IntegerInputComponent } from 'core-app/shared/components/dynamic-forms/components/dynamic-inputs/integer-input/integer-input.component';
import { SelectInputComponent } from 'core-app/shared/components/dynamic-forms/components/dynamic-inputs/select-input/select-input.component';
@@ -269,11 +269,11 @@ describe('DynamicFormComponent', () => {
};
const apiV3Base = 'http://www.openproject.com/api/v3/';
const IPathHelperServiceStub = { api: { v3: { apiV3Base } } };
- let notificationsService:jasmine.SpyObj<NotificationsService>;
+ let toastService:jasmine.SpyObj<ToastService>;
let dynamicFormService:jasmine.SpyObj<DynamicFormService>;
beforeEach(async () => {
- const notificationsServiceSpy = jasmine.createSpyObj('NotificationsService', ['addError', 'addSuccess']);
+ const toastServiceSpy = jasmine.createSpyObj('ToastService', ['addError', 'addSuccess']);
const dynamicFormServiceSpy = jasmine.createSpyObj('DynamicFormService', ['getSettings', 'getSettingsFromBackend$', 'registerForm', 'submit$']);
const confirmDialogServiceSpy = jasmine.createSpyObj('ConfirmDialogService', ['confirm']);
@@ -323,7 +323,7 @@ describe('DynamicFormComponent', () => {
DynamicFieldsService,
{ provide: I18nService, useValue: I18nServiceStub },
{ provide: PathHelperService, useValue: IPathHelperServiceStub },
- { provide: NotificationsService, useValue: notificationsServiceSpy },
+ { provide: ToastService, useValue: toastServiceSpy },
{ provide: ConfirmDialogService, useValue: confirmDialogServiceSpy },
],
})
@@ -350,7 +350,7 @@ describe('DynamicFormComponent', () => {
fixture = TestBed.createComponent(DynamicFormComponent);
component = fixture.componentInstance;
- notificationsService = fixture.debugElement.injector.get(NotificationsService) as jasmine.SpyObj<NotificationsService>;
+ toastService = fixture.debugElement.injector.get(ToastService) as jasmine.SpyObj<ToastService>;
dynamicFormService = fixture.debugElement.injector.get(DynamicFormService) as jasmine.SpyObj<DynamicFormService>;
});
@@ -429,7 +429,7 @@ describe('DynamicFormComponent', () => {
flush();
expect(dynamicFormService.submit$).toHaveBeenCalled();
- expect(notificationsService.addSuccess).not.toHaveBeenCalled();
+ expect(toastService.addSuccess).not.toHaveBeenCalled();
// Should not show notifications when showNotifications === true
component.showNotifications = true;
@@ -442,7 +442,7 @@ describe('DynamicFormComponent', () => {
flush();
expect(dynamicFormService.submit$).toHaveBeenCalled();
- expect(notificationsService.addSuccess).toHaveBeenCalled();
+ expect(toastService.addSuccess).toHaveBeenCalled();
dynamicFormService.submit$.and.returnValue(defer(() => {
throw new Error('Error');
@@ -452,7 +452,7 @@ describe('DynamicFormComponent', () => {
flush();
- expect(notificationsService.addError).toHaveBeenCalled();
+ expect(toastService.addError).toHaveBeenCalled();
dynamicFormService.submit$.and.returnValue(defer(() => Promise.resolve('ok')));
}));
diff --git a/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.ts b/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.ts
index 09fd810129c..7f0ce692c66 100644
--- a/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.ts
+++ b/frontend/src/app/shared/components/dynamic-forms/components/dynamic-form/dynamic-form.component.ts
@@ -13,7 +13,7 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { catchError, finalize } from 'rxjs/operators';
import { HalSource } from 'core-app/features/hal/resources/hal-resource';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { DynamicFieldsService } from 'core-app/shared/components/dynamic-forms/services/dynamic-fields/dynamic-fields.service';
import { FormGroup } from '@angular/forms';
import { HttpErrorResponse } from '@angular/common/http';
@@ -152,7 +152,7 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements OnChang
return;
}
- const formattedModel = this._dynamicFormService.formatModelToEdit(payload);
+ const formattedModel = this.dynamicFormService.formatModelToEdit(payload);
this.form.patchValue(formattedModel);
}
@@ -186,12 +186,12 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements OnChang
inFlight:boolean;
text = {
- save: this._I18n.t('js.button_save'),
- cancel: this._I18n.t('js.button_cancel'),
- load_error_message: this._I18n.t('js.forms.load_error_message'),
- successful_update: this._I18n.t('js.notice_successful_update'),
- successful_create: this._I18n.t('js.notice_successful_create'),
- job_started: this._I18n.t('js.notice_job_started'),
+ save: this.I18n.t('js.button_save'),
+ cancel: this.I18n.t('js.button_cancel'),
+ load_error_message: this.I18n.t('js.forms.load_error_message'),
+ successful_update: this.I18n.t('js.notice_successful_update'),
+ successful_create: this.I18n.t('js.notice_successful_create'),
+ job_started: this.I18n.t('js.notice_job_started'),
};
noSettingsSourceErrorMessage = `DynamicFormComponent needs a settings, formUrl or resourcePath @Input
@@ -208,17 +208,17 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements OnChang
@ViewChild(FormlyForm)
set dynamicForm(dynamicForm:FormlyForm) {
- this._dynamicFormService.registerForm(dynamicForm);
+ this.dynamicFormService.registerForm(dynamicForm);
}
constructor(
- private _dynamicFormService:DynamicFormService,
- private _dynamicFieldsService:DynamicFieldsService,
- private _I18n:I18nService,
- private _pathHelperService:PathHelperService,
- private _notificationsService:NotificationsService,
- private _changeDetectorRef:ChangeDetectorRef,
- private _confirmDialogService:ConfirmDialogService,
+ private dynamicFormService:DynamicFormService,
+ private dynamicFieldsService:DynamicFieldsService,
+ private I18n:I18nService,
+ private pathHelperService:PathHelperService,
+ private toastService:ToastService,
+ private changeDetectorRef:ChangeDetectorRef,
+ private confirmDialogService:ConfirmDialogService,
) {
super();
}
@@ -263,7 +263,7 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements OnChang
}
this.inFlight = true;
- this._dynamicFormService
+ this.dynamicFormService
.submit$(form, this.formEndpoint, this.resourceId, this.formHttpMethod)
.pipe(
finalize(() => this.inFlight = false),
@@ -275,7 +275,7 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements OnChang
},
(error:HttpErrorResponse) => {
this.errored.emit(error?.error || error);
- this.showNotifications && this._notificationsService.addError(error?.error?.message || error?.message);
+ this.showNotifications && this.toastService.addError(error?.error?.message || error?.message);
},
);
}
@@ -285,15 +285,15 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements OnChang
throw new Error(this.noPathToSubmitToError);
}
- return this._dynamicFormService.validateForm$(this.form, this.formEndpoint);
+ return this.dynamicFormService.validateForm$(this.form, this.formEndpoint);
}
handleCancel() {
if (this.form.dirty) {
- this._confirmDialogService.confirm({
+ this.confirmDialogService.confirm({
text: {
- title: this._I18n.t('js.text_are_you_sure'),
- text: this._I18n.t('js.text_data_lost'),
+ title: this.I18n.t('js.text_are_you_sure'),
+ text: this.I18n.t('js.text_data_lost'),
},
}).then(() => {
this.goBack();
@@ -347,11 +347,11 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements OnChang
}
private setupDynamicFormFromBackend(formEndpoint?:string, resourceId?:string, payload?:Object) {
- this._dynamicFormService
+ this.dynamicFormService
.getSettingsFromBackend$(formEndpoint, resourceId, payload)
.pipe(
catchError((error) => {
- this._notificationsService.addError(this.text.load_error_message);
+ this.toastService.addError(this.text.load_error_message);
throw error;
}),
)
@@ -365,7 +365,7 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements OnChang
schema: settings?.schema,
},
};
- const dynamicFormSettings = this._dynamicFormService.getSettings(formattedSettings);
+ const dynamicFormSettings = this.dynamicFormService.getSettings(formattedSettings);
this.setupDynamicForm(dynamicFormSettings);
}
@@ -376,27 +376,27 @@ export class DynamicFormComponent extends UntilDestroyedMixin implements OnChang
}
if (this.fieldGroups) {
- fields = this._dynamicFieldsService.getFormlyFormWithFieldGroups(this.fieldGroups, fields);
+ fields = this.dynamicFieldsService.getFormlyFormWithFieldGroups(this.fieldGroups, fields);
}
this.fields = fields;
this.innerModel = model;
this.form = this.dynamicFormGroup || form;
- this._changeDetectorRef.detectChanges();
+ this.changeDetectorRef.detectChanges();
}
private showSuccessNotification(formResponse:HalSource|any):void {
- let submit_message;
+ const submitMessage = (() => {
+ if (formResponse?.jobId) {
+ const title = formResponse?.payload?.title;
- if (formResponse?.jobId) {
- const title = formResponse?.payload?.title;
+ return `${title || ''} ${this.text.job_started}`;
+ } else {
+ return this.formHttpMethod === 'patch' ? this.text.successful_update : this.text.successful_create;
+ }
+ })();
- submit_message = `${title || ''} ${this.text.job_started}`;
- } else {
- submit_message = this.formHttpMethod === 'patch' ? this.text.successful_update : this.text.successful_create;
- }
-
- this._notificationsService.addSuccess(submit_message);
+ this.toastService.addSuccess(submitMessage);
}
}
diff --git a/frontend/src/app/shared/components/dynamic-forms/spec/helpers.ts b/frontend/src/app/shared/components/dynamic-forms/spec/helpers.ts
index 0210297ea85..8a6b4ceacbb 100644
--- a/frontend/src/app/shared/components/dynamic-forms/spec/helpers.ts
+++ b/frontend/src/app/shared/components/dynamic-forms/spec/helpers.ts
@@ -20,7 +20,7 @@ import { FormattableControlComponent } from 'core-app/shared/components/dynamic-
import { OpCkeditorComponent } from 'core-app/shared/components/editor/components/ckeditor/op-ckeditor.component';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
import { CKEditorSetupService } from 'core-app/shared/components/editor/components/ckeditor/ckeditor-setup.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { OpFormFieldComponent } from 'core-app/shared/components/forms/form-field/form-field.component';
export function createDynamicInputFixture(fields:IOPFormlyFieldSettings[], model:any, providers?:any[]):ComponentFixture<any> {
@@ -45,7 +45,7 @@ export function createDynamicInputFixture(fields:IOPFormlyFieldSettings[], model
@ViewChild(FormlyForm) dynamicForm:FormlyForm;
}
- const notificationsServiceSpy = jasmine.createSpyObj('NotificationsService', ['addError', 'addSuccess']);
+ const toastServiceSpy = jasmine.createSpyObj('ToastService', ['addError', 'addSuccess']);
TestBed
.configureTestingModule({
@@ -93,7 +93,7 @@ export function createDynamicInputFixture(fields:IOPFormlyFieldSettings[], model
set: {
providers: [
CKEditorSetupService,
- { provide: NotificationsService, useValue: notificationsServiceSpy },
+ { provide: ToastService, useValue: toastServiceSpy },
{
provide: NG_VALUE_ACCESSOR,
multi: true,
diff --git a/frontend/src/app/shared/components/editor/components/ckeditor-augmented-textarea/ckeditor-augmented-textarea.component.ts b/frontend/src/app/shared/components/editor/components/ckeditor-augmented-textarea/ckeditor-augmented-textarea.component.ts
index c9200bccbec..c79633ce124 100644
--- a/frontend/src/app/shared/components/editor/components/ckeditor-augmented-textarea/ckeditor-augmented-textarea.component.ts
+++ b/frontend/src/app/shared/components/editor/components/ckeditor-augmented-textarea/ckeditor-augmented-textarea.component.ts
@@ -35,7 +35,7 @@ import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
import { States } from 'core-app/core/states/states.service';
import { filter, takeUntil } from 'rxjs/operators';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import {
ICKEditorType,
@@ -90,7 +90,7 @@ export class CkeditorAugmentedTextareaComponent extends UntilDestroyedMixin impl
constructor(protected elementRef:ElementRef,
protected pathHelper:PathHelperService,
protected halResourceService:HalResourceService,
- protected Notifications:NotificationsService,
+ protected Notifications:ToastService,
protected I18n:I18nService,
protected states:States,
protected ConfigurationService:ConfigurationService) {
diff --git a/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.component.ts b/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.component.ts
index 4901799cb1d..4b0922b1d9a 100644
--- a/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.component.ts
+++ b/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.component.ts
@@ -29,7 +29,7 @@
import {
Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild,
} from '@angular/core';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
import {
@@ -109,7 +109,7 @@ export class OpCkeditorComponent implements OnInit, OnDestroy {
private $element:JQuery;
constructor(private readonly elementRef:ElementRef,
- private readonly Notifications:NotificationsService,
+ private readonly Notifications:ToastService,
private readonly I18n:I18nService,
private readonly configurationService:ConfigurationService,
private readonly ckEditorSetup:CKEditorSetupService) {
diff --git a/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.html b/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.html
index 2ba39af067d..3c6873bcc94 100644
--- a/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.html
+++ b/frontend/src/app/shared/components/editor/components/ckeditor/op-ckeditor.html
@@ -1,6 +1,6 @@
<ng-container>
- <div *ngIf="error" class="notification-box -error">
- <div class="notification-box--content">
+ <div *ngIf="error" class="op-toast -error">
+ <div class="op-toast--content">
<p>
<strong [textContent]="text.errorTitle"></strong>
<br/>
diff --git a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.sass b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.sass
index a761ff7c8bd..a286ae243f2 100644
--- a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.sass
+++ b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.sass
@@ -1,8 +1,8 @@
.op-enterprise-banner
- .notification-box
+ .op-toast
&.-left-margin
margin-left: 1.25rem
- .notification-box--content p
+ .op-toast--content p
margin-bottom: 10px
diff --git a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts
index cca0e5c1a49..fb3ed2977db 100644
--- a/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts
+++ b/frontend/src/app/shared/components/enterprise-banner/enterprise-banner.component.ts
@@ -7,9 +7,9 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
styleUrls: ['./enterprise-banner.component.sass'],
template: `
<div class="op-enterprise-banner">
- <div class="notification-box -ee-upsale"
+ <div class="op-toast -ee-upsale"
[ngClass]="{'-left-margin': leftMargin }">
- <div class="notification-box--content">
+ <div class="op-toast--content">
<p class="-bold" [textContent]="text.enterpriseFeature"></p>
<p [textContent]="textMessage"></p>
<a [href]="eeLink()"
diff --git a/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.ts b/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.ts
index 46491d92000..b8568b4d78c 100644
--- a/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.ts
+++ b/frontend/src/app/shared/components/fields/edit/field/editable-attribute-field.component.ts
@@ -41,7 +41,7 @@ import {
} from '@angular/core';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
import { OPContextMenuService } from 'core-app/shared/components/op-context-menu/op-context-menu.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { getPosition } from 'core-app/shared/helpers/set-click-position/set-click-position';
import { EditFormComponent } from 'core-app/shared/components/fields/edit/edit-form/edit-form.component';
@@ -98,7 +98,6 @@ export class EditableAttributeFieldComponent extends UntilDestroyedMixin impleme
protected schemaCache:SchemaCacheService,
// Get parent field group from injector if we're in a form
@Optional() protected editForm:EditFormComponent,
- protected NotificationsService:NotificationsService,
protected cdRef:ChangeDetectorRef,
protected I18n:I18nService) {
super();
diff --git a/frontend/src/app/shared/components/grids/grid/area.service.ts b/frontend/src/app/shared/components/grids/grid/area.service.ts
index 2cab8d40751..00252bacb8c 100644
--- a/frontend/src/app/shared/components/grids/grid/area.service.ts
+++ b/frontend/src/app/shared/components/grids/grid/area.service.ts
@@ -6,7 +6,7 @@ import { GridResource } from 'core-app/features/hal/resources/grid-resource';
import { GridWidgetResource } from 'core-app/features/hal/resources/grid-widget-resource';
import { SchemaResource } from 'core-app/features/hal/resources/schema-resource';
import { WidgetChangeset } from 'core-app/shared/components/grids/widgets/widget-changeset';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { BehaviorSubject } from 'rxjs';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
@@ -37,7 +37,7 @@ export class GridAreaService {
public helpMode = false;
constructor(private apiV3Service:APIV3Service,
- private notification:NotificationsService,
+ private toastService:ToastService,
private i18n:I18nService) { }
public set gridResource(value:GridResource) {
@@ -158,7 +158,7 @@ export class GridAreaService {
.patch(resource, schema)
.subscribe((updatedGrid) => {
this.assignAreasWidget(updatedGrid);
- this.notification.addSuccess(this.i18n.t('js.notice_successful_update'));
+ this.toastService.addSuccess(this.i18n.t('js.notice_successful_update'));
});
}
diff --git a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts
index 0a41de070b4..439ad4c7db2 100644
--- a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts
+++ b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts
@@ -10,7 +10,7 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
import * as URI from 'urijs';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { LoadingIndicatorService } from 'core-app/core/loading-indicator/loading-indicator.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { JobStatusModalComponent } from 'core-app/features/job-status/job-status-modal/job-status.modal';
import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/query-space/isolated-query-space';
import { OpModalLocalsToken } from 'core-app/shared/components/modal/modal.service';
@@ -53,7 +53,7 @@ export class WpTableExportModalComponent extends OpModalComponent implements OnI
readonly httpClient:HttpClient,
readonly wpTableColumns:WorkPackageViewColumnsService,
readonly loadingIndicator:LoadingIndicatorService,
- readonly notifications:NotificationsService) {
+ readonly toastService:ToastService) {
super(locals, cdRef, elementRef);
}
@@ -119,7 +119,7 @@ export class WpTableExportModalComponent extends OpModalComponent implements OnI
}
private showError(error:HttpErrorResponse) {
- this.notifications.addError(error.message || this.I18n.t('js.error.internal'));
+ this.toastService.addError(error.message || this.I18n.t('js.error.internal'));
}
private addColumnsToHref(href:string) {
diff --git a/frontend/src/app/shared/components/modals/save-modal/save-query.modal.ts b/frontend/src/app/shared/components/modals/save-modal/save-query.modal.ts
index 66b3c94a0ac..7026d31216e 100644
--- a/frontend/src/app/shared/components/modals/save-modal/save-query.modal.ts
+++ b/frontend/src/app/shared/components/modals/save-modal/save-query.modal.ts
@@ -31,7 +31,7 @@ import {
} from '@angular/core';
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service';
import { QueryResource } from 'core-app/features/hal/resources/query-resource';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { OpModalComponent } from 'core-app/shared/components/modal/modal.component';
import { OpModalLocalsToken } from 'core-app/shared/components/modal/modal.service';
import { OpModalLocalsMap } from 'core-app/shared/components/modal/modal.types';
@@ -74,7 +74,7 @@ export class SaveQueryModalComponent extends OpModalComponent {
readonly wpListService:WorkPackagesListService,
readonly halNotification:HalResourceNotificationService,
readonly cdRef:ChangeDetectorRef,
- readonly notificationsService:NotificationsService) {
+ readonly toastService:ToastService) {
super(locals, cdRef, elementRef);
}
diff --git a/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.ts b/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.ts
index 28d924b953e..17062094534 100644
--- a/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.ts
+++ b/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.ts
@@ -30,7 +30,7 @@ import { WorkPackagesListService } from 'core-app/features/work-packages/compone
import { States } from 'core-app/core/states/states.service';
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service';
import { QueryResource } from 'core-app/features/hal/resources/query-resource';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { OpModalComponent } from 'core-app/shared/components/modal/modal.component';
import { OpModalLocalsToken } from 'core-app/shared/components/modal/modal.service';
import { OpModalLocalsMap } from 'core-app/shared/components/modal/modal.types';
@@ -72,7 +72,7 @@ export class QuerySharingModalComponent extends OpModalComponent implements OnIn
readonly cdRef:ChangeDetectorRef,
readonly wpListService:WorkPackagesListService,
readonly halNotification:HalResourceNotificationService,
- readonly notificationsService:NotificationsService) {
+ readonly toastService:ToastService) {
super(locals, cdRef, elementRef);
}
@@ -119,7 +119,7 @@ export class QuerySharingModalComponent extends OpModalComponent implements OnIn
this.isBusy = false;
})
.catch(() => {
- this.notificationsService.addError(this.I18n.t('js.errors.query_saving'));
+ this.toastService.addError(this.I18n.t('js.errors.query_saving'));
this.isBusy = false;
});
}
diff --git a/frontend/src/app/shared/components/op-context-menu/handlers/wp-status-dropdown-menu.directive.ts b/frontend/src/app/shared/components/op-context-menu/handlers/wp-status-dropdown-menu.directive.ts
index 4ed98abf05a..fa3067fc725 100644
--- a/frontend/src/app/shared/components/op-context-menu/handlers/wp-status-dropdown-menu.directive.ts
+++ b/frontend/src/app/shared/components/op-context-menu/handlers/wp-status-dropdown-menu.directive.ts
@@ -37,7 +37,7 @@ import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { CollectionResource } from 'core-app/features/hal/resources/collection-resource';
import { Highlighting } from 'core-app/features/work-packages/components/wp-fast-table/builders/highlighting/highlighting.functions';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { HalEventsService } from 'core-app/features/hal/services/hal-events.service';
import { WorkPackageNotificationService } from 'core-app/features/work-packages/services/notifications/work-package-notification.service';
import isNewResource from 'core-app/features/hal/helpers/is-new-resource';
@@ -53,7 +53,7 @@ export class WorkPackageStatusDropdownDirective extends OpContextMenuTrigger {
readonly $state:StateService,
protected workPackageNotificationService:WorkPackageNotificationService,
protected halEditing:HalResourceEditingService,
- protected notificationService:NotificationsService,
+ protected toastService:ToastService,
protected I18n:I18nService,
protected halEvents:HalEventsService) {
super(elementRef, opContextMenu);
@@ -68,7 +68,7 @@ export class WorkPackageStatusDropdownDirective extends OpContextMenuTrigger {
const { writable } = change.schema.status;
if (!writable) {
- this.notificationService.addError(this.I18n.t('js.work_packages.message_work_package_status_blocked'));
+ this.toastService.addError(this.I18n.t('js.work_packages.message_work_package_status_blocked'));
} else {
this.opContextMenu.show(this, evt);
}
diff --git a/frontend/src/app/shared/components/persistent-toggle/persistent-toggle.component.ts b/frontend/src/app/shared/components/persistent-toggle/persistent-toggle.component.ts
index 4faedd9a386..51150ee8aaa 100644
--- a/frontend/src/app/shared/components/persistent-toggle/persistent-toggle.component.ts
+++ b/frontend/src/app/shared/components/persistent-toggle/persistent-toggle.component.ts
@@ -65,16 +65,16 @@ export class PersistentToggleComponent implements OnInit {
.find('.persistent-toggle--click-handler')
.on('click', () => this.toggle(!this.isHidden));
- // Register target notification close icon
+ // Register target toaster close icon
this.$targetNotification
- .find('.notification-box--close')
+ .find('.op-toast--close')
.on('click', () => this.toggle(true));
}
private getTargetNotification() {
return this.$element
.parent()
- .find('.persistent-toggle--notification');
+ .find('.persistent-toggle--toaster');
}
private toggle(isNowHidden:boolean) {
diff --git a/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts b/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts
index 436edfda79b..000f66166ea 100644
--- a/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts
+++ b/frontend/src/app/shared/components/time_entries/edit/trigger-actions-entry.component.ts
@@ -4,7 +4,7 @@ import {
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { TimeEntryEditService } from 'core-app/shared/components/time_entries/edit/edit.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { HalResourceEditingService } from 'core-app/shared/components/fields/edit/services/hal-resource-editing.service';
import { APIV3Service } from 'core-app/core/apiv3/api-v3.service';
import { TimeEntryResource } from 'core-app/features/hal/resources/time-entry-resource';
@@ -36,7 +36,7 @@ export class TriggerActionsEntryComponent {
@InjectField() readonly apiv3Service:APIV3Service;
- @InjectField() readonly notificationsService:NotificationsService;
+ @InjectField() readonly toastService:ToastService;
@InjectField() readonly elementRef:ElementRef;
@@ -82,7 +82,7 @@ export class TriggerActionsEntryComponent {
.delete()
.subscribe(
() => window.location.reload(),
- (error) => this.notificationsService.addError(error || this.text.error),
+ (error) => this.toastService.addError(error || this.text.error),
);
});
}
diff --git a/frontend/src/app/shared/components/notifications/notification.component.html b/frontend/src/app/shared/components/toaster/toast.component.html
similarity index 68%
rename from frontend/src/app/shared/components/notifications/notification.component.html
rename to frontend/src/app/shared/components/toaster/toast.component.html
index 7401acfc1f7..18029b025bc 100644
--- a/frontend/src/app/shared/components/notifications/notification.component.html
+++ b/frontend/src/app/shared/components/toaster/toast.component.html
@@ -1,12 +1,12 @@
-<div class="notification-box -{{ type }}" tabindex="0">
- <div class="notification-box--content" role="alert" aria-atomic="true">
+<div class="op-toast -{{ type }}" tabindex="0">
+ <div class="op-toast--content" role="alert" aria-atomic="true">
<p>
- <span [textContent]="notification.message"></span>
+ <span [textContent]="toast.message"></span>
<span [textContent]="' '"></span>
- <a class="notification-box--target-link"
- *ngIf="notification.link"
+ <a class="op-toast--target-link"
+ *ngIf="toast.link"
(click)="executeTarget($event)"
- [textContent]="notification.link!.text">
+ [textContent]="toast.link!.text">
</a>
</p>
<div [ngSwitch]="type">
@@ -21,19 +21,19 @@
<span [textContent]="uploadText"></span>
</div>
<div [ngClass]="{ '-hidden': !show && canBeHidden() }">
- <ul class="notification-box--uploads" *ngIf="data && data.length > 0">
- <notifications-upload-progress
+ <ul class="op-toast--uploads" *ngIf="data && data.length > 0">
+ <op-toasters-upload-progress
*ngFor="let upload of data"
[upload]="upload"
(onSuccess)="onUploadSuccess()"
(onError)="onUploadError($event)">
- </notifications-upload-progress>
+ </op-toasters-upload-progress>
</ul>
</div>
</div>
<div *ngSwitchCase="'success'"></div>
<div *ngSwitchCase="'error'">
- <ul class="notification-box--errors">
+ <ul class="op-toast--errors">
<li *ngFor="let error of data" [textContent]="error"></li>
</ul>
</div>
@@ -42,7 +42,7 @@
<button
*ngIf="removable()"
type="button"
- class="op-link notification-box--close"
+ class="op-link op-toast--close"
[title]="text.close_popup"
(click)="remove()"
>
diff --git a/frontend/src/app/shared/components/notifications/notification.component.ts b/frontend/src/app/shared/components/toaster/toast.component.ts
similarity index 76%
rename from frontend/src/app/shared/components/notifications/notification.component.ts
rename to frontend/src/app/shared/components/toaster/toast.component.ts
index 663f0ed014e..28c52e53e99 100644
--- a/frontend/src/app/shared/components/notifications/notification.component.ts
+++ b/frontend/src/app/shared/components/toaster/toast.component.ts
@@ -31,39 +31,39 @@ import {
} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import {
- INotification,
- NotificationsService,
- NotificationType,
-} from 'core-app/shared/components/notifications/notifications.service';
+ IToast,
+ ToastService,
+ ToastType,
+} from './toast.service';
@Component({
- templateUrl: './notification.component.html',
+ templateUrl: './toast.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
- selector: 'notification',
+ selector: 'op-toast',
})
-export class NotificationComponent implements OnInit {
- @Input() public notification:INotification;
+export class ToastComponent implements OnInit {
+ @Input() public toast:IToast;
public text = {
close_popup: this.I18n.t('js.close_popup_title'),
};
- public type:NotificationType;
+ public type:ToastType;
public uploadCount = 0;
public show = false;
constructor(readonly I18n:I18nService,
- readonly notificationsService:NotificationsService) {
+ readonly toastService:ToastService) {
}
ngOnInit() {
- this.type = this.notification.type;
+ this.type = this.toast.type;
}
public get data() {
- return this.notification.data;
+ return this.toast.data;
}
public canBeHidden() {
@@ -71,20 +71,20 @@ export class NotificationComponent implements OnInit {
}
public removable() {
- return this.notification.type !== 'upload';
+ return this.toast.type !== 'upload';
}
public remove() {
- this.notificationsService.remove(this.notification);
+ this.toastService.remove(this.toast);
}
/**
* Execute the link callback from content.link.target
- * and close this notification.
+ * and close this toaster.
*/
public executeTarget() {
- if (this.notification.link) {
- this.notification.link.target();
+ if (this.toast.link) {
+ this.toast.link.target();
this.remove();
}
}
diff --git a/frontend/src/app/shared/components/notifications/notifications.service.spec.ts b/frontend/src/app/shared/components/toaster/toast.service.spec.ts
similarity index 63%
rename from frontend/src/app/shared/components/notifications/notifications.service.spec.ts
rename to frontend/src/app/shared/components/toaster/toast.service.spec.ts
index 9214f8315d5..fe0a26e117d 100644
--- a/frontend/src/app/shared/components/notifications/notifications.service.spec.ts
+++ b/frontend/src/app/shared/components/toaster/toast.service.spec.ts
@@ -27,13 +27,13 @@
//++
import { TestBed, waitForAsync } from '@angular/core/testing';
-import { NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
+import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { OpenprojectHalModule } from 'core-app/features/hal/openproject-hal.module';
-describe('NotificationsService', () => {
- let notificationsService:NotificationsService;
+describe('ToastService', () => {
+ let toastService:ToastService;
beforeEach(waitForAsync(() => {
// noinspection JSIgnoredPromiseFromCall
@@ -44,24 +44,24 @@ describe('NotificationsService', () => {
providers: [
{ provide: ConfigurationService, useValue: { autoHidePopups: () => true } },
I18nService,
- NotificationsService,
+ ToastService,
],
})
.compileComponents()
.then(() => {
- notificationsService = TestBed.inject(NotificationsService);
+ toastService = TestBed.inject(ToastService);
});
}));
it('should be able to create warnings', () => {
- const notification = notificationsService.addWarning('warning!');
+ const toaster = toastService.addWarning('warning!');
- expect(notification).toEqual({ message: 'warning!', type: 'warning' });
+ expect(toaster).toEqual({ message: 'warning!', type: 'warning' });
});
it('should be able to create error messages with errors', () => {
- const notification = notificationsService.addError('a super cereal error', ['fooo', 'baarr']);
- expect(notification).toEqual({
+ const toaster = toastService.addError('a super cereal error', ['fooo', 'baarr']);
+ expect(toaster).toEqual({
message: 'a super cereal error',
data: ['fooo', 'baarr'],
type: 'error',
@@ -69,8 +69,8 @@ describe('NotificationsService', () => {
});
it('should be able to create error messages with only a message', () => {
- const notification = notificationsService.addError('a super cereal error');
- expect(notification).toEqual({
+ const toaster = toastService.addError('a super cereal error');
+ expect(toaster).toEqual({
message: 'a super cereal error',
data: [],
type: 'error',
@@ -78,8 +78,8 @@ describe('NotificationsService', () => {
});
it('should be able to create upload messages with uploads', () => {
- const notification = notificationsService.addAttachmentUpload('uploading...', [0, 1, 2] as any);
- expect(notification).toEqual({
+ const toaster = toastService.addAttachmentUpload('uploading...', [0, 1, 2] as any);
+ expect(toaster).toEqual({
message: 'uploading...',
type: 'upload',
data: [0, 1, 2],
@@ -88,30 +88,30 @@ describe('NotificationsService', () => {
it('should throw an Error if trying to create an upload with uploads = null', () => {
expect(() => {
- notificationsService.addAttachmentUpload('themUploads', null as any);
+ toastService.addAttachmentUpload('themUploads', null as any);
}).toThrow();
});
it('should throw an Error if trying to create an upload without uploads', () => {
expect(() => {
- notificationsService.addAttachmentUpload('themUploads', []);
+ toastService.addAttachmentUpload('themUploads', []);
}).toThrow();
});
- it('sends a broadcast to remove the first notification upon adding a second success notification',
+ it('sends a broadcast to remove the first toaster upon adding a second success toaster',
() => {
- const firstNotification = notificationsService.addSuccess('blubs');
- expect(notificationsService.current.value!.length).toEqual(1);
+ const firstToast = toastService.addSuccess('blubs');
+ expect(toastService.current.value!.length).toEqual(1);
- notificationsService.addSuccess('blubs2');
- expect(notificationsService.current.value!.length).toEqual(1);
+ toastService.addSuccess('blubs2');
+ expect(toastService.current.value!.length).toEqual(1);
});
- it('sends a broadcast to remove the first notification upon adding a second error notification',
+ it('sends a broadcast to remove the first toaster upon adding a second error toaster',
() => {
- const firstNotification = notificationsService.addSuccess('blubs');
- notificationsService.addError('blubs2');
+ const firstToast = toastService.addSuccess('blubs');
+ toastService.addError('blubs2');
- expect(notificationsService.current.value!.length).toEqual(1);
+ expect(toastService.current.value!.length).toEqual(1);
});
});
diff --git a/frontend/src/app/shared/components/notifications/notifications.service.ts b/frontend/src/app/shared/components/toaster/toast.service.ts
similarity index 56%
rename from frontend/src/app/shared/components/notifications/notifications.service.ts
rename to frontend/src/app/shared/components/toaster/toast.service.ts
index ec35cef82ee..6c9d86f2a08 100644
--- a/frontend/src/app/shared/components/notifications/notifications.service.ts
+++ b/frontend/src/app/shared/components/toaster/toast.service.ts
@@ -43,56 +43,56 @@ export function removeSuccessFlashMessages() {
jQuery('.flash.notice').remove();
}
-export type NotificationType = 'success'|'error'|'warning'|'info'|'upload';
-export const OPNotificationEvent = 'op:notifications:add';
+export type ToastType = 'success'|'error'|'warning'|'info'|'upload';
+export const OPToastEvent = 'op:toasters:add';
-export interface INotification {
+export interface IToast {
message:string;
link?:{ text:string, target:Function };
- type:NotificationType;
+ type:ToastType;
data?:any;
}
@Injectable({ providedIn: 'root' })
-export class NotificationsService {
- // The current stack of notifications
- private stack = input<INotification[]>([]);
+export class ToastService {
+ // The current stack of toasters
+ private stack = input<IToast[]>([]);
constructor(readonly configurationService:ConfigurationService) {
jQuery(window)
- .on(OPNotificationEvent,
- (event:JQuery.TriggeredEvent, notification:INotification) => {
- this.add(notification);
+ .on(OPToastEvent,
+ (event:JQuery.TriggeredEvent, toast:IToast) => {
+ this.add(toast);
});
}
/**
- * Get a read-only view of the current stack of notifications.
+ * Get a read-only view of the current stack of toasters.
*/
- public get current():State<INotification[]> {
+ public get current():State<IToast[]> {
return this.stack;
}
- public add(notification:INotification, timeoutAfter = 5000):INotification {
+ public add(toast:IToast, timeoutAfter = 5000):IToast {
// Remove flash messages
removeSuccessFlashMessages();
this.stack.doModify((current) => {
- const nextValue = [notification].concat(current);
+ const nextValue = [toast].concat(current);
_.remove(nextValue, (n, i) => i > 0 && (n.type === 'success' || n.type === 'error'));
return nextValue;
});
// auto-hide if success
- if (notification.type === 'success' && this.configurationService.autoHidePopups()) {
- setTimeout(() => this.remove(notification), timeoutAfter);
+ if (toast.type === 'success' && this.configurationService.autoHidePopups()) {
+ setTimeout(() => this.remove(toast), timeoutAfter);
}
- return notification;
+ return toast;
}
- public addError(obj:HttpErrorResponse|INotification|string, additionalErrors:unknown[]|string = []):INotification {
- let message:INotification|string;
+ public addError(obj:HttpErrorResponse|IToast|string, additionalErrors:unknown[]|string = []):IToast {
+ let message:IToast|string;
let errors = [...additionalErrors];
if (obj instanceof HttpErrorResponse && (obj.error as IHalMultipleError)?._embedded.errors) {
@@ -102,34 +102,34 @@ export class NotificationsService {
];
message = obj.message;
} else {
- message = obj as INotification|string;
+ message = obj as IToast|string;
}
- const notification:INotification = this.createNotification(message, 'error');
- notification.data = errors;
+ const toast:IToast = this.createToast(message, 'error');
+ toast.data = errors;
- return this.add(notification);
+ return this.add(toast);
}
- public addWarning(message:INotification|string):INotification {
- return this.add(this.createNotification(message, 'warning'));
+ public addWarning(message:IToast|string):IToast {
+ return this.add(this.createToast(message, 'warning'));
}
- public addSuccess(message:INotification|string):INotification {
- return this.add(this.createNotification(message, 'success'));
+ public addSuccess(message:IToast|string):IToast {
+ return this.add(this.createToast(message, 'success'));
}
- public addNotice(message:INotification|string):INotification {
- return this.add(this.createNotification(message, 'info'));
+ public addNotice(message:IToast|string):IToast {
+ return this.add(this.createToast(message, 'info'));
}
- public addAttachmentUpload(message:INotification|string, uploads:UploadInProgress[]):INotification {
- return this.add(this.createAttachmentUploadNotification(message, uploads));
+ public addAttachmentUpload(message:IToast|string, uploads:UploadInProgress[]):IToast {
+ return this.add(this.createAttachmentUploadToast(message, uploads));
}
- public remove(notification:INotification):void {
+ public remove(toast:IToast):void {
this.stack.doModify((current) => {
- _.remove(current, (n) => n === notification);
+ _.remove(current, (n) => n === toast);
return current;
});
}
@@ -138,7 +138,7 @@ export class NotificationsService {
this.stack.putValue([]);
}
- private createNotification(message:INotification|string, type:NotificationType):INotification {
+ private createToast(message:IToast|string, type:ToastType):IToast {
if (typeof message === 'string') {
return { message, type };
}
@@ -147,14 +147,14 @@ export class NotificationsService {
return message;
}
- private createAttachmentUploadNotification(message:INotification|string, uploads:UploadInProgress[]) {
+ private createAttachmentUploadToast(message:IToast|string, uploads:UploadInProgress[]) {
if (!uploads.length) {
- throw new Error('Cannot create an upload notification without uploads!');
+ throw new Error('Cannot create an upload toast without uploads!');
}
- const notification = this.createNotification(message, 'upload');
- notification.data = uploads;
+ const toast = this.createToast(message, 'upload');
+ toast.data = uploads;
- return notification;
+ return toast;
}
}
diff --git a/frontend/src/app/shared/components/notifications/notifications-container.component.ts b/frontend/src/app/shared/components/toaster/toasts-container.component.ts
similarity index 69%
rename from frontend/src/app/shared/components/notifications/notifications-container.component.ts
rename to frontend/src/app/shared/components/toaster/toasts-container.component.ts
index cafa95cbcd5..bd74eaf462c 100644
--- a/frontend/src/app/shared/components/notifications/notifications-container.component.ts
+++ b/frontend/src/app/shared/components/toaster/toasts-container.component.ts
@@ -29,34 +29,36 @@
import {
ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit,
} from '@angular/core';
-import { INotification, NotificationsService } from 'core-app/shared/components/notifications/notifications.service';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
+import { IToast, ToastService } from './toast.service';
-export const notificationsContainerSelector = 'notifications-container';
+export const toastsContainerSelector = 'op-toasts-container';
@Component({
template: `
- <div class="notification-box--wrapper">
- <div class="notification-box--casing">
- <notification [notification]="notification" *ngFor="let notification of stack"></notification>
+ <div class="op-toast--wrapper">
+ <div class="op-toast--casing">
+ <op-toast [toast]="toast" *ngFor="let toast of stack"></op-toast>
</div>
</div>
`,
changeDetection: ChangeDetectionStrategy.OnPush,
- selector: notificationsContainerSelector,
+ selector: toastsContainerSelector,
})
-export class NotificationsContainerComponent extends UntilDestroyedMixin implements OnInit {
- public stack:INotification[] = [];
+export class ToastsContainerComponent extends UntilDestroyedMixin implements OnInit {
+ public stack:IToast[] = [];
- constructor(readonly notificationsService:NotificationsService,
- readonly cdRef:ChangeDetectorRef) {
+ constructor(
+ readonly toastService:ToastService,
+ readonly cdRef:ChangeDetectorRef
+ ) {
super();
}
ngOnInit():void {
- this.notificationsService
+ this.toastService
.current
- .values$('Subscribing to changes in the notification stack')
+ .values$('Subscribing to changes in the toaster stack')
.pipe(
this.untilDestroyed(),
)
diff --git a/frontend/src/app/shared/components/notifications/upload-progress.component.ts b/frontend/src/app/shared/components/toaster/upload-progress.component.ts
similarity index 98%
rename from frontend/src/app/shared/components/notifications/upload-progress.component.ts
rename to frontend/src/app/shared/components/toaster/upload-progress.component.ts
index afc08d1c7e7..93984ac6896 100644
--- a/frontend/src/app/shared/components/notifications/upload-progress.component.ts
+++ b/frontend/src/app/shared/components/toaster/upload-progress.component.ts
@@ -36,7 +36,7 @@ import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destr
import { UploadFile, UploadHttpEvent, UploadInProgress } from 'core-app/core/file-upload/op-file-upload.service';
@Component({
- selector: 'notifications-upload-progress',
+ selector: 'op-toasters-upload-progress',
template: `
<li>
<span class="filename" [textContent]="fileName"></span>
diff --git a/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.template.html b/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.template.html
index dba18a16c7c..0470ca8388d 100644
--- a/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.template.html
+++ b/frontend/src/app/shared/components/work-package-graphs/overview/wp-overview-graph.template.html
@@ -4,8 +4,8 @@
</select>
<div *ngIf="error"
- class="notification-box -error">
- <div class="notification-box--content"
+ class="op-toast -error">
+ <div class="op-toast--content"
[textContent]="error">
</div>
</div>
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index 14ec0f5c557..1d2507eb5db 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -64,9 +64,9 @@ import {
import { CopyToClipboardDirective } from './components/copy-to-clipboard/copy-to-clipboard.directive';
import { OpDateTimeComponent } from './components/date/op-date-time.component';
-import { NotificationComponent } from './components/notifications/notification.component';
-import { NotificationsContainerComponent } from './components/notifications/notifications-container.component';
-import { UploadProgressComponent } from './components/notifications/upload-progress.component';
+import { ToastComponent } from './components/toaster/toast.component';
+import { ToastsContainerComponent } from './components/toaster/toasts-container.component';
+import { UploadProgressComponent } from './components/toaster/upload-progress.component';
import { ResizerComponent } from './components/resizer/resizer.component';
import { CollapsibleSectionComponent } from './components/collapsible-section/collapsible-section.component';
import { NoResultsComponent } from './components/no-results/no-results.component';
@@ -149,9 +149,8 @@ export function bootstrapModule(injector:Injector) {
FocusModule,
OpDateTimeComponent,
- // Notifications
- NotificationsContainerComponent,
- NotificationComponent,
+ ToastsContainerComponent,
+ ToastComponent,
UploadProgressComponent,
OpDateTimeComponent,
@@ -190,9 +189,8 @@ export function bootstrapModule(injector:Injector) {
declarations: [
OpDateTimeComponent,
- // Notifications
- NotificationsContainerComponent,
- NotificationComponent,
+ ToastsContainerComponent,
+ ToastComponent,
UploadProgressComponent,
OpDateTimeComponent,
diff --git a/frontend/src/global_styles/content/_grid.sass b/frontend/src/global_styles/content/_grid.sass
index d171815c37c..3b56ccb21c9 100644
--- a/frontend/src/global_styles/content/_grid.sass
+++ b/frontend/src/global_styles/content/_grid.sass
@@ -262,7 +262,7 @@ body.widget-grid-layout
margin-top: -$grid--widget-padding
.grid--add-widget-ee
- .notification-box
+ .op-toast
position: sticky
bottom: 0
margin-bottom: 0
diff --git a/frontend/src/global_styles/content/_index.sass b/frontend/src/global_styles/content/_index.sass
index 110d8e5f830..65bccd650b2 100644
--- a/frontend/src/global_styles/content/_index.sass
+++ b/frontend/src/global_styles/content/_index.sass
@@ -13,8 +13,8 @@
@import collapsible_section
@import copy_to_clipboard
@import custom_logo
-@import notifications
-@import notifications_mobile
+@import toast
+@import toast_mobile
@import links
@import loading_indicator
@import enterprise
diff --git a/frontend/src/global_styles/content/_notifications.sass b/frontend/src/global_styles/content/_notifications.sass
index fd6f7be2c10..11633a9625c 100644
--- a/frontend/src/global_styles/content/_notifications.sass
+++ b/frontend/src/global_styles/content/_notifications.sass
@@ -28,13 +28,13 @@
// NOTE: these are demo ski
-//nm - notification messages
+//nm - toaster messages
//pb - progress bar
$nm-font-size: rem-calc(13px)
$nm-border-radius: rem-calc(2px)
$nm-box-padding: rem-calc(10px 35px 10px 35px)
-$nm-notification-width: rem-calc(550)
+$nm-toaster-width: rem-calc(550)
$nm-color-error-background: #fedada
@@ -105,13 +105,13 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
left: $left
font-size: $size
-.notification-box
- @extend %notification
+.op-toast
+ @extend %toaster
z-index: 21
- +notification-layout($x: left, $y: top, $size: auto, $offset: rem-calc(0))
- +notification-style($background: $nm-color-background, $color: var(--body-font-color), $padding: $nm-padding-box, $radius: $nm-border-radius)
- .notification-icon
- +notification-icon($size: $notification-icon-size, $margin: $notification-icon-margin, $align: $notification-icon-align)
+ +toaster-layout($x: left, $y: top, $size: auto, $offset: rem-calc(0))
+ +toaster-style($background: $nm-color-background, $color: var(--body-font-color), $padding: $nm-padding-box, $radius: $nm-border-radius)
+ .toaster-icon
+ +toaster-icon($size: $toaster-icon-size, $margin: $toaster-icon-margin, $align: $toaster-icon-align)
display: flex
box-shadow: rem-calc(1px 2px 3px) rgba(0, 0, 0, 0.2)
border: rem-calc(1px) solid $nm-color-border
@@ -120,7 +120,7 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
& .button
margin: rem-calc(10px 10px 0 0)
- .notification-box--close
+ .op-toast--close
position: absolute
top: rem-calc(12px)
right: rem-calc(12px)
@@ -189,28 +189,28 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
&.-info
color: $nm-color-info-icon
-.notification-box--wrapper,
+.op-toast--wrapper,
.flash, #errorExplanation
position: absolute
- max-width: $nm-notification-width
+ max-width: $nm-toaster-width
margin: 0 auto
left: 10%
right: 10%
-.notification-box--wrapper
+.op-toast--wrapper
z-index: 10000 // Higher than loading indicator and modal wrapper!
top: 4rem
- .notification-box--casing
+ .op-toast--casing
position: relative
- .notification-box
+ .op-toast
margin-bottom: rem-calc(3px)
.flash, #errorExplanation
top: 1rem
// awesome animations
-.notification-box
+.op-toast
&.ng-enter
transition: opacity 0.5s ease
opacity: 0
@@ -222,7 +222,7 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
&.ng-leave.ng-leave-active
opacity: 0
- .notification-box--content
+ .op-toast--content
width: 100%
> p
@@ -239,7 +239,7 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
&::-webkit-progress-value
border-radius: $nm-pb-border-radius
-// upload notification styles
+// upload toaster styles
%progress-styles
appearance: none
border-radius: $nm-pb-border-radius
@@ -250,27 +250,27 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
color: var(--primary-color-dark)
margin: 0
-.notification-box--toggle-message
+.op-toast--toggle-message
font-size: rem-calc(16)
margin: rem-calc(5 0 15 0)
-.notification-box--uploads
+.op-toast--uploads
list-style: none
padding: 0
margin: 0
-.notification-box--uploads-element
+.op-toast--uploads-element
margin: rem-calc(5 0)
.filename
font-weight: bold
[class^="icon-"]
font-size: $nm-upload-file-status-icon-size
-.notification-box--upload-status
+.op-toast--upload-status
font-size: $nm-upload-status-font-size !important
line-height: $nm-upload-status-font-size !important
-.notification-box--notice
+.op-toast--notice
border-radius: $nm-border-radius
border-style: solid
border-width: rem-calc(1)
@@ -353,7 +353,7 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
.flash + .flash
margin-top: 3rem
-a.notification-box--target-link
+a.op-toast--target-link
cursor: pointer
text-decoration: underline
diff --git a/frontend/src/global_styles/content/_notifications.lsg b/frontend/src/global_styles/content/_toast.lsg
similarity index 59%
rename from frontend/src/global_styles/content/_notifications.lsg
rename to frontend/src/global_styles/content/_toast.lsg
index 7546e63d370..560686c6a9e 100644
--- a/frontend/src/global_styles/content/_notifications.lsg
+++ b/frontend/src/global_styles/content/_toast.lsg
@@ -1,8 +1,8 @@
# Notifications
```
-<div class="notification-box">
- <div class="notification-box--content">
+<div class="op-toast">
+ <div class="op-toast--content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quia laudantium ea delectus incidunt accusantium repudiandae deserunt excepturi non esse vero distinctio et reprehenderit, cupiditate quidem consectetur rerum iste magnam voluptatibus.</p>
</div>
</div>
@@ -11,8 +11,8 @@
## Info
```
-<div class="notification-box -info">
- <div class="notification-box--content">
+<div class="op-toast -info">
+ <div class="op-toast--content">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quia laudantium ea delectus incidunt accusantium repudiandae deserunt excepturi non esse vero distinctio et reprehenderit, cupiditate quidem consectetur rerum iste magnam voluptatibus.</p>
</div>
</div>
@@ -21,9 +21,9 @@
## Error
```
-<div class="notification-box -error">
- <a href="#" title="close" class="notification-box--close icon-context icon-close"></a>
- <div class="notification-box--content">
+<div class="op-toast -error">
+ <a href="#" title="close" class="op-toast--close icon-context icon-close"></a>
+ <div class="op-toast--content">
<p>An error occured, here are the facts:</p>
<ul>
<li>Fact 1: You made a mistake</li>
@@ -38,9 +38,9 @@
## Warning
```
-<div class="notification-box -warning">
- <a href="#" title="close" class="notification-box--close icon-context icon-close"></a>
- <div class="notification-box--content">
+<div class="op-toast -warning">
+ <a href="#" title="close" class="op-toast--close icon-context icon-close"></a>
+ <div class="op-toast--content">
<p>This is a warning. You may ignore it, but bad things might happen.</p>
</div>
</div>
@@ -49,9 +49,9 @@
## Success
```
-<div class="notification-box -success">
- <a href="#" title="close" class="notification-box--close icon-context icon-close"></a>
- <div class="notification-box--content">
+<div class="op-toast -success">
+ <a href="#" title="close" class="op-toast--close icon-context icon-close"></a>
+ <div class="op-toast--content">
<p>Successful update. <a href="#">A link to the past</a></p>
</div>
</div>
@@ -64,35 +64,35 @@
<div class="controls">
<button class="button stuck-message" id="test-notifier">click</button>
</div>
-<div class="notification-box--wrapper">
- <div class="notification-box--casing"></div>
+<div class="op-toast--wrapper">
+ <div class="op-toast--casing"></div>
</div>
<script type="text\template" id="warning-message-zx00x">
- <div class="notification-box -warning">
- <a href="#" class="notification-box--close">&times;</a>
- <div class="notification-box--content">
- <p>This is a warning. You may ignore it, but bad things might happen. notificationNo {{number}}</p>
+ <div class="op-toast -warning">
+ <a href="#" class="op-toast--close">&times;</a>
+ <div class="op-toast--content">
+ <p>This is a warning. You may ignore it, but bad things might happen. toasterNo {{number}}</p>
</div>
</div>
</script>
```
-## Upload notifications
+## Upload toasters
### Upload progress
```
-<div class="notification-box -upload">
- <div class="notification-box--content">
+<div class="op-toast -upload">
+ <div class="op-toast--content">
<span>Uploading files...</span>
- <ul class="notification-box--uploads">
- <notifications-upload-progress>
+ <ul class="op-toast--uploads">
+ <op-toasters-upload-progress>
<li>
<span class="filename">Awesome_Landscape.png</span>
<progress max="100" value="70">70%</progress>
</li>
- </notifications-upload-progress>
+ </op-toasters-upload-progress>
</ul>
</div>
</div>
@@ -102,13 +102,13 @@
### Upload progress done
```
-<div class="notification-box -upload">
- <div class="notification-box--content">
+<div class="op-toast -upload">
+ <div class="op-toast--content">
<span>Uploading files...</span>
<div>
<div>
- <ul class="notification-box--uploads">
- <notifications-upload-progress>
+ <ul class="op-toast--uploads">
+ <op-toasters-upload-progress>
<li>
<span class="filename">Awesome_Landscape.png</span>
<span class="upload-completed"><i class="icon-checkmark -success"></i></span>
@@ -116,9 +116,9 @@
<li>
<span class="filename">Awesome_Landscape2.png</span>
<span class="upload-completed"><i class="icon-close -error"></i></span>
- <p class="notification-box--notice -error">Something went wrong!...</p>
+ <p class="op-toast--notice -error">Something went wrong!...</p>
</li>
- </notifications-upload-progress>
+ </op-toasters-upload-progress>
</ul>
</div>
</div>
diff --git a/frontend/src/global_styles/content/_toast.sass b/frontend/src/global_styles/content/_toast.sass
new file mode 100644
index 00000000000..11633a9625c
--- /dev/null
+++ b/frontend/src/global_styles/content/_toast.sass
@@ -0,0 +1,370 @@
+//-- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2021 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+
+// NOTE: these are demo ski
+
+//nm - toaster messages
+//pb - progress bar
+
+$nm-font-size: rem-calc(13px)
+$nm-border-radius: rem-calc(2px)
+$nm-box-padding: rem-calc(10px 35px 10px 35px)
+$nm-toaster-width: rem-calc(550)
+
+$nm-color-error-background: #fedada
+
+$nm-color-success-border: #35c53f
+$nm-color-success-icon: #35c53f
+$nm-color-success-background: #d8fdd1
+
+$nm-color-warning-border: #b5b078
+$nm-color-warning-icon: #333
+$nm-color-warning-background: #f4f4aa
+
+$nm-color-info-icon: #333
+
+$nm-color-border: #8fc0db
+$nm-color-background: #e3f5ff
+$nm-padding-box: rem-calc(10px)
+
+$nm-pb-border-color: $nm-color-border
+$nm-pb-regress-color: whiteSmoke
+$nm-pb-border-radius: rem-calc(6)
+$nm-pb-height: rem-calc(20)
+
+$nm-upload-status-font-size: rem-calc(18)
+$nm-upload-file-status-icon-size: rem-calc(12)
+
+$nm-upload-box-padding: rem-calc(15) rem-calc(25)
+
+%nm-icon-error
+ @include icon-mixin-error
+ color: var(--content-form-danger-zone-bg-color)
+
+%nm-icon-success
+ @include icon-mixin-checkmark
+ color: $nm-color-success-icon
+
+%nm-icon-warning
+ @include icon-mixin-attention
+ color: $nm-color-warning-icon
+
+%nm-icon-info
+ @include icon-mixin-info1
+ color: $nm-color-info-icon
+
+%nm-icon-enterprise
+ @include icon-mixin-enterprise
+ color: $nm-color-info-icon
+
+%error-placeholder
+ background-color: $nm-color-error-background
+ border-color: var(--content-form-danger-zone-bg-color)
+
+%success-placeholder
+ background-color: $nm-color-success-background
+ border-color: $nm-color-success-border
+
+%warning-placeholder
+ background-color: $nm-color-warning-background
+ border-color: $nm-color-warning-border
+
+%info-placeholder
+ background-color: $nm-color-background
+ border-color: $nm-color-border
+
+@mixin messages-icon($top:rem-calc(11), $left:rem-calc(10), $size:rem-calc(18))
+ @include icon-font-common
+ position: absolute
+ top: $top
+ left: $left
+ font-size: $size
+
+.op-toast
+ @extend %toaster
+ z-index: 21
+ +toaster-layout($x: left, $y: top, $size: auto, $offset: rem-calc(0))
+ +toaster-style($background: $nm-color-background, $color: var(--body-font-color), $padding: $nm-padding-box, $radius: $nm-border-radius)
+ .toaster-icon
+ +toaster-icon($size: $toaster-icon-size, $margin: $toaster-icon-margin, $align: $toaster-icon-align)
+ display: flex
+ box-shadow: rem-calc(1px 2px 3px) rgba(0, 0, 0, 0.2)
+ border: rem-calc(1px) solid $nm-color-border
+ font-size: $nm-font-size
+ word-wrap: break-word
+ & .button
+ margin: rem-calc(10px 10px 0 0)
+
+ .op-toast--close
+ position: absolute
+ top: rem-calc(12px)
+ right: rem-calc(12px)
+ background-color: rgba(0, 0, 0, 0)
+ border-radius: rem-calc(50px)
+ width: 1rem
+ height: 1rem
+ text-align: center
+ line-height: rem-calc(20px)
+ &:hover
+ text-decoration: none
+
+ &.-error,
+ &.-success,
+ &.-warning,
+ &.-info,
+ &.-ee-upsale
+ padding: $nm-box-padding
+
+ &.-error
+ @extend %error-placeholder
+ &::before
+ @include messages-icon
+ @extend %nm-icon-error
+
+ &.-success
+ @extend %success-placeholder
+ &::before
+ @include messages-icon
+ @extend %nm-icon-success
+
+ &.-warning
+ @extend %warning-placeholder
+ &::before
+ @include messages-icon
+ @extend %nm-icon-warning
+
+ &.-info::before
+ @extend %info-placeholder
+ @include messages-icon
+ @extend %nm-icon-info
+
+ &.-ee-upsale::before
+ @extend %info-placeholder
+ @include messages-icon
+ @extend %nm-icon-enterprise
+
+ &.-upload
+ padding: $nm-upload-box-padding
+
+ //@hack adapting to provided styles
+ //messy I dont have all the details for a magic resolve, this might change
+ & p, & ul
+ margin-bottom: 0
+ & p, & ul>li, & .button
+ font-size: $nm-font-size
+
+
+[class^="icon-"]
+ &.-error
+ color: var(--content-form-danger-zone-bg-color)
+ &.-success
+ color: $nm-color-success-icon
+ &.-warning
+ color: $nm-color-warning-icon
+ &.-info
+ color: $nm-color-info-icon
+
+.op-toast--wrapper,
+.flash, #errorExplanation
+ position: absolute
+ max-width: $nm-toaster-width
+ margin: 0 auto
+ left: 10%
+ right: 10%
+
+.op-toast--wrapper
+ z-index: 10000 // Higher than loading indicator and modal wrapper!
+ top: 4rem
+
+ .op-toast--casing
+ position: relative
+ .op-toast
+ margin-bottom: rem-calc(3px)
+
+.flash, #errorExplanation
+ top: 1rem
+
+// awesome animations
+.op-toast
+ &.ng-enter
+ transition: opacity 0.5s ease
+ opacity: 0
+ &.ng-enter.ng-enter-active
+ opacity: 1
+ &.ng-leave
+ transition: opacity 2s ease
+ opacity: 1
+ &.ng-leave.ng-leave-active
+ opacity: 0
+
+ .op-toast--content
+ width: 100%
+
+ > p
+ margin-bottom: 0
+ color: var(--body-font-color)
+
+ progress[value]
+ @extend %progress-styles
+ &::-moz-progress-bar
+ border-radius: $nm-pb-border-radius
+ &::-webkit-progress-bar
+ background-color: $nm-pb-regress-color
+ border-radius: $nm-pb-border-radius
+ &::-webkit-progress-value
+ border-radius: $nm-pb-border-radius
+
+// upload toaster styles
+%progress-styles
+ appearance: none
+ border-radius: $nm-pb-border-radius
+ height: $nm-pb-height
+ animation: animate-stripes 5s linear infinite
+ background-color: $nm-pb-regress-color
+ border: rem-calc(1) solid $nm-pb-border-color
+ color: var(--primary-color-dark)
+ margin: 0
+
+.op-toast--toggle-message
+ font-size: rem-calc(16)
+ margin: rem-calc(5 0 15 0)
+
+.op-toast--uploads
+ list-style: none
+ padding: 0
+ margin: 0
+
+.op-toast--uploads-element
+ margin: rem-calc(5 0)
+ .filename
+ font-weight: bold
+ [class^="icon-"]
+ font-size: $nm-upload-file-status-icon-size
+
+.op-toast--upload-status
+ font-size: $nm-upload-status-font-size !important
+ line-height: $nm-upload-status-font-size !important
+
+.op-toast--notice
+ border-radius: $nm-border-radius
+ border-style: solid
+ border-width: rem-calc(1)
+ padding: rem-calc(5)
+ margin: rem-calc(5 0)
+ &.-error
+ @extend %error-placeholder
+ &.-success
+ @extend %success-placeholder
+ &.-warning
+ @extend %warning-placeholder
+
+// Use same styles for flash messages
+.flash, #errorExplanation
+ border-radius: $nm-border-radius
+ border-style: solid
+ border-width: rem-calc(1)
+ font-size: $nm-font-size
+ line-height: 1.6
+ padding: $nm-box-padding
+ box-shadow: rem-calc(1px 2px 3px) rgba(0, 0, 0, 0.2)
+ margin-bottom: 0.1875rem
+ margin-top: 0.5rem
+ z-index: 15
+
+ &.ng-leave
+ @include animation(0.5s fade-out)
+
+ a
+ text-decoration: none
+ cursor: default
+
+ ul
+ font-size: $nm-font-size
+ margin: 0 0 0 30px
+
+ .close-handler
+ float: none
+ position: absolute
+ right: rem-calc(11)
+ top: rem-calc(11)
+ cursor: pointer
+
+ &::before
+ @include messages-icon
+ padding: 0 !important
+
+ &.notice
+ @extend %success-placeholder
+
+ &::before
+ @extend %nm-icon-success
+ color: $nm-color-success-icon
+
+ &.error, &.nodata
+ @extend %error-placeholder
+
+ &::before
+ @extend %nm-icon-error
+ color: var(--content-form-danger-zone-bg-color)
+
+ &.info
+ @extend %info-placeholder
+
+ &::before
+ @include messages-icon
+ @extend %nm-icon-info
+
+ &::before
+ @extend %nm-icon-info
+ color: $nm-color-info-icon
+
+ &.warning
+ @extend %warning-placeholder
+
+ &::before
+ @extend %nm-icon-warning
+ color: $nm-color-warning-icon
+
+.flash + .flash
+ margin-top: 3rem
+
+a.op-toast--target-link
+ cursor: pointer
+ text-decoration: underline
+
+#errorExplanation
+ @extend %error-placeholder
+ top: rem-calc(68px)
+
+ &::before
+ color: var(--content-form-danger-zone-bg-color) !important
+
+ &.-inline
+ position: relative
+ top: 0
+ left: 0
diff --git a/frontend/src/global_styles/content/_notifications_mobile.sass b/frontend/src/global_styles/content/_toast_mobile.sass
similarity index 97%
rename from frontend/src/global_styles/content/_notifications_mobile.sass
rename to frontend/src/global_styles/content/_toast_mobile.sass
index 3bed13c11db..b42256b7ff1 100644
--- a/frontend/src/global_styles/content/_notifications_mobile.sass
+++ b/frontend/src/global_styles/content/_toast_mobile.sass
@@ -27,7 +27,7 @@
//++
@include breakpoint(680px down)
- .notification-box--wrapper,
+ .op-toast--wrapper,
.flash,
#errorExplanation
left: 20px !important
diff --git a/frontend/src/global_styles/layout/_print.sass b/frontend/src/global_styles/layout/_print.sass
index 782ff7f0f62..3810fc1b2b3 100644
--- a/frontend/src/global_styles/layout/_print.sass
+++ b/frontend/src/global_styles/layout/_print.sass
@@ -15,7 +15,7 @@
#wiki_add_attachment
display: none !important
- .notification-box:not(.show-when-print)
+ .op-toast:not(.show-when-print)
display: none !important
#main
diff --git a/frontend/src/global_styles/openproject/_scm.sass b/frontend/src/global_styles/openproject/_scm.sass
index 8a031a17bc2..3ae2a7f3202 100644
--- a/frontend/src/global_styles/openproject/_scm.sass
+++ b/frontend/src/global_styles/openproject/_scm.sass
@@ -234,7 +234,7 @@ tr
&.entry
&.truncation-warning
td
- div.notification-box
+ div.op-toast
margin-left: var(--repository-entry-filename-margin-left)
margin-top: 0
margin-bottom: 0
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_notification.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_notification.scss
deleted file mode 100644
index 2820f9fa26f..00000000000
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_notification.scss
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- NOTIFICATION
- ------------
-
- An alert that pins to the corner of the screen when triggered by JavaScript. It can be set to disappear after a certain period of time, or to stay put until the user clicks on it. A custom action can be asigned to a notification as well.
-
- Optionally, the notifications directive can also tap into the browser's native notification support, if it exists.
-*/
-
-/// @Foundation.settings
-// Notification
-$notification-default-position: right top !default;
-$notification-width: rem-calc(400) !default;
-$notification-offset: $global-padding !default;
-
-$notification-background: $primary-color !default;
-$notification-color: white !default;
-$notification-padding: $global-padding !default;
-$notification-radius: 4px !default;
-
-$notification-icon-size: 60px !default;
-$notification-icon-margin: $global-padding !default;
-$notification-icon-align: top !default;
-
-///
-
-%notification {
- z-index: 1000;
- display: flex;
- position: relative;
- margin-top: .5rem;
- margin-bottom: .5rem;
- display: none;
-
- h1 {
- font-size: 1.25em;
- margin: 0;
- }
- p {
- margin: 0;
- }
-
- // Placeholder animation
- // transition: opacity 1s ease-out;
-
- &.is-active {
- display: flex;
- }
-
- .close-button {
- color: white;
- }
-}
-
-%notification-container {
- z-index: 3000;
- position: fixed;
-
- display: flex;
- flex-direction: column;
-}
-
-@mixin notification-layout(
- $x: nth($notification-default-position, 1),
- $y: nth($notification-default-position, 2),
- $size: $notification-width,
- $offset: $notification-offset
-) {
- width: $size;
-
- @if $x == right {
- right: $offset;
- }
- @else if $x == left {
- left: $offset;
- }
- @else if $x == middle {
- left: 50%;
- margin-left: -($size * 0.5);
- }
-
- @if $y == top {
- top: $offset;
- }
- @else if $y == bottom {
- top: auto;
- bottom: $offset;
- }
-
- // On small screens, notifications are full width but maintain their vertical orientation
- @include breakpoint(small only) {
- width: auto;
- left: $offset;
- right: $offset;
- margin-left: 0;
- }
-}
-@mixin notification-style(
- $background: $notification-background,
- $color: $notification-color,
- $padding: $notification-padding,
- $radius: $notification-radius
-) {
- background: $background;
- padding: $padding;
- border-radius: $radius;
-
- &, h1, h2, h3, h4, h5, h6 {
- color: $color;
- }
-}
-
-@mixin notification(
- $background: $notification-background,
- $color: $notification-color,
- $padding: $notification-padding,
- $radius: $notification-radius
-) {
- @extend %notification;
- @include notification-style($background, $color, $padding, $radius);
-}
-
-@mixin notification-container(
- $x: nth($notification-default-position, 1),
- $y: nth($notification-default-position, 2),
- $size: $notification-width,
- $offset: $notification-offset
-) {
- @extend %notification-container;
- @include notification-layout($x, $y, $size, $offset);
-}
-
-@mixin notification-icon(
- $size: $notification-icon-size,
- $margin: $notification-icon-margin,
- $align: $notification-icon-align
-) {
- $alignments: (
- top: flex-start,
- middle: middle,
- bottom: flex-end,
- );
- flex: 0 0 $size;
- margin-right: $global-padding;
- align-self: map-get($alignments, $align);
-
- img {
- width: 100%;
- height: auto;
- }
-}
-
-/*
- CSS Output
-*/
-
-@include exports(notification) {
- .notification {
- @include notification;
-
- &.success { @include notification-style($success-color) }
- &.warning { @include notification-style($warning-color) }
- &.alert { @include notification-style($alert-color) }
- &.dark { @include notification-style($dark-color, #fff) }
-
-
- }
-
- .static-notification {
- @include notification;
-
- position: fixed !important;
-
- &.top-right { @include notification-layout(right, top); }
- &.top-left { @include notification-layout(left, top); }
- &.top-middle { @include notification-layout(middle, top); }
-
- &.bottom-right { @include notification-layout(right, bottom); }
- &.bottom-left { @include notification-layout(left, bottom); }
- &.bottom-middle { @include notification-layout(middle, bottom); }
-
- &.success { @include notification-style($success-color) }
- &.warning { @include notification-style($warning-color) }
- &.alert { @include notification-style($alert-color) }
- &.dark { @include notification-style($dark-color, #fff) }
- }
-
- .notification-container {
- @include notification-container;
-
- &.top-right { @include notification-layout(right, top); }
- &.top-left { @include notification-layout(left, top); }
- &.top-middle { @include notification-layout(middle, top); }
-
- &.bottom-right { @include notification-layout(right, bottom); }
- &.bottom-left { @include notification-layout(left, bottom); }
- &.bottom-middle { @include notification-layout(middle, bottom); }
- }
-
- .notification-icon {
- @include notification-icon;
- }
- .notification-content {
- flex: 1;
- }
-
-}
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/components/_toast.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_toast.scss
new file mode 100644
index 00000000000..182004c9bce
--- /dev/null
+++ b/frontend/src/global_styles/vendor/foundation-apps/scss/components/_toast.scss
@@ -0,0 +1,207 @@
+/*
+ TOAST
+ ------------
+
+ An alert that pins to the corner of the screen when triggered by JavaScript. It can be set to disappear after a certain period of time, or to stay put until the user clicks on it. A custom action can be asigned to a toaster as well.
+
+ Optionally, the toasters directive can also tap into the browser's native toaster support, if it exists.
+*/
+
+/// @Foundation.settings
+// Notification
+$toaster-default-position: right top !default;
+$toaster-width: rem-calc(400) !default;
+$toaster-offset: $global-padding !default;
+
+$toaster-background: $primary-color !default;
+$toaster-color: white !default;
+$toaster-padding: $global-padding !default;
+$toaster-radius: 4px !default;
+
+$toaster-icon-size: 60px !default;
+$toaster-icon-margin: $global-padding !default;
+$toaster-icon-align: top !default;
+
+///
+
+%toaster {
+ z-index: 1000;
+ display: flex;
+ position: relative;
+ margin-top: .5rem;
+ margin-bottom: .5rem;
+ display: none;
+
+ h1 {
+ font-size: 1.25em;
+ margin: 0;
+ }
+ p {
+ margin: 0;
+ }
+
+ // Placeholder animation
+ // transition: opacity 1s ease-out;
+
+ &.is-active {
+ display: flex;
+ }
+
+ .close-button {
+ color: white;
+ }
+}
+
+%toaster-container {
+ z-index: 3000;
+ position: fixed;
+
+ display: flex;
+ flex-direction: column;
+}
+
+@mixin toaster-layout(
+ $x: nth($toaster-default-position, 1),
+ $y: nth($toaster-default-position, 2),
+ $size: $toaster-width,
+ $offset: $toaster-offset
+) {
+ width: $size;
+
+ @if $x == right {
+ right: $offset;
+ }
+ @else if $x == left {
+ left: $offset;
+ }
+ @else if $x == middle {
+ left: 50%;
+ margin-left: -($size * 0.5);
+ }
+
+ @if $y == top {
+ top: $offset;
+ }
+ @else if $y == bottom {
+ top: auto;
+ bottom: $offset;
+ }
+
+ // On small screens, toasters are full width but maintain their vertical orientation
+ @include breakpoint(small only) {
+ width: auto;
+ left: $offset;
+ right: $offset;
+ margin-left: 0;
+ }
+}
+@mixin toaster-style(
+ $background: $toaster-background,
+ $color: $toaster-color,
+ $padding: $toaster-padding,
+ $radius: $toaster-radius
+) {
+ background: $background;
+ padding: $padding;
+ border-radius: $radius;
+
+ &, h1, h2, h3, h4, h5, h6 {
+ color: $color;
+ }
+}
+
+@mixin toaster(
+ $background: $toaster-background,
+ $color: $toaster-color,
+ $padding: $toaster-padding,
+ $radius: $toaster-radius
+) {
+ @extend %toaster;
+ @include toaster-style($background, $color, $padding, $radius);
+}
+
+@mixin toaster-container(
+ $x: nth($toaster-default-position, 1),
+ $y: nth($toaster-default-position, 2),
+ $size: $toaster-width,
+ $offset: $toaster-offset
+) {
+ @extend %toaster-container;
+ @include toaster-layout($x, $y, $size, $offset);
+}
+
+@mixin toaster-icon(
+ $size: $toaster-icon-size,
+ $margin: $toaster-icon-margin,
+ $align: $toaster-icon-align
+) {
+ $alignments: (
+ top: flex-start,
+ middle: middle,
+ bottom: flex-end,
+ );
+ flex: 0 0 $size;
+ margin-right: $global-padding;
+ align-self: map-get($alignments, $align);
+
+ img {
+ width: 100%;
+ height: auto;
+ }
+}
+
+/*
+ CSS Output
+*/
+
+@include exports(toaster) {
+ .toaster {
+ @include toaster;
+
+ &.success { @include toaster-style($success-color) }
+ &.warning { @include toaster-style($warning-color) }
+ &.alert { @include toaster-style($alert-color) }
+ &.dark { @include toaster-style($dark-color, #fff) }
+
+
+ }
+
+ .static-toaster {
+ @include toaster;
+
+ position: fixed !important;
+
+ &.top-right { @include toaster-layout(right, top); }
+ &.top-left { @include toaster-layout(left, top); }
+ &.top-middle { @include toaster-layout(middle, top); }
+
+ &.bottom-right { @include toaster-layout(right, bottom); }
+ &.bottom-left { @include toaster-layout(left, bottom); }
+ &.bottom-middle { @include toaster-layout(middle, bottom); }
+
+ &.success { @include toaster-style($success-color) }
+ &.warning { @include toaster-style($warning-color) }
+ &.alert { @include toaster-style($alert-color) }
+ &.dark { @include toaster-style($dark-color, #fff) }
+ }
+
+ .toaster-container {
+ @include toaster-container;
+
+ &.top-right { @include toaster-layout(right, top); }
+ &.top-left { @include toaster-layout(left, top); }
+ &.top-middle { @include toaster-layout(middle, top); }
+
+ &.bottom-right { @include toaster-layout(right, bottom); }
+ &.bottom-left { @include toaster-layout(left, bottom); }
+ &.bottom-middle { @include toaster-layout(middle, bottom); }
+ }
+
+ .toaster-icon {
+ @include toaster-icon;
+ }
+ .toaster-content {
+ flex: 1;
+ }
+
+}
diff --git a/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss b/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss
index a2a42419bc4..2c99ef9f735 100755
--- a/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss
+++ b/frontend/src/global_styles/vendor/foundation-apps/scss/foundation.scss
@@ -35,7 +35,7 @@ $foundation-version: '1.1.0';
"components/menu-bar",
"components/modal",
"components/motion",
-"components/notification",
+"components/toast",
"components/off-canvas",
"components/popup",
"components/switch",
diff --git a/modules/avatars/frontend/module/avatar-upload-form/avatar-upload-form.component.ts b/modules/avatars/frontend/module/avatar-upload-form/avatar-upload-form.component.ts
index 90f563070f5..3a47d321db3 100644
--- a/modules/avatars/frontend/module/avatar-upload-form/avatar-upload-form.component.ts
+++ b/modules/avatars/frontend/module/avatar-upload-form/avatar-upload-form.component.ts
@@ -29,7 +29,7 @@ import { Component, ElementRef, OnInit, ViewChild } from "@angular/core";
import { OpenProjectFileUploadService, UploadFile } from "core-app/core/file-upload/op-file-upload.service";
import { resizeFile } from "core-app/shared/helpers/images/resizer";
import { I18nService } from "core-app/core/i18n/i18n.service";
-import { NotificationsService } from "core-app/shared/components/notifications/notifications.service";
+import { ToastService } from "core-app/shared/components/toaster/toast.service";
@Component({
selector: 'avatar-upload-form',
@@ -62,7 +62,7 @@ export class AvatarUploadFormComponent implements OnInit {
public constructor(protected I18n:I18nService,
protected elementRef:ElementRef,
- protected notificationsService:NotificationsService,
+ protected toastService:ToastService,
protected opFileUpload:OpenProjectFileUploadService) {
}
@@ -96,7 +96,7 @@ export class AvatarUploadFormComponent implements OnInit {
evt.preventDefault();
this.busy = true;
const upload = this.opFileUpload.uploadSingle(this.target, this.avatarFile, this.method, 'text');
- this.notificationsService.addAttachmentUpload(this.text.uploading, [upload]);
+ this.toastService.addAttachmentUpload(this.text.uploading, [upload]);
upload[1].subscribe(
(evt:any) => {
@@ -116,7 +116,7 @@ export class AvatarUploadFormComponent implements OnInit {
}
},
(error:any) => {
- this.notificationsService.addError(error.error);
+ this.toastService.addError(error.error);
this.busy = false;
}
);
diff --git a/modules/backlogs/spec/features/backlogs_in_backlog_view_spec.rb b/modules/backlogs/spec/features/backlogs_in_backlog_view_spec.rb
index 2cd9ee16d9b..df0b3cadcec 100644
--- a/modules/backlogs/spec/features/backlogs_in_backlog_view_spec.rb
+++ b/modules/backlogs/spec/features/backlogs_in_backlog_view_spec.rb
@@ -188,7 +188,7 @@ describe 'Backlogs in backlog view',
click_button 'Save'
backlogs_page
- .expect_and_dismiss_notification(message: "Successful update.")
+ .expect_and_dismiss_toaster(message: "Successful update.")
backlogs_page
.expect_backlog(sprint)
@@ -209,7 +209,7 @@ describe 'Backlogs in backlog view',
click_button 'Save'
backlogs_page
- .expect_and_dismiss_notification(message: "Successful update.")
+ .expect_and_dismiss_toaster(message: "Successful update.")
# Now works as a sprint instead of a backlog
backlogs_page
@@ -231,7 +231,7 @@ describe 'Backlogs in backlog view',
click_button 'Save'
backlogs_page
- .expect_and_dismiss_notification(message: "Successful update.")
+ .expect_and_dismiss_toaster(message: "Successful update.")
# the disabled backlog/sprint is no longer visible
expect(page)
@@ -253,7 +253,7 @@ describe 'Backlogs in backlog view',
click_button 'Save'
backlogs_page
- .expect_and_dismiss_notification(message: "Successful update.")
+ .expect_and_dismiss_toaster(message: "Successful update.")
# the disabled backlog/sprint is no longer visible
expect(page)
diff --git a/modules/backlogs/spec/features/resolved_status_spec.rb b/modules/backlogs/spec/features/resolved_status_spec.rb
index a1abbf7f36a..87976e826c0 100644
--- a/modules/backlogs/spec/features/resolved_status_spec.rb
+++ b/modules/backlogs/spec/features/resolved_status_spec.rb
@@ -56,7 +56,7 @@ describe 'Resolved status',
check status.name
click_button 'Save'
- settings_page.expect_notification(message: 'Successful update')
+ settings_page.expect_toast(message: 'Successful update')
expect(page)
.to have_checked_field(status.name)
diff --git a/modules/backlogs/spec/support/pages/backlogs.rb b/modules/backlogs/spec/support/pages/backlogs.rb
index d798f42ada1..5142b2b86a1 100644
--- a/modules/backlogs/spec/support/pages/backlogs.rb
+++ b/modules/backlogs/spec/support/pages/backlogs.rb
@@ -291,7 +291,7 @@ module Pages
"#story_#{story.id}"
end
- def notification_type
+ def toast_type
:ruby
end
end
diff --git a/modules/bim/app/views/bim/bcf/issues/_render_issues.html.erb b/modules/bim/app/views/bim/bcf/issues/_render_issues.html.erb
index 0a593c6d9f9..06a2824d0d8 100644
--- a/modules/bim/app/views/bim/bcf/issues/_render_issues.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/_render_issues.html.erb
@@ -13,8 +13,8 @@
<% end %>
</p>
<% if issue.errors.present? %>
- <div class="notification-box -error">
- <div class="notification-box--content">
+ <div class="op-toast -error">
+ <div class="op-toast--content">
<% issue.errors.full_messages.each do |message| %>
<p><%= message %></p>
<% end %>
diff --git a/modules/bim/app/views/bim/bcf/issues/configure_non_members.html.erb b/modules/bim/app/views/bim/bcf/issues/configure_non_members.html.erb
index 8aeb271af16..6d666dc519c 100644
--- a/modules/bim/app/views/bim/bcf/issues/configure_non_members.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/configure_non_members.html.erb
@@ -12,8 +12,8 @@
solution_text: t('bcf.bcf_xml.import.add_as_members_with_role', project: @project.name),
solution_options: @roles.collect { |obj| [obj.name, obj.id] }} %>
<% else %>
- <div class="notification-box -warning">
- <div class="notification-box--content">
+ <div class="op-toast -warning">
+ <div class="op-toast--content">
<input type="hidden" name="import_options[non_members_action]" value="cancel">
<%= t('bcf.bcf_xml.import.contact_project_admin') %>
</div>
@@ -24,8 +24,8 @@
class: 'button' %>
<% end %>
<% else %>
- <div class="notification-box -error">
- <div class="notification-box--content">
+ <div class="op-toast -error">
+ <div class="op-toast--content">
<%= I18n.t('text_no_roles_defined') %>
</div>
</div>
diff --git a/modules/bim/app/views/bim/bcf/issues/configure_unknown_mails.html.erb b/modules/bim/app/views/bim/bcf/issues/configure_unknown_mails.html.erb
index 3d06531da1c..c85b0d27456 100644
--- a/modules/bim/app/views/bim/bcf/issues/configure_unknown_mails.html.erb
+++ b/modules/bim/app/views/bim/bcf/issues/configure_unknown_mails.html.erb
@@ -34,8 +34,8 @@
</div>
</div>
<% else %>
- <div class="notification-box -warning">
- <div class="notification-box--content">
+ <div class="op-toast -warning">
+ <div class="op-toast--content">
<%= t('bcf.bcf_xml.import.no_permission_to_add_members') %>
<%= t('bcf.bcf_xml.import.contact_project_admin') %>
</div>
@@ -48,8 +48,8 @@
<% end %>
<%= styled_submit_tag t('bcf.bcf_xml.import.button_proceed'), class: '-highlight' %>
<% else %>
- <div class="notification-box -error">
- <div class="notification-box--content">
+ <div class="op-toast -error">
+ <div class="op-toast--content">
<%= I18n.t('text_no_roles_defined') %>
</div>
</div>
diff --git a/modules/bim/app/views/bim/ifc_models/ifc_models/_no_default_notice.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/_no_default_notice.html.erb
index 9366b01e4ed..533ab03fe17 100644
--- a/modules/bim/app/views/bim/ifc_models/ifc_models/_no_default_notice.html.erb
+++ b/modules/bim/app/views/bim/ifc_models/ifc_models/_no_default_notice.html.erb
@@ -1,5 +1,5 @@
-<div class="notification-box -info">
- <div class="notification-box--content">
+<div class="op-toast -info">
+ <div class="op-toast--content">
<p><%= t('ifc_models.no_defaults_warning.title') %></p>
<ul>
<li><%= t('ifc_models.no_defaults_warning.check_1') %></li>
diff --git a/modules/bim/app/views/bim/ifc_models/ifc_viewer/_unconverted_notice.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_viewer/_unconverted_notice.html.erb
index 0455696afb2..59b333f03bb 100644
--- a/modules/bim/app/views/bim/ifc_models/ifc_viewer/_unconverted_notice.html.erb
+++ b/modules/bim/app/views/bim/ifc_models/ifc_viewer/_unconverted_notice.html.erb
@@ -1,6 +1,6 @@
-<div class="notification-box -info">
- <a href="#" title="close" class="notification-box--close icon-context icon-close"></a>
- <div class="notification-box--content">
+<div class="op-toast -info">
+ <a href="#" title="close" class="op-toast--close icon-context icon-close"></a>
+ <div class="op-toast--content">
<p><%= t('ifc_models.processing_notice.processing_default') %></p>
<ul>
<% unconverted.each do |model| %>
diff --git a/modules/bim/spec/features/bcf/create_spec.rb b/modules/bim/spec/features/bcf/create_spec.rb
index 4b00f765b8d..4be1a7611d2 100644
--- a/modules/bim/spec/features/bcf/create_spec.rb
+++ b/modules/bim/spec/features/bcf/create_spec.rb
@@ -76,7 +76,7 @@ describe 'Create BCF',
sleep 5
- index_page.expect_and_dismiss_notification(
+ index_page.expect_and_dismiss_toaster(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
diff --git a/modules/bim/spec/features/model_management_spec.rb b/modules/bim/spec/features/model_management_spec.rb
index 58393b508f3..d8dcd14abb8 100644
--- a/modules/bim/spec/features/model_management_spec.rb
+++ b/modules/bim/spec/features/model_management_spec.rb
@@ -136,7 +136,7 @@ describe 'model management',
it "I can't see any models and perform no actions" do
expected = '[Error 403] You are not authorized to access this page.'
- expect(page).to have_selector('.notification-box.-error', text: expected)
+ expect(page).to have_selector('.op-toast.-error', text: expected)
index_page.add_model_allowed false
end
diff --git a/modules/bim/spec/features/model_viewer_spec.rb b/modules/bim/spec/features/model_viewer_spec.rb
index 4ea8cfd368c..53b831e473d 100644
--- a/modules/bim/spec/features/model_viewer_spec.rb
+++ b/modules/bim/spec/features/model_viewer_spec.rb
@@ -97,7 +97,7 @@ describe 'model viewer',
it 'shows a warning that no IFC models exist yet' do
login_as user
visit defaults_bcf_project_ifc_models_path(project)
- expect(page).to have_selector('.notification-box.-info', text: I18n.t('js.ifc_models.empty_warning'))
+ expect(page).to have_selector('.op-toast.-info', text: I18n.t('js.ifc_models.empty_warning'))
end
end
end
@@ -140,7 +140,7 @@ describe 'model viewer',
it 'shows no viewer' do
expected = '[Error 403] You are not authorized to access this page.'
- expect(page).to have_selector('.notification-box.-error', text: expected)
+ expect(page).to have_selector('.op-toast.-error', text: expected)
show_model_page.model_viewer_visible false
show_model_page.model_viewer_shows_a_toolbar false
diff --git a/modules/bim/spec/features/show_default_spec.rb b/modules/bim/spec/features/show_default_spec.rb
index 2822a8b2038..753c5a66d8d 100644
--- a/modules/bim/spec/features/show_default_spec.rb
+++ b/modules/bim/spec/features/show_default_spec.rb
@@ -62,7 +62,7 @@ describe 'show default model',
it 'shows an error loading the page' do
show_default_page.visit!
- show_default_page.expect_notification(type: :error, message: 'Your view is erroneous and could not be processed')
+ show_default_page.expect_toast(type: :error, message: 'Your view is erroneous and could not be processed')
end
end
@@ -100,7 +100,7 @@ describe 'show default model',
it 'renders a notification' do
show_default_page
- .expect_notification(type: :info,
+ .expect_toast(type: :info,
message: I18n.t(:'ifc_models.processing_notice.processing_default'))
end
end
diff --git a/modules/boards/spec/features/action_boards/assignee_board_spec.rb b/modules/boards/spec/features/action_boards/assignee_board_spec.rb
index b069a53dceb..4640252ab6c 100644
--- a/modules/boards/spec/features/action_boards/assignee_board_spec.rb
+++ b/modules/boards/spec/features/action_boards/assignee_board_spec.rb
@@ -171,7 +171,7 @@ describe 'Assignee action board',
split_view = card.open_details_view
split_view.expect_subject
split_view.edit_field(:assignee).update('Foo Bar')
- split_view.expect_and_dismiss_notification message: 'Successful update.'
+ split_view.expect_and_dismiss_toaster message: 'Successful update.'
work_package.reload
expect(work_package.assigned_to).to eq(foobar_user)
diff --git a/modules/boards/spec/features/action_boards/status_board_spec.rb b/modules/boards/spec/features/action_boards/status_board_spec.rb
index 69dce9121e3..dfa93b0f21c 100644
--- a/modules/boards/spec/features/action_boards/status_board_spec.rb
+++ b/modules/boards/spec/features/action_boards/status_board_spec.rb
@@ -164,7 +164,7 @@ describe 'Status action board', type: :feature, js: true do
# Try to drag to whatever, which has no workflow
board_page.move_card(0, from: 'Closed', to: 'Whatever')
- board_page.expect_and_dismiss_notification(
+ board_page.expect_and_dismiss_toaster(
type: :error,
message: "Status is invalid because no valid transition exists from old to new status for the current user's roles."
)
@@ -227,7 +227,7 @@ describe 'Status action board', type: :feature, js: true do
split_view = card.open_details_view
split_view.expect_subject
split_view.edit_field(:status).update('Open')
- split_view.expect_and_dismiss_notification message: 'Successful update.'
+ split_view.expect_and_dismiss_toaster message: 'Successful update.'
wp.reload
expect(wp.status).to eq(open_status)
diff --git a/modules/boards/spec/features/action_boards/subproject_board_spec.rb b/modules/boards/spec/features/action_boards/subproject_board_spec.rb
index 54dc468ce78..adb16a27fee 100644
--- a/modules/boards/spec/features/action_boards/subproject_board_spec.rb
+++ b/modules/boards/spec/features/action_boards/subproject_board_spec.rb
@@ -208,7 +208,7 @@ describe 'Subproject action board', type: :feature, js: true do
board_page.expect_card subproject1.name, work_package.subject
# No error is to be displayed as erroneous columns are filtered out
- expect(page).not_to have_selector('.notification-box.-error')
+ expect(page).not_to have_selector('.op-toast.-error')
board_page.expect_no_list(subproject2.name)
expect(page)
diff --git a/modules/boards/spec/features/action_boards/subtasks_board_spec.rb b/modules/boards/spec/features/action_boards/subtasks_board_spec.rb
index 1dc67640eb1..4551e0bd0f6 100644
--- a/modules/boards/spec/features/action_boards/subtasks_board_spec.rb
+++ b/modules/boards/spec/features/action_boards/subtasks_board_spec.rb
@@ -169,7 +169,7 @@ describe 'Subtasks action board', type: :feature, js: true do
# Try to move child to itself
board_page.move_card(0, from: 'Parent WP', to: 'Child WP')
- board_page.expect_and_dismiss_notification type: :error,
+ board_page.expect_and_dismiss_toaster type: :error,
message: I18n.t('js.boards.error_cannot_move_into_self')
child.reload
diff --git a/modules/boards/spec/features/action_boards/version_board_spec.rb b/modules/boards/spec/features/action_boards/version_board_spec.rb
index 75256d5f8d8..2e37cb2dee4 100644
--- a/modules/boards/spec/features/action_boards/version_board_spec.rb
+++ b/modules/boards/spec/features/action_boards/version_board_spec.rb
@@ -212,7 +212,7 @@ describe 'Version action board', type: :feature, js: true do
split_view = card.open_details_view
split_view.expect_subject
split_view.edit_field(:version).update('Open version')
- split_view.expect_and_dismiss_notification message: 'Successful update.'
+ split_view.expect_and_dismiss_toaster message: 'Successful update.'
work_package.reload
expect(work_package.version).to eq(open_version)
diff --git a/modules/boards/spec/features/board_management_spec.rb b/modules/boards/spec/features/board_management_spec.rb
index 037193eb4c2..d211ff361b8 100644
--- a/modules/boards/spec/features/board_management_spec.rb
+++ b/modules/boards/spec/features/board_management_spec.rb
@@ -242,7 +242,7 @@ describe 'Board management spec', type: :feature, js: true do
# Add item
board_page.add_card 'List 1', 'Task 1'
- board_page.expect_and_dismiss_notification(message: "Successful creation.")
+ board_page.expect_and_dismiss_toaster(message: "Successful creation.")
# Move item to Second list
board_page.move_card(0, from: 'List 1', to: 'List 2')
diff --git a/modules/boards/spec/features/board_navigation_spec.rb b/modules/boards/spec/features/board_navigation_spec.rb
index 46d7c60dc8a..964971e4b45 100644
--- a/modules/boards/spec/features/board_navigation_spec.rb
+++ b/modules/boards/spec/features/board_navigation_spec.rb
@@ -61,7 +61,7 @@ describe 'Work Package boards spec', type: :feature, js: true do
board_page = board_index.open_board board_view
board_page.expect_query 'List 1', editable: true
board_page.add_card 'List 1', 'Task 1'
- board_page.expect_notification message: I18n.t(:notice_successful_create)
+ board_page.expect_toast message: I18n.t(:notice_successful_create)
wp = WorkPackage.last
expect(wp.subject).to eq 'Task 1'
@@ -85,7 +85,7 @@ describe 'Work Package boards spec', type: :feature, js: true do
# Add a second card, focus on that
board_page.add_card 'List 1', 'Foobar'
- board_page.expect_notification message: I18n.t(:notice_successful_create)
+ board_page.expect_toast message: I18n.t(:notice_successful_create)
wp = WorkPackage.last
expect(wp.subject).to eq 'Foobar'
@@ -120,7 +120,7 @@ describe 'Work Package boards spec', type: :feature, js: true do
board_page = board_index.open_board board_view
board_page.expect_query 'List 1', editable: true
board_page.add_card 'List 1', 'Task 1'
- board_page.expect_notification message: I18n.t(:notice_successful_create)
+ board_page.expect_toast message: I18n.t(:notice_successful_create)
wp = WorkPackage.last
expect(wp.subject).to eq 'Task 1'
@@ -155,7 +155,7 @@ describe 'Work Package boards spec', type: :feature, js: true do
board_page = board_index.open_board board_view
board_page.expect_query 'List 1', editable: true
board_page.add_card 'List 1', 'Task 1'
- board_page.expect_notification message: I18n.t(:notice_successful_create)
+ board_page.expect_toast message: I18n.t(:notice_successful_create)
wp = WorkPackage.last
expect(wp.subject).to eq 'Task 1'
diff --git a/modules/boards/spec/features/board_update_spec.rb b/modules/boards/spec/features/board_update_spec.rb
index d074f1445ad..85acea5441a 100644
--- a/modules/boards/spec/features/board_update_spec.rb
+++ b/modules/boards/spec/features/board_update_spec.rb
@@ -51,7 +51,7 @@ describe 'Work Package boards updating spec', type: :feature, js: true do
board_page = board_index.open_board board_view
board_page.expect_query 'List 1', editable: true
board_page.add_card 'List 1', 'Foo Bar'
- board_page.expect_notification message: I18n.t(:notice_successful_create)
+ board_page.expect_toast message: I18n.t(:notice_successful_create)
work_package = WorkPackage.last
expect(work_package.subject).to eq 'Foo Bar'
@@ -62,7 +62,7 @@ describe 'Work Package boards updating spec', type: :feature, js: true do
split_view.expect_subject
split_view.edit_field(:subject).update('My super cool new title')
- split_view.expect_and_dismiss_notification message: 'Successful update.'
+ split_view.expect_and_dismiss_toaster message: 'Successful update.'
card.expect_subject 'My super cool new title'
end
end
diff --git a/modules/boards/spec/features/support/board_page.rb b/modules/boards/spec/features/support/board_page.rb
index e16995f7af8..e2c1e0e0363 100644
--- a/modules/boards/spec/features/support/board_page.rb
+++ b/modules/boards/spec/features/support/board_page.rb
@@ -204,7 +204,7 @@ module Pages
def save
page.find('.editable-toolbar-title--save').click
- expect_and_dismiss_notification message: 'Successful update.'
+ expect_and_dismiss_toaster message: 'Successful update.'
end
def expect_changed
@@ -231,7 +231,7 @@ module Pages
click_list_dropdown name, 'Delete list'
accept_alert_dialog!
- expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
expect(page).to have_no_selector list_selector(name)
end
@@ -272,7 +272,7 @@ module Pages
click_dropdown_entry 'Delete'
accept_alert_dialog!
- expect_and_dismiss_notification message: I18n.t('js.notice_successful_delete')
+ expect_and_dismiss_toaster message: I18n.t('js.notice_successful_delete')
end
def back_to_index
@@ -306,7 +306,7 @@ module Pages
end
end
- expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
page.within('.toolbar-container') do
expect(page).to have_field('editable-toolbar-title', with: new_name)
@@ -323,7 +323,7 @@ module Pages
input.set to
input.send_keys :enter
- expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
end
def expect_query(name, editable: true)
@@ -359,8 +359,8 @@ module Pages
def add_list_modal_shows_warning(value, with_link: false)
within page.find('.op-modal') do
- warning = '.notification-box.-warning'
- link = '.notification-box--content a'
+ warning = '.op-toast.-warning'
+ link = '.op-toast--content a'
expect(page).to (value ? have_selector(warning) : have_no_selector(warning))
expect(page).to (with_link ? have_selector(link) : have_no_selector(link))
diff --git a/modules/budgets/spec/features/budgets/copy_budget_spec.rb b/modules/budgets/spec/features/budgets/copy_budget_spec.rb
index 404858f849a..04d0f18c30f 100644
--- a/modules/budgets/spec/features/budgets/copy_budget_spec.rb
+++ b/modules/budgets/spec/features/budgets/copy_budget_spec.rb
@@ -89,7 +89,7 @@ describe 'Copying a budget', type: :feature, js: true do
click_button 'Create'
- budget_page.expect_notification message: 'Successful creation.'
+ budget_page.expect_toast message: 'Successful creation.'
expect(page)
.to have_selector('.author', text: current_user.name)
diff --git a/modules/budgets/spec/features/costs_edit_fields_spec.rb b/modules/budgets/spec/features/costs_edit_fields_spec.rb
index 3487ea65bac..01bf3ab5f64 100644
--- a/modules/budgets/spec/features/costs_edit_fields_spec.rb
+++ b/modules/budgets/spec/features/costs_edit_fields_spec.rb
@@ -60,7 +60,7 @@ describe 'Work Package budget fields', type: :feature, js: true do
create_page.save!
- view_page.expect_notification(message: "Successful creation.")
+ view_page.expect_toast(message: "Successful creation.")
view_page.edit_field(:budget).expect_display_value budget.name
end
diff --git a/modules/budgets/spec/features/work_package_filter_spec.rb b/modules/budgets/spec/features/work_package_filter_spec.rb
index ddb8b99fa16..ea6ee4f2ced 100644
--- a/modules/budgets/spec/features/work_package_filter_spec.rb
+++ b/modules/budgets/spec/features/work_package_filter_spec.rb
@@ -82,7 +82,7 @@ describe 'Filter by budget', js: true do
wp_table.save_as('Some query name')
- wp_table.expect_and_dismiss_notification message: 'Successful creation.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful creation.'
filters.remove_filter 'budget'
diff --git a/modules/budgets/spec/support/pages/budget_form.rb b/modules/budgets/spec/support/pages/budget_form.rb
index dc0cae0b39c..881aab6e624 100644
--- a/modules/budgets/spec/support/pages/budget_form.rb
+++ b/modules/budgets/spec/support/pages/budget_form.rb
@@ -182,7 +182,7 @@ module Pages
@labor_rows ||= 0
end
- def notification_type
+ def toast_type
:rails
end
end
diff --git a/modules/dashboards/spec/features/custom_text_spec.rb b/modules/dashboards/spec/features/custom_text_spec.rb
index f52bee42f1e..85a85d0be33 100644
--- a/modules/dashboards/spec/features/custom_text_spec.rb
+++ b/modules/dashboards/spec/features/custom_text_spec.rb
@@ -86,7 +86,7 @@ describe 'Project description widget on dashboard', type: :feature, js: true do
field.save!
- dashboard_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
within('#content') do
expect(page).to have_selector("a[href=\"/projects/#{project.identifier}/work_packages/new?type=#{type.id}\"]")
@@ -108,7 +108,7 @@ describe 'Project description widget on dashboard', type: :feature, js: true do
field.save!
end
- dashboard_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
within custom_text_widget.area do
expect(page)
@@ -123,7 +123,7 @@ describe 'Project description widget on dashboard', type: :feature, js: true do
.to have_selector('.inline-edit--display-field', text: 'My own little text')
end
- dashboard_page.expect_no_notification message: I18n.t('js.notice_successful_update')
+ dashboard_page.expect_no_toaster message: I18n.t('js.notice_successful_update')
within custom_text_widget.area do
# adding an image
@@ -143,7 +143,7 @@ describe 'Project description widget on dashboard', type: :feature, js: true do
field.save!
end
- dashboard_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
within custom_text_widget.area do
expect(page)
diff --git a/modules/dashboards/spec/features/project_description_spec.rb b/modules/dashboards/spec/features/project_description_spec.rb
index e23d84e2c74..953855bb519 100644
--- a/modules/dashboards/spec/features/project_description_spec.rb
+++ b/modules/dashboards/spec/features/project_description_spec.rb
@@ -63,7 +63,7 @@ describe 'Project description widget on dashboard', type: :feature, js: true do
dashboard_page.visit!
dashboard_page.add_widget(1, 1, :within, "Project description")
- dashboard_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
end
before do
@@ -143,7 +143,7 @@ describe 'Project description widget on dashboard', type: :feature, js: true do
field.save!
- dashboard_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
within('#content') do
expect(page).to have_selector("a[href=\"/projects/#{project.identifier}/work_packages/new?type=#{type.id}\"]")
diff --git a/modules/dashboards/spec/features/project_details_spec.rb b/modules/dashboards/spec/features/project_details_spec.rb
index 50ff6876453..69a2d861949 100644
--- a/modules/dashboards/spec/features/project_details_spec.rb
+++ b/modules/dashboards/spec/features/project_details_spec.rb
@@ -95,7 +95,7 @@ describe 'Project details widget on dashboard', type: :feature, js: true do
dashboard_page.visit!
dashboard_page.add_widget(1, 1, :within, "Project details")
- dashboard_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
end
def change_cf_value(cf, old_value, new_value)
diff --git a/modules/dashboards/spec/features/project_status_spec.rb b/modules/dashboards/spec/features/project_status_spec.rb
index 23966cd618e..3f87df04e59 100644
--- a/modules/dashboards/spec/features/project_status_spec.rb
+++ b/modules/dashboards/spec/features/project_status_spec.rb
@@ -66,7 +66,7 @@ describe 'Project status widget on dashboard', type: :feature, js: true do
dashboard_page.visit!
dashboard_page.add_widget(1, 1, :within, "Project status")
- dashboard_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ dashboard_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
end
before do
diff --git a/modules/grids/spec/support/pages/grid.rb b/modules/grids/spec/support/pages/grid.rb
index d1ab8dddad9..0313d2258d8 100644
--- a/modules/grids/spec/support/pages/grid.rb
+++ b/modules/grids/spec/support/pages/grid.rb
@@ -59,7 +59,7 @@ module Pages
.to have_content(I18n.t('js.grid.add_widget'))
expect(page)
- .to have_selector('.notification-box.-ee-upsale', text: I18n.t('js.upsale.ee_only'))
+ .to have_selector('.op-toast.-ee-upsale', text: I18n.t('js.upsale.ee_only'))
end
end
diff --git a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/index.html.erb b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/index.html.erb
index 75b41909e7d..b770c40d4e5 100644
--- a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/index.html.erb
+++ b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/index.html.erb
@@ -22,8 +22,8 @@
</li>
<% end %>
-<div class="notification-box -info">
- <div class="notification-box--content">
+<div class="op-toast -info">
+ <div class="op-toast--content">
<strong><%= t('note') %></strong>
<%= t('ldap_groups.synchronized_groups.help_text_html') %>
</div>
diff --git a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/upsale.html.erb b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/upsale.html.erb
index bc86f286441..8c118f3a331 100644
--- a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/upsale.html.erb
+++ b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/upsale.html.erb
@@ -1,8 +1,8 @@
<% html_title(t(:label_administration), t('ldap_groups.synchronized_groups.plural')) -%>
<%= breadcrumb_toolbar(t('ldap_groups.synchronized_groups.plural')) %>
-<div class="notification-box upsale-notification">
- <div class="notification-box--content">
+<div class="op-toast upsale-notification">
+ <div class="op-toast--content">
<h3><%= t('admin.enterprise.upgrade_to_ee') %></h3>
<%= image_tag "enterprise_edition.png", class: "widget-box--teaser-image" %>
diff --git a/modules/meeting/spec/features/meetings_attachments_spec.rb b/modules/meeting/spec/features/meetings_attachments_spec.rb
index a5f6b71bd3a..e090c1ef291 100644
--- a/modules/meeting/spec/features/meetings_attachments_spec.rb
+++ b/modules/meeting/spec/features/meetings_attachments_spec.rb
@@ -65,13 +65,13 @@ describe 'Add an attachment to a meeting (agenda)', js: true do
# Attach file manually
expect(page).to have_no_selector('.work-package--attachments--filename')
attachments.attach_file_on_input(image_fixture.path)
- expect(page).not_to have_selector('notification-upload-progress')
+ expect(page).not_to have_selector('op-toasters-upload-progress')
expect(page).to have_selector('.work-package--attachments--filename', text: 'image.png', wait: 5)
##
# and via drag & drop
attachments.drag_and_drop_file(container, image_fixture.path)
- expect(page).not_to have_selector('notification-upload-progress')
+ expect(page).not_to have_selector('op-toasters-upload-progress')
expect(page).to have_selector('.work-package--attachments--filename', text: 'image.png', count: 2, wait: 5)
end
end
diff --git a/modules/meeting/spec/features/meetings_new_spec.rb b/modules/meeting/spec/features/meetings_new_spec.rb
index f45d2dad879..0720873ea28 100644
--- a/modules/meeting/spec/features/meetings_new_spec.rb
+++ b/modules/meeting/spec/features/meetings_new_spec.rb
@@ -77,7 +77,7 @@ describe 'Meetings new', type: :feature do
# Error when no title is provided. Only works without js as otherwise html5 would already catch this
new_page.click_create
- new_page.expect_notification(type: :error, message: "Title can't be blank")
+ new_page.expect_toast(type: :error, message: "Title can't be blank")
new_page.set_title 'Some title'
new_page.set_start_date '2013-03-28'
@@ -87,7 +87,7 @@ describe 'Meetings new', type: :feature do
show_page = new_page.click_create
- show_page.expect_notification(message: 'Successful creation')
+ show_page.expect_toast(message: 'Successful creation')
show_page.expect_invited(user, other_user)
@@ -118,7 +118,7 @@ describe 'Meetings new', type: :feature do
show_page = new_page.click_create
- show_page.expect_notification(message: 'Successful creation')
+ show_page.expect_toast(message: 'Successful creation')
# Not sure if that is then intended behaviour but that is what is currently programmed
show_page.expect_invited(admin)
diff --git a/modules/meeting/spec/features/meetings_participants_spec.rb b/modules/meeting/spec/features/meetings_participants_spec.rb
index f2f87a6cea7..3f0dba3d3ce 100644
--- a/modules/meeting/spec/features/meetings_participants_spec.rb
+++ b/modules/meeting/spec/features/meetings_participants_spec.rb
@@ -69,7 +69,7 @@ describe 'Meetings participants', type: :feature do
edit_page.invite(viewer_user)
show_page = edit_page.click_save
- show_page.expect_notification(message: 'Successful update')
+ show_page.expect_toast(message: 'Successful update')
show_page.expect_invited(viewer_user)
@@ -77,7 +77,7 @@ describe 'Meetings participants', type: :feature do
edit_page.uninvite(viewer_user)
show_page = edit_page.click_save
- show_page.expect_notification(message: 'Successful update')
+ show_page.expect_toast(message: 'Successful update')
show_page.expect_uninvited(viewer_user)
end
diff --git a/modules/meeting/spec/support/pages/meetings/base.rb b/modules/meeting/spec/support/pages/meetings/base.rb
index a08a359f412..09a374eb055 100644
--- a/modules/meeting/spec/support/pages/meetings/base.rb
+++ b/modules/meeting/spec/support/pages/meetings/base.rb
@@ -34,7 +34,7 @@ module Pages::Meetings
self.project = project
end
- def notification_type
+ def toast_type
:rails
end
end
diff --git a/modules/my_page/spec/features/my/accountable_spec.rb b/modules/my_page/spec/features/my/accountable_spec.rb
index 2815f9ab2bd..cf7c502e914 100644
--- a/modules/my_page/spec/features/my/accountable_spec.rb
+++ b/modules/my_page/spec/features/my/accountable_spec.rb
@@ -87,7 +87,7 @@ describe 'Accountable widget on my page', type: :feature, js: true do
# browser can get confused. Therefore we wait.
sleep(1)
- my_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ my_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
accountable_area = Components::Grids::GridArea.new('.grid--area.-widgeted:nth-of-type(3)')
@@ -96,7 +96,7 @@ describe 'Accountable widget on my page', type: :feature, js: true do
assigned_area = Components::Grids::GridArea.new('.grid--area.-widgeted:nth-of-type(1)')
assigned_area.remove
- my_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ my_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
created_area = Components::Grids::GridArea.new('.grid--area.-widgeted:nth-of-type(1)')
created_area.expect_to_span(1, 1, 2, 2)
diff --git a/modules/my_page/spec/features/my/assigned_to_me_spec.rb b/modules/my_page/spec/features/my/assigned_to_me_spec.rb
index b26641be129..11529137861 100644
--- a/modules/my_page/spec/features/my/assigned_to_me_spec.rb
+++ b/modules/my_page/spec/features/my/assigned_to_me_spec.rb
@@ -159,7 +159,7 @@ describe 'Assigned to me embedded query on my page', type: :feature, js: true do
type_field.openSelectField
type_field.set_value type.name
- embedded_table.expect_notification(
+ embedded_table.expect_toast(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
@@ -192,7 +192,7 @@ describe 'Assigned to me embedded query on my page', type: :feature, js: true do
assigned_area.resize_to(1, 2)
- my_page.expect_notification(message: I18n.t('js.notice_successful_update'))
+ my_page.expect_toast(message: I18n.t('js.notice_successful_update'))
assigned_area.expect_to_span(1, 1, 2, 3)
# has been moved down by resizing
diff --git a/modules/my_page/spec/features/my/my_page_spec.rb b/modules/my_page/spec/features/my/my_page_spec.rb
index 03b10a0f135..1c6000fbf0b 100644
--- a/modules/my_page/spec/features/my/my_page_spec.rb
+++ b/modules/my_page/spec/features/my/my_page_spec.rb
@@ -159,7 +159,7 @@ describe 'My page', type: :feature, js: true do
# that widgets that have been there are moved down
created_area.drag_to(1, 3)
- my_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ my_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
reload_grid!
@@ -174,7 +174,7 @@ describe 'My page', type: :feature, js: true do
# as no more widgets start in the second column, that column is removed
news_area.drag_to(1, 3)
- my_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ my_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
reload_grid!
diff --git a/modules/my_page/spec/features/my/time_entries_current_user_spec.rb b/modules/my_page/spec/features/my/time_entries_current_user_spec.rb
index e344a3e684e..1b16c36624b 100644
--- a/modules/my_page/spec/features/my/time_entries_current_user_spec.rb
+++ b/modules/my_page/spec/features/my/time_entries_current_user_spec.rb
@@ -114,7 +114,7 @@ describe 'My page time entries current user widget spec', type: :feature, js: tr
entries_area = Components::Grids::GridArea.new('.grid--area.-widgeted:nth-of-type(1)')
- my_page.expect_and_dismiss_notification message: I18n.t(:notice_successful_update)
+ my_page.expect_and_dismiss_toaster message: I18n.t(:notice_successful_update)
entries_area.expect_to_span(1, 1, 2, 2)
@@ -190,7 +190,7 @@ describe 'My page time entries current user widget spec', type: :feature, js: tr
time_logging_modal.perform_action 'Create'
time_logging_modal.is_visible false
- my_page.expect_and_dismiss_notification message: I18n.t(:notice_successful_create)
+ my_page.expect_and_dismiss_toaster message: I18n.t(:notice_successful_create)
within entries_area.area do
expect(page)
@@ -228,7 +228,7 @@ describe 'My page time entries current user widget spec', type: :feature, js: tr
time_logging_modal.is_visible false
sleep(0.1)
- my_page.expect_and_dismiss_notification message: I18n.t(:notice_successful_update)
+ my_page.expect_and_dismiss_toaster message: I18n.t(:notice_successful_update)
within entries_area.area do
find("td.fc-timegrid-col:nth-of-type(3) .te-calendar--time-entry").hover
diff --git a/modules/my_page/spec/features/my/work_package_table_spec.rb b/modules/my_page/spec/features/my/work_package_table_spec.rb
index 7b65ff1a9dc..dd9dcea5c34 100644
--- a/modules/my_page/spec/features/my/work_package_table_spec.rb
+++ b/modules/my_page/spec/features/my/work_package_table_spec.rb
@@ -84,7 +84,7 @@ describe 'Arbitrary WorkPackage query table widget on my page', type: :feature,
# browser can get confused. Therefore we wait.
sleep(1)
- my_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ my_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
filter_area = Components::Grids::GridArea.new('.grid--area.-widgeted:nth-of-type(3)')
filter_area.expect_to_span(1, 2, 2, 3)
@@ -127,7 +127,7 @@ describe 'Arbitrary WorkPackage query table widget on my page', type: :feature,
input.native.send_keys(:return)
end
- my_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ my_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
sleep(1)
diff --git a/modules/openid_connect/app/views/openid_connect/providers/upsale.html.erb b/modules/openid_connect/app/views/openid_connect/providers/upsale.html.erb
index 37046d3d622..bc4637abf64 100644
--- a/modules/openid_connect/app/views/openid_connect/providers/upsale.html.erb
+++ b/modules/openid_connect/app/views/openid_connect/providers/upsale.html.erb
@@ -2,8 +2,8 @@
<%= breadcrumb_toolbar(t('openid_connect.providers.plural')) %>
-<div class="notification-box upsale-notification">
- <div class="notification-box--content">
+<div class="op-toast upsale-notification">
+ <div class="op-toast--content">
<h3><%= t('admin.enterprise.upgrade_to_ee') %></h3>
<%= image_tag "enterprise_edition.png", class: "widget-box--teaser-image" %>
diff --git a/modules/overviews/spec/features/managing_overview_page_spec.rb b/modules/overviews/spec/features/managing_overview_page_spec.rb
index 91982cac5de..7c6c12ac759 100644
--- a/modules/overviews/spec/features/managing_overview_page_spec.rb
+++ b/modules/overviews/spec/features/managing_overview_page_spec.rb
@@ -103,7 +103,7 @@ describe 'Overview page managing', type: :feature, js: true, with_mail: false do
# browser can get confused. Therefore we wait.
sleep(1)
- overview_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ overview_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
table_area = Components::Grids::GridArea.new('.grid--area.-widgeted:nth-of-type(6)')
table_area.expect_to_span(1, 1, 2, 2)
@@ -111,13 +111,13 @@ describe 'Overview page managing', type: :feature, js: true, with_mail: false do
# A useless resizing shows no message and does not alter the size
table_area.resize_to(1, 1)
- overview_page.expect_no_notification message: I18n.t('js.notice_successful_update')
+ overview_page.expect_no_toaster message: I18n.t('js.notice_successful_update')
table_area.expect_to_span(1, 1, 2, 2)
table_area.resize_to(1, 2)
- overview_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ overview_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
# Resizing leads to the table area now spanning a larger area
table_area.expect_to_span(1, 1, 2, 3)
diff --git a/modules/two_factor_authentication/app/views/two_factor_authentication/my/backup_codes/show.html.erb b/modules/two_factor_authentication/app/views/two_factor_authentication/my/backup_codes/show.html.erb
index 7e6ed17a07c..f0d4a40e7cb 100644
--- a/modules/two_factor_authentication/app/views/two_factor_authentication/my/backup_codes/show.html.erb
+++ b/modules/two_factor_authentication/app/views/two_factor_authentication/my/backup_codes/show.html.erb
@@ -8,8 +8,8 @@
</small>
</h1>
-<div class="notification-box show-when-print -warning">
- <div class="notification-box--content">
+<div class="op-toast show-when-print -warning">
+ <div class="op-toast--content">
<p>
<strong><%= t 'two_factor_authentication.backup_codes.generate.keep_safe_as_password' %></strong>
<%= t 'two_factor_authentication.backup_codes.generate.keep_safe_warning' %>
diff --git a/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb b/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb
index af78635a9e3..c20a2c44329 100644
--- a/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb
+++ b/modules/two_factor_authentication/app/views/two_factor_authentication/my/two_factor_devices/index.html.erb
@@ -3,8 +3,8 @@
<% if @has_remember_token_for_user %>
<section class="account--section" id="two_factor_authentication_remember_cookie">
- <div class="notification-box show-when-print -info">
- <div class="notification-box--content">
+ <div class="op-toast show-when-print -info">
+ <div class="op-toast--content">
<p>
<strong><%= t(:note) %></strong>
<% if @remember_token %>
diff --git a/modules/two_factor_authentication/spec/features/backup_codes/generate_backup_codes.rb b/modules/two_factor_authentication/spec/features/backup_codes/generate_backup_codes.rb
index 8c06059e8df..e8a90e25e9d 100644
--- a/modules/two_factor_authentication/spec/features/backup_codes/generate_backup_codes.rb
+++ b/modules/two_factor_authentication/spec/features/backup_codes/generate_backup_codes.rb
@@ -38,7 +38,7 @@ describe 'Generate 2FA backup codes', with_2fa_ee: true, type: :feature,
click_on I18n.t('two_factor_authentication.backup_codes.generate.title')
dialog.confirm_flow_with user_password, should_fail: false
- expect(page).to have_selector('.notification-box.-warning')
+ expect(page).to have_selector('.op-toast.-warning')
backup_codes.each do |code|
expect(page).to have_selector('.two-factor-authentication--backup-codes li', text: code)
end
diff --git a/spec/controllers/news_controller_spec.rb b/spec/controllers/news_controller_spec.rb
index b8b1a69afa6..240153e1004 100644
--- a/spec/controllers/news_controller_spec.rb
+++ b/spec/controllers/news_controller_spec.rb
@@ -138,7 +138,7 @@ describe NewsController, type: :controller do
expect(assigns(:news)).not_to be_nil
expect(assigns(:news)).to be_new_record
- expect(response.body).to have_selector('div.notification-box.-error', text: /1 error/)
+ expect(response.body).to have_selector('div.op-toast.-error', text: /1 error/)
end
end
diff --git a/spec/features/admin/enterprise/enterprise_trial_spec.rb b/spec/features/admin/enterprise/enterprise_trial_spec.rb
index b5650f0f5b2..df6c192d888 100644
--- a/spec/features/admin/enterprise/enterprise_trial_spec.rb
+++ b/spec/features/admin/enterprise/enterprise_trial_spec.rb
@@ -258,7 +258,7 @@ describe 'Enterprise trial management',
it 'can confirm that trial regularly' do
find('.op-modal--body [data-qa-selector="op-ee-trial-waiting-resend-link"]', text: 'Resend').click
- expect(page).to have_selector('.notification-box.-success', text: 'Email has been resent.', wait: 20)
+ expect(page).to have_selector('.op-toast.-success', text: 'Email has been resent.', wait: 20)
expect(page).to have_text '[email protected]'
expect(page).to have_text 'email sent - waiting for confirmation'
diff --git a/spec/features/custom_fields/multi_user_custom_field_spec.rb b/spec/features/custom_fields/multi_user_custom_field_spec.rb
index 587115954d7..efb87851520 100644
--- a/spec/features/custom_fields/multi_user_custom_field_spec.rb
+++ b/spec/features/custom_fields/multi_user_custom_field_spec.rb
@@ -73,7 +73,7 @@ describe "multi select custom values", js: true do
expect(page).to have_text "groupfoo"
expect(page).to have_text "PLACEHOLDER"
- wp_page.expect_and_dismiss_notification(message: "Successful update.")
+ wp_page.expect_and_dismiss_toaster(message: "Successful update.")
work_package.reload
cvs = work_package
@@ -86,7 +86,7 @@ describe "multi select custom values", js: true do
cf_edit_field.unset_value "Da Real", true
cf_edit_field.submit_by_dashboard
- wp_page.expect_and_dismiss_notification(message: "Successful update.")
+ wp_page.expect_and_dismiss_toaster(message: "Successful update.")
expect(page).to have_text "groupfoo"
expect(page).to have_text "PLACEHOLDER"
@@ -150,7 +150,7 @@ describe "multi select custom values", js: true do
cf_edit_field.set_value "Cooper Quatermaine"
click_on "Reviewer: Save"
- wp_page.expect_and_dismiss_notification(message: "Successful update.")
+ wp_page.expect_and_dismiss_toaster(message: "Successful update.")
expect(page).to have_selector('.custom-option', count: 2)
expect(page).to have_text custom_field.name
diff --git a/spec/features/custom_fields/multi_value_custom_field_spec.rb b/spec/features/custom_fields/multi_value_custom_field_spec.rb
index 3289af5f55a..fbdf8dcfb23 100644
--- a/spec/features/custom_fields/multi_value_custom_field_spec.rb
+++ b/spec/features/custom_fields/multi_value_custom_field_spec.rb
@@ -141,7 +141,7 @@ describe "multi select custom values", clear_cache: true, js: true do
wp1_field.submit_by_dashboard
- wp_page.expect_and_dismiss_notification message: 'Successful update'
+ wp_page.expect_and_dismiss_toaster message: 'Successful update'
# Expect changed groups
expect(page).to have_selector('.group--value .count', count: 1)
@@ -155,7 +155,7 @@ describe "multi select custom values", clear_cache: true, js: true do
field.unset_value "ham", true
field.submit_by_dashboard
- wp_page.expect_and_dismiss_notification message: 'Successful update'
+ wp_page.expect_and_dismiss_toaster message: 'Successful update'
# Expect none selected in split and table
field.expect_state_text '-'
diff --git a/spec/features/forums/attachment_upload_spec.rb b/spec/features/forums/attachment_upload_spec.rb
index e44ae109a58..9b7d41241e6 100644
--- a/spec/features/forums/attachment_upload_spec.rb
+++ b/spec/features/forums/attachment_upload_spec.rb
@@ -61,7 +61,7 @@ describe 'Upload attachment to forum message', js: true do
editor.drag_attachment image_fixture.path, 'Image uploaded on creation'
expect(page).to have_selector('attachment-list-item', text: 'image.png')
- expect(page).not_to have_selector('notification-upload-progress')
+ expect(page).not_to have_selector('op-toasters-upload-progress')
show_page = create_page.click_save
@@ -81,7 +81,7 @@ describe 'Upload attachment to forum message', js: true do
editor.drag_attachment image_fixture.path, 'Image uploaded the second time'
expect(page).to have_selector('attachment-list-item', text: 'image.png', count: 2)
- expect(page).not_to have_selector('notification-upload-progress')
+ expect(page).not_to have_selector('op-toasters-upload-progress')
show_page.click_save
diff --git a/spec/features/forums/message_spec.rb b/spec/features/forums/message_spec.rb
index ce7916d01cb..5aa4c6d696c 100644
--- a/spec/features/forums/message_spec.rb
+++ b/spec/features/forums/message_spec.rb
@@ -76,7 +76,7 @@ describe 'messages', type: :feature, js: true do
create_page.set_subject 'The message is'
create_page.click_save
- create_page.expect_notification(type: :error, message: 'Content can\'t be blank')
+ create_page.expect_toast(type: :error, message: 'Content can\'t be blank')
SeleniumHubWaiter.wait
create_page.add_text 'There is no message here'
diff --git a/spec/features/notifications/notification_center/notification_center_sidemenu_spec.rb b/spec/features/notifications/notification_center/notification_center_sidemenu_spec.rb
index 69f384efa72..b38c3dfea8f 100644
--- a/spec/features/notifications/notification_center/notification_center_sidemenu_spec.rb
+++ b/spec/features/notifications/notification_center/notification_center_sidemenu_spec.rb
@@ -70,7 +70,7 @@ describe "Notification center sidemenu", type: :feature, js: true do
expect(page).to have_text 'New notifications will appear here when there is activity that concerns you'
- center.expect_no_notification
+ center.expect_no_toaster
side_menu.expect_item_with_no_count 'Inbox'
side_menu.expect_item_with_no_count 'Assigned'
diff --git a/spec/features/notifications/notification_center/notification_center_spec.rb b/spec/features/notifications/notification_center/notification_center_spec.rb
index 64bab5dc131..3a89b6d65d0 100644
--- a/spec/features/notifications/notification_center/notification_center_spec.rb
+++ b/spec/features/notifications/notification_center/notification_center_spec.rb
@@ -135,7 +135,7 @@ describe "Notification center", type: :feature, js: true, with_settings: { journ
center.expect_work_package_item notification2
center.expect_no_toaster
notification3.update(read_ian: false)
- center.expect_toaster
+ center.expect_toast
center.update_via_toaster
center.expect_no_toaster
center.expect_work_package_item notification
diff --git a/spec/features/notifications/settings/immediate_reminder_spec.rb b/spec/features/notifications/settings/immediate_reminder_spec.rb
index 2d173435a2c..75e19951c0b 100644
--- a/spec/features/notifications/settings/immediate_reminder_spec.rb
+++ b/spec/features/notifications/settings/immediate_reminder_spec.rb
@@ -17,7 +17,7 @@ describe "Immediate reminder settings", type: :feature, js: true do
reminders_settings_page.save
- reminders_settings_page.expect_and_dismiss_notification(message: I18n.t('js.notice_successful_update'))
+ reminders_settings_page.expect_and_dismiss_toaster(message: I18n.t('js.notice_successful_update'))
reminders_settings_page.reload!
diff --git a/spec/features/notifications/settings/pause_reminder_settings_spec.rb b/spec/features/notifications/settings/pause_reminder_settings_spec.rb
index e60f7a7049d..f8fde30b575 100644
--- a/spec/features/notifications/settings/pause_reminder_settings_spec.rb
+++ b/spec/features/notifications/settings/pause_reminder_settings_spec.rb
@@ -22,7 +22,7 @@ describe "Pause reminder settings", type: :feature, js: true do
reminders_settings_page.save
- reminders_settings_page.expect_and_dismiss_notification(message: I18n.t('js.notice_successful_update'))
+ reminders_settings_page.expect_and_dismiss_toaster(message: I18n.t('js.notice_successful_update'))
reminders_settings_page.reload!
diff --git a/spec/features/notifications/settings/reminder_email_settings_spec.rb b/spec/features/notifications/settings/reminder_email_settings_spec.rb
index 50335ed89ac..a2a5f09919a 100644
--- a/spec/features/notifications/settings/reminder_email_settings_spec.rb
+++ b/spec/features/notifications/settings/reminder_email_settings_spec.rb
@@ -21,7 +21,7 @@ describe "Reminder email", type: :feature, js: true do
reminders_settings_page.save
- reminders_settings_page.expect_and_dismiss_notification(message: I18n.t('js.notice_successful_update'))
+ reminders_settings_page.expect_and_dismiss_toaster(message: I18n.t('js.notice_successful_update'))
reminders_settings_page.reload!
@@ -33,7 +33,7 @@ describe "Reminder email", type: :feature, js: true do
reminders_settings_page.save
- reminders_settings_page.expect_and_dismiss_notification(message: I18n.t('js.notice_successful_update'))
+ reminders_settings_page.expect_and_dismiss_toaster(message: I18n.t('js.notice_successful_update'))
reminders_settings_page.reload!
diff --git a/spec/features/notifications/settings/workdays_settings_spec.rb b/spec/features/notifications/settings/workdays_settings_spec.rb
index d2683739267..60791921438 100644
--- a/spec/features/notifications/settings/workdays_settings_spec.rb
+++ b/spec/features/notifications/settings/workdays_settings_spec.rb
@@ -28,7 +28,7 @@ describe "Workday notification settings", type: :feature, js: true do
settings_page.save
- settings_page.expect_and_dismiss_notification(message: I18n.t('js.notice_successful_update'))
+ settings_page.expect_and_dismiss_toaster(message: I18n.t('js.notice_successful_update'))
settings_page.reload!
@@ -62,7 +62,7 @@ describe "Workday notification settings", type: :feature, js: true do
settings_page.save
- settings_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_update')
+ settings_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_update')
settings_page.reload!
diff --git a/spec/features/oauth/authorization_code_flow_spec.rb b/spec/features/oauth/authorization_code_flow_spec.rb
index 98cae1dc4f3..86b2e00170e 100644
--- a/spec/features/oauth/authorization_code_flow_spec.rb
+++ b/spec/features/oauth/authorization_code_flow_spec.rb
@@ -120,7 +120,7 @@ describe 'OAuth authorization code flow',
login_with user.login, 'adminADMIN!', visit_signin_path: false
# But we got no further
- expect(page).to have_selector('.notification-box.-error',
+ expect(page).to have_selector('.op-toast.-error',
text: 'Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.')
# And also have no grant for this application
diff --git a/spec/features/page_objects/notification.rb b/spec/features/page_objects/notification.rb
index 93edca4138f..e643ee3c5f2 100644
--- a/spec/features/page_objects/notification.rb
+++ b/spec/features/page_objects/notification.rb
@@ -39,7 +39,7 @@ module PageObjects
def expect_type(type, message)
raise "Unimplemented type #{type}." unless types.include?(type)
- expect(page).to have_selector(".notification-box.-#{type}", text: message, wait: 10)
+ expect(page).to have_selector(".op-toast.-#{type}", text: message, wait: 10)
end
def expect_success(message)
diff --git a/spec/features/projects/modules_spec.rb b/spec/features/projects/modules_spec.rb
index 3b84fc53e26..4a34ba62b8c 100644
--- a/spec/features/projects/modules_spec.rb
+++ b/spec/features/projects/modules_spec.rb
@@ -65,7 +65,7 @@ describe 'Projects module administration',
click_button 'Save'
- settings_page.expect_notification message: I18n.t(:notice_successful_update)
+ settings_page.expect_toast message: I18n.t(:notice_successful_update)
expect(page)
.to have_checked_field 'Activity'
@@ -81,7 +81,7 @@ describe 'Projects module administration',
click_button 'Save'
expect(page)
- .to have_selector '.notification-box.-error',
+ .to have_selector '.op-toast.-error',
text: I18n.t(:'activerecord.errors.models.project.attributes.enabled_modules.dependency_missing',
dependency: 'Work package tracking',
module: 'Calendar')
@@ -90,7 +90,7 @@ describe 'Projects module administration',
click_button 'Save'
- settings_page.expect_notification message: I18n.t(:notice_successful_update)
+ settings_page.expect_toast message: I18n.t(:notice_successful_update)
expect(page)
.to have_checked_field 'Activity'
diff --git a/spec/features/repositories/repository_settings_spec.rb b/spec/features/repositories/repository_settings_spec.rb
index 17460c1f1ff..9257413be8f 100644
--- a/spec/features/repositories/repository_settings_spec.rb
+++ b/spec/features/repositories/repository_settings_spec.rb
@@ -84,7 +84,7 @@ describe 'Repository Settings', type: :feature, js: true do
else
SeleniumHubWaiter.wait
find('a.icon-remove', text: I18n.t(:button_remove)).click
- expect(page).to have_selector('.notification-box.-warning')
+ expect(page).to have_selector('.op-toast.-warning')
SeleniumHubWaiter.wait
find('a', text: I18n.t(:button_remove)).click
end
diff --git a/spec/features/statuses/read_only_statuses_spec.rb b/spec/features/statuses/read_only_statuses_spec.rb
index 42c28efadd8..835cfdf5094 100644
--- a/spec/features/statuses/read_only_statuses_spec.rb
+++ b/spec/features/statuses/read_only_statuses_spec.rb
@@ -84,7 +84,7 @@ describe 'Read-only statuses affect work package editing',
status_field.expect_state_text 'Unlocked'
status_field.update 'Locked'
- wp_page.expect_and_dismiss_notification(message: 'Successful update.')
+ wp_page.expect_and_dismiss_toaster(message: 'Successful update.')
status_field.expect_state_text 'Locked'
diff --git a/spec/features/wiki/attachment_upload_spec.rb b/spec/features/wiki/attachment_upload_spec.rb
index 323fc127b60..fa604f3a444 100644
--- a/spec/features/wiki/attachment_upload_spec.rb
+++ b/spec/features/wiki/attachment_upload_spec.rb
@@ -54,7 +54,7 @@ describe 'Upload attachment to wiki page', js: true do
editor.drag_attachment image_fixture.path, 'Image uploaded the first time'
expect(page).to have_selector('attachment-list-item', text: 'image.png')
- expect(page).not_to have_selector('notification-upload-progress')
+ expect(page).not_to have_selector('op-toasters-upload-progress')
click_on 'Save'
@@ -76,7 +76,7 @@ describe 'Upload attachment to wiki page', js: true do
editor.drag_attachment image_fixture.path, 'Image uploaded the second time'
- expect(page).not_to have_selector('notification-upload-progress')
+ expect(page).not_to have_selector('op-toasters-upload-progress')
expect(page).to have_selector('attachment-list-item', text: 'image.png', count: 2)
editor.in_editor do |container, _|
@@ -115,7 +115,7 @@ describe 'Upload attachment to wiki page', js: true do
# Upload image to dropzone
expect(page).to have_no_selector('.work-package--attachments--filename')
attachments.attach_file_on_input(image_fixture.path)
- expect(page).not_to have_selector('notification-upload-progress')
+ expect(page).not_to have_selector('op-toasters-upload-progress')
expect(page).to have_selector('.work-package--attachments--filename', text: 'image.png')
# Assume we could still save the page with an empty title
diff --git a/spec/features/work_packages/attachments/attachment_upload_spec.rb b/spec/features/work_packages/attachments/attachment_upload_spec.rb
index 86883d77788..5baddbcba5e 100644
--- a/spec/features/work_packages/attachments/attachment_upload_spec.rb
+++ b/spec/features/work_packages/attachments/attachment_upload_spec.rb
@@ -100,7 +100,7 @@ describe 'Upload attachment to work package', js: true do
attachments.drag_and_drop_file(target, image_fixture.path)
sleep 2
- expect(page).not_to have_selector('notification-upload-progress')
+ expect(page).not_to have_selector('op-toasters-upload-progress')
editor.in_editor do |_container, editable|
expect(editable).to have_selector('img[src*="/api/v3/attachments/"]', wait: 20)
@@ -118,7 +118,7 @@ describe 'Upload attachment to work package', js: true do
scroll_to_and_click find('#work-packages--edit-actions-save')
- wp_page.expect_notification(
+ wp_page.expect_toast(
message: 'Successful creation.'
)
@@ -171,13 +171,13 @@ describe 'Upload attachment to work package', js: true do
# Attach file manually
expect(page).to have_no_selector('.work-package--attachments--filename')
attachments.attach_file_on_input(image_fixture.path)
- expect(page).not_to have_selector('notification-upload-progress')
+ expect(page).not_to have_selector('op-toasters-upload-progress')
expect(page).to have_selector('.work-package--attachments--filename', text: 'image.png', wait: 5)
##
# and via drag & drop
attachments.drag_and_drop_file(container, image_fixture.path)
- expect(page).not_to have_selector('notification-upload-progress')
+ expect(page).not_to have_selector('op-toasters-upload-progress')
expect(page).to have_selector('.work-package--attachments--filename', text: 'image.png', count: 2, wait: 5)
end
end
diff --git a/spec/features/work_packages/bulk/update_work_package_spec.rb b/spec/features/work_packages/bulk/update_work_package_spec.rb
index 084d7bae58b..3438220279c 100644
--- a/spec/features/work_packages/bulk/update_work_package_spec.rb
+++ b/spec/features/work_packages/bulk/update_work_package_spec.rb
@@ -100,9 +100,9 @@ describe 'Bulk update work packages through Rails view', js: true do
fill_in 'work_package_start_date', with: '123'
click_on 'Submit'
- expect(page).to have_selector('.notification-box', text: I18n.t('work_packages.bulk.could_not_be_saved'))
- expect(page).to have_selector('.notification-box', text: work_package.id)
- expect(page).to have_selector('.notification-box', text: work_package2.id)
+ expect(page).to have_selector('.op-toast', text: I18n.t('work_packages.bulk.could_not_be_saved'))
+ expect(page).to have_selector('.op-toast', text: work_package.id)
+ expect(page).to have_selector('.op-toast', text: work_package2.id)
# Should not update the status
work_package2.reload
diff --git a/spec/features/work_packages/cards/wp_card_status_spec.rb b/spec/features/work_packages/cards/wp_card_status_spec.rb
index d04c87311d2..70f578bb1ff 100644
--- a/spec/features/work_packages/cards/wp_card_status_spec.rb
+++ b/spec/features/work_packages/cards/wp_card_status_spec.rb
@@ -77,7 +77,7 @@ describe 'Update status from WP card', type: :feature, js: true do
status_button = wp_card_view.status_button(work_package)
status_button.update status2.name
- wp_card_view.expect_and_dismiss_notification message: 'Successful update.'
+ wp_card_view.expect_and_dismiss_toaster message: 'Successful update.'
status_button.expect_text status2.name
work_package.reload
diff --git a/spec/features/work_packages/copy_spec.rb b/spec/features/work_packages/copy_spec.rb
index 6416cb29931..02eb8d23267 100644
--- a/spec/features/work_packages/copy_spec.rb
+++ b/spec/features/work_packages/copy_spec.rb
@@ -104,7 +104,7 @@ RSpec.feature 'Work package copy', js: true, selenium: true do
to_copy_work_package_page.update_attributes Description: 'Copied WP Description'
to_copy_work_package_page.save!
- expect(page).to have_selector('.notification-box--content',
+ expect(page).to have_selector('.op-toast--content',
text: I18n.t('js.notice_successful_create'))
copied_work_package = WorkPackage.order(created_at: 'desc').first
@@ -144,7 +144,7 @@ RSpec.feature 'Work package copy', js: true, selenium: true do
to_copy_work_package_page.update_attributes Description: 'Copied WP Description'
to_copy_work_package_page.save!
- to_copy_work_package_page.expect_and_dismiss_notification message: I18n.t('js.notice_successful_create')
+ to_copy_work_package_page.expect_and_dismiss_toaster message: I18n.t('js.notice_successful_create')
end
end
@@ -158,7 +158,7 @@ RSpec.feature 'Work package copy', js: true, selenium: true do
to_copy_work_package_page.update_attributes Description: 'Copied WP Description'
to_copy_work_package_page.save!
- expect(page).to have_selector('.notification-box--content',
+ expect(page).to have_selector('.op-toast--content',
text: I18n.t('js.notice_successful_create'))
copied_work_package = WorkPackage.order(created_at: 'desc').first
diff --git a/spec/features/work_packages/custom_actions/custom_actions_spec.rb b/spec/features/work_packages/custom_actions/custom_actions_spec.rb
index 1f41c852dd6..82b12280593 100644
--- a/spec/features/work_packages/custom_actions/custom_actions_spec.rb
+++ b/spec/features/work_packages/custom_actions/custom_actions_spec.rb
@@ -449,7 +449,7 @@ describe 'Custom actions', type: :feature, js: true do
wp_page.click_custom_action('Escalate', expect_success: false)
- wp_page.expect_notification type: :error, message: I18n.t('api_v3.errors.code_409')
+ wp_page.expect_toast type: :error, message: I18n.t('api_v3.errors.code_409')
end
scenario 'editing a current date custom action (Regression #30949)' do
diff --git a/spec/features/work_packages/details/closed_status_and_version_spec.rb b/spec/features/work_packages/details/closed_status_and_version_spec.rb
index 024fc35c837..2019869eac6 100644
--- a/spec/features/work_packages/details/closed_status_and_version_spec.rb
+++ b/spec/features/work_packages/details/closed_status_and_version_spec.rb
@@ -22,7 +22,7 @@ describe 'Closed status and version in full view', js: true do
status = page.find('[data-qa-selector="op-wp-status-button"] button:not([disabled])')
status.click
- wp_page.expect_and_dismiss_notification type: :error,
+ wp_page.expect_and_dismiss_toaster type: :error,
message: I18n.t('js.work_packages.message_work_package_status_blocked')
expect(page).to have_selector('[data-qa-selector="op-wp-status-button"] button[disabled]')
diff --git a/spec/features/work_packages/details/custom_fields/custom_field_spec.rb b/spec/features/work_packages/details/custom_fields/custom_field_spec.rb
index cc2ce5c06ab..01e5336b1cb 100644
--- a/spec/features/work_packages/details/custom_fields/custom_field_spec.rb
+++ b/spec/features/work_packages/details/custom_fields/custom_field_spec.rb
@@ -34,8 +34,8 @@ describe 'custom field inplace editor', js: true do
wp_field.set_value value
wp_field.submit_by_enter if wp_field.field_type == 'input'
- wp_page.expect_notification(update_args)
- wp_page.dismiss_notification!
+ wp_page.expect_toast(update_args)
+ wp_page.dismiss_toaster!
end
describe 'long text' do
diff --git a/spec/features/work_packages/details/date_editor_spec.rb b/spec/features/work_packages/details/date_editor_spec.rb
index 292a071a18d..a46b6997d1c 100644
--- a/spec/features/work_packages/details/date_editor_spec.rb
+++ b/spec/features/work_packages/details/date_editor_spec.rb
@@ -124,7 +124,7 @@ describe 'date inplace editor',
start_date.save!
- work_packages_page.expect_and_dismiss_notification message: 'Successful update.'
+ work_packages_page.expect_and_dismiss_toaster message: 'Successful update.'
start_date.expect_inactive!
start_date.expect_state_text 'no start date'
@@ -177,7 +177,7 @@ describe 'date inplace editor',
# When cancelling, expect there to be no notification
create_page.cancel!
- create_page.expect_no_notification type: nil
+ create_page.expect_no_toaster type: nil
create_page.visit!
cf_field.expect_active!
@@ -188,7 +188,7 @@ describe 'date inplace editor',
create_page.edit_field(:subject).set_value 'My subject!'
create_page.save!
- create_page.expect_and_dismiss_notification message: 'Successful creation'
+ create_page.expect_and_dismiss_toaster message: 'Successful creation'
wp = WorkPackage.last
expect(wp.custom_value_for(date_cf.id).value).to eq Time.zone.today.iso8601
diff --git a/spec/features/work_packages/details/markdown/description_editor_spec.rb b/spec/features/work_packages/details/markdown/description_editor_spec.rb
index 7b11e071980..b5615af4cbe 100644
--- a/spec/features/work_packages/details/markdown/description_editor_spec.rb
+++ b/spec/features/work_packages/details/markdown/description_editor_spec.rb
@@ -100,7 +100,7 @@ describe 'description inplace editor', js: true, selenium: true do
field.expect_save_button(enabled: true)
field.submit_by_click
- wp_page.expect_notification message: I18n.t('js.notice_successful_update')
+ wp_page.expect_toast message: I18n.t('js.notice_successful_update')
field.expect_state_text 'A new hope ...'
end
end
diff --git a/spec/features/work_packages/details/markdown/todolist_spec.rb b/spec/features/work_packages/details/markdown/todolist_spec.rb
index 0a638dcc0d7..1ec22818c8f 100644
--- a/spec/features/work_packages/details/markdown/todolist_spec.rb
+++ b/spec/features/work_packages/details/markdown/todolist_spec.rb
@@ -80,7 +80,7 @@ describe 'Todolists in CKEditor', js: true do
field.submit_by_click
- wp_page.expect_and_dismiss_notification message: 'Successful update.'
+ wp_page.expect_and_dismiss_toaster message: 'Successful update.'
within(field.display_element) do
expect(page).to have_selector('.op-uc-list--task-checkbox', count: 5)
@@ -119,7 +119,7 @@ describe 'Todolists in CKEditor', js: true do
end
field.submit_by_click
- wp_page.expect_and_dismiss_notification message: 'Successful update.'
+ wp_page.expect_and_dismiss_toaster message: 'Successful update.'
within(field.display_element) do
expect(page).to have_selector('.op-uc-list--task-checkbox', count: 5)
@@ -179,7 +179,7 @@ describe 'Todolists in CKEditor', js: true do
end
wp_page.save!
- wp_page.expect_and_dismiss_notification message: 'Successful creation.'
+ wp_page.expect_and_dismiss_toaster message: 'Successful creation.'
expect(page).to have_selector('.op-uc-list--task-checkbox', count: 3)
expect(page).to have_selector('.op-uc-list--task-checkbox[checked]', count: 1)
@@ -213,7 +213,7 @@ describe 'Todolists in CKEditor', js: true do
end
wp_page.save!
- wp_page.expect_and_dismiss_notification message: 'Successful creation.'
+ wp_page.expect_and_dismiss_toaster message: 'Successful creation.'
within(field.display_element) do
expect(page).to have_selector('.op-uc-list--task-checkbox', count: 2)
@@ -242,7 +242,7 @@ describe 'Todolists in CKEditor', js: true do
end
field.submit_by_click
- wp_page.expect_and_dismiss_notification message: 'Successful update.'
+ wp_page.expect_and_dismiss_toaster message: 'Successful update.'
within(field.display_element) do
expect(page).to have_selector('.op-uc-list--task-checkbox', count: 2)
diff --git a/spec/features/work_packages/details/query_groups/relation_query_group_spec.rb b/spec/features/work_packages/details/query_groups/relation_query_group_spec.rb
index dab152934bf..18e4cb5b6b0 100644
--- a/spec/features/work_packages/details/query_groups/relation_query_group_spec.rb
+++ b/spec/features/work_packages/details/query_groups/relation_query_group_spec.rb
@@ -179,7 +179,7 @@ describe 'Work package with relation query group', js: true, selenium: true do
# Will first try to load the query, and then hide it.
expect(page).to have_no_selector('.attributes-group--header-text', text: query_text, wait: 20)
- expect(page).to have_no_selector('.work-packages-embedded-view--container .notification-box.-error')
+ expect(page).to have_no_selector('.work-packages-embedded-view--container .op-toast.-error')
end
end
end
diff --git a/spec/features/work_packages/details/relations/hierarchy_custom_fields_spec.rb b/spec/features/work_packages/details/relations/hierarchy_custom_fields_spec.rb
index 821c88476ba..5f3e248518b 100644
--- a/spec/features/work_packages/details/relations/hierarchy_custom_fields_spec.rb
+++ b/spec/features/work_packages/details/relations/hierarchy_custom_fields_spec.rb
@@ -61,7 +61,7 @@ describe 'creating a child directly after the wp itself was created', js: true d
# Save WP
wp_page.save!
- wp_page.expect_and_dismiss_notification(message: 'Successful creation.')
+ wp_page.expect_and_dismiss_toaster(message: 'Successful creation.')
# Add child
scroll_to_and_click relations_tab
@@ -70,7 +70,7 @@ describe 'creating a child directly after the wp itself was created', js: true d
find('#wp-new-inline-edit--field-subject').native.send_keys(:return)
# Expect CF value to be still visible
- wp_page.expect_and_dismiss_notification(message: 'Successful creation.')
+ wp_page.expect_and_dismiss_toaster(message: 'Successful creation.')
expect(wp_page).to have_selector('[data-qa-selector="tab-count"]', text: "(1)")
wp_page.expect_attributes "customField#{custom_field.id}": '42'
end
diff --git a/spec/features/work_packages/details/relations/hierarchy_spec.rb b/spec/features/work_packages/details/relations/hierarchy_spec.rb
index e2684f57e31..0f1bc5fbe6e 100644
--- a/spec/features/work_packages/details/relations/hierarchy_spec.rb
+++ b/spec/features/work_packages/details/relations/hierarchy_spec.rb
@@ -117,7 +117,7 @@ shared_examples 'work package relations tab', js: true, selenium: true do
type_field.activate!
type_field.set_value type2.name
- wp_page.expect_notification message: "#{custom_field.name} can't be blank.",
+ wp_page.expect_toast message: "#{custom_field.name} can't be blank.",
type: 'error'
cf_field = wp_page.edit_field("customField#{custom_field.id}")
@@ -127,7 +127,7 @@ shared_examples 'work package relations tab', js: true, selenium: true do
cf_field.set_value 'my value'
cf_field.save!
- wp_page.expect_notification message: "Successful update.",
+ wp_page.expect_toast message: "Successful update.",
type: 'success'
wp.reload
@@ -235,7 +235,7 @@ shared_examples 'work package relations tab', js: true, selenium: true do
it 'should be able to link parent and children' do
# Add parent
relations.add_parent(parent.id, parent)
- wp_page.expect_and_dismiss_notification(message: 'Successful update.')
+ wp_page.expect_and_dismiss_toaster(message: 'Successful update.')
relations.expect_parent(parent)
##
@@ -243,7 +243,7 @@ shared_examples 'work package relations tab', js: true, selenium: true do
relations.openChildrenAutocompleter
relations.add_existing_child(child)
- wp_page.expect_and_dismiss_notification(message: 'Successful update.')
+ wp_page.expect_and_dismiss_toaster(message: 'Successful update.')
relations.expect_child(child)
# Expect counter to add up child to the existing relations
@@ -251,7 +251,7 @@ shared_examples 'work package relations tab', js: true, selenium: true do
# Remove parent
relations.remove_parent
- wp_page.expect_and_dismiss_notification(message: 'Successful update.')
+ wp_page.expect_and_dismiss_toaster(message: 'Successful update.')
relations.expect_no_parent
# Remove child
diff --git a/spec/features/work_packages/display_fields/spent_time_display_spec.rb b/spec/features/work_packages/display_fields/spent_time_display_spec.rb
index ff0b2f29048..91806efd203 100644
--- a/spec/features/work_packages/display_fields/spent_time_display_spec.rb
+++ b/spec/features/work_packages/display_fields/spent_time_display_spec.rb
@@ -56,7 +56,7 @@ describe 'Logging time within the work package view', type: :feature, js: true d
# a click on save creates a time entry
time_logging_modal.perform_action I18n.t('js.label_create')
- wp_page.expect_and_dismiss_notification message: I18n.t(:notice_successful_create)
+ wp_page.expect_and_dismiss_toaster message: I18n.t(:notice_successful_create)
end
context 'as an admin' do
diff --git a/spec/features/work_packages/edit_on_assign_version_permission_spec.rb b/spec/features/work_packages/edit_on_assign_version_permission_spec.rb
index 90341f7a96e..cc2affd992e 100644
--- a/spec/features/work_packages/edit_on_assign_version_permission_spec.rb
+++ b/spec/features/work_packages/edit_on_assign_version_permission_spec.rb
@@ -44,7 +44,7 @@ describe 'edit work package', js: true do
it 'can only change the version' do
wp_page.update_attributes version: version.name
- wp_page.expect_notification(message: 'Successful update')
+ wp_page.expect_toast(message: 'Successful update')
wp_page.expect_attributes version: version.name
subject_field = wp_page.work_package_field('subject')
diff --git a/spec/features/work_packages/edit_work_package_spec.rb b/spec/features/work_packages/edit_work_package_spec.rb
index c03c5c2213d..429d405acdb 100644
--- a/spec/features/work_packages/edit_work_package_spec.rb
+++ b/spec/features/work_packages/edit_work_package_spec.rb
@@ -210,7 +210,7 @@ describe 'edit work package', js: true do
type_field.activate!
type_field.set_value type2.name
- wp_page.expect_notification message: "#{custom_field.name} can't be blank.",
+ wp_page.expect_toast message: "#{custom_field.name} can't be blank.",
type: 'error'
cf_field = wp_page.edit_field("customField#{custom_field.id}")
@@ -227,7 +227,7 @@ describe 'edit work package', js: true do
wp_page.save_comment
- wp_page.expect_notification(message: 'The comment was successfully added.')
+ wp_page.expect_toast(message: 'The comment was successfully added.')
wp_page.expect_comment text: 'hallo welt'
end
@@ -253,7 +253,7 @@ describe 'edit work package', js: true do
field = wp_page.work_package_field(:subject)
field.update(too_long, expect_failure: true)
- wp_page.expect_notification message: 'Subject is too long (maximum is 255 characters)',
+ wp_page.expect_toast message: 'Subject is too long (maximum is 255 characters)',
type: 'error'
end
@@ -267,7 +267,7 @@ describe 'edit work package', js: true do
it 'submits the edit mode when pressing enter' do
subject_field.input_element.send_keys(:return)
- wp_page.expect_notification(message: 'Successful update')
+ wp_page.expect_toast(message: 'Successful update')
subject_field.expect_inactive!
subject_field.expect_state_text 'My new subject!'
end
@@ -275,7 +275,7 @@ describe 'edit work package', js: true do
it 'submits the edit mode when changing the focus' do
page.find("body").click
- wp_page.expect_notification(message: 'Successful update')
+ wp_page.expect_toast(message: 'Successful update')
subject_field.expect_inactive!
subject_field.expect_state_text 'My new subject!'
end
diff --git a/spec/features/work_packages/highlighting_spec.rb b/spec/features/work_packages/highlighting_spec.rb
index 462beac0582..35d6656185e 100644
--- a/spec/features/work_packages/highlighting_spec.rb
+++ b/spec/features/work_packages/highlighting_spec.rb
@@ -133,7 +133,7 @@ describe 'Work Package highlighting fields',
# Save query
wp_table.save
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
query.reload
expect(query.highlighting_mode).to eq(:status)
@@ -165,7 +165,7 @@ describe 'Work Package highlighting fields',
# Save query
wp_table.save
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
query.reload
expect(query.highlighting_mode).to eq(:priority)
@@ -183,7 +183,7 @@ describe 'Work Package highlighting fields',
# Save query
wp_table.save
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
query.reload
expect(query.highlighting_mode).to eq(:none)
@@ -211,7 +211,7 @@ describe 'Work Package highlighting fields',
prio_wp1.update priority_no_color.name
prio_wp1.expect_state_text priority_no_color.name
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
wp_1.reload
expect(wp_1.priority).to eq priority_no_color
diff --git a/spec/features/work_packages/navigation_spec.rb b/spec/features/work_packages/navigation_spec.rb
index 19d1d942829..bfff3b19810 100644
--- a/spec/features/work_packages/navigation_spec.rb
+++ b/spec/features/work_packages/navigation_spec.rb
@@ -147,10 +147,10 @@ RSpec.feature 'Work package navigation', js: true, selenium: true do
visit '/work_packages/999999999'
page404 = ::Pages::Page.new
- page404.expect_notification type: :error, message: I18n.t(:notice_file_not_found)
+ page404.expect_toast type: :error, message: I18n.t(:notice_file_not_found)
visit "/projects/#{project.identifier}/work_packages/999999999"
- page404.expect_and_dismiss_notification type: :error, message: I18n.t('api_v3.errors.not_found.work_package')
+ page404.expect_and_dismiss_toaster type: :error, message: I18n.t('api_v3.errors.not_found.work_package')
end
# Regression #29994
@@ -232,7 +232,7 @@ RSpec.feature 'Work package navigation', js: true, selenium: true do
subject = full_view.edit_field :subject
subject.update 'bar'
- full_view.expect_and_dismiss_notification message: 'Successful update.'
+ full_view.expect_and_dismiss_toaster message: 'Successful update.'
# Go back to list
full_view.go_back
diff --git a/spec/features/work_packages/new/attributes_from_filter_spec.rb b/spec/features/work_packages/new/attributes_from_filter_spec.rb
index 8be3fe1e38d..566f760c5f8 100644
--- a/spec/features/work_packages/new/attributes_from_filter_spec.rb
+++ b/spec/features/work_packages/new/attributes_from_filter_spec.rb
@@ -99,7 +99,7 @@ RSpec.feature 'Work package create uses attributes from filters', js: true, sele
subject.set_value 'Foobar!'
split_page.save!
- wp_table.expect_and_dismiss_notification(
+ wp_table.expect_and_dismiss_toaster(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
wp = WorkPackage.last
@@ -141,10 +141,10 @@ RSpec.feature 'Work package create uses attributes from filters', js: true, sele
subject_field.set_value 'Foobar!'
subject_field.submit_by_enter
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
- wp_table.dismiss_notification!
+ wp_table.dismiss_toaster!
wp = WorkPackage.last
expect(wp.subject).to eq 'Foobar!'
@@ -171,7 +171,7 @@ RSpec.feature 'Work package create uses attributes from filters', js: true, sele
click_button 'Save'
end
- wp_table.expect_notification(message: 'Successful creation.')
+ wp_table.expect_toast(message: 'Successful creation.')
wp = WorkPackage.last
expect(wp.subject).to eq 'Split Foobar!'
diff --git a/spec/features/work_packages/new/new_work_package_spec.rb b/spec/features/work_packages/new/new_work_package_spec.rb
index c45124cd98d..600c7cbe83a 100644
--- a/spec/features/work_packages/new/new_work_package_spec.rb
+++ b/spec/features/work_packages/new/new_work_package_spec.rb
@@ -30,7 +30,7 @@ describe 'new work package', js: true do
let(:project_field) { wp_page.edit_field :project }
let(:assignee_field) { wp_page.edit_field :assignee }
let(:type_field) { wp_page.edit_field :type }
- let(:notification) { PageObjects::Notifications.new(page) }
+ let(:toaster) { PageObjects::Notifications.new(page) }
def disable_leaving_unsaved_warning
FactoryBot.create(:user_preference, user: user, others: { warn_on_leaving_unsaved: false })
@@ -40,7 +40,7 @@ describe 'new work package', js: true do
scroll_to_and_click find('#work-packages--edit-actions-save')
if expect_success
- notification.expect_success('Successful creation.')
+ toaster.expect_success('Successful creation.')
end
end
@@ -93,8 +93,8 @@ describe 'new work package', js: true do
save_work_package!
# safegurards
- wp_page.dismiss_notification!
- wp_page.expect_no_notification(
+ wp_page.dismiss_toaster!
+ wp_page.expect_no_toaster(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
@@ -113,8 +113,8 @@ describe 'new work package', js: true do
subject_field.send_keys(:enter)
# safegurards
- wp_page.dismiss_notification!
- wp_page.expect_no_notification(
+ wp_page.dismiss_toaster!
+ wp_page.expect_no_toaster(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
@@ -132,7 +132,7 @@ describe 'new work package', js: true do
subject_field.send_keys(:backspace)
save_work_package!(false)
- notification.expect_error("Subject can't be blank.")
+ toaster.expect_error("Subject can't be blank.")
end
end
@@ -202,7 +202,7 @@ describe 'new work package', js: true do
cf.set_value 'foo'
save_work_package!(false)
- notification.expect_error("#{custom_field1.name} can't be blank.")
+ toaster.expect_error("#{custom_field1.name} can't be blank.")
cf1.set 'Custom field content'
save_work_package!(true)
@@ -227,12 +227,12 @@ describe 'new work package', js: true do
let(:create_method) { method(:create_work_package) }
end
- it 'allows to go to the full page through the notification (Regression #37555)' do
+ it 'allows to go to the full page through the toaster (Regression #37555)' do
create_work_package(type_task, project.name)
save_work_package!
- wp_page.expect_notification message: 'Successful creation. Click here to open this work package in fullscreen view.'
- page.find('.notification-box--target-link', text: 'Click here to open this work package in fullscreen view.').click
+ wp_page.expect_toast message: 'Successful creation. Click here to open this work package in fullscreen view.'
+ page.find('.op-toast--target-link', text: 'Click here to open this work package in fullscreen view.').click
full_page = Pages::FullWorkPackage.new(WorkPackage.last)
full_page.ensure_page_loaded
@@ -247,7 +247,7 @@ describe 'new work package', js: true do
wp_page.subject_field.set('new work package')
save_work_package!
- wp_page.dismiss_notification!
+ wp_page.dismiss_toaster!
expect(page).to have_selector('.wp--row.-checked')
@@ -261,7 +261,7 @@ describe 'new work package', js: true do
table_subject.submit_by_enter
table_subject.expect_state_text new_subject
- wp_page.expect_notification(
+ wp_page.expect_toast(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
@@ -331,7 +331,7 @@ describe 'new work package', js: true do
wp_page.subject_field.set('new work package')
save_work_package!
- wp_page.dismiss_notification!
+ wp_page.dismiss_toaster!
assignee_field.expect_state_text user.name
wp = WorkPackage.last
@@ -373,7 +373,7 @@ describe 'new work package', js: true do
it 'shows a 403 error on creation paths' do
paths.each do |path|
visit path
- wp_page.expect_notification(type: :error, message: I18n.t('api_v3.errors.code_403'))
+ wp_page.expect_toast(type: :error, message: I18n.t('api_v3.errors.code_403'))
end
end
end
@@ -394,7 +394,7 @@ describe 'new work package', js: true do
sleep(0.2)
subject_field.update('new work package')
- wp_page.expect_and_dismiss_notification(
+ wp_page.expect_and_dismiss_toaster(
message: 'Successful creation.'
)
@@ -461,7 +461,7 @@ describe 'new work package', js: true do
split_create_page.save!
- split_create_page.expect_and_dismiss_notification(message: I18n.t('js.notice_successful_create'))
+ split_create_page.expect_and_dismiss_toaster(message: I18n.t('js.notice_successful_create'))
split_create_page.expect_attributes(combinedDate: "no start date - #{parent.due_date.strftime('%m/%d/%Y')}")
@@ -477,7 +477,7 @@ describe 'new work package', js: true do
subject.set_value 'Child'
subject.submit_by_enter
- wp_page.expect_and_dismiss_notification(message: I18n.t('js.notice_successful_create'))
+ wp_page.expect_and_dismiss_toaster(message: I18n.t('js.notice_successful_create'))
sleep 1
# Move to the newly created child
diff --git a/spec/features/work_packages/new/work_package_default_description_spec.rb b/spec/features/work_packages/new/work_package_default_description_spec.rb
index 6776009ef23..1451bc33eea 100644
--- a/spec/features/work_packages/new/work_package_default_description_spec.rb
+++ b/spec/features/work_packages/new/work_package_default_description_spec.rb
@@ -57,7 +57,7 @@ describe 'new work package', js: true, with_mail: false do
end
scroll_to_and_click find('#work-packages--edit-actions-save')
- wp_page.expect_notification message: 'Successful creation.'
+ wp_page.expect_toast message: 'Successful creation.'
expect(page).to have_selector('.inline-edit--display-field.description h1', text: 'New Bug template')
end
diff --git a/spec/features/work_packages/scheduling/scheduling_mode_spec.rb b/spec/features/work_packages/scheduling/scheduling_mode_spec.rb
index 1f435d945e2..b9030de591f 100644
--- a/spec/features/work_packages/scheduling/scheduling_mode_spec.rb
+++ b/spec/features/work_packages/scheduling/scheduling_mode_spec.rb
@@ -111,7 +111,7 @@ describe 'scheduling mode',
combined_field.toggle_scheduling_mode
combined_field.update(%w[2016-01-05 2016-01-10])
- work_packages_page.expect_and_dismiss_notification message: 'Successful update.'
+ work_packages_page.expect_and_dismiss_toaster message: 'Successful update.'
# Changing the scheduling mode is journalized
work_packages_page.expect_activity_message("Manual scheduling activated")
@@ -144,7 +144,7 @@ describe 'scheduling mode',
combined_field.expect_parent_notification
combined_field.save!
- work_packages_page.expect_and_dismiss_notification message: 'Successful update.'
+ work_packages_page.expect_and_dismiss_toaster message: 'Successful update.'
# Moved forward again as the child determines the dates again
expect_dates(wp, '2016-01-01', '2016-01-05')
@@ -176,7 +176,7 @@ describe 'scheduling mode',
# Increasing the duration while at it
combined_field.update(%w[2015-12-20 2015-12-31])
- work_packages_page.expect_and_dismiss_notification message: 'Successful update.'
+ work_packages_page.expect_and_dismiss_toaster message: 'Successful update.'
expect_dates(wp, '2015-12-20', '2015-12-31')
expect(wp.schedule_manually).to be_truthy
@@ -206,7 +206,7 @@ describe 'scheduling mode',
combined_field.expect_parent_notification
combined_field.save!
- work_packages_page.expect_and_dismiss_notification message: 'Successful update.'
+ work_packages_page.expect_and_dismiss_toaster message: 'Successful update.'
# Moved backwards again as the child determines the dates again
expect_dates(wp, '2016-01-01', '2016-01-05')
diff --git a/spec/features/work_packages/sorting/manual_sorting_spec.rb b/spec/features/work_packages/sorting/manual_sorting_spec.rb
index 9391255d43a..4427c101e66 100644
--- a/spec/features/work_packages/sorting/manual_sorting_spec.rb
+++ b/spec/features/work_packages/sorting/manual_sorting_spec.rb
@@ -108,7 +108,7 @@ describe 'Manual sorting of WP table', type: :feature, js: true do
expect(page).to have_selector('.editable-toolbar-title--save')
wp_table.save_as "My sorted query"
- wp_table.expect_and_dismiss_notification message: 'Successful creation.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful creation.'
query = nil
retry_block do
@@ -207,7 +207,7 @@ describe 'Manual sorting of WP table', type: :feature, js: true do
group_by.enable_via_menu 'Type'
wp_table.save_as 'Type query'
- wp_table.expect_and_dismiss_notification message: 'Successful creation.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful creation.'
expect(page).to have_selector('.group--value', text: 'Task (2)')
expect(page).to have_selector('.group--value', text: 'Bug (2)')
@@ -226,7 +226,7 @@ describe 'Manual sorting of WP table', type: :feature, js: true do
expect(page).to have_selector('.group--value', text: 'Task (1)')
expect(page).to have_selector('.group--value', text: 'Bug (3)')
- expect(page).to have_no_selector '.notification-box.error'
+ expect(page).to have_no_selector '.op-toast.error'
end
end
end
@@ -260,7 +260,7 @@ describe 'Manual sorting of WP table', type: :feature, js: true do
subject_field.set_value 'Foobar!'
subject_field.submit_by_enter
- wp_table.expect_and_dismiss_notification(
+ wp_table.expect_and_dismiss_toaster(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
@@ -304,7 +304,7 @@ describe 'Manual sorting of WP table', type: :feature, js: true do
wp_table.expect_work_package_order work_package_1, work_package_3, work_package_2, work_package_4
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
retry_block do
query.reload
@@ -333,7 +333,7 @@ describe 'Manual sorting of WP table', type: :feature, js: true do
wp_table.save_as 'Manual sorted query'
- wp_table.expect_and_dismiss_notification message: 'Successful creation.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful creation.'
query = Query.last
expect(query.name).to eq 'Manual sorted query'
diff --git a/spec/features/work_packages/table/context_menu_spec.rb b/spec/features/work_packages/table/context_menu_spec.rb
index 64b538fb50b..9e9c239217c 100644
--- a/spec/features/work_packages/table/context_menu_spec.rb
+++ b/spec/features/work_packages/table/context_menu_spec.rb
@@ -150,7 +150,7 @@ describe 'Work package table context menu', js: true do
subject.set_value 'Child task'
subject.submit_by_enter
- split_view.expect_and_dismiss_notification message: 'Successful creation.'
+ split_view.expect_and_dismiss_toaster message: 'Successful creation.'
expect(page).to have_selector('[data-qa-selector="op-wp-breadcrumb"]', text: "Parent:\n#{work_package.subject}")
wp = WorkPackage.last
expect(wp.parent).to eq work_package
diff --git a/spec/features/work_packages/table/edit_work_packages_spec.rb b/spec/features/work_packages/table/edit_work_packages_spec.rb
index 8d2ce957632..4c4505ae580 100644
--- a/spec/features/work_packages/table/edit_work_packages_spec.rb
+++ b/spec/features/work_packages/table/edit_work_packages_spec.rb
@@ -63,7 +63,7 @@ describe 'Inline editing work packages', js: true do
subject_field.save!
subject_field.expect_text('New subject!')
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
@@ -79,9 +79,9 @@ describe 'Inline editing work packages', js: true do
subject_field.set_value('Other subject!')
subject_field.save!
- wp_table.expect_notification(message: 'Successful update')
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(message: 'Successful update')
+ wp_table.expect_toast(message: 'Successful update')
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(message: 'Successful update')
status_field.activate!
status_field.set_value(status2.name)
@@ -92,9 +92,9 @@ describe 'Inline editing work packages', js: true do
subject_field.expect_text('Other subject!')
status_field.expect_text(status2.name)
- wp_table.expect_notification(message: 'Successful update')
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(message: 'Successful update')
+ wp_table.expect_toast(message: 'Successful update')
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(message: 'Successful update')
work_package.reload
expect(work_package.subject).to eq('Other subject!')
@@ -168,7 +168,7 @@ describe 'Inline editing work packages', js: true do
# Should raise two errors
cf_list_name = custom_fields.first.name
cf_text_name = custom_fields.last.name
- wp_table.expect_notification(
+ wp_table.expect_toast(
type: :error,
message: "#{cf_list_name} can't be blank.\n#{cf_text_name} can't be blank."
)
@@ -188,7 +188,7 @@ describe 'Inline editing work packages', js: true do
cf_text.expect_inactive!
cf_list.expect_inactive!
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
diff --git a/spec/features/work_packages/table/empty_filters_spec.rb b/spec/features/work_packages/table/empty_filters_spec.rb
index 69e2002436d..ef6e8d53a5b 100644
--- a/spec/features/work_packages/table/empty_filters_spec.rb
+++ b/spec/features/work_packages/table/empty_filters_spec.rb
@@ -24,7 +24,7 @@ describe 'Empty query filters', js: true do
wp_table.expect_work_package_listed(work_package)
- wp_table.expect_no_notification(type: :error)
+ wp_table.expect_no_toaster(type: :error)
filters.expect_filter_count(0)
end
end
diff --git a/spec/features/work_packages/table/hierarchy/hierarchy_indent_spec.rb b/spec/features/work_packages/table/hierarchy/hierarchy_indent_spec.rb
index b2e5727f261..ff5be23bf9a 100644
--- a/spec/features/work_packages/table/hierarchy/hierarchy_indent_spec.rb
+++ b/spec/features/work_packages/table/hierarchy/hierarchy_indent_spec.rb
@@ -55,7 +55,7 @@ describe 'Work Package table hierarchy and sorting', js: true do
# Indent last child
hierarchy.indent! wp_child3
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
hierarchy.expect_hierarchy_at(wp_root, wp_child2)
hierarchy.expect_leaf_at(wp_child1, wp_child3)
@@ -96,14 +96,14 @@ describe 'Work Package table hierarchy and sorting', js: true do
subject = wp_table.edit_field(wp_child3, :subject)
subject.update 'First edit'
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
# Wait a bit before moving
sleep 2
# Indent last child
hierarchy.indent! wp_child3
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
# Expect changed
hierarchy.expect_hierarchy_at(wp_root, wp_child2)
@@ -114,7 +114,7 @@ describe 'Work Package table hierarchy and sorting', js: true do
subject = wp_table.edit_field(wp_child3, :subject)
subject.update 'Second edit'
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
sleep 2
wp_child3.reload
diff --git a/spec/features/work_packages/table/hierarchy/hierarchy_spec.rb b/spec/features/work_packages/table/hierarchy/hierarchy_spec.rb
index d165a17409d..48283baaed3 100644
--- a/spec/features/work_packages/table/hierarchy/hierarchy_spec.rb
+++ b/spec/features/work_packages/table/hierarchy/hierarchy_spec.rb
@@ -59,8 +59,8 @@ describe 'Work Package table hierarchy', js: true do
subject = wp_table.edit_field wp_inter, :subject
subject.update 'New subject'
- wp_table.expect_notification message: 'Successful update.'
- wp_table.dismiss_notification!
+ wp_table.expect_toast message: 'Successful update.'
+ wp_table.dismiss_toaster!
hierarchy.expect_hierarchy_at(wp_root, wp_inter)
hierarchy.expect_leaf_at(wp_leaf, wp_other)
diff --git a/spec/features/work_packages/table/inline_create/create_work_packages_spec.rb b/spec/features/work_packages/table/inline_create/create_work_packages_spec.rb
index 0fbae4a66a8..e261d2c3dfd 100644
--- a/spec/features/work_packages/table/inline_create/create_work_packages_spec.rb
+++ b/spec/features/work_packages/table/inline_create/create_work_packages_spec.rb
@@ -49,7 +49,7 @@ describe 'inline create work package', js: true do
# Callback for adjustments
callback.call
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
@@ -71,8 +71,8 @@ describe 'inline create work package', js: true do
expect(page).to have_selector('.wp--row .subject', text: 'Another subject')
# safegurards
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
@@ -120,7 +120,7 @@ describe 'inline create work package', js: true do
type_field.openSelectField
type_field.set_value cf_type.name
- wp_table.expect_notification(
+ wp_table.expect_toast(
type: :error,
message: 'Subject can\'t be blank.'
)
@@ -130,7 +130,7 @@ describe 'inline create work package', js: true do
subject_field.set_value 'Some subject'
subject_field.save!
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
diff --git a/spec/features/work_packages/table/inline_create/parallel_creation_spec.rb b/spec/features/work_packages/table/inline_create/parallel_creation_spec.rb
index 7f6122fa1a0..2fec413ae2d 100644
--- a/spec/features/work_packages/table/inline_create/parallel_creation_spec.rb
+++ b/spec/features/work_packages/table/inline_create/parallel_creation_spec.rb
@@ -61,10 +61,10 @@ describe 'Parallel work package creation spec', js: true do
expect(page).to have_selector('.wp--row', count: 1)
expect(page).to have_no_selector('.wp-inline-create-row')
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful creation. Click here to open this work package in fullscreen view.'
)
- wp_table.dismiss_notification!
+ wp_table.dismiss_toaster!
# Get the last work package
wp1 = WorkPackage.last
@@ -92,10 +92,10 @@ describe 'Parallel work package creation spec', js: true do
subject_field.expect_value 'New subject'
subject_field.save!
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful creation.'
)
- wp_table.dismiss_notification!
+ wp_table.dismiss_toaster!
expect(page).to have_selector('.wp--row', count: 2)
expect(page).to have_no_selector('.wp-inline-create-row')
diff --git a/spec/features/work_packages/table/invalid_query_spec.rb b/spec/features/work_packages/table/invalid_query_spec.rb
index ac6aeeabd2e..3eccd0e1fca 100644
--- a/spec/features/work_packages/table/invalid_query_spec.rb
+++ b/spec/features/work_packages/table/invalid_query_spec.rb
@@ -65,7 +65,7 @@ describe 'Invalid query spec', js: true do
filters.expect_no_filter_by('Assignee')
filters.expect_filter_by('Status', 'open', nil)
- wp_table.expect_no_notification(type: :error,
+ wp_table.expect_no_toaster(type: :error,
message: I18n.t('js.work_packages.faulty_query.description'))
wp_table.expect_work_package_listed work_package_assigned
@@ -86,9 +86,9 @@ describe 'Invalid query spec', js: true do
wp_table.visit_with_params("query_id=#{valid_query.id}&query_props=#{invalid_props}")
- wp_table.expect_notification(type: :error,
+ wp_table.expect_toast(type: :error,
message: I18n.t('js.work_packages.faulty_query.description'))
- wp_table.dismiss_notification!
+ wp_table.dismiss_toaster!
wp_table.expect_no_work_package_listed
filters.expect_filter_count 2
@@ -105,6 +105,6 @@ describe 'Invalid query spec', js: true do
wp_table.expect_work_package_listed work_package_assigned
wp_table.save
- wp_table.expect_notification(message: I18n.t('js.notice_successful_update'))
+ wp_table.expect_toast(message: I18n.t('js.notice_successful_update'))
end
end
diff --git a/spec/features/work_packages/table/queries/assignee_filter_spec.rb b/spec/features/work_packages/table/queries/assignee_filter_spec.rb
index 0069286658f..15c29e23baa 100644
--- a/spec/features/work_packages/table/queries/assignee_filter_spec.rb
+++ b/spec/features/work_packages/table/queries/assignee_filter_spec.rb
@@ -75,7 +75,7 @@ describe 'Work package filtering by assignee', js: true do
wp_table.save_as('Subject query')
- wp_table.expect_and_dismiss_notification(message: 'Successful creation.')
+ wp_table.expect_and_dismiss_toaster(message: 'Successful creation.')
# Revisit query
wp_table.visit_query Query.last
diff --git a/spec/features/work_packages/table/queries/bool_cf_filter_spec.rb b/spec/features/work_packages/table/queries/bool_cf_filter_spec.rb
index 19ca9c9980b..3bb2b852878 100644
--- a/spec/features/work_packages/table/queries/bool_cf_filter_spec.rb
+++ b/spec/features/work_packages/table/queries/bool_cf_filter_spec.rb
@@ -93,7 +93,7 @@ describe 'Work package filtering by bool custom field', js: true do
wp_table.save_as('Saved query')
- wp_table.expect_and_dismiss_notification(message: 'Successful creation.')
+ wp_table.expect_and_dismiss_toaster(message: 'Successful creation.')
# Revisit query
wp_table.visit_query Query.last
diff --git a/spec/features/work_packages/table/queries/id_filter_spec.rb b/spec/features/work_packages/table/queries/id_filter_spec.rb
index 774e44699b5..10a47f711dd 100644
--- a/spec/features/work_packages/table/queries/id_filter_spec.rb
+++ b/spec/features/work_packages/table/queries/id_filter_spec.rb
@@ -62,7 +62,7 @@ describe 'Work package filtering by id', js: true do
wp_table.save_as('Id query')
- wp_table.expect_and_dismiss_notification(message: 'Successful creation.')
+ wp_table.expect_and_dismiss_toaster(message: 'Successful creation.')
# Revisit query
wp_table.visit_query Query.last
diff --git a/spec/features/work_packages/table/queries/me_filter_spec.rb b/spec/features/work_packages/table/queries/me_filter_spec.rb
index f3f7877ec64..5ac63713fff 100644
--- a/spec/features/work_packages/table/queries/me_filter_spec.rb
+++ b/spec/features/work_packages/table/queries/me_filter_spec.rb
@@ -70,7 +70,7 @@ describe 'filter me value', js: true do
it 'shows an error visiting a query with a me value' do
wp_table.visit_query assignee_query
- wp_table.expect_notification(type: :error,
+ wp_table.expect_toast(type: :error,
message: I18n.t('js.work_packages.faulty_query.description'))
end
end
@@ -118,7 +118,7 @@ describe 'filter me value', js: true do
subject.set_value 'foobar'
subject.submit_by_enter
- split_screen.expect_and_dismiss_notification message: 'Successful creation.'
+ split_screen.expect_and_dismiss_toaster message: 'Successful creation.'
wp = WorkPackage.last
expect(wp.assigned_to_id).to eq(admin.id)
@@ -175,7 +175,7 @@ describe 'filter me value', js: true do
it 'shows an error visiting a query with a me value' do
wp_table.visit_query assignee_query
- wp_table.expect_notification(type: :error,
+ wp_table.expect_toast(type: :error,
message: I18n.t('js.work_packages.faulty_query.description'))
end
end
diff --git a/spec/features/work_packages/table/queries/query_name_inline_edit_spec.rb b/spec/features/work_packages/table/queries/query_name_inline_edit_spec.rb
index cfcbd310d40..638fac5b305 100644
--- a/spec/features/work_packages/table/queries/query_name_inline_edit_spec.rb
+++ b/spec/features/work_packages/table/queries/query_name_inline_edit_spec.rb
@@ -92,7 +92,7 @@ describe 'Query name inline edit', js: true do
# TODO: The notification should actually not be shown at all since no update
# has taken place
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
assignee_query.reload
expect(assignee_query.filters.count).to eq(1)
@@ -104,7 +104,7 @@ describe 'Query name inline edit', js: true do
# Rename query
query_title.rename 'Not my assignee query'
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
assignee_query.reload
expect(assignee_query.name).to eq 'Not my assignee query'
@@ -116,7 +116,7 @@ describe 'Query name inline edit', js: true do
page.driver.browser.switch_to.active_element.send_keys('Some other name')
page.driver.browser.switch_to.active_element.send_keys(:return)
- wp_table.expect_and_dismiss_notification message: 'Successful update.'
+ wp_table.expect_and_dismiss_toaster message: 'Successful update.'
assignee_query.reload
expect(assignee_query.name).to eq 'Some other name'
diff --git a/spec/features/work_packages/table/queries/responsible_filter_spec.rb b/spec/features/work_packages/table/queries/responsible_filter_spec.rb
index 099e5e4bcf4..39edc7c41c6 100644
--- a/spec/features/work_packages/table/queries/responsible_filter_spec.rb
+++ b/spec/features/work_packages/table/queries/responsible_filter_spec.rb
@@ -75,7 +75,7 @@ describe 'Work package filtering by responsible', js: true do
wp_table.save_as('Responsible query')
- wp_table.expect_and_dismiss_notification(message: 'Successful creation.')
+ wp_table.expect_and_dismiss_toaster(message: 'Successful creation.')
# Revisit query
wp_table.visit_query Query.last
diff --git a/spec/features/work_packages/table/queries/user_cf_filter_spec.rb b/spec/features/work_packages/table/queries/user_cf_filter_spec.rb
index aca4793f44a..97d3ef233af 100644
--- a/spec/features/work_packages/table/queries/user_cf_filter_spec.rb
+++ b/spec/features/work_packages/table/queries/user_cf_filter_spec.rb
@@ -104,7 +104,7 @@ describe 'Work package filtering by user custom field', js: true do
wp_table.save_as('Saved query')
- wp_table.expect_and_dismiss_notification(message: 'Successful creation.')
+ wp_table.expect_and_dismiss_toaster(message: 'Successful creation.')
# Revisit query
wp_table.visit_query Query.last
diff --git a/spec/features/work_packages/table/switch_types_spec.rb b/spec/features/work_packages/table/switch_types_spec.rb
index 61640f8ac95..74338e3ad94 100644
--- a/spec/features/work_packages/table/switch_types_spec.rb
+++ b/spec/features/work_packages/table/switch_types_spec.rb
@@ -70,12 +70,12 @@ describe 'Switching types in work package table', js: true do
text_field.set_value 'Foobar'
text_field.save!
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
# safegurards
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
@@ -83,13 +83,13 @@ describe 'Switching types in work package table', js: true do
type_field.activate!
type_field.set_value type_bug.name
- wp_table.expect_notification(
+ wp_table.expect_toast(
type: :error,
message: "#{cf_req_text.name} can't be blank."
)
# safegurards
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(
type: :error,
message: "#{cf_req_text.name} can't be blank."
)
@@ -99,12 +99,12 @@ describe 'Switching types in work package table', js: true do
req_text_field.set_value 'Required'
req_text_field.save!
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
# safegurards
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
@@ -113,12 +113,12 @@ describe 'Switching types in work package table', js: true do
type_field.activate!
type_field.set_value type_task.name
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
# safegurards
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
@@ -131,13 +131,13 @@ describe 'Switching types in work package table', js: true do
type_field.activate!
type_field.set_value type_bug.name
- wp_table.expect_notification(
+ wp_table.expect_toast(
type: :error,
message: "#{cf_req_text.name} can't be blank."
)
# safegurards
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(
type: :error,
message: "#{cf_req_text.name} can't be blank."
)
@@ -150,12 +150,12 @@ describe 'Switching types in work package table', js: true do
type_field.openSelectField
type_field.set_value type_task.name
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
# safegurards
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
end
@@ -173,13 +173,13 @@ describe 'Switching types in work package table', js: true do
type_field.activate!
type_field.set_value type_bug.name
- wp_table.expect_notification(
+ wp_table.expect_toast(
type: :error,
message: "#{cf_req_text.name} can't be blank."
)
# safegurards
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(
type: :error,
message: "#{cf_req_text.name} can't be blank."
)
@@ -195,12 +195,12 @@ describe 'Switching types in work package table', js: true do
# Set the value now
req_text_field.update 'foobar'
- wp_table.expect_notification(
+ wp_table.expect_toast(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
# safegurards
- wp_table.dismiss_notification!
- wp_table.expect_no_notification(
+ wp_table.dismiss_toaster!
+ wp_table.expect_no_toaster(
message: 'Successful update. Click here to open this work package in fullscreen view.'
)
@@ -249,9 +249,9 @@ describe 'Switching types in work package table', js: true do
type_field.update type_bug.name
# safegurards
- wp_page.expect_notification message: 'Successful update.'
- wp_page.dismiss_notification!
- wp_page.expect_no_notification message: 'Successful update.'
+ wp_page.expect_toast message: 'Successful update.'
+ wp_page.dismiss_toaster!
+ wp_page.expect_no_toaster message: 'Successful update.'
type_field.expect_state_text type_bug.name.upcase
@@ -334,7 +334,7 @@ describe 'Switching types in work package table', js: true do
wp_page.save!
- wp_page.expect_notification(
+ wp_page.expect_toast(
message: 'Successful creation.'
)
diff --git a/spec/features/work_packages/tabs/activity_notifications_spec.rb b/spec/features/work_packages/tabs/activity_notifications_spec.rb
index 8eccb11159f..4de5743d6a8 100644
--- a/spec/features/work_packages/tabs/activity_notifications_spec.rb
+++ b/spec/features/work_packages/tabs/activity_notifications_spec.rb
@@ -101,8 +101,8 @@ describe 'Activity tab notifications', js: true, selenium: true do
full_view.visit_tab! 'activity'
full_view.ensure_page_loaded
- full_view.expect_no_notification type: :error, message: 'Http failure response for'
- full_view.expect_no_notification
+ full_view.expect_no_toaster type: :error, message: 'Http failure response for'
+ full_view.expect_no_toaster
end
end
end
diff --git a/spec/features/work_packages/timeline/timeline_navigation_spec.rb b/spec/features/work_packages/timeline/timeline_navigation_spec.rb
index 7eeb76b31e9..0a99384e7d7 100644
--- a/spec/features/work_packages/timeline/timeline_navigation_spec.rb
+++ b/spec/features/work_packages/timeline/timeline_navigation_spec.rb
@@ -174,7 +174,7 @@ RSpec.feature 'Work package timeline navigation', js: true, selenium: true do
# Save
wp_timeline.save
- wp_timeline.expect_and_dismiss_notification message: 'Successful update'
+ wp_timeline.expect_and_dismiss_toaster message: 'Successful update'
query.reload
expect(query.timeline_zoom_level).to eq 'auto'
diff --git a/spec/features/work_packages/work_packages_page.rb b/spec/features/work_packages/work_packages_page.rb
index 703df9a1c4e..499ad207708 100644
--- a/spec/features/work_packages/work_packages_page.rb
+++ b/spec/features/work_packages/work_packages_page.rb
@@ -66,12 +66,12 @@ class WorkPackagesPage
end
def click_toolbar_button(button)
- close_notifications
+ close_toasters
find('.toolbar-container', wait: 5).click_button button
end
- def close_notifications
- page.all(:css, '.notification-box--close').each(&:click)
+ def close_toasters
+ page.all(:css, '.op-toast--close').each(&:click)
end
def select_query(query)
diff --git a/spec/features/wysiwyg/user_mention_spec.rb b/spec/features/wysiwyg/user_mention_spec.rb
index a801b2f4a1f..c5afb296f91 100644
--- a/spec/features/wysiwyg/user_mention_spec.rb
+++ b/spec/features/wysiwyg/user_mention_spec.rb
@@ -80,7 +80,7 @@ describe 'Wysiwyg work package user mentions',
comment_field.submit_by_click if comment_field.active?
- wp_page.expect_and_dismiss_notification message: "The comment was successfully added."
+ wp_page.expect_and_dismiss_toaster message: "The comment was successfully added."
expect(page)
.to have_selector('a.user-mention', text: 'Foo Bar')
@@ -99,7 +99,7 @@ describe 'Wysiwyg work package user mentions',
comment_field.submit_by_click if comment_field.active?
- wp_page.expect_and_dismiss_notification message: "The comment was successfully added."
+ wp_page.expect_and_dismiss_toaster message: "The comment was successfully added."
expect(page)
.to have_selector('a.user-mention', text: 'Foogroup')
diff --git a/spec/support/components/grids/grid_area.rb b/spec/support/components/grids/grid_area.rb
index 3d6ed6dc00b..312d93ceb60 100644
--- a/spec/support/components/grids/grid_area.rb
+++ b/spec/support/components/grids/grid_area.rb
@@ -22,8 +22,8 @@ module Components
end
def click_menu_item(text)
- # Ensure there are no active notifications
- dismiss_notification!
+ # Ensure there are no active toasters
+ dismiss_toaster!
open_menu
@@ -133,12 +133,12 @@ module Components
action.perform
end
- def dismiss_notification!
- if page.has_selector?('.notification-box--close')
- page.find('.notification-box--close').click
+ def dismiss_toaster!
+ if page.has_selector?('.op-toast--close')
+ page.find('.op-toast--close').click
end
- expect(page).to have_no_selector('.notification-box')
+ expect(page).to have_no_selector('.op-toast')
end
end
end
diff --git a/spec/support/components/wysiwyg/wysiwyg_editor.rb b/spec/support/components/wysiwyg/wysiwyg_editor.rb
index 8a4bad4b018..ba1835cf4c9 100644
--- a/spec/support/components/wysiwyg/wysiwyg_editor.rb
+++ b/spec/support/components/wysiwyg/wysiwyg_editor.rb
@@ -81,8 +81,8 @@ module Components
expect(page)
.to have_selector('figure img[src^="/api/v3/attachments/"]', count: images.length + 1, wait: 10)
- expect(page).not_to have_selector('notification-upload-progress')
- sleep 0.5
+ sleep 3
+ expect(page).not_to have_selector('op-toasters-upload-progress', wait: 5)
# Get the image uploaded last. As there is no way to distinguish between
# two uploaded images, from the perspective of the user, we do it by getting
@@ -166,4 +166,4 @@ module Components
find('.ck-button-save').click
end
end
-end
\ No newline at end of file
+end
diff --git a/spec/support/pages/messages/base.rb b/spec/support/pages/messages/base.rb
index 78d512eb5f3..8b7888202fe 100644
--- a/spec/support/pages/messages/base.rb
+++ b/spec/support/pages/messages/base.rb
@@ -30,7 +30,7 @@ require 'support/pages/page'
module Pages::Messages
class Base < ::Pages::Page
- def notification_type
+ def toast_type
:rails
end
end
diff --git a/spec/support/pages/my/password_page.rb b/spec/support/pages/my/password_page.rb
index e29c06b1df9..6e1854fc56b 100644
--- a/spec/support/pages/my/password_page.rb
+++ b/spec/support/pages/my/password_page.rb
@@ -45,12 +45,12 @@ module Pages
end
def expect_password_reuse_error_message(count)
- expect_notification(type: :error,
+ expect_toast(type: :error,
message: I18n.t(:'activerecord.errors.models.user.attributes.password.reused', count: count))
end
def expect_password_weak_error_message
- expect_notification(type: :error,
+ expect_toast(type: :error,
message: "Password Must contain characters of the following classes (at least 2 of 3): lowercase (e.g. 'a'), uppercase (e.g. 'A'), numeric (e.g. '1').")
end
@@ -61,7 +61,7 @@ module Pages
private
- def notification_type
+ def toast_type
:rails
end
end
diff --git a/spec/support/pages/notifications/center.rb b/spec/support/pages/notifications/center.rb
index 33f44410448..1b54d1d594c 100644
--- a/spec/support/pages/notifications/center.rb
+++ b/spec/support/pages/notifications/center.rb
@@ -135,15 +135,15 @@ module Pages
end
def expect_no_toaster
- expect(page).to have_no_selector('.notification-box.-info', wait: 10)
+ expect(page).to have_no_selector('.op-toast.-info', wait: 10)
end
- def expect_toaster
- expect(page).to have_selector('.notification-box.-info', wait: 10)
+ def expect_toast
+ expect(page).to have_selector('.op-toast.-info', wait: 10)
end
def update_via_toaster
- page.find('.notification-box.-info a', wait: 10).click
+ page.find('.op-toast.-info a', wait: 10).click
end
end
end
diff --git a/spec/support/pages/notifications/settings.rb b/spec/support/pages/notifications/settings.rb
index 196c45f651c..68c31c328f5 100644
--- a/spec/support/pages/notifications/settings.rb
+++ b/spec/support/pages/notifications/settings.rb
@@ -97,7 +97,7 @@ module Pages
def save
click_button 'Save'
- expect_notification message: 'Successful update.'
+ expect_toast message: 'Successful update.'
end
end
end
diff --git a/spec/support/pages/page.rb b/spec/support/pages/page.rb
index bfd40f65443..45f648be0e4 100644
--- a/spec/support/pages/page.rb
+++ b/spec/support/pages/page.rb
@@ -89,9 +89,9 @@ module Pages
expect(current_path).to eql expected_path
end
- def expect_notification(message:, type: :success)
- if notification_type == :angular
- expect(page).to have_selector(".notification-box.-#{type}", text: message, wait: 20)
+ def expect_toast(message:, type: :success)
+ if toast_type == :angular
+ expect(page).to have_selector(".op-toast.-#{type}", text: message, wait: 20)
elsif type == :error
expect(page).to have_selector(".errorExplanation", text: message)
elsif type == :success
@@ -101,25 +101,25 @@ module Pages
end
end
- def expect_and_dismiss_notification(message:, type: :success)
- expect_notification(type: type, message: message)
- dismiss_notification!
- expect_no_notification(type: type, message: message)
+ def expect_and_dismiss_toaster(message:, type: :success)
+ expect_toast(type: type, message: message)
+ dismiss_toaster!
+ expect_no_toaster(type: type, message: message)
end
- def dismiss_notification!
- if notification_type == :angular
- page.find('.notification-box--close').click
+ def dismiss_toaster!
+ if toast_type == :angular
+ page.find('.op-toast--close').click
else
page.find('.flash .icon-close').click
end
end
- def expect_no_notification(type: :success, message: nil)
+ def expect_no_toaster(type: :success, message: nil)
if type.nil?
- expect(page).to have_no_selector(".notification-box")
+ expect(page).to have_no_selector(".op-toast")
else
- expect(page).to have_no_selector(".notification-box.-#{type}", text: message)
+ expect(page).to have_no_selector(".op-toast.-#{type}", text: message)
end
end
@@ -127,7 +127,7 @@ module Pages
nil
end
- def notification_type
+ def toast_type
:angular
end
end
diff --git a/spec/support/pages/projects/settings.rb b/spec/support/pages/projects/settings.rb
index 01b1be71177..22b3254d847 100644
--- a/spec/support/pages/projects/settings.rb
+++ b/spec/support/pages/projects/settings.rb
@@ -43,8 +43,8 @@ module Pages
visit "/projects/#{project.identifier}/settings/#{name}"
end
- # only notice is used as opposed to notification-box
- def expect_notification(message:, type: :notice)
+ # only notice is used as opposed to op-toast
+ def expect_toast(message:, type: :notice)
expect(page).to have_selector(".flash.#{type}", text: message, wait: 10)
end
@@ -88,7 +88,7 @@ module Pages
private
- def notification_type
+ def toast_type
:rails
end
diff --git a/spec/support/pages/types/index.rb b/spec/support/pages/types/index.rb
index fe1828f7f38..7289037b450 100644
--- a/spec/support/pages/types/index.rb
+++ b/spec/support/pages/types/index.rb
@@ -44,11 +44,11 @@ module Pages
end
def expect_successful_create
- expect_notification message: I18n.t(:notice_successful_create)
+ expect_toast message: I18n.t(:notice_successful_create)
end
def expect_successful_update
- expect_notification message: I18n.t(:notice_successful_update)
+ expect_toast message: I18n.t(:notice_successful_update)
end
def click_new
@@ -85,7 +85,7 @@ module Pages
type.respond_to?(:name) ? type.name : type
end
- def notification_type
+ def toast_type
:rails
end
end
diff --git a/spec/support/pages/work_packages/abstract_work_package.rb b/spec/support/pages/work_packages/abstract_work_package.rb
index 88b42b630a8..80a1fb3e16d 100644
--- a/spec/support/pages/work_packages/abstract_work_package.rb
+++ b/spec/support/pages/work_packages/abstract_work_package.rb
@@ -235,7 +235,7 @@ module Pages
end
if expect_success
- expect_and_dismiss_notification message: 'Successful update'
+ expect_and_dismiss_toaster message: 'Successful update'
sleep 1
end
end
@@ -296,9 +296,9 @@ module Pages
end
def ensure_no_conflicting_modifications
- expect_notification(message: 'Successful update')
- dismiss_notification!
- expect_no_notification(message: 'Successful update')
+ expect_toast(message: 'Successful update')
+ dismiss_toaster!
+ expect_no_toaster(message: 'Successful update')
end
end
end
diff --git a/spec/support/pages/work_packages/work_packages_table.rb b/spec/support/pages/work_packages/work_packages_table.rb
index 0bb162235ea..9ca11401ded 100644
--- a/spec/support/pages/work_packages/work_packages_table.rb
+++ b/spec/support/pages/work_packages/work_packages_table.rb
@@ -251,7 +251,7 @@ module Pages
click_button 'Save'
- expect_notification message: 'Successful creation.'
+ expect_toast message: 'Successful creation.'
expect_title name
end