Skip to content

Commit c09de93

Browse files
committed
More work on share dynamics
1 parent 2f46b79 commit c09de93

File tree

55 files changed

+1161
-304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1161
-304
lines changed

projects/budgetkey/src/app/app-routing.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const routes: Routes = [
88
{ path: 'i', loadChildren: () => import('./item/item.module').then(m => m.ItemModule) },
99
{ path: 'about', loadChildren: () => import('./about/about.module').then(m => m.AboutModule) },
1010
{ path: 'p', loadChildren: () => import('./profile/profile.module').then(m => m.ProfileModule) },
11-
{ path: 'l', loadChildren: () => import('./list-components/list-components.module').then(m => m.ListComponentsModule) },
11+
{ path: 'l', loadChildren: () => import('./list-page/list-page.module').then(m => m.ListPageModule) },
1212
{ path: 'not-found', component: PageNotFoundComponent },
1313
{ path: '**', pathMatch: 'full', component: PageNotFoundComponent },
1414
];
@@ -17,6 +17,7 @@ const routes: Routes = [
1717
imports: [RouterModule.forRoot(routes, {
1818
initialNavigation: 'enabledBlocking',
1919
anchorScrolling: 'enabled',
20+
// enableTracing: true,
2021
})],
2122
exports: [RouterModule]
2223
})

projects/budgetkey/src/app/app.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { NGX_SEO_CONFIG_TOKEN, NgxSeoModule } from '@avivharuzi/ngx-seo';
88
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
99
import { AppErrorHandler } from './app-error-handler';
1010
import { ListComponentsModule } from './list-components/list-components.module';
11+
import { provideRouter, withDebugTracing } from '@angular/router';
12+
import { ListPageModule } from './list-page/list-page.module';
1113

