Skip to content

Commit

Permalink
update query
Browse files Browse the repository at this point in the history
  • Loading branch information
ntqdinh-axonivy committed Jul 22, 2024
1 parent a218a31 commit 43516fe
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
12 changes: 8 additions & 4 deletions marketplace-ui/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
@if(!isDesignerViewer()){
<header class="d-flex align-items-center">
<div class="container">
<app-header></app-header>
</div>
</header>
}
<main>
<div class="container">
<router-outlet />
</div>
</main>
@if(!isDesignerViewer()){
<footer>
<div class="container">
<app-footer></app-footer>
</div>
</footer>
}

@if (loadingService.isLoading()) {
<div class="spinner-container">
<div class="spinner-border"></div>
</div>
}
<div class="spinner-container">
<div class="spinner-border"></div>
</div>
}
12 changes: 9 additions & 3 deletions marketplace-ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { FooterComponent } from './shared/components/footer/footer.component';
import { HeaderComponent } from './shared/components/header/header.component';
import { LoadingService } from './core/services/loading/loading.service';
import { filter } from 'rxjs';
import { DESIGNER_VARIABLE } from './shared/constants/common.constant';

@Component({
selector: 'app-root',
Expand All @@ -20,19 +21,24 @@ import { filter } from 'rxjs';
export class AppComponent {
loadingService = inject(LoadingService);
isDesignerViewer = signal(false);
ivyVersion = signal('');

constructor(
private router: Router,
private route: ActivatedRoute
) {}
) { }

ngOnInit(): void {
this.router.events
.pipe(filter(event => event instanceof NavigationEnd))
.subscribe(() => {
this.route.queryParams.subscribe(params => {
console.log(params['ivy-viewer']);
console.log(params['ivy-version']);
if (params['ivy-viewer'] == DESIGNER_VARIABLE.viewer) {
this.isDesignerViewer.set(true);
}
if (params["ivy-version"]) {
this.ivyVersion.set(params["ivy-version"]);
}
});
});
}
Expand Down
6 changes: 5 additions & 1 deletion marketplace-ui/src/app/shared/constants/common.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,8 @@ export const FEEDBACK_SORT_TYPES = [
label: 'common.sort.value.lowest',
sortFn: 'rating,asc'
}
];
];

export const DESIGNER_VARIABLE = {
viewer: "designer-market"
};

0 comments on commit 43516fe

Please sign in to comment.