| * Copyright 2020 Google LLC |
| * SPDX-License-Identifier: Apache-2.0 |
| import {Observable} from 'rxjs'; |
| import {Model} from '../../models/base/model'; |
| import {select} from '../../utils/observable-util'; |
| import {define} from '../../models/dependency'; |
| AGREEMENTS = 'agreements', |
| DOCUMENTATION_SEARCH = 'documentation-search', |
| PLUGIN_SCREEN = 'plugin-screen', |
| SERVER_INFO = 'server-info', |
| // TODO: Consider renaming this to AppElementState or something similar. |
| // Or maybe RootViewState. This class does *not* model the state of the router. |
| export interface RouterState { |
| // Note that this router model view must be updated before view model state. |
| export const routerModelToken = define<RouterModel>('router-model'); |
| // TODO: Consider renaming this to AppElementViewModel or something similar. |
| // Or maybe RootViewModel. This class is *not* a view model of the router. |
| export class RouterModel extends Model<RouterState> { |
| readonly routerView$: Observable<GerritView | undefined> = select( |