Skip to content

Commit

Permalink
Merged in feature/SHIBUI-797 (pull request #181)
Browse files Browse the repository at this point in the history
SHIBUI-797 Fixed backup file init configuration

Approved-by: Shibui Jenkins <shibui.jenkins@gmail.com>
Approved-by: Ryan Mathis <rmathis@unicon.net>
  • Loading branch information
rmathis committed Aug 27, 2018
1 parent 6685072 commit 4a7bd22
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 61 deletions.
8 changes: 8 additions & 0 deletions ui/src/app/metadata/provider/action/collection.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum ProviderCollectionActionTypes {
UPDATE_PROVIDER_REQUEST = '[Metadata Provider] Update Request',
UPDATE_PROVIDER_SUCCESS = '[Metadata Provider] Update Success',
UPDATE_PROVIDER_FAIL = '[Metadata Provider] Update Fail',
UPDATE_PROVIDER_CONFLICT = '[Metadata Provider] Update Conflict',

LOAD_PROVIDER_REQUEST = '[Metadata Provider Collection] Provider Load REQUEST',
LOAD_PROVIDER_SUCCESS = '[Metadata Provider Collection] Provider Load SUCCESS',
Expand Down Expand Up @@ -91,6 +92,12 @@ export class UpdateProviderFail implements Action {
constructor(public payload: MetadataProvider) { }
}

export class UpdateProviderConflict implements Action {
readonly type = ProviderCollectionActionTypes.UPDATE_PROVIDER_FAIL;

constructor(public payload: MetadataProvider) { }
}

export class AddProviderRequest implements Action {
readonly type = ProviderCollectionActionTypes.ADD_PROVIDER_REQUEST;

Expand Down Expand Up @@ -195,6 +202,7 @@ export type ProviderCollectionActionsUnion =
| UpdateProviderRequest
| UpdateProviderSuccess
| UpdateProviderFail
| UpdateProviderConflict
| SetOrderProviderRequest
| SetOrderProviderSuccess
| SetOrderProviderFail
Expand Down
5 changes: 3 additions & 2 deletions ui/src/app/metadata/provider/effect/collection.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
UpdateProviderRequest,
UpdateProviderSuccess,
UpdateProviderFail,
UpdateProviderConflict,
GetOrderProviderRequest,
GetOrderProviderSuccess,
GetOrderProviderFail,
Expand All @@ -44,7 +45,7 @@ export class CollectionEffects {

@Effect()
openContention$ = this.actions$.pipe(
ofType<UpdateProviderFail>(ProviderCollectionActionTypes.UPDATE_PROVIDER_FAIL),
ofType<UpdateProviderConflict>(ProviderCollectionActionTypes.UPDATE_PROVIDER_CONFLICT),
map(action => action.payload),
withLatestFrom(this.store.select(fromProvider.getSelectedProvider)),
switchMap(([changes, current]) =>
Expand Down Expand Up @@ -118,7 +119,7 @@ export class CollectionEffects {
.update(provider)
.pipe(
map(p => new UpdateProviderSuccess({id: p.id, changes: p})),
catchError((e) => of(new UpdateProviderFail(provider)))
catchError((e) => e.status === 409 ? of(new UpdateProviderConflict(provider)) : of(new UpdateProviderFail(provider)))
)
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
"required": [
"name",
"xmlId",
"metadataURL"
"metadataURL",
"backingFile",
"backupFileInitNextRefreshDelay"
],
"dependencies": {
"initializeFromBackupFile": {"required": ["backingFile", "backupFileInitNextRefreshDelay"]}
},
"anyOf": [
{
"properties": {
Expand All @@ -29,11 +28,7 @@
true
]
}
},
"required": [
"backingFile",
"backupFileInitNextRefreshDelay"
]
}
},
{
"properties": {
Expand Down Expand Up @@ -144,22 +139,12 @@
"title": "Backing File",
"description": "Specifies where the backing file is located. If the remote server is unavailable at startup, the backing file is loaded instead.",
"type": "string",
"default": "",
"visibleIf": {
"initializeFromBackupFile": [
true
]
}
"default": ""
},
"backupFileInitNextRefreshDelay": {
"title": "Backup File Init Next Refresh Delay",
"description": "Delay duration after which to schedule next HTTP refresh when initialized from the backing file.",
"type": "string",
"visibleIf": {
"initializeFromBackupFile": [
true
]
},
"widget": {
"id": "datalist",
"data": [
Expand Down
41 changes: 2 additions & 39 deletions ui/src/assets/schema/provider/filebacked-http-common.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,7 @@
"useDefaultPredicateRegistry",
"satisfyAnyPredicates"
],
"required": ["xmlId", "metadataURL"],
"dependencies": {
"initializeFromBackupFile": {"required": ["backingFile", "backupFileInitNextRefreshDelay"]}
},
"anyOf": [
{
"properties": {
"initializeFromBackupFile": {
"enum": [
true
]
}
},
"required": [
"backingFile",
"backupFileInitNextRefreshDelay"
]
},
{
"properties": {
"initializeFromBackupFile": {
"enum": [
false
]
}
}
}
],
"required": ["xmlId", "metadataURL", "backingFile", "backupFileInitNextRefreshDelay"],
"properties": {
"xmlId": {
"title": "ID",
Expand Down Expand Up @@ -81,22 +54,12 @@
"title": "Backing File",
"description": "Specifies where the backing file is located. If the remote server is unavailable at startup, the backing file is loaded instead.",
"type": "string",
"default": "",
"visibleIf": {
"initializeFromBackupFile": [
true
]
}
"default": ""
},
"backupFileInitNextRefreshDelay": {
"title": "Backup File Init Next Refresh Delay",
"description": "Delay duration after which to schedule next HTTP refresh when initialized from the backing file.",
"type": "string",
"visibleIf": {
"initializeFromBackupFile": [
true
]
},
"widget": {
"id": "datalist",
"data": [
Expand Down

0 comments on commit 4a7bd22

Please sign in to comment.