Skip to content

Commit c6917db

Browse files
Merge pull request #80 from RBTech-dev/develop
fix: fixate regressioni
2 parents dec1b89 + 4323509 commit c6917db

5 files changed

Lines changed: 15 additions & 16 deletions

File tree

.github/workflows/pr_on_master.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,12 @@ jobs:
2828
uses: actions/setup-node@v3
2929
with:
3030
node-version: ${{ matrix.node-version }}
31+
cache: 'npm'
3132

3233
# Make sure we have all branches
3334
- name: Fetch other branches
3435
run: git fetch --no-tags --prune --depth=5 origin master
3536

36-
# https://github.com/marketplace/actions/npm-install-cache
37-
- uses: c-hive/gha-npm-cache@v1
38-
if: ${{ !env.ACT }}
39-
4037
- uses: nrwl/nx-set-shas@v3
4138
with:
4239
main-branch-name: 'master'

.github/workflows/publish.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ jobs:
2828
with:
2929
node-version: ${{ matrix.node-version }}
3030
registry-url: https://registry.npmjs.org/
31-
32-
# https://github.com/marketplace/actions/npm-install-cache
33-
- uses: c-hive/gha-npm-cache@v1
34-
if: ${{ !env.ACT }}
31+
cache: 'npm'
3532

3633
- name: Set variables
3734
run: |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
<rbtech-sidebar [menu]="menu"></rbtech-sidebar>
2+
<button
3+
style="position: fixed; right: 0; top: 0"
4+
(click)="winboxService.closeAllWinBoxes()"
5+
>
6+
CHIUDI TUTTE LE SCHEDE
7+
</button>
28
<router-outlet></router-outlet>

apps/winbox-example-app/src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class AppComponent implements OnInit {
9393
};
9494

9595
constructor(
96-
private winboxService: WinboxService,
96+
protected winboxService: WinboxService,
9797
private modalService: NgbModal
9898
) {}
9999

packages/angular-winbox/src/lib/winbox.service.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@ export class WinboxService {
5959
const optionsClose = options.onclose;
6060
winBox.onclose = (force) => {
6161
if (force) {
62-
return this.destroyComponent(componentRef, winBox);
62+
return this.destroyComponent<ComponentInstance>(componentRef, winBox);
6363
}
64-
6564
const isCloseConfirmed = optionsClose?.apply(winBox, [force]);
66-
if (isCloseConfirmed) {
67-
return this.destroyComponent(componentRef, winBox);
65+
if (isCloseConfirmed || !optionsClose) {
66+
return this.destroyComponent<ComponentInstance>(componentRef, winBox);
6867
}
6968
return true;
7069
};
@@ -80,7 +79,7 @@ export class WinboxService {
8079

8180
public closeAllWinBoxes() {
8281
for (const winBox of this.winBoxStack) {
83-
winBox.close();
82+
winBox.close(true);
8483
}
8584
this.winBoxStack = [];
8685
this.isThereAWinBox = false;
@@ -102,8 +101,8 @@ export class WinboxService {
102101
this.winBoxStack.find((winbox) => winbox.id === id)?.maximize(state);
103102
}
104103

105-
private destroyComponent(
106-
componentRef: ComponentRef<any>,
104+
private destroyComponent<ComponentInstance>(
105+
componentRef: ComponentRef<ComponentInstance>,
107106
winBox: WinBox
108107
): boolean {
109108
componentRef.destroy();

0 commit comments

Comments
 (0)