Skip to content

Commit

Permalink
fix: Application status panel shows Syncing instead of Deleting (#7486)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
  • Loading branch information
Alexander Matyushentsev committed Oct 19, 2021
1 parent c7074fe commit 7ea3592
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ui/src/app/applications/components/utils.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ test('getOperationType.Sync.Operation', () => {
expect(state).toBe('Sync');
});

test('getOperationType.DeleteAndRecentSync', () => {
const state = getOperationType({metadata: {deletionTimestamp: '123'}, status: {operationState: {operation: {sync: {}}}}} as Application);

expect(state).toBe('Delete');
});

test('getOperationType.Sync.Status', () => {
const state = getOperationType({metadata: {}, status: {operationState: {operation: {sync: {}}}}} as Application);

Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/applications/components/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,12 @@ export const getAppOperationState = (app: appModels.Application): appModels.Oper

export function getOperationType(application: appModels.Application) {
const operation = application.operation || (application.status && application.status.operationState && application.status.operationState.operation);
if (application.metadata.deletionTimestamp && !application.operation) {
return 'Delete';
}
if (operation && operation.sync) {
return 'Sync';
}
if (application.metadata.deletionTimestamp) {
return 'Delete';
}
return 'Unknown';
}

Expand Down

0 comments on commit 7ea3592

Please sign in to comment.