From 8524df013abff9ba93481e60f431e0574d083868 Mon Sep 17 00:00:00 2001 From: sercan Date: Wed, 19 May 2021 10:57:40 +0300 Subject: [PATCH 01/14] (fuse/tailwind) Fixed: Barrel exports are wrong for FuseTailwindService --- src/@fuse/services/tailwind/index.ts | 2 +- src/@fuse/services/tailwind/public-api.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/@fuse/services/tailwind/index.ts b/src/@fuse/services/tailwind/index.ts index b2dad0cb..2efe083b 100644 --- a/src/@fuse/services/tailwind/index.ts +++ b/src/@fuse/services/tailwind/index.ts @@ -1 +1 @@ -export * from '@fuse/services/media-watcher/public-api'; +export * from '@fuse/services/tailwind/public-api'; diff --git a/src/@fuse/services/tailwind/public-api.ts b/src/@fuse/services/tailwind/public-api.ts index fd5905d7..3eeb3757 100644 --- a/src/@fuse/services/tailwind/public-api.ts +++ b/src/@fuse/services/tailwind/public-api.ts @@ -1,2 +1,2 @@ -export * from '@fuse/services/media-watcher/media-watcher.module'; -export * from '@fuse/services/media-watcher/media-watcher.service'; +export * from '@fuse/services/tailwind/tailwind.module'; +export * from '@fuse/services/tailwind/tailwind.service'; From eca618c95bca610220955ab151a9d67b8f6a8844 Mon Sep 17 00:00:00 2001 From: sercan Date: Wed, 19 May 2021 13:37:37 +0300 Subject: [PATCH 02/14] (FuseNavigation) Fixed: If [routerLinkActiveOptions] is "undefined" initially, router throws an error and stops working --- .../components/basic/basic.component.html | 4 ++-- .../components/basic/basic.component.ts | 23 ++++++++++++++----- .../components/basic/basic.component.html | 4 ++-- .../components/basic/basic.component.ts | 23 ++++++++++++++----- 4 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/@fuse/components/navigation/horizontal/components/basic/basic.component.html b/src/@fuse/components/navigation/horizontal/components/basic/basic.component.html index 1d136ccf..73ca799b 100644 --- a/src/@fuse/components/navigation/horizontal/components/basic/basic.component.html +++ b/src/@fuse/components/navigation/horizontal/components/basic/basic.component.html @@ -11,7 +11,7 @@ [ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}" [routerLink]="[item.link]" [routerLinkActive]="'fuse-horizontal-navigation-item-active'" - [routerLinkActiveOptions]="item.isActiveMatchOptions"> + [routerLinkActiveOptions]="isActiveMatchOptions"> @@ -39,7 +39,7 @@ [ngClass]="{'fuse-horizontal-navigation-item-active-forced': item.active}" [routerLink]="[item.link]" [routerLinkActive]="'fuse-horizontal-navigation-item-active'" - [routerLinkActiveOptions]="item.isActiveMatchOptions" + [routerLinkActiveOptions]="isActiveMatchOptions" (click)="item.function(item)"> diff --git a/src/@fuse/components/navigation/horizontal/components/basic/basic.component.ts b/src/@fuse/components/navigation/horizontal/components/basic/basic.component.ts index e32f5819..f20224ac 100644 --- a/src/@fuse/components/navigation/horizontal/components/basic/basic.component.ts +++ b/src/@fuse/components/navigation/horizontal/components/basic/basic.component.ts @@ -1,4 +1,5 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core'; +import { IsActiveMatchOptions } from '@angular/router'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { FuseHorizontalNavigationComponent } from '@fuse/components/navigation/horizontal/horizontal.component'; @@ -17,6 +18,7 @@ export class FuseHorizontalNavigationBasicItemComponent implements OnInit, OnDes @Input() item: FuseNavigationItem; @Input() name: string; + isActiveMatchOptions: IsActiveMatchOptions; private _fuseHorizontalNavigationComponent: FuseHorizontalNavigationComponent; private _unsubscribeAll: Subject = new Subject(); @@ -29,6 +31,11 @@ export class FuseHorizontalNavigationBasicItemComponent implements OnInit, OnDes private _fuseUtilsService: FuseUtilsService ) { + // Set the equivalent of {exact: false} as default for active match options. + // We are not assigning the item.isActiveMatchOptions directly to the + // [routerLinkActiveOptions] because if it's "undefined" initially, the router + // will throw an error and stop working. + this.isActiveMatchOptions = this._fuseUtilsService.subsetMatchOptions; } // ----------------------------------------------------------------------------------------------------- @@ -40,16 +47,20 @@ export class FuseHorizontalNavigationBasicItemComponent implements OnInit, OnDes */ ngOnInit(): void { - // If the item doesn't have "isActiveMatchOptions", - // set it using the equivalent form of "item.exactMatch" - if ( !this.item.isActiveMatchOptions ) - { - this.item.isActiveMatchOptions = this.item.exactMatch ? this._fuseUtilsService.exactMatchOptions : this._fuseUtilsService.subsetMatchOptions; - } + // Set the "isActiveMatchOptions" either from item's + // "isActiveMatchOptions" or the equivalent form of + // item's "exactMatch" option + this.isActiveMatchOptions = + this.item.isActiveMatchOptions ?? this.item.exactMatch + ? this._fuseUtilsService.exactMatchOptions + : this._fuseUtilsService.subsetMatchOptions; // Get the parent navigation component this._fuseHorizontalNavigationComponent = this._fuseNavigationService.getComponent(this.name); + // Mark for check + this._changeDetectorRef.markForCheck(); + // Subscribe to onRefreshed on the navigation component this._fuseHorizontalNavigationComponent.onRefreshed.pipe( takeUntil(this._unsubscribeAll) diff --git a/src/@fuse/components/navigation/vertical/components/basic/basic.component.html b/src/@fuse/components/navigation/vertical/components/basic/basic.component.html index 7b255875..7eea495e 100644 --- a/src/@fuse/components/navigation/vertical/components/basic/basic.component.html +++ b/src/@fuse/components/navigation/vertical/components/basic/basic.component.html @@ -11,7 +11,7 @@ [ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}" [routerLink]="[item.link]" [routerLinkActive]="'fuse-vertical-navigation-item-active'" - [routerLinkActiveOptions]="item.isActiveMatchOptions"> + [routerLinkActiveOptions]="isActiveMatchOptions"> @@ -39,7 +39,7 @@ [ngClass]="{'fuse-vertical-navigation-item-active-forced': item.active}" [routerLink]="[item.link]" [routerLinkActive]="'fuse-vertical-navigation-item-active'" - [routerLinkActiveOptions]="item.isActiveMatchOptions" + [routerLinkActiveOptions]="isActiveMatchOptions" (click)="item.function(item)"> diff --git a/src/@fuse/components/navigation/vertical/components/basic/basic.component.ts b/src/@fuse/components/navigation/vertical/components/basic/basic.component.ts index 556e8d5e..b3a20aa4 100644 --- a/src/@fuse/components/navigation/vertical/components/basic/basic.component.ts +++ b/src/@fuse/components/navigation/vertical/components/basic/basic.component.ts @@ -1,4 +1,5 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core'; +import { IsActiveMatchOptions } from '@angular/router'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { FuseVerticalNavigationComponent } from '@fuse/components/navigation/vertical/vertical.component'; @@ -17,6 +18,7 @@ export class FuseVerticalNavigationBasicItemComponent implements OnInit, OnDestr @Input() item: FuseNavigationItem; @Input() name: string; + isActiveMatchOptions: IsActiveMatchOptions; private _fuseVerticalNavigationComponent: FuseVerticalNavigationComponent; private _unsubscribeAll: Subject = new Subject(); @@ -29,6 +31,11 @@ export class FuseVerticalNavigationBasicItemComponent implements OnInit, OnDestr private _fuseUtilsService: FuseUtilsService ) { + // Set the equivalent of {exact: false} as default for active match options. + // We are not assigning the item.isActiveMatchOptions directly to the + // [routerLinkActiveOptions] because if it's "undefined" initially, the router + // will throw an error and stop working. + this.isActiveMatchOptions = this._fuseUtilsService.subsetMatchOptions; } // ----------------------------------------------------------------------------------------------------- @@ -40,16 +47,20 @@ export class FuseVerticalNavigationBasicItemComponent implements OnInit, OnDestr */ ngOnInit(): void { - // If the item doesn't have "isActiveMatchOptions", - // set it using the equivalent form of "item.exactMatch" - if ( !this.item.isActiveMatchOptions ) - { - this.item.isActiveMatchOptions = this.item.exactMatch ? this._fuseUtilsService.exactMatchOptions : this._fuseUtilsService.subsetMatchOptions; - } + // Set the "isActiveMatchOptions" either from item's + // "isActiveMatchOptions" or the equivalent form of + // item's "exactMatch" option + this.isActiveMatchOptions = + this.item.isActiveMatchOptions ?? this.item.exactMatch + ? this._fuseUtilsService.exactMatchOptions + : this._fuseUtilsService.subsetMatchOptions; // Get the parent navigation component this._fuseVerticalNavigationComponent = this._fuseNavigationService.getComponent(this.name); + // Mark for check + this._changeDetectorRef.markForCheck(); + // Subscribe to onRefreshed on the navigation component this._fuseVerticalNavigationComponent.onRefreshed.pipe( takeUntil(this._unsubscribeAll) From e499c0688429906a632e3ab0ece6fdf146d9c64d Mon Sep 17 00:00:00 2001 From: sercan Date: Wed, 19 May 2021 13:38:10 +0300 Subject: [PATCH 03/14] (apps/mailbox) Small tweak on resolver's comment --- .../modules/admin/apps/mailbox/mailbox.resolvers.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/modules/admin/apps/mailbox/mailbox.resolvers.ts b/src/app/modules/admin/apps/mailbox/mailbox.resolvers.ts index b91dd0e3..2a9c777c 100644 --- a/src/app/modules/admin/apps/mailbox/mailbox.resolvers.ts +++ b/src/app/modules/admin/apps/mailbox/mailbox.resolvers.ts @@ -155,11 +155,11 @@ export class MailboxMailsResolver implements Resolve .pipe( finalize(() => { - // Reset the mail every time mails list changes, - // if there is no selected mail. This will ensure - // that the mail will be reset while navigating - // between the folders/filters/labels but it won't - // reset on page reload if we are reading a mail. + // If there is no selected mail, reset the mail every + // time mail list changes. This will ensure that the + // mail will be reset while navigating between the + // folders/filters/labels but it won't reset on page + // reload if we are reading a mail. // Try to get the current activated route let currentRoute = route; From 3d09241c646057e2c4512afaa65afab2a3e22b89 Mon Sep 17 00:00:00 2001 From: sercan Date: Wed, 19 May 2021 14:37:38 +0300 Subject: [PATCH 04/14] (fuse/animations) Fixed: Barrel exports (FuseMasonry) Fixed: Barrel exports (FuseUtilsService) Fixed: Barrel exports (FuseValidators) Fixed: Barrel exports --- src/@fuse/animations/index.ts | 2 +- src/@fuse/animations/public-api.ts | 10 +++++----- src/@fuse/components/masonry/index.ts | 2 +- src/@fuse/services/utils/index.ts | 2 +- src/@fuse/validators/index.ts | 2 +- src/@fuse/validators/public-api.ts | 2 +- src/app/modules/admin/apps/notes/notes.module.ts | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/@fuse/animations/index.ts b/src/@fuse/animations/index.ts index 7e1a213e..e3669783 100644 --- a/src/@fuse/animations/index.ts +++ b/src/@fuse/animations/index.ts @@ -1 +1 @@ -export * from './public-api'; +export * from '@fuse/animations/public-api'; diff --git a/src/@fuse/animations/public-api.ts b/src/@fuse/animations/public-api.ts index 60d4ee81..3e7cd5a5 100644 --- a/src/@fuse/animations/public-api.ts +++ b/src/@fuse/animations/public-api.ts @@ -1,8 +1,8 @@ -import { expandCollapse } from './expand-collapse'; -import { fadeIn, fadeInBottom, fadeInLeft, fadeInRight, fadeInTop, fadeOut, fadeOutBottom, fadeOutLeft, fadeOutRight, fadeOutTop } from './fade'; -import { shake } from './shake'; -import { slideInBottom, slideInLeft, slideInRight, slideInTop, slideOutBottom, slideOutLeft, slideOutRight, slideOutTop } from './slide'; -import { zoomIn, zoomOut } from './zoom'; +import { expandCollapse } from '@fuse/animations/expand-collapse'; +import { fadeIn, fadeInBottom, fadeInLeft, fadeInRight, fadeInTop, fadeOut, fadeOutBottom, fadeOutLeft, fadeOutRight, fadeOutTop } from '@fuse/animations/fade'; +import { shake } from '@fuse/animations/shake'; +import { slideInBottom, slideInLeft, slideInRight, slideInTop, slideOutBottom, slideOutLeft, slideOutRight, slideOutTop } from '@fuse/animations/slide'; +import { zoomIn, zoomOut } from '@fuse/animations/zoom'; export const fuseAnimations = [ expandCollapse, diff --git a/src/@fuse/components/masonry/index.ts b/src/@fuse/components/masonry/index.ts index ac978a78..b2f1a036 100644 --- a/src/@fuse/components/masonry/index.ts +++ b/src/@fuse/components/masonry/index.ts @@ -1 +1 @@ -export * from '@fuse/components/card/public-api'; +export * from '@fuse/components/masonry/public-api'; diff --git a/src/@fuse/services/utils/index.ts b/src/@fuse/services/utils/index.ts index 0563cafe..a507e7ff 100644 --- a/src/@fuse/services/utils/index.ts +++ b/src/@fuse/services/utils/index.ts @@ -1 +1 @@ -export * from '@fuse/services/config/public-api'; +export * from '@fuse/services/utils/public-api'; diff --git a/src/@fuse/validators/index.ts b/src/@fuse/validators/index.ts index 7e1a213e..5e4748d3 100644 --- a/src/@fuse/validators/index.ts +++ b/src/@fuse/validators/index.ts @@ -1 +1 @@ -export * from './public-api'; +export * from '@fuse/validators/public-api'; diff --git a/src/@fuse/validators/public-api.ts b/src/@fuse/validators/public-api.ts index 011b41e0..fc16900a 100644 --- a/src/@fuse/validators/public-api.ts +++ b/src/@fuse/validators/public-api.ts @@ -1 +1 @@ -export * from './validators'; +export * from '@fuse/validators/validators'; diff --git a/src/app/modules/admin/apps/notes/notes.module.ts b/src/app/modules/admin/apps/notes/notes.module.ts index 86860824..23aaf7d8 100644 --- a/src/app/modules/admin/apps/notes/notes.module.ts +++ b/src/app/modules/admin/apps/notes/notes.module.ts @@ -10,7 +10,7 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatRippleModule } from '@angular/material/core'; import { MatSidenavModule } from '@angular/material/sidenav'; import { FuseAutogrowModule } from '@fuse/directives/autogrow'; -import { FuseMasonryModule } from '@fuse/components/masonry/masonry.module'; +import { FuseMasonryModule } from '@fuse/components/masonry'; import { SharedModule } from 'app/shared/shared.module'; import { NotesComponent } from 'app/modules/admin/apps/notes/notes.component'; import { NotesDetailsComponent } from 'app/modules/admin/apps/notes/details/details.component'; From ee86dc62450c69801edc9aebc26daa821ded4e45 Mon Sep 17 00:00:00 2001 From: sercan Date: Wed, 19 May 2021 14:45:30 +0300 Subject: [PATCH 05/14] (tailwind) Use TAILWIND_MODE environment variable to activate purge on build --- tailwind.config.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tailwind.config.js b/tailwind.config.js index 75d82c49..db6e214e 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -74,11 +74,7 @@ const config = { darkMode : 'class', important : true, purge : { - // Until AngularCLI team provides a better way to distinguish between - // development and production, we will decide whether to purge or not - // by looking at the process arguments. If there is a "build" argument - // with the "ng" command then we will enable the purge. - enabled: process && process.argv && process.argv.find(arg => arg.includes('ng')) && process.argv.indexOf('build') !== -1, + enabled: process.env.TAILWIND_MODE === 'build', content: ['./src/**/*.{html,scss,ts}'], options: { safelist: { From 4694bb401d3f5b2b8202691c6357033947cb13cb Mon Sep 17 00:00:00 2001 From: sercan Date: Wed, 19 May 2021 22:43:16 +0300 Subject: [PATCH 06/14] (layout/common) Added trackBy functions to ngFor loops in common components --- .../layout/common/language/language.component.html | 2 +- src/app/layout/common/language/language.component.ts | 11 +++++++++++ .../layout/common/messages/messages.component.html | 2 +- src/app/layout/common/messages/messages.component.ts | 11 +++++++++++ .../common/notifications/notifications.component.html | 2 +- .../common/notifications/notifications.component.ts | 11 +++++++++++ src/app/layout/common/search/search.component.html | 4 ++-- src/app/layout/common/search/search.component.ts | 11 +++++++++++ .../layout/common/shortcuts/shortcuts.component.html | 2 +- .../layout/common/shortcuts/shortcuts.component.ts | 11 +++++++++++ 10 files changed, 61 insertions(+), 6 deletions(-) diff --git a/src/app/layout/common/language/language.component.html b/src/app/layout/common/language/language.component.html index cbb1a54a..c8907850 100644 --- a/src/app/layout/common/language/language.component.html +++ b/src/app/layout/common/language/language.component.html @@ -9,7 +9,7 @@ - +