Skip to content

Commit

Permalink
Merge branch 'release/0.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
XanderVertegaal committed Oct 4, 2024
2 parents 016125e + db1d174 commit 61122a4
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 45 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ authors:
website: 'https://cdh.uu.nl/rsl/'
repository-code: 'https://github.com/CentreForDigitalHumanities/lettercraft'
license: BSD-3-Clause
version: 0.5.0
date-released: '2024-10-01'
version: 0.5.1
date-released: '2024-10-04'
32 changes: 5 additions & 27 deletions frontend/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,14 +1057,7 @@ export type DataEntryAgentDescriptionQueryVariables = Exact<{
}>;


export type DataEntryAgentDescriptionQuery = { __typename?: 'Query', agentDescription?: { __typename?: 'AgentDescriptionType', id: string, isGroup: boolean, gender?: { __typename?: 'AgentDescriptionGenderType', id: string, gender: Gender, sourceMention: SourceMention, note: string } | null, location?: { __typename?: 'AgentDescriptionLocationType', id: string, sourceMention: SourceMention, note: string, location: { __typename?: 'SpaceDescriptionType', id: string } } | null, source: { __typename?: 'SourceType', id: string } } | null };

export type LocationsInSourceListQueryVariables = Exact<{
id: Scalars['ID']['input'];
}>;


export type LocationsInSourceListQuery = { __typename?: 'Query', spaceDescriptions: Array<{ __typename?: 'SpaceDescriptionType', id: string, name: string }> };
export type DataEntryAgentDescriptionQuery = { __typename?: 'Query', agentDescription?: { __typename?: 'AgentDescriptionType', id: string, isGroup: boolean, gender?: { __typename?: 'AgentDescriptionGenderType', id: string, gender: Gender, sourceMention: SourceMention, note: string } | null, location?: { __typename?: 'AgentDescriptionLocationType', id: string, sourceMention: SourceMention, note: string, location: { __typename?: 'SpaceDescriptionType', id: string } } | null, source: { __typename?: 'SourceType', id: string, spaces: Array<{ __typename?: 'SpaceDescriptionType', id: string, name: string }> } } | null };

export type DataEntryAgentEpisodesQueryVariables = Exact<{
id: Scalars['ID']['input'];
Expand Down Expand Up @@ -1437,6 +1430,10 @@ export const DataEntryAgentDescriptionDocument = gql`
}
source {
id
spaces {
id
name
}
}
}
}
Expand All @@ -1448,25 +1445,6 @@ export const DataEntryAgentDescriptionDocument = gql`
export class DataEntryAgentDescriptionGQL extends Apollo.Query<DataEntryAgentDescriptionQuery, DataEntryAgentDescriptionQueryVariables> {
override document = DataEntryAgentDescriptionDocument;

constructor(apollo: Apollo.Apollo) {
super(apollo);
}
}
export const LocationsInSourceListDocument = gql`
query LocationsInSourceList($id: ID!) {
spaceDescriptions(sourceId: $id) {
id
name
}
}
`;

@Injectable({
providedIn: 'root'
})
export class LocationsInSourceListGQL extends Apollo.Query<LocationsInSourceListQuery, LocationsInSourceListQueryVariables> {
override document = LocationsInSourceListDocument;

constructor(apollo: Apollo.Apollo) {
super(apollo);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h3>Location</h3>
<select class="form-select" id="input-location"
[formControl]="form.controls.location.controls.location">
<ng-container *ngIf="locations$ | async as locationData">
<option *ngFor="let location of locationData.spaceDescriptions"
<option *ngFor="let location of locationData"
[value]="location.id">
{{location.name}}
</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import {
DataEntryUpdateAgentMutation,
Gender,
SourceMention,
LocationsInSourceListGQL,
LocationsInSourceListQuery,
UpdateAgentInput,
} from 'generated/graphql';
import { Observable, map, switchMap, shareReplay, filter, debounceTime, distinctUntilChanged, withLatestFrom, BehaviorSubject, tap, skip } from 'rxjs';
Expand Down Expand Up @@ -48,11 +46,11 @@ export class AgentDescriptionFormComponent implements OnDestroy {
location: new FormControl<string | null>(null),
sourceMention: new FormControl<SourceMention>(SourceMention.Direct),
note: new FormControl<string>('', { updateOn: 'blur' }),
})
}),
});

isGroup$: Observable<boolean>;
locations$: Observable<LocationsInSourceListQuery>;
locations$: Observable<{ id: string, name: string }[]>;

status$ = new BehaviorSubject<FormStatus>('idle');

Expand All @@ -62,7 +60,6 @@ export class AgentDescriptionFormComponent implements OnDestroy {

constructor(
private agentQuery: DataEntryAgentDescriptionGQL,
private locationsQuery: LocationsInSourceListGQL,
private agentMutation: DataEntryUpdateAgentGQL,
private toastService: ToastService,
private formService: FormService,
Expand All @@ -78,10 +75,8 @@ export class AgentDescriptionFormComponent implements OnDestroy {
map(result => result.agentDescription?.isGroup || false),
);
this.locations$ = this.data$.pipe(
map(data => data.agentDescription?.source.id),
map(data => data.agentDescription?.source.spaces),
filter(_.negate(_.isUndefined)),
switchMap(id => this.locationsQuery.watch({ id }).valueChanges),
map(result => result.data),
shareReplay(1),
);
this.data$.subscribe(this.updateFormData.bind(this));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ query DataEntryAgentDescription($id: ID!) {
}
source {
id
spaces {
id
name
}
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export class EpisodeContentsFormComponent implements OnInit, OnDestroy {
this.form.patchValue(
{
summary: episode.summary,
designators: episode.designators,
categories: episode.categories.map((c) => c.id),
},
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lettercraft",
"version": "0.5.0",
"version": "0.5.1",
"description": "Lettercraft & Epistolary Performance in Medieval Europe",
"author": "UU Centre for Digital Humanities - Research Software Lab",
"license": "BSD-3-Clause",
Expand Down

0 comments on commit 61122a4

Please sign in to comment.