Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/app/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export class DashboardComponent implements OnInit, OnDestroy {
badge: this.examsCount },
{ baseFirstLine: $localize` my `, title: $localize`Chat`, link: '/chat' },
{ baseFirstLine: $localize` my `, title: $localize`Progress`, link: 'myProgress' },
{ baseFirstLine: $localize`my`, title: $localize`Personals`, link: 'myPersonals' },
{ baseFirstLine: $localize`my`, title: $localize`Achievements`, link: 'myAchievements' },
{ baseFirstLine: $localize`my`, title: $localize`Surveys`, link: 'mySurveys', badge: this.surveysCount },
{ baseFirstLine: $localize` my `, title: $localize`Health`, link: 'myHealth' }
Expand Down
4 changes: 0 additions & 4 deletions src/app/home/home-router.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ const alwaysGuardedRoutes = [
{
path: dashboardPath('myLibrary'),
loadChildren: () => import('../resources/resources.module').then(m => m.ResourcesModule), data: { view: 'myLibrary' }
},
{
path: dashboardPath('myPersonals'),
loadChildren: () => import('../resources/resources.module').then(m => m.ResourcesModule), data: { view: 'myPersonals' }
}
];

Expand Down
2 changes: 1 addition & 1 deletion src/app/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class HomeComponent implements OnInit, DoCheck, AfterViewChecked, OnDestr
const routesWithBackground = [
'resources', 'courses', 'feedback', 'users', 'meetups', 'requests', 'associated', 'submissions', 'teams', 'surveys', 'news',
'mySurveys', 'myHealth', 'myCourses', 'myLibrary', 'myTeams', 'enterprises', 'certifications', 'myDashboard', 'nation', 'earth',
'health', 'myPersonals', 'community', 'voices'
'health', 'community', 'voices'
];
// Leaving the exception variable in so we can easily use this while still testing backgrounds
const routesWithoutBackground = [];
Expand Down
20 changes: 10 additions & 10 deletions src/app/resources/resources.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@

<ng-template #collectionRow>
<button mat-icon-button (click)="goBack()" *ngIf="!isDialog"><mat-icon>arrow_back</mat-icon></button>
<span i18n>{myView, select, myPersonals {myPersonals} myLibrary {myLibrary} other {Library}}</span>
<mat-form-field class="font-size-1 mat-form-field-type-no-underline mat-form-field-dynamic-width collections-search margin-lr" *ngIf="myView !== 'myPersonals'">
<span i18n>{myView, select, myLibrary {myLibrary} other {Library}}</span>
<mat-form-field class="font-size-1 mat-form-field-type-no-underline mat-form-field-dynamic-width collections-search margin-lr">
<planet-tag-input [formControl]="tagFilter" [db]="dbName" [parent]="parent" [filteredData]="resources.filteredData" [helperText]="false" [largeFont]="true" mode="filter" [selectMany]="false"></planet-tag-input>
</mat-form-field>
</ng-template>

