mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 19:13:08 +00:00
[835] Auto-save in new Item Submission form breaks the form
Submission form Save button disabled when no pending operations are present
This commit is contained in:
@@ -161,6 +161,18 @@ export abstract class JsonPatchOperationsService<ResponseDefinitionDomain, Patch
|
||||
return this.submitJsonPatchOperations(href$, resourceType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Select the jsonPatch operation related to the specified resource type.
|
||||
* @param resourceType
|
||||
*/
|
||||
public hasPendingOperations(resourceType: string): Observable<boolean> {
|
||||
return this.store.select(jsonPatchOperationsByResourceType(resourceType)).pipe(
|
||||
map((val) => !isEmpty(val) && Object.values(val.children)
|
||||
.filter((section) => !isEmpty((section as any).body)).length > 0),
|
||||
distinctUntilChanged(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Make a new JSON Patch request with all operations related to the specified resource id
|
||||
*
|
||||
|
Reference in New Issue
Block a user