Use ng-metadata as a Backport of Angular 2+ API (#2486)
* starting UtilService refactor * pre find-replace angular.module('quay') => angular.module('QuayModule') * successfully switched to ng-metadata for backported Angular2 API * working with parent component reference in child * fixing @Output to use EventEmitter * fixed @Output events for custom git trigger * more fixes * refactored QuayPages module for backwards-compatibility * reinitialized test.db * use minified libraries * replaced references for angular-ts-decorators * fixed ng-show
This commit is contained in:
parent
6352b3cac5
commit
7a352ddfbc
43 changed files with 642 additions and 551 deletions
|
@ -1,7 +1,7 @@
|
|||
<div class="manage-trigger-custom-git-element manage-trigger-control">
|
||||
<linear-workflow
|
||||
done-title="Create Trigger"
|
||||
on-workflow-complete="$ctrl.activateTrigger({'config': $ctrl.config})">
|
||||
(on-workflow-complete)="$ctrl.activateTrigger.emit({config: $ctrl.config})">
|
||||
<!-- Section: Repository -->
|
||||
<linear-workflow-section class="row"
|
||||
section-id="repo"
|
||||
|
|
|
@ -8,7 +8,7 @@ describe("ManageTriggerCustomGitComponent", () => {
|
|||
component = new ManageTriggerCustomGitComponent();
|
||||
});
|
||||
|
||||
describe("$onChanges", () => {
|
||||
describe("ngOnChanges", () => {
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
import { Input, Output, Component } from 'angular-ts-decorators';
|
||||
import { Input, Output, Component, EventEmitter, OnChanges, SimpleChanges } from 'ng-metadata/core';
|
||||
|
||||
|
||||
/**
|
||||
* A component that lets the user set up a build trigger for a custom Git repository.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'manageTriggerCustomGit',
|
||||
selector: 'manage-trigger-custom-git',
|
||||
templateUrl: '/static/js/directives/ui/manage-trigger-custom-git/manage-trigger-custom-git.component.html'
|
||||
})
|
||||
export class ManageTriggerCustomGitComponent implements ng.IComponentController {
|
||||
export class ManageTriggerCustomGitComponent implements OnChanges {
|
||||
|
||||
// FIXME: Use one-way data binding
|
||||
@Input('=') public trigger: {config: any};
|
||||
@Output() public activateTrigger: (trigger: {config: any}) => void;
|
||||
@Output() public activateTrigger: EventEmitter<{config: any, pull_robot?: any}> = new EventEmitter();
|
||||
private config: any = {};
|
||||
private currentState: any | null;
|
||||
|
||||
public $onChanges(changes: ng.IOnChangesObject): void {
|
||||
public ngOnChanges(changes: SimpleChanges): void {
|
||||
if (changes['trigger'] !== undefined) {
|
||||
this.config = Object.assign({}, changes['trigger'].currentValue.config);
|
||||
}
|
||||
|
|
Reference in a new issue