diff --git a/backend/src/main/resources/i18n/messages.properties b/backend/src/main/resources/i18n/messages.properties
index 0d5356269..0032a25ed 100644
--- a/backend/src/main/resources/i18n/messages.properties
+++ b/backend/src/main/resources/i18n/messages.properties
@@ -453,6 +453,7 @@ message.protocol-support-required=Protocol Support Enumeration is required if an
message.conflict=Conflict
message.data-version-contention=Data Version Contention
message.contention-new-version=A newer version of this metadata source has been saved. Below are a list of changes. You can use your changes or their changes.
+message.contention-error=There was a problem saving due to a mismatched version.
message.organization-feedback=These three fields must all be entered if any single field has a value.
message.valid-email=Must be a valid Email Address
message.valid-url=Must be a valid URL
diff --git a/ui/src/app/contention/component/contention-dialog.component.html b/ui/src/app/contention/component/contention-dialog.component.html
index 0922f982f..18b436d03 100644
--- a/ui/src/app/contention/component/contention-dialog.component.html
+++ b/ui/src/app/contention/component/contention-dialog.component.html
@@ -3,12 +3,16 @@
Data Version Contention
-
+
-
- A newer version of this metadata source has been saved. Below are a list of changes. You can use your changes or their changes.
+
0">
+ A newer version of this metadata source has been saved. Below are a list of changes. You can use your changes or their changes.
+
+
+ There was a problem saving due to a mismatched version.
+
-
+
0">
@@ -31,16 +35,17 @@
Da
-
diff --git a/ui/src/app/contention/effect/contention.effect.ts b/ui/src/app/contention/effect/contention.effect.ts
index aa89ffbd1..55c815c71 100644
--- a/ui/src/app/contention/effect/contention.effect.ts
+++ b/ui/src/app/contention/effect/contention.effect.ts
@@ -23,12 +23,6 @@ export class ContentionEffects {
switchMap(contention => {
const resolutionAction = of(new ResolveContentionAction({ value: contention.resolutionObject, handlers: contention.handlers }));
const rejectionAction = of(new CancelContentionAction({ value: contention.rejectionObject, handlers: contention.handlers }));
- if (contention.ourChanges.length < 1) {
- return rejectionAction;
- }
- if (contention.theirChanges.length < 1) {
- return resolutionAction;
- }
return this.modal
.open(ContentionDialogComponent, DEFAULT_MODAL_OPTIONS, { contention })
.pipe(
diff --git a/ui/src/app/metadata/provider/effect/collection.effect.ts b/ui/src/app/metadata/provider/effect/collection.effect.ts
index 1eb9e5093..04d296c7e 100644
--- a/ui/src/app/metadata/provider/effect/collection.effect.ts
+++ b/ui/src/app/metadata/provider/effect/collection.effect.ts
@@ -33,13 +33,13 @@ import { MetadataProviderService } from '../../domain/service/provider.service';
import * as fromProvider from '../reducer';
import * as fromRoot from '../../../app.reducer';
import { array_move } from '../../../shared/util';
-import { ClearProvider, ResetChanges } from '../action/entity.action';
+import { ClearProvider } from '../action/entity.action';
import { ShowContentionAction } from '../../../contention/action/contention.action';
import { ContentionService } from '../../../contention/service/contention.service';
import { MetadataProvider } from '../../domain/model';
import { AddNotification } from '../../../notification/action/notification.action';
import { Notification, NotificationType } from '../../../notification/model/notification';
-import { WizardActionTypes, SetDisabled } from '../../../wizard/action/wizard.action';
+import { SetDisabled } from '../../../wizard/action/wizard.action';
import { I18nService } from '../../../i18n/service/i18n.service';
import * as fromI18n from '../../../i18n/reducer';
import { ClearEditor } from '../action/editor.action';
diff --git a/ui/src/app/metadata/provider/effect/editor.effect.ts b/ui/src/app/metadata/provider/effect/editor.effect.ts
index 60ec2d719..28a134724 100644
--- a/ui/src/app/metadata/provider/effect/editor.effect.ts
+++ b/ui/src/app/metadata/provider/effect/editor.effect.ts
@@ -2,10 +2,7 @@ import { Injectable } from '@angular/core';
import { Effect, Actions, ofType } from '@ngrx/effects';
import { SchemaService } from '../../../schema-form/service/schema.service';
-import {
- EditorActionTypes
-} from '../action/editor.action';
-import { map, switchMap, catchError, withLatestFrom, debounceTime } from 'rxjs/operators';
+import { map, switchMap, catchError, debounceTime } from 'rxjs/operators';
import { of } from 'rxjs';
import {
LoadSchemaRequest,
@@ -18,6 +15,7 @@ import { ResetChanges } from '../action/entity.action';
import * as fromWizard from '../../../wizard/reducer';
import { Store } from '@ngrx/store';
+import { CancelContentionAction, ContentionActionTypes } from '../../../contention/action/contention.action';
@Injectable()
export class EditorEffects {
@@ -43,9 +41,14 @@ export class EditorEffects {
map(() => new ResetChanges())
);
+ @Effect()
+ $resetChangesOnContentionFail = this.actions$.pipe(
+ ofType(ContentionActionTypes.CANCEL_CONTENTION),
+ map(() => new ResetChanges())
+ );
+
constructor(
private schemaService: SchemaService,
- private store: Store,
private actions$: Actions
) { }
} /* istanbul ignore next */
diff --git a/ui/src/app/metadata/resolver/container/resolver-edit.component.ts b/ui/src/app/metadata/resolver/container/resolver-edit.component.ts
index 6d5e802d2..c5cc6b324 100644
--- a/ui/src/app/metadata/resolver/container/resolver-edit.component.ts
+++ b/ui/src/app/metadata/resolver/container/resolver-edit.component.ts
@@ -1,11 +1,11 @@
import { Component, OnDestroy } from '@angular/core';
-import { Router, ActivatedRoute, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
+import { Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { Observable, of, Subject } from 'rxjs';
-import { skipWhile, map, combineLatest, filter, takeUntil } from 'rxjs/operators';
+import { map, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import * as fromWizard from '../../../wizard/reducer';
import * as fromResolver from '../reducer';
-import { ClearWizard, SetIndex, LoadSchemaRequest } from '../../../wizard/action/wizard.action';
+import { LoadSchemaRequest } from '../../../wizard/action/wizard.action';
import { MetadataResolver } from '../../domain/model';
import { Clear } from '../action/entity.action';
import { Wizard } from '../../../wizard/model';
@@ -41,7 +41,6 @@ export class ResolverEditComponent implements OnDestroy, CanComponentDeactivate
constructor(
private store: Store,
private router: Router,
- private route: ActivatedRoute,
private modalService: NgbModal,
private diffService: DifferentialService
) {
diff --git a/ui/src/app/metadata/resolver/effect/entity.effect.ts b/ui/src/app/metadata/resolver/effect/entity.effect.ts
index badd1925c..f869a55dc 100644
--- a/ui/src/app/metadata/resolver/effect/entity.effect.ts
+++ b/ui/src/app/metadata/resolver/effect/entity.effect.ts
@@ -12,11 +12,12 @@ import {
Clear,
Cancel,
UpdateChangesRequest,
- UpdateChangesSuccess
+ UpdateChangesSuccess,
+ UpdateSaving
} from '../action/entity.action';
import * as provider from '../action/collection.action';
-import { ShowContentionAction } from '../../../contention/action/contention.action';
+import { CancelContentionAction, ContentionActionTypes, ShowContentionAction } from '../../../contention/action/contention.action';
import { ResolverCollectionActionTypes } from '../action/collection.action';
import { ResolverService } from '../../domain/service/resolver.service';
@@ -69,6 +70,12 @@ export class EntityEffects {
})
);
+ @Effect()
+ $resetChangesOnContentionFail = this.actions$.pipe(
+ ofType(ContentionActionTypes.CANCEL_CONTENTION),
+ map(() => new UpdateSaving(false))
+ );
+
constructor(
private store: Store,
private service: ResolverService,
diff --git a/ui/src/app/schema-form/widget/array/array.component.html b/ui/src/app/schema-form/widget/array/array.component.html
index 2bcf6271b..84a5a1e9b 100644
--- a/ui/src/app/schema-form/widget/array/array.component.html
+++ b/ui/src/app/schema-form/widget/array/array.component.html
@@ -38,9 +38,10 @@