Skip to content

Commit bdae4ce

Browse files
authored
Fix/818 bug (#514)
* fix(metadata): fixed contributors bug and updated models * fix(contributors): clear search after close dialog
1 parent 6b6c76d commit bdae4ce

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/app/features/metadata/metadata.component.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
GetAllContributors,
3333
InstitutionsSelectors,
3434
SubjectsSelectors,
35+
UpdateContributorsSearchValue,
3536
UpdateResourceInstitutions,
3637
UpdateResourceSubjects,
3738
} from '@osf/shared/stores';
@@ -165,6 +166,7 @@ export class MetadataComponent implements OnInit {
165166
fetchSelectedSubjects: FetchSelectedSubjects,
166167
fetchChildrenSubjects: FetchChildrenSubjects,
167168
updateResourceSubjects: UpdateResourceSubjects,
169+
updateContributorsSearchValue: UpdateContributorsSearchValue,
168170
});
169171

170172
isLoading = computed(() => {
@@ -336,16 +338,18 @@ export class MetadataComponent implements OnInit {
336338
this.customDialogService
337339
.open(ContributorsDialogComponent, {
338340
header: this.translateService.instant('project.metadata.contributors.editContributors'),
339-
breakpoints: { '768px': '95vw' },
340341
data: {
341342
resourceId: this.resourceId,
342343
resourceType: this.resourceType(),
343344
},
344345
})
345-
.onClose.pipe(filter((result) => !!result))
346-
.subscribe(() => {
347-
this.actions.getResourceMetadata(this.resourceId, this.resourceType());
348-
this.toastService.showSuccess('project.metadata.contributors.updateSucceed');
346+
.onClose.subscribe((result) => {
347+
if (result) {
348+
this.actions.getResourceMetadata(this.resourceId, this.resourceType());
349+
this.toastService.showSuccess('project.metadata.contributors.updateSucceed');
350+
}
351+
352+
this.actions.updateContributorsSearchValue(null);
349353
});
350354
}
351355

0 commit comments

Comments
 (0)