Skip to content

fixes issue 269 #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import {Observable, Subject} from 'rxjs';
import {ReqLoadPage, ReqLoadRootPage} from './ngrx/actions/page-actions';
import {PageModel} from './models/page-model';
import {AddCommand, ClearHistory, PreviewIndexUpdate, ToggleCli} from './ngrx/actions/cli-actions';
import {AddCommand, ClearHistory, PreviewIndexUpdate, ToggleCli, CollapseCli} from './ngrx/actions/cli-actions';
import {ConfirmDialogComponent} from './components/confirm-dialog/confirm-dialog.component';
import {InformationDialogComponent} from './components/information-dialog/information-dialog.component';
import {SettingsDialogComponent} from './components/settings-dialog/settings-dialog.component';
Expand Down Expand Up @@ -195,6 +195,7 @@ export class AppComponent implements OnInit {
this.currentInstance = null;
this._store.dispatch(new RedisDisconnect({id}));
this._store.dispatch(new ReqLoadPage(getNewPage()));
this._store.dispatch(new CollapseCli());
}

onInformationEvt() {
Expand Down
7 changes: 6 additions & 1 deletion src/app/ngrx/actions/cli-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export enum CliActions {
ClearHistory = 'Clear History', // clear all cli history
ToggleCli = 'Toggle Cli', // toggle cli panel
ClearPreviewIndex = 'Clear Preview Index', // clear preview index
PreviewIndexUpdate = 'Preview Index Update' // update preview index
PreviewIndexUpdate = 'Preview Index Update', // update preview index
CollapseCli = 'Collapse Cli' // collpase cli panel
}

export class AddCommand implements Action {
Expand Down Expand Up @@ -41,3 +42,7 @@ export class PreviewIndexUpdate implements Action {
export class ClearPreviewIndex implements Action {
readonly type = CliActions.ClearPreviewIndex;
}

export class CollapseCli implements Action {
readonly type = CliActions.CollapseCli;
}
4 changes: 4 additions & 0 deletions src/app/ngrx/reducer/cli-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ export function reducer(state = initialState, action) {
state.expanded = !state.expanded;
return state;
}
case CliActions.CollapseCli: {
state.expanded = false;
return state;
}
default: {
return state;
}
Expand Down