Skip to content

Commit

Permalink
[ZEPPELIN-6151] Remove AngularJS -> Angular Code Migration Suggestion…
Browse files Browse the repository at this point in the history
… Feature

### What is this PR for?
I propose removing the feature in Zeppelin's new UI that converts AngularJS code to Angular code.

This feature currently prompts users when they run code with the `%angular` prefix, asking whether to migrate AngularJS code to Angular, and performs the migration if confirmed.

The reasons for suggesting its removal are as follows:

- The library supporting this feature is not compatible with the latest Angular versions due to peer dependency issues, making it difficult to upgrade Angular.
- It is likely that this feature is not widely used by the community.

Removing this feature will reduce unnecessary library dependencies, which will help streamline future updates to the latest Angular versions.

If you have any other opinions, please feel free to share them.

### What type of PR is it?
Removing Feature

### Todos
* [ ] - Task

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-6151

### How should this be tested?
* Strongly recommended: add automated unit tests for any new or changed behavior
* Outline any manual steps to test the PR here.

### Screenshots (if appropriate)

### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Closes #4900 from tbonelee/remove-ng1-migration.

Signed-off-by: Cheng Pan <[email protected]>
(cherry picked from commit ae48f71)
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
tbonelee authored and pan3793 committed Nov 25, 2024
1 parent b66142e commit 856a9db
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 460 deletions.
18 changes: 0 additions & 18 deletions zeppelin-web-angular/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion zeppelin-web-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"mathjax": "2.7.5",
"monaco-editor": "0.15.1",
"ng-zorro-antd": "^8.4.0",
"ng1-template-updater": "0.0.4",
"parse5": "^5.1.1",
"rxjs": "~6.5.3",
"systemjs": "^5.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import {
} from '@zeppelin/services';
import { SpellResult } from '@zeppelin/spell/spell-result';

import { NgTemplateAdapterService } from '@zeppelin/services/ng-template-adapter.service';
import { NzResizeEvent } from 'ng-zorro-antd/resizable';
import { NotebookParagraphResultComponent } from '../../share/result/result.component';
import { NotebookParagraphCodeEditorComponent } from './code-editor/code-editor.component';
Expand Down Expand Up @@ -301,31 +300,8 @@ export class NotebookParagraphComponent extends ParagraphBase implements OnInit,
this.runParagraphUsingSpell(text, magic, propagated);
this.runParagraphAfter(text);
} else {
const check = this.ngTemplateAdapterService.preCheck(text);
if (!check) {
this.runParagraphUsingBackendInterpreter(text);
this.runParagraphAfter(text);
} else {
this.waitConfirmFromEdit = true;
this.nzModalService
.confirm({
nzTitle: 'Do you want to migrate the Angular.js template?',
nzContent:
'The Angular.js template has been deprecated, please upgrade to Angular template.' +
' (<a href="https://angular.io/guide/ajs-quick-reference" target="_blank">more info</a>)',
nzOnOk: () => {
this.switchMode('command');
this.ngTemplateAdapterService
.openMigrationDialog(check)
.pipe(takeUntil(this.destroy$))
.subscribe(newText => {
this.cloneParagraph('below', newText);
});
}
})
.afterClose.pipe(takeUntil(this.destroy$))
.subscribe(() => (this.waitConfirmFromEdit = false));
}
this.runParagraphUsingBackendInterpreter(text);
this.runParagraphAfter(text);
}
}
}
Expand Down Expand Up @@ -452,20 +428,17 @@ export class NotebookParagraphComponent extends ParagraphBase implements OnInit,
private nzModalService: NzModalService,
private noteVarShareService: NoteVarShareService,
private shortcutService: ShortcutService,
private host: ElementRef,
private ngTemplateAdapterService: NgTemplateAdapterService
private host: ElementRef
) {
super(messageService, noteStatusService, ngZService, cdr);
}

ngOnInit() {
const shortcutService = this.shortcutService.forkByElement(this.host.nativeElement);
const observables: Array<
Observable<{
action: ParagraphActions;
event: KeyboardEvent;
}>
> = [];
const observables: Array<Observable<{
action: ParagraphActions;
event: KeyboardEvent;
}>> = [];
Object.entries(ShortcutsMap).forEach(([action, keys]) => {
const keysArr: string[] = Array.isArray(keys) ? keys : [keys];
keysArr.forEach(key => {
Expand Down Expand Up @@ -617,6 +590,7 @@ export class NotebookParagraphComponent extends ParagraphBase implements OnInit,
});
}
}

ngOnChanges(changes: SimpleChanges): void {
const { index, select, scrolled } = changes;
if (
Expand All @@ -637,6 +611,7 @@ export class NotebookParagraphComponent extends ParagraphBase implements OnInit,
getElement(): HTMLElement {
return this.host && this.host.nativeElement;
}

ngAfterViewInit(): void {
this.scrollIfNeeded();
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 856a9db

Please sign in to comment.