-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix/arpa 937 put project body overload (#297)
* ARPA-937 Fixed put project body overload * introduced interface for project participation graphql query * interface for project parent query
- Loading branch information
1 parent
de560bb
commit aaabd74
Showing
15 changed files
with
148 additions
and
89 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
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
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
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
8 changes: 8 additions & 0 deletions
8
src/app/features/projects/project-layout/edit-project/projectParents.graphql.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
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
36 changes: 5 additions & 31 deletions
36
src/app/features/projects/project-layout/project-layout.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,45 +1,19 @@ | ||
import { Component, Input } from '@angular/core'; | ||
import { Component } from '@angular/core'; | ||
import { DynamicDialogConfig } from 'primeng/dynamicdialog'; | ||
import { Observable } from 'rxjs'; | ||
import { ProjectDto } from '@arpa/models'; | ||
import { VenueDto } from '@arpa/models'; | ||
import { SelectItem } from 'primeng/api'; | ||
import { map } from 'rxjs/operators'; | ||
import { ReducedProjectDto } from '../../../../@arpa/models/reducedProjectDto'; | ||
import { ProjectsQueryResponse } from '../project-list/projects.graphql'; | ||
|
||
@Component({ | ||
selector: 'arpa-project-layout', | ||
templateUrl: './project-layout.component.html', | ||
styleUrls: ['./project-layout.component.scss'], | ||
}) | ||
export class ProjectLayoutComponent { | ||
project: ProjectDto = this.config.data.project; | ||
venues: Observable<SelectItem[]> = this.config.data.venues.pipe( | ||
map((venues: VenueDto[]) => | ||
venues.map( | ||
(v) => | ||
({ | ||
label: this.getAddress(v), | ||
value: v.id, | ||
} as SelectItem) | ||
) | ||
) | ||
); | ||
type: Observable<SelectItem[]> = this.config.data.type; | ||
genre: Observable<SelectItem[]> = this.config.data.genre; | ||
children: Observable<ReducedProjectDto[]> = this.config.data.children; | ||
parent: Observable<ReducedProjectDto[]> = this.config.data.parent; | ||
project: ProjectsQueryResponse = this.config.data.project; | ||
typeOptions$: Observable<SelectItem[]> = this.config.data.type; | ||
genreOptions$: Observable<SelectItem[]> = this.config.data.genre; | ||
public index = 0; | ||
|
||
constructor(public config: DynamicDialogConfig) {} | ||
|
||
private getAddress(venue: VenueDto): string { | ||
if (venue.address) { | ||
const { city, urbanDistrict } = venue.address; | ||
const comb = `${city ? city : ''}${city && urbanDistrict ? ' ' : ''}${urbanDistrict ? urbanDistrict : ''}`; | ||
return `${comb}${comb ? ' | ' : ''}${venue.name}`; | ||
} else { | ||
return venue?.name || ''; | ||
} | ||
} | ||
} |
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
46 changes: 45 additions & 1 deletion
46
...pp/features/projects/project-layout/project-participants/projectparticipations.graphql.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
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
Oops, something went wrong.