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

min-width reached feedback improvements: - Moved styles to the -error glocal class - Styles clean up moved to the 'resizeEnd' method (no need for ngZone nor ChangeDetector)

Aleix Suau7811c9ba363f
diff --git a/app/assets/stylesheets/openproject/_generic.sass b/app/assets/stylesheets/openproject/_generic.sass
index 60e19916841..b6ee00a3f06 100644
--- a/app/assets/stylesheets/openproject/_generic.sass
+++ b/app/assets/stylesheets/openproject/_generic.sass
@@ -116,3 +116,6 @@
.-no-z-index
z-index: 0 !important
+
+.-error
+ color: $content-form-error-color
diff --git a/frontend/src/app/components/resizer/wp-resizer.component.ts b/frontend/src/app/components/resizer/wp-resizer.component.ts
index 70ad73a814d..d24cdad6a25 100644
--- a/frontend/src/app/components/resizer/wp-resizer.component.ts
+++ b/frontend/src/app/components/resizer/wp-resizer.component.ts
@@ -26,7 +26,7 @@
// See docs/COPYRIGHT.rdoc for more details.
//++
-import {AfterViewInit, Component, ElementRef, Input, OnInit, NgZone, ChangeDetectorRef} from '@angular/core';
+import {AfterViewInit, Component, ElementRef, Input, OnInit, ChangeDetectionStrategy} from '@angular/core';
import {debounceTime, distinctUntilChanged} from 'rxjs/operators';
import {TransitionService} from '@uirouter/core';
import {MainMenuToggleService} from "core-components/main-menu/main-menu-toggle.service";
@@ -45,7 +45,8 @@ import {fromEvent} from "rxjs";
(start)="resizeStart()"
(move)="resizeMove($event)">
</resizer>
- `
+ `,
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class WpResizerDirective extends UntilDestroyedMixin implements OnInit, AfterViewInit {
@@ -67,9 +68,7 @@ export class WpResizerDirective extends UntilDestroyedMixin implements OnInit, A
constructor(readonly toggleService:MainMenuToggleService,
private elementRef:ElementRef,
readonly $transitions:TransitionService,
- readonly browserDetector:BrowserDetector,
- private ngZone:NgZone,
- private changeDetectorRef:ChangeDetectorRef) {
+ readonly browserDetector:BrowserDetector) {
super();
}
@@ -146,6 +145,10 @@ export class WpResizerDirective extends UntilDestroyedMixin implements OnInit, A
// Send a event that we resized this element
const event = new Event(this.resizeEvent);
window.dispatchEvent(event);
+
+ if (this.resizer.classList.contains('-error')) {
+ this.resizer.classList.remove('-error');
+ }
}
resizeMove(deltas:ResizeDelta) {
@@ -161,19 +164,15 @@ export class WpResizerDirective extends UntilDestroyedMixin implements OnInit, A
newValue = this.elementMinWidth;
// Show the resizer red when it reaches its limit (min-width)
- if (this.resizer.style.color !== 'red') {
- this.resizer.style.color = 'red';
-
- // Avoid triggering change detection for all the app
- this.ngZone.runOutsideAngular(() => {
- setTimeout(() => {
- this.resizer.style.color = '';
- this.changeDetectorRef.detectChanges();
- }, 500);
- });
+ if (!this.resizer.classList.contains('-error')) {
+ this.resizer.classList.add('-error');
}
} else {
newValue = this.elementWidth;
+
+ if (this.resizer.classList.contains('-error')) {
+ this.resizer.classList.remove('-error');
+ }
}
// Store item in local storage
diff --git a/modules/bim/app/assets/stylesheets/bim/ifc_viewer/generic.sass b/modules/bim/app/assets/stylesheets/bim/ifc_viewer/generic.sass
index c9a36218273..a1b9774bce1 100644
--- a/modules/bim/app/assets/stylesheets/bim/ifc_viewer/generic.sass
+++ b/modules/bim/app/assets/stylesheets/bim/ifc_viewer/generic.sass
@@ -1,6 +1,7 @@
// -------------------------- GENERIC --------------------------
@import "openproject/variables"
@import "openproject/mixins"
+@import "openproject/generic"
@import "fonts/openproject_icon_definitions"
@import "fonts/openproject_icon_font"