-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
849f04f
commit c3d6e1c
Showing
7 changed files
with
78 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
apps/picsa-tools/resources-tool/src/app/components/resource-item/templates/pdf.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component, Input } from '@angular/core'; | ||
|
||
import { IResourceFile } from '../../../models'; | ||
|
||
@Component({ | ||
selector: 'resource-item-pdf', | ||
template: `name.component.html`, | ||
}) | ||
export class ResourceItemPDFComponent { | ||
@Input() resource: IResourceFile; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 26 additions & 3 deletions
29
apps/picsa-tools/resources-tool/src/app/pages/home/home.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,35 @@ | ||
import { Component } from '@angular/core'; | ||
import { Component, OnDestroy, OnInit } from '@angular/core'; | ||
import { Subject, takeUntil } from 'rxjs'; | ||
|
||
import { ResourcesToolService } from '../../services/resources-tool.service'; | ||
import { ResourcesStore } from '../../stores'; | ||
|
||
@Component({ | ||
selector: 'resource-home', | ||
templateUrl: './home.component.html', | ||
styleUrls: ['./home.component.scss'], | ||
}) | ||
export class HomeComponent { | ||
constructor(public store: ResourcesStore) {} | ||
export class HomeComponent implements OnInit, OnDestroy { | ||
private componentDestroyed$ = new Subject(); | ||
|
||
constructor(public service: ResourcesToolService, public store: ResourcesStore) {} | ||
|
||
async ngOnInit() { | ||
await this.service.ready(); | ||
// TODO - want to subscribe to collections | ||
const query = this.service.dbFileCollection.find(); | ||
query.$.pipe(takeUntil(this.componentDestroyed$)).subscribe((docs) => { | ||
console.log('home page files retrieved', docs); | ||
// const { code } = this.configurationService.activeConfiguration.localisation.country; | ||
// // filter forms to include only active config country forms | ||
// this.forms = docs | ||
// .map((doc) => doc._data) | ||
// .filter((form) => !form.appCountries || form.appCountries.includes(code)); | ||
}); | ||
} | ||
|
||
ngOnDestroy(): void { | ||
this.componentDestroyed$.next(true); | ||
this.componentDestroyed$.complete(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// export * from './collection'; | ||
export * from './file'; | ||
// export * from './link'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters