--- /dev/null
+<div dropdown>
+ <a dropdownToggle
+ class="dropdown-toggle"
+ data-toggle="dropdown">
+ <i class="fa fa-question-circle-o"></i>
+ <span i18n>Help</span>
+ <span class="caret"></span>
+ </a>
+ <ul *dropdownMenu
+ class="dropdown-menu">
+ <li>
+ <a i18n
+ class="dropdown-item"
+ [ngClass]="{'disabled': !docsUrl}"
+ href="{{ docsUrl }}"
+ target="_blank">Documentation
+ </a>
+ </li>
+ <li>
+ <a i18n
+ class="dropdown-item"
+ href="/docs"
+ target="_blank">API
+ </a>
+ </li>
+ </ul>
+</div>
--- /dev/null
+import { HttpClientTestingModule } from '@angular/common/http/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { SharedModule } from '../../../shared/shared.module';
+import { configureTestBed } from '../../../shared/unit-test-helper';
+import { DashboardHelpComponent } from './dashboard-help.component';
+
+describe('DashboardHelpComponent', () => {
+ let component: DashboardHelpComponent;
+ let fixture: ComponentFixture<DashboardHelpComponent>;
+
+ configureTestBed({
+ imports: [HttpClientTestingModule, SharedModule],
+ declarations: [DashboardHelpComponent]
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(DashboardHelpComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+
+});
--- /dev/null
+import { Component, OnInit } from '@angular/core';
+
+import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe';
+import { SummaryService } from '../../../shared/services/summary.service';
+
+@Component({
+ selector: 'cd-dashboard-help',
+ templateUrl: './dashboard-help.component.html',
+ styleUrls: ['./dashboard-help.component.scss']
+})
+export class DashboardHelpComponent implements OnInit {
+
+ docsUrl: string;
+
+ constructor(private summaryService: SummaryService,
+ private cephReleaseNamePipe: CephReleaseNamePipe) {}
+
+ ngOnInit() {
+ const subs = this.summaryService.summaryData$.subscribe((summary: any) => {
+ const releaseName = this.cephReleaseNamePipe.transform(summary.version);
+ this.docsUrl = `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/`;
+ subs.unsubscribe();
+ });
+ }
+}
import { AppRoutingModule } from '../../app-routing.module';
import { SharedModule } from '../../shared/shared.module';
import { AuthModule } from '../auth/auth.module';
+import { DashboardHelpComponent } from './dashboard-help/dashboard-help.component';
import { NavigationComponent } from './navigation/navigation.component';
import { NotificationsComponent } from './notifications/notifications.component';
import { TaskManagerComponent } from './task-manager/task-manager.component';
SharedModule,
RouterModule
],
- declarations: [NavigationComponent, NotificationsComponent, TaskManagerComponent],
+ declarations: [
+ NavigationComponent,
+ NotificationsComponent,
+ TaskManagerComponent,
+ DashboardHelpComponent
+ ],
exports: [NavigationComponent]
})
export class NavigationModule {}
<li>
<cd-notifications class="oa-navbar"></cd-notifications>
</li>
+ <li>
+ <cd-dashboard-help class="oa-navbar"></cd-dashboard-help>
+ </li>
<li class="tc_logout">
<cd-logout class="oa-navbar"></cd-logout>
</li>
import { SharedModule } from '../../../shared/shared.module';
import { configureTestBed } from '../../../shared/unit-test-helper';
import { LogoutComponent } from '../../auth/logout/logout.component';
+import { DashboardHelpComponent } from '../dashboard-help/dashboard-help.component';
import { NotificationsComponent } from '../notifications/notifications.component';
import { TaskManagerComponent } from '../task-manager/task-manager.component';
import { NavigationComponent } from './navigation.component';
NavigationComponent,
NotificationsComponent,
LogoutComponent,
- TaskManagerComponent
+ TaskManagerComponent,
+ DashboardHelpComponent
],
providers: [{ provide: NotificationService, useValue: fakeService }]
});
.navbar-openattic .navbar-collapse {
padding: 0;
}
+.navbar-openattic .navbar-nav>li>.oa-navbar>[dropdown]>ul>li>.dropdown-item {
+ font-size: 12px;
+}
.navbar-openattic .navbar-nav>li>a,
-.navbar-openattic .navbar-nav>li>.oa-navbar>a {
+.navbar-openattic .navbar-nav>li>.oa-navbar>a,
+.navbar-openattic .navbar-nav>li>.oa-navbar>[dropdown]>a {
color: #ececec;
line-height: 1;
padding: 10px 20px;
.navbar-openattic .navbar-nav>li>a:focus,
.navbar-openattic .navbar-nav>li>a:hover,
.navbar-openattic .navbar-nav>li>.oa-navbar>a:focus,
-.navbar-openattic .navbar-nav>li>.oa-navbar>a:hover {
+.navbar-openattic .navbar-nav>li>.oa-navbar>a:hover,
+.navbar-openattic .navbar-nav>li>.oa-navbar>[dropdown]>a:focus,
+.navbar-openattic .navbar-nav>li>.oa-navbar>[dropdown]>a:hover {
color: #ececec;
}
.navbar-openattic .navbar-nav>li>a:hover,
-.navbar-openattic .navbar-nav>li>.oa-navbar>a:hover {
+.navbar-openattic .navbar-nav>li>.oa-navbar>a:hover,
+.navbar-openattic .navbar-nav>li>.oa-navbar>[dropdown]>a:hover,
+.navbar-openattic .navbar-nav>li>.oa-navbar>[dropdown].open>a {
background-color: #505050;
}
.navbar-openattic .navbar-nav>.open>a,
.navbar-openattic .navbar-nav>.open>a:focus,
.navbar-openattic .navbar-nav>.open>.oa-navbar>a,
.navbar-openattic .navbar-nav>.open>.oa-navbar>a:hover,
-.navbar-openattic .navbar-nav>.open>.oa-navbar>a:focus {
+.navbar-openattic .navbar-nav>.open>.oa-navbar>a:focus,
+.navbar-openattic .navbar-nav>.open>.oa-navbar>[dropdown]>a,
+.navbar-openattic .navbar-nav>.open>.oa-navbar>[dropdown]>a:hover,
+.navbar-openattic .navbar-nav>.open>.oa-navbar>li>a:focus {
color: #ececec;
border-color: transparent;
background-color: transparent;