Skip to content

Commit

Permalink
issue #167 Add project pages, copyright and license info
Browse files Browse the repository at this point in the history
  • Loading branch information
wajda committed Nov 13, 2021
1 parent 6921dec commit 0772e4f
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"LAYOUT": {
"APP_VERSION": "Version",
"BUILD_REVISION": "Build Revision",
"BUILD_TIMESTAMP": "Build Date"
"BUILD_TIMESTAMP": "Build Date",
"PROJECT_PAGES": "Project Pages",
"COPYRIGHT": "Copyright",
"LICENSE": "License"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,44 @@
<!-- ./SECTION :: SIDEBAR -->
</div>
<div class="sl-sidenav__footer">
<div class="sl-sidenav__version " [hidden]="!isSideNavExpanded">
<div class="sl-sidenav__version-label"> {{ 'COMMON.LAYOUT.APP_VERSION' | translate }}:</div>
{{ appVersion }}
</div>
<div class="d-flex pt-2" *ngIf="buildRevision || buildDate">
<div class="sl-sidenav__version pr-2" [hidden]="!isSideNavExpanded" *ngIf="buildRevision">
<div class="sl-sidenav__version-label"> {{ 'COMMON.LAYOUT.BUILD_REVISION' | translate }}:</div>
{{ buildRevision }}
<div *ngIf="isSideNavExpanded">
<div class="sl-sidenav__footer__entry">
<div class="sl-sidenav__footer__entry-label"> {{ 'COMMON.LAYOUT.APP_VERSION' | translate }}:</div>
{{ appVersion }}
</div>
<div class="sl-sidenav__version" [hidden]="!isSideNavExpanded" *ngIf="buildDate">
<div class="sl-sidenav__version-label"> {{ 'COMMON.LAYOUT.BUILD_TIMESTAMP' | translate }}:</div>
{{ buildDate | date : 'yyyy-MM-dd' }}

<div class="d-flex pt-2" *ngIf="buildRevision || buildDate">
<div class="sl-sidenav__footer__entry pr-2" *ngIf="buildRevision">
<div class="sl-sidenav__footer__entry-label"> {{ 'COMMON.LAYOUT.BUILD_REVISION' | translate }}:</div>
{{ buildRevision }}
</div>
<div class="sl-sidenav__footer__entry" *ngIf="buildDate">
<div class="sl-sidenav__footer__entry-label"> {{ 'COMMON.LAYOUT.BUILD_TIMESTAMP' | translate }}:</div>
{{ buildDate | date : 'yyyy-MM-dd' }}
</div>
</div>

<div class="pt-2">
<div class="sl-sidenav__footer__entry pr-2">
<div class="sl-sidenav__footer__entry-label"> {{ 'COMMON.LAYOUT.PROJECT_PAGES' | translate }}:</div>
<a target="_blank" [href]="projectPages.href">{{ projectPages.name }}</a>
</div>
</div>

<div class="pt-2">
<div class="sl-sidenav__footer__entry">
<div class="sl-sidenav__footer__entry-label"> {{ 'COMMON.LAYOUT.COPYRIGHT' | translate }}:</div>
{{ copyright }}
</div>
</div>

<div class="pt-2">
<div class="sl-sidenav__footer__entry">
<div class="sl-sidenav__footer__entry-label"> {{ 'COMMON.LAYOUT.LICENSE' | translate }}:</div>
<a target="_blank" [href]="license.href">{{ license.name }}</a>
</div>
</div>

</div>

<div class="pt-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { AfterContentInit, Component, ContentChildren, EventEmitter, Input, Outp

import { SplineLayoutSectionDirective } from '../../directives'
import { SplineLayoutSection } from '../../models'
import { NamedHref } from 'spline-utils'


@Component({
Expand All @@ -33,6 +34,9 @@ export class SplineLayoutCommonComponent implements AfterContentInit {
@Input() appVersion: string
@Input() buildRevision: string
@Input() buildDate: Date
@Input() projectPages: NamedHref
@Input() copyright: string
@Input() license: NamedHref
@Input() noHeader = true

@Output() sidenavExpanded$ = new EventEmitter<{ isExpanded: boolean }>()
Expand Down
22 changes: 13 additions & 9 deletions ui/projects/spline-common/layout/styles/_spline-layout-common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,21 @@ $spline-layout-settings-default: (
&__footer {
color: $color-grey;
padding: 1rem 1rem 0.5rem 0.75rem;
}

&__version {
font-size: 10px;
line-height: 1;
white-space: nowrap;
&__entry {
font-size: 10px;
line-height: 1;
white-space: nowrap;

&-label {
color: $color-grey-2;
font-size: 8px;
margin-bottom: 2px;
}

&-label {
color: $color-grey-2;
font-size: 8px;
margin-bottom: 2px;
a {
color: $color-grey;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ export type GenericEvent<TData extends SplineRecord = SplineRecord> = {
eventName: string
data?: TData
}

export type NamedHref = {
name: string
href: string
}
3 changes: 3 additions & 0 deletions ui/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
[appVersion]="state.appVersion"
[buildRevision]="state.buildRevision"
[buildDate]="state.buildDate"
[projectPages]="state.projectPages"
[copyright]="state.copyright"
[license]="state.license"
[isSideNavExpanded]="state.isSideNavExpanded">

<!-- HEADER -->
Expand Down
10 changes: 10 additions & 0 deletions ui/src/app/store/models/app.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import moment from 'moment'

import { SplineSidebarMenu } from '../../components'
import { AppSidebarMenu } from '../../models'
import { NamedHref } from 'spline-utils'


export namespace AppStore {
Expand All @@ -28,6 +29,9 @@ export namespace AppStore {
appVersion: string | null
buildRevision: string | null
buildDate: Date | null
projectPages: NamedHref
copyright: string
license: NamedHref
isEmbeddedMode: boolean
isSideNavExpanded: boolean
sidebarMenuItems: SplineSidebarMenu.MenuItem[]
Expand All @@ -39,6 +43,12 @@ export namespace AppStore {
appVersion: environment.version,
buildRevision: environment.buildRevision ?? null,
buildDate: environment.buildTimestamp ? moment(environment.buildTimestamp).toDate() : null,
projectPages: {
name: environment.projectPagesHref,
href: environment.projectPagesHref
},
copyright: environment.copyright,
license: environment.license,
isEmbeddedMode: false,
isSideNavExpanded: false,
sidebarMenuItems: AppSidebarMenu.getSidebarMenu(),
Expand Down
6 changes: 6 additions & 0 deletions ui/src/environments/environment.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export const environmentBase: Environment = {
version: config.version,
buildRevision: __SPLINE_UI_BUILD_REVISION__,
buildTimestamp: __SPLINE_UI_BUILD_TIMESTAMP__,
projectPagesHref: 'https://absaoss.github.io/spline',
copyright: '© 2019 ABSA Group Limited',
license: {
name: 'Apache License, Version 2.0.',
href: 'https://www.apache.org/licenses/LICENSE-2.0'
},
deploymentPrefix: DEPLOYMENT_PREFIX,
url: URL,
key: null,
Expand Down
6 changes: 6 additions & 0 deletions ui/src/environments/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* limitations under the License.
*/

import { NamedHref } from 'spline-utils'


export const RELATIVE_URL = '.'
export const DEPLOYMENT_PREFIX = '/'

Expand All @@ -22,6 +25,9 @@ export interface Environment {
version: string
buildRevision: string
buildTimestamp: string
projectPagesHref: string
copyright: string
license: NamedHref
deploymentPrefix: string
url: string
key: string
Expand Down

0 comments on commit 0772e4f

Please sign in to comment.