Skip to content

Commit

Permalink
feat(version): display abstruse version in header dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Oct 3, 2017
1 parent 7257f24 commit 13fe0aa
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ export class AppBuildDetailsComponent implements OnInit, OnDestroy {
} else if (this.build.data.head_commit) {
const commit = this.build.data.head_commit;
this.committerAvatar = this.build.data.sender.avatar_url;
this.nameCommitter = this.build.data.head_commit.author.name;
this.nameAuthor = this.build.data.head_commit.author.name;
this.nameCommitter = this.build.data.head_commit.committer.name;

if (commit.author.username !== commit.committer.username) {
this.nameCommitter = commit.committer.name;
Expand Down
4 changes: 4 additions & 0 deletions src/app/components/app-header/app-header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
<a class="nav-dropdown-item" (click)="logout()">
Logout
</a>
<a class="version-link" href="https://github.com/bleenco/abstruse" target="_blank">
Abstruse {{ version }}
<i class="ionicon ion-social-github"></i>
</a>
</div>
</a>

Expand Down
3 changes: 3 additions & 0 deletions src/app/components/app-header/app-header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { AuthService } from '../../services/auth.service';
import { ConfigService } from '../../services/config.service';
import { SocketService } from '../../services/socket.service';
import { NotificationService, NotificationType } from '../../services/notification.service';
const pkgJson = require('../../../../package.json');

@Component({
selector: 'app-header',
Expand All @@ -14,6 +15,7 @@ export class AppHeaderComponent implements OnInit {
notifyDropped: boolean;
user: any;
notifications: NotificationType[];
version: string;

constructor(
private authService: AuthService,
Expand All @@ -30,6 +32,7 @@ export class AppHeaderComponent implements OnInit {
});

this.notifications = [];
this.version = pkgJson.version;
}

ngOnInit() {
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/app-job/app-job.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ export class AppJobComponent implements OnInit, OnDestroy {
} else if (this.job.build.data.head_commit) {
const commit = this.job.build.data.head_commit;
this.committerAvatar = this.job.build.data.sender.avatar_url;
this.nameCommitter = this.job.build.data.head_commit.author.name;
this.nameAuthor = this.job.build.data.head_commit.author.name;
this.nameCommitter = this.job.build.data.head_commit.committer.name;

if (commit.author.username !== commit.committer.username) {
this.nameCommitter = commit.committer.name;
Expand Down
15 changes: 15 additions & 0 deletions src/app/styles/nav.sass
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,21 @@
background: $background
color: $color

.version-link
font-size: 10px
color: $grey-light
padding: 5px 10px
position: relative
display: block
text-align: center

i
position: absolute
font-size: 14px !important
top: 0
right: 0
color: $grey-light

&.sub-nav
background: transparent
padding-top: 40px
Expand Down
3 changes: 2 additions & 1 deletion src/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"outDir": "lib",
"typeRoots": [
"../node_modules/@types"
]
],
"types": ["node"]
},
"exclude": [
"main.aot.ts",
Expand Down

0 comments on commit 13fe0aa

Please sign in to comment.