Default to the first credential tab if no cookie

Also removes the credential dialog id, to ensure persistence across
sessions
This commit is contained in:
Sam Chow 2018-04-25 16:01:13 -04:00
parent f89ad30320
commit b5db46ad06
4 changed files with 16 additions and 14 deletions

View file

@ -20,6 +20,7 @@ export class CorCookieTabsDirective implements AfterContentInit {
public ngAfterContentInit(): void {
// Set initial tab
const tabId: string = this.cookieService.get(this.cookieName);
this.panel.activeTab.next(tabId);
this.panel.activeTab.subscribe((tab: string) => {

View file

@ -14,9 +14,9 @@ import 'rxjs/add/operator/filter';
}
})
export class CorTabComponent implements OnInit {
@Input('@') public tabId: string;
@Input('@') public tabTitle: string;
@Input('<') public tabActive: boolean = false;
@Output() public tabInit: EventEmitter<any> = new EventEmitter();
@Output() public tabShow: EventEmitter<any> = new EventEmitter();
@ -29,6 +29,8 @@ export class CorTabComponent implements OnInit {
}
public ngOnInit(): void {
this.isActive = this.tabActive;
this.panel.activeTab
.filter(tabId => tabId != undefined)
.subscribe((tabId: string) => {

View file

@ -34,7 +34,6 @@ angular.module('quay').directive('credentialsDialog', function () {
}
$rootScope.credentialsDialogCounter++;
$scope.dialogID = $rootScope.credentialsDialogCounter;
$scope.hide = function() {
$element.find('.modal').modal('hide');