1214
@NgModule({
1315
declarations: [
@@ -20,6 +22,7 @@ import { ListComponentsModule } from './list-components/list-components.module';
2022
CommonComponentsModule,
2123
ListComponentsModule,
2224
NgxSeoModule.forRoot(),
25+
ListPageModule,
2326
],
2427
providers: [
2528
provideClientHydration(),

projects/budgetkey/src/app/common-components/auth/auth.component.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
</svg>
1717
</div>
1818
<div *ngIf="user && user.authenticated" class='menu'>
19-
<a class='menu-line' (activated)="profile()" clickOnReturn>התראות שמורות</a>
20-
<a class='menu-line' (activated)="profile()" clickOnReturn>פרופיל אישי</a>
19+
<a class='menu-line' (activated)="profile()" *ngIf='hasProfile' clickOnReturn>התראות שמורות</a>
20+
<a class='menu-line' (activated)="myLists()" clickOnReturn *ngIf='lists.hasCuratedLists()'>הרשימות שלי</a>
21+
<!-- <a class='menu-line' (activated)="profile()" clickOnReturn>פרופיל אישי</a> -->
2122
<a class='menu-line' (activated)="logout()" clickOnReturn>התנתקות</a>
2223
</div>
2324
</div>

projects/budgetkey/src/app/common-components/auth/auth.component.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { AuthService } from './auth.service';
66
import { Observable } from 'rxjs';
77
import { PlatformService } from '../platform.service';
88
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
9+
import { Router } from '@angular/router';
10+
import { ListsService } from '../services/lists.service';
911

1012
@UntilDestroy()
1113
@Component({
@@ -18,7 +20,7 @@ export class AuthComponent implements AfterViewInit {
1820

1921
@Input() theme: any;
2022

21-
constructor(private auth: AuthService, private ps: PlatformService) {
23+
constructor(private auth: AuthService, private ps: PlatformService, private router: Router, public lists: ListsService) {
2224
this.auth.getUser().pipe(
2325
untilDestroyed(this)
2426
).subscribe((user) => {
@@ -55,13 +57,17 @@ export class AuthComponent implements AfterViewInit {
5557
});
5658
}
5759

60+
get hasProfile() {
61+
return this.auth?.authConfig?.profilePagePath || null;
62+
}
63+
5864
profile() {
5965
if (this.auth.authConfig.profilePagePath) {
60-
let params = '';
61-
if (this.theme && this.theme.themeId) {
62-
params = '?theme=' + this.theme.themeId;
63-
}
64-
window.location.href = this.auth.authConfig.profilePagePath + params;
66+
this.router.navigate(this.auth.authConfig.profilePagePath, { queryParamsHandling: 'preserve' });
6567
}
6668
}
69+
70+
myLists() {
71+
this.router.navigate(['/l/my'], { queryParamsHandling: 'preserve' });
72+
}
6773
}

projects/budgetkey/src/app/common-components/auth/auth.service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class AuthService {
1818
authServerUrl: 'https://next.obudget.org',
1919
jwtLocalStorageKey: 'jwt',
2020
jwtQueryParam: 'jwt',
21-
profilePagePath: '/p/'
21+
profilePagePath: ['/p']
2222
};
2323

2424
constructor(private http: HttpClient, private platform: PlatformService) {
@@ -104,9 +104,7 @@ export class AuthService {
104104
}
105105

106106
logout(): Observable<any> {
107-
console.log('LOGOUT');
108107
this.deleteToken();
109-
console.log('token delted');
110108
return this.check();
111109
}
112110

projects/budgetkey/src/app/common-components/common.less

Lines changed: 0 additions & 4 deletions
This file was deleted.

projects/budgetkey/src/app/common-components/components/header/bk-header.component.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../common.less';
1+
@import '../../../../common.less';
22

33
header {
44
height: @headerHeight;

projects/budgetkey/src/app/common-components/components/header/bk-header.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {Component, Inject, Input} from '@angular/core';
22
import { GlobalSettingsService } from '../../global-settings.service';
33
import { Router } from '@angular/router';
4+
import { platform } from 'os';
5+
import { PlatformService } from '../../platform.service';
46

57
@Component({
68
selector: 'app-bk-header',
@@ -13,8 +15,8 @@ export class BkHeaderComponent {
1315
@Input() showLanguages = false;
1416
public showAuth = false;
1517

16-
constructor (public globalSettings: GlobalSettingsService, private router: Router) {
17-
this.showAuth = !globalSettings.theme.disableAuth;
18+
constructor (public globalSettings: GlobalSettingsService, private router: Router, private platform: PlatformService) {
19+
this.showAuth = !globalSettings.theme.disableAuth && this.platform.browser();
1820
}
1921

2022
doSearch(href?: string) {
Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
<div class="bkmodal-bg">
2-
<div class="bkmodal-dialog">
3-
<div class="bkmodal-content">
4-
<button type="button" class="close" (click)="_close()">&times;</button>
5-
<div class="bkmodal-header" *ngIf='title'>
6-
<h4 class="modal-title">{{title}}</h4>
7-
</div>
8-
<div class="bkmodal-body">
9-
<ng-content></ng-content>
10-
</div>
11-
</div>
2+
<div class="bkmodal-dialog">
3+
<div class="bkmodal-content" *ngIf='standardLayout'>
4+
<button type="button" class="close" (click)="_close()">&times;</button>
5+
<div class="bkmodal-header" *ngIf='title'>
6+
<h4 class="modal-title">{{title}}</h4>
7+
</div>
8+
<div class="bkmodal-body">
9+
<ng-content></ng-content>
10+
</div>
1211
</div>
13-
</div>
12+
<div *ngIf='!standardLayout'>
13+
<ng-content></ng-content>
14+
</div>
15+
</div>
16+
</div>

projects/budgetkey/src/app/common-components/components/modal/modal.component.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
:host {
2+
position: relative;
3+
24
.bkmodal-bg {
35
position: fixed;
46
z-index: 10000;
@@ -14,7 +16,6 @@
1416
}
1517

1618
.bkmodal-dialog {
17-
1819
width: 60%;
1920
max-width: 600px;
2021
background: white;

0 commit comments

Comments
 (0)