Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jira==3.10.5
oauthlib==3.3.1
packaging==25.0
python-dotenv==1.1.1
requests==2.32.5
requests==2.33.0
requests-oauthlib==2.0.0
requests-toolbelt==1.0.0
typing-extensions==4.14.1
Expand Down
20 changes: 19 additions & 1 deletion zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class Message {
public connectedStatus = false;
public connectedStatus$ = new Subject<boolean>();
private ws: WebSocketSubject<WebSocketMessage<MessageDataTypeMap>> | null = null;
private wsSubscription: Subscription | null = null;
private open$ = new Subject<Event>();
private close$ = new Subject<CloseEvent>();
private sent$ = new Subject<WebSocketMessage<MessageSendDataTypeMap>>();
Expand Down Expand Up @@ -99,13 +100,26 @@ export class Message {
if (!this.wsUrl) {
throw new Error('WebSocket URL is not set. Please call setWsUrl() before connect()');
}

// Unsubscribe from existing subscription first
if (this.wsSubscription) {
this.wsSubscription.unsubscribe();
this.wsSubscription = null;
}

// Then close existing WebSocket
if (this.ws) {
this.ws.complete();
this.ws = null;
}

this.ws = webSocket<WebSocketMessage<MessageDataTypeMap>>({
url: this.wsUrl,
openObserver: this.open$,
closeObserver: this.close$
});

this.ws
this.wsSubscription = this.ws
.pipe(
// reconnect
retryWhen(errors => errors.pipe(mergeMap(() => this.close$.pipe(take(1), delay(4000)))))
Expand Down Expand Up @@ -190,6 +204,10 @@ export class Message {
}

destroy(): void {
if (this.wsSubscription) {
this.wsSubscription.unsubscribe();
this.wsSubscription = null;
}
if (this.ws) {
this.ws.complete();
this.ws = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,18 +435,31 @@ export class NotebookComponent extends MessageListenersManager implements OnInit
this.noteVarShareService.clear();
});
this.activatedRoute.params.pipe(takeUntil(this.destroy$)).subscribe(param => {
const { noteId, revisionId } = param;
if (revisionId) {
this.messageService.noteRevision(noteId, revisionId);
} else {
this.messageService.getNote(noteId);
}
this.revisionView = !!revisionId;
this.revisionView = !!param.revisionId;
this.cdr.markForCheck();
this.messageService.listRevisionHistory(noteId);
// TODO(hsuanxyz) scroll to current paragraph
});
this.revisionView = !!this.activatedRoute.snapshot.params.revisionId;

// Fetch note when WebSocket connects or reconnects
this.messageService.connectedStatus$
.pipe(startWith(this.messageService.connectedStatus), takeUntil(this.destroy$))
.subscribe(connected => {
console.log('connectedStatus$ changed to ', connected ? 'connected' : 'disconnected');
if (connected) {
const { noteId, revisionId } = this.activatedRoute.snapshot.params;
if (!noteId) {
throw new Error('Route parameter `noteId` is required.');
}
if (revisionId) {
this.messageService.noteRevision(noteId, revisionId);
} else {
this.messageService.getNote(noteId);
}
this.cdr.markForCheck();
this.messageService.listRevisionHistory(noteId);
// TODO(hsuanxyz) scroll to current paragraph
}
});
}

removeParagraphFromNgZ(): void {
Expand Down
10 changes: 5 additions & 5 deletions zeppelin-web-angular/src/app/share/header/header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@
<ul nz-menu>
<li nz-menu-item (click)="about()">About Zeppelin</li>
<li nz-menu-divider></li>
<li nz-menu-item routerLinkActive="ant-dropdown-menu-item-selected">
<li nz-menu-item nzMatchRouter>
<a [routerLink]="['/interpreter']">Interpreter</a>
</li>
<li nz-menu-item routerLinkActive="ant-dropdown-menu-item-selected">
<li nz-menu-item nzMatchRouter>
<a [routerLink]="['/notebook-repos']">Notebook Repos</a>
</li>
<li nz-menu-item routerLinkActive="ant-dropdown-menu-item-selected">
<li nz-menu-item nzMatchRouter>
<a [routerLink]="['/credential']">Credential</a>
</li>
<!-- <li nz-menu-item routerLinkActive="ant-dropdown-menu-item-selected">-->
<!-- <li nz-menu-item nzMatchRouter>-->
<!-- <a [routerLink]="['/helium']">Helium</a>-->
<!-- </li>-->
<li nz-menu-item routerLinkActive="ant-dropdown-menu-item-selected">
<li nz-menu-item nzMatchRouter>
<a [routerLink]="['/configuration']">Configuration</a>
</li>
<ng-container *ngIf="ticketService.ticket.principal !== 'anonymous'">
Expand Down
8 changes: 8 additions & 0 deletions zeppelin-web-angular/src/styles/global.less
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@
}
}

// Fix `a` tag in nz-dropdown-menu to be clickable with full width
.ant-dropdown-menu-item > a::before {
position: absolute;
inset: 0;
background-color: transparent;
content: '';
}

//.view-lines {
// .view-line {
// &:first-child {
Expand Down
Loading