Skip to content

Commit ae48f71

Browse files
authored
[ZEPPELIN-6151] Remove AngularJS -> Angular Code Migration Suggestion 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]>
1 parent d21e362 commit ae48f71

File tree

8 files changed

+11
-460
lines changed

8 files changed

+11
-460
lines changed

zeppelin-web-angular/package-lock.json

Lines changed: 0 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zeppelin-web-angular/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"mathjax": "2.7.5",
4242
"monaco-editor": "0.15.1",
4343
"ng-zorro-antd": "^8.4.0",
44-
"ng1-template-updater": "0.0.4",
4544
"parse5": "^5.1.1",
4645
"rxjs": "~6.5.3",
4746
"systemjs": "^5.0.0",

zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/paragraph.component.ts

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import {
4646
} from '@zeppelin/services';
4747
import { SpellResult } from '@zeppelin/spell/spell-result';
4848

49-
import { NgTemplateAdapterService } from '@zeppelin/services/ng-template-adapter.service';
5049
import { NzResizeEvent } from 'ng-zorro-antd/resizable';
5150
import { NotebookParagraphResultComponent } from '../../share/result/result.component';
5251
import { NotebookParagraphCodeEditorComponent } from './code-editor/code-editor.component';
@@ -301,31 +300,8 @@ export class NotebookParagraphComponent extends ParagraphBase implements OnInit,
301300
this.runParagraphUsingSpell(text, magic, propagated);
302301
this.runParagraphAfter(text);
303302
} else {
304-
const check = this.ngTemplateAdapterService.preCheck(text);
305-
if (!check) {
306-
this.runParagraphUsingBackendInterpreter(text);
307-
this.runParagraphAfter(text);
308-
} else {
309-
this.waitConfirmFromEdit = true;
310-
this.nzModalService
311-
.confirm({
312-
nzTitle: 'Do you want to migrate the Angular.js template?',
313-
nzContent:
314-
'The Angular.js template has been deprecated, please upgrade to Angular template.' +
315-
' (<a href="https://angular.io/guide/ajs-quick-reference" target="_blank">more info</a>)',
316-
nzOnOk: () => {
317-
this.switchMode('command');
318-
this.ngTemplateAdapterService
319-
.openMigrationDialog(check)
320-
.pipe(takeUntil(this.destroy$))
321-
.subscribe(newText => {
322-
this.cloneParagraph('below', newText);
323-
});
324-
}
325-
})
326-
.afterClose.pipe(takeUntil(this.destroy$))
327-
.subscribe(() => (this.waitConfirmFromEdit = false));
328-
}
303+
this.runParagraphUsingBackendInterpreter(text);
304+
this.runParagraphAfter(text);
329305
}
330306
}
331307
}
@@ -452,20 +428,17 @@ export class NotebookParagraphComponent extends ParagraphBase implements OnInit,
452428
private nzModalService: NzModalService,
453429
private noteVarShareService: NoteVarShareService,
454430
private shortcutService: ShortcutService,
455-
private host: ElementRef,
456-
private ngTemplateAdapterService: NgTemplateAdapterService
431+
private host: ElementRef
457432
) {
458433
super(messageService, noteStatusService, ngZService, cdr);
459434
}
460435

461436
ngOnInit() {
462437
const shortcutService = this.shortcutService.forkByElement(this.host.nativeElement);
463-
const observables: Array<
464-
Observable<{
465-
action: ParagraphActions;
466-
event: KeyboardEvent;
467-
}>
468-
> = [];
438+
const observables: Array<Observable<{
439+
action: ParagraphActions;
440+
event: KeyboardEvent;
441+
}>> = [];
469442
Object.entries(ShortcutsMap).forEach(([action, keys]) => {
470443
const keysArr: string[] = Array.isArray(keys) ? keys : [keys];
471444
keysArr.forEach(key => {
@@ -617,6 +590,7 @@ export class NotebookParagraphComponent extends ParagraphBase implements OnInit,
617590
});
618591
}
619592
}
593+
620594
ngOnChanges(changes: SimpleChanges): void {
621595
const { index, select, scrolled } = changes;
622596
if (
@@ -637,6 +611,7 @@ export class NotebookParagraphComponent extends ParagraphBase implements OnInit,
637611
getElement(): HTMLElement {
638612
return this.host && this.host.nativeElement;
639613
}
614+
640615
ngAfterViewInit(): void {
641616
this.scrollIfNeeded();
642617
}

zeppelin-web-angular/src/app/services/ng-template-adapter.service.ts

Lines changed: 0 additions & 65 deletions
This file was deleted.

zeppelin-web-angular/src/app/share/ng1-migration/ng1-migration.component.html

Lines changed: 0 additions & 65 deletions
This file was deleted.

zeppelin-web-angular/src/app/share/ng1-migration/ng1-migration.component.less

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)