<ng-template #filterRow>
<span class="font-size-1 margin-lr-4" i18n>Search by:</span>
<button mat-stroked-button i18n (click)="this.showFilters = !this.showFilters" *ngIf="myView !== 'myPersonals'">Filter</button>
<button mat-stroked-button i18n (click)="this.showFilters = !this.showFilters">Filter</button>
<mat-form-field class="font-size-1 margin-lr-4">
<input matInput i18n-placeholder placeholder="Title" [(ngModel)]="titleSearch">
</mat-form-field>
Expand All @@ -43,13 +43,13 @@
<div class="space-container primary-link-hover">
<mat-toolbar class="primary-color font-size-1" *ngIf="!isDialog">
<ng-container *ngIf="isAuthorized">
<button *ngIf="!parent && myView !== 'myPersonals'" mat-mini-fab routerLink="add"><mat-icon>add</mat-icon></button>
<button *ngIf="!parent" mat-mini-fab routerLink="add"><mat-icon>add</mat-icon></button>
<div class="column margin-lr-5">
<planet-filtered-amount [table]="resources"></planet-filtered-amount>
<planet-tag-selected-input *ngIf="myView !== 'myPersonals'" [selectedIds]="tagFilter.value" [allTags]="tagInputComponent?.tags"></planet-tag-selected-input>
<planet-tag-selected-input [selectedIds]="tagFilter.value" [allTags]="tagInputComponent?.tags"></planet-tag-selected-input>
</div>
<span class="toolbar-fill"></span>
<ng-container *ngIf="myView !== 'myPersonals'">
<ng-container>
<span *ngIf="parent">
<button mat-button [disabled]="!selection.selected.length" (click)="shareResource('pull', selection.selected)">
<mat-icon aria-hidden="true" class="margin-lr-3">cloud_download</mat-icon><span i18n>Get resource</span>
Expand Down Expand Up @@ -133,7 +133,7 @@ <h3 class="header">
<a [routerLink]="isDialog ? ['resources/view', element._id] : ['view', element._id]" [target]="isDialog ? '_blank' : null">
{{ element.doc.title | truncateText:180 }}
</a>
<ng-container *ngIf="!parent && !isDialog && myView !== 'myPersonals'">
<ng-container *ngIf="!parent && !isDialog">
<mat-icon class="margin-lr-3 cursor-pointer" i18n-matTooltip matTooltip="In myLibrary" [inline]="true" *ngIf="element.libraryInfo" (click)="libraryToggle([ element._id ], 'remove')">bookmark</mat-icon>
<mat-icon class="margin-lr-3 cursor-pointer" i18n-matTooltip matTooltip="Not in myLibrary" [inline]="true" *ngIf="!element.libraryInfo" (click)="libraryToggle([ element._id ], 'add')">bookmark_border</mat-icon>
</ng-container>
Expand Down Expand Up @@ -162,7 +162,7 @@ <h3 class="header">
<mat-icon>more_vert</mat-icon>
</button>
<mat-menu #resourceMenu="matMenu">
<ng-container *ngIf="myView !== 'myPersonals'">
<ng-container>
<a *ngIf="!element.libraryInfo" mat-menu-item (click)="libraryToggle([ element._id ], 'add')">
<mat-icon>library_add</mat-icon><span i18n>Add to myLibrary</span>
</a>
Expand All @@ -174,7 +174,7 @@ <h3 class="header">
<span i18n>Feedback</span>
</a>
</ng-container>
<ng-container *ngIf="element.canManage && myView !== 'myPersonals'">
<ng-container *ngIf="element.canManage">
<a mat-menu-item (click)="updateResource(element)">
<mat-icon>edit</mat-icon>
<span i18n>Edit Resource</span>
Expand All @@ -188,7 +188,7 @@ <h3 class="header">
<mat-icon>star</mat-icon>
<span i18n>View Ratings</span>
</button>
<a href="{{urlPrefix + element._id + '/' + element.doc.filename}}" mat-menu-item download [disabled]="!(myView === 'myPersonals') && !element.doc.isDownloadable">
<a href="{{urlPrefix + element._id + '/' + element.doc.filename}}" mat-menu-item download [disabled]="!element.doc.isDownloadable">
<mat-icon>file_download</mat-icon>
<span i18n>Download file</span>
</a>
Expand Down
9 changes: 2 additions & 7 deletions src/app/resources/resources.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy {
}

ngOnInit() {
if (this.myView !== 'myPersonals') {
this.displayedColumns = [ 'select', 'title', 'info', 'createdDate', 'rating' ];
}
this.displayedColumns = [ 'select', 'title', 'info', 'createdDate', 'rating' ];
this.titleSearch = '';
combineLatest(this.resourcesService.resourcesListener(this.parent), this.userService.shelfChange$).pipe(
startWith([ [], null ]), skip(1), takeUntil(this.onDestroy$),
Expand All @@ -144,10 +142,7 @@ export class ResourcesComponent implements OnInit, AfterViewInit, OnDestroy {
).subscribe((resources) => {
this.resources.data = resources.filter(
(resource: any) =>
this.excludeIds.indexOf(resource._id) === -1 &&
(this.myView === 'myPersonals' ?
(resource.doc.private === true && (resource.doc.privateFor || {}).users === this.userService.get()._id) :
resource.doc.private !== true)
this.excludeIds.indexOf(resource._id) === -1 && resource.doc.private !== true
);
this.resources.paginator = this.paginator;
this.isLoading = false;
Expand Down
Loading