Skip to content

Commit

Permalink
chore(app-navigation): implements module permalinks. fix #72
Browse files Browse the repository at this point in the history
  • Loading branch information
dzintars committed Jul 25, 2020
1 parent 93d2360 commit e17d59d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/store/modules/modules/models.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export interface Module {
readonly id: string
readonly title: string
readonly permalink: string
}

export interface ModulesState {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/app-flyout/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import style from './style'
export class AppFlyoutElement extends connect(store, LitElement) {
@property({ type: String }) key: string = ''
@property({ type: String }) label: string = 'Unspecified label'
@property({ type: Array }) modules: Module[] = [{ id: '1', title: 'Flyout' }]
@property({ type: Array }) modules: Module[] = [{ id: '1', title: 'Flyout', permalink: 'permalink' }]

mapState(state: RootState) {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/app-navigation/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class AppNavigationElement extends LitElement {

@property({ type: String }) pathname: string
@property({ type: String }) appid: string = ''
@property({ type: Array }) modules: Module[] = [{ id: '1', title: 'Module' }]
@property({ type: Array }) modules: Module[] = [{ id: '1', title: 'Module', permalink: '' }]
@property({ type: String }) name: string = 'component'

protected render(): TemplateResult {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/app-navigation/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function template(this: AppNavigationElement): TemplateResult {
module => module.id,
module => html`
<div>
<a href="${this.pathname}/${module.id}"><p>${module.title}</p></a>
<a href="${this.pathname}/${module.permalink}"><p>${module.title}</p></a>
</div>
`
)}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/containers/main-launcher/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class MainLauncherElement extends connect(store, LitElement) {
@property({ type: Object }) wrapperRef: any = this.setWrapperRef.bind(this)
@property({ type: Array }) applications: Application[]
@property({ type: String }) activeNavItem: string = ''
@property({ type: Array }) modules: Module[] = [{ id: '1', title: 'test' }]
@property({ type: Array }) modules: Module[] = [{ id: '1', title: 'test', permalink: 'permalink' }]
@property({ type: String }) activeView: string = ''

// Map state to props (Connect lib)
Expand Down

0 comments on commit e17d59d

Please sign in to comment.