Skip to content

Commit

Permalink
fix(ui): Multiple UI fixes (#5498)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Behar <simbeh7@gmail.com>
  • Loading branch information
simster7 authored Mar 23, 2021
1 parent dfe6ceb commit 4eb351c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ export class ArchivedWorkflowList extends BasePage<RouteComponentProps<any>, Sta
this.storage = new ScopedLocalStorage('ArchiveListOptions');
const savedOptions = this.storage.getItem('options', {
pagination: {limit: defaultPaginationLimit},
selectedPhases: []
selectedPhases: [],
selectedLabels: []
} as State);
const phaseQueryParam = this.queryParams('phase');
const labelQueryParam = this.queryParams('label');
this.state = {
pagination: {offset: this.queryParam('offset'), limit: parseLimit(this.queryParam('limit')) || savedOptions.pagination.limit},
namespace: this.props.match.params.namespace || '',
selectedPhases: phaseQueryParam.length > 0 ? phaseQueryParam : savedOptions.selectedPhases,
selectedLabels: this.queryParams('label'),
selectedLabels: labelQueryParam.length > 0 ? labelQueryParam : savedOptions.selectedLabels,
minStartedAt: this.parseTime(this.queryParam('minStartedAt')) || this.lastMonth(),
maxStartedAt: this.parseTime(this.queryParam('maxStartedAt')) || this.nextDay()
};
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/login/components/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const getRedirect = (): string => {
if (urlParams.has('redirect')) {
return 'redirect=' + urlParams.get('redirect');
}
return '';
return 'redirect=' + window.location.origin + '/workflows';
};
export const Login = () => (
<Page title='Login' toolbar={{breadcrumbs: [{title: 'Login'}]}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface State {
interface WorkflowListRenderOptions {
paginationLimit: number;
selectedPhases: WorkflowPhase[];
selectedLabels: string[];
}

const allBatchActionsEnabled: Actions.OperationDisabled = {
Expand Down Expand Up @@ -82,6 +83,7 @@ export class WorkflowsList extends BasePage<RouteComponentProps<any>, State> {
private get options() {
const options: WorkflowListRenderOptions = {} as WorkflowListRenderOptions;
options.selectedPhases = this.state.selectedPhases;
options.selectedLabels = this.state.selectedLabels;
if (this.state.pagination.limit) {
options.paginationLimit = this.state.pagination.limit;
}
Expand All @@ -95,16 +97,19 @@ export class WorkflowsList extends BasePage<RouteComponentProps<any>, State> {
this.storage = new ScopedLocalStorage('ListOptions');
const savedOptions = this.storage.getItem('options', {
paginationLimit: 0,
selectedPhases: []
selectedPhases: [],
selectedLabels: []
} as WorkflowListRenderOptions);
const phaseQueryParam = this.queryParams('phase');
const labelQueryParam = this.queryParams('label');
this.state = {
pagination: {
offset: this.queryParam('offset'),
limit: parseLimit(this.queryParam('limit')) || savedOptions.paginationLimit || 500
},
namespace: this.props.match.params.namespace || '',
selectedPhases: this.queryParams('phase').length > 0 ? (this.queryParams('phase') as WorkflowPhase[]) : savedOptions.selectedPhases,
selectedLabels: this.queryParams('label'),
selectedPhases: phaseQueryParam.length > 0 ? (phaseQueryParam as WorkflowPhase[]) : savedOptions.selectedPhases,
selectedLabels: labelQueryParam.length > 0 ? (labelQueryParam as string[]) : savedOptions.selectedLabels,
selectedWorkflows: new Map<string, models.Workflow>(),
batchActionDisabled: {...allBatchActionsEnabled}
};
Expand Down

0 comments on commit 4eb351c

Please sign in to comment.