diff --git a/app/edge/components/associated-endpoints-datatable/associatedEndpointsDatatableController.js b/app/edge/components/associated-endpoints-datatable/associatedEndpointsDatatableController.js index 9b7b2a836..5b551af12 100644 --- a/app/edge/components/associated-endpoints-datatable/associatedEndpointsDatatableController.js +++ b/app/edge/components/associated-endpoints-datatable/associatedEndpointsDatatableController.js @@ -1,6 +1,7 @@ import angular from 'angular'; export class AssociatedEndpointsDatatableController { + /* @ngInject */ constructor($scope, $controller, DatatableService, PaginationService) { this.extendGenericController($controller, $scope); this.DatatableService = DatatableService; diff --git a/app/edge/components/edge-job-form/edgeJobFormController.js b/app/edge/components/edge-job-form/edgeJobFormController.js index 52eabb5f6..5fcf9687f 100644 --- a/app/edge/components/edge-job-form/edgeJobFormController.js +++ b/app/edge/components/edge-job-form/edgeJobFormController.js @@ -33,8 +33,6 @@ export class EdgeJobFormController { // see https://regexr.com/573i2 this.cronRegex = /(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ){4,6}((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*))/; - this.onChangeModel(this.model); - this.action = this.action.bind(this); this.editorUpdate = this.editorUpdate.bind(this); this.associateEndpoint = this.associateEndpoint.bind(this); @@ -85,6 +83,10 @@ export class EdgeJobFormController { dissociateEndpoint(endpoint) { this.model.Endpoints = _.filter(this.model.Endpoints, (id) => id !== endpoint.Id); } + + $onInit() { + this.onChangeModel(this.model); + } } function cronToDatetime(cron, defaultTime = moment()) { diff --git a/app/edge/components/edge-stack-endpoints-datatable/edgeStackEndpointsDatatableController.js b/app/edge/components/edge-stack-endpoints-datatable/edgeStackEndpointsDatatableController.js index 59113c793..8a0c12765 100644 --- a/app/edge/components/edge-stack-endpoints-datatable/edgeStackEndpointsDatatableController.js +++ b/app/edge/components/edge-stack-endpoints-datatable/edgeStackEndpointsDatatableController.js @@ -1,6 +1,7 @@ import angular from 'angular'; export class EdgeStackEndpointsDatatableController { + /* @ngInject */ constructor($async, $scope, $controller, DatatableService, PaginationService, Notifications) { this.extendGenericController($controller, $scope); this.DatatableService = DatatableService; diff --git a/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js b/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js index a35a7ed4e..f9ffc1843 100644 --- a/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js +++ b/app/edge/components/edit-edge-stack-form/editEdgeStackFormController.js @@ -1,4 +1,5 @@ export class EditEdgeStackFormController { + /* @ngInject */ constructor() { this.editorUpdate = this.editorUpdate.bind(this); } diff --git a/app/edge/components/groups-datatable/groupsDatatableController.js b/app/edge/components/groups-datatable/groupsDatatableController.js index f3371692c..3f7cdf774 100644 --- a/app/edge/components/groups-datatable/groupsDatatableController.js +++ b/app/edge/components/groups-datatable/groupsDatatableController.js @@ -1,6 +1,7 @@ import angular from 'angular'; export class EdgeGroupsDatatableController { + /* @ngInject */ constructor($scope, $controller) { const allowSelection = this.allowSelection; angular.extend(this, $controller('GenericDatatableController', { $scope: $scope })); diff --git a/app/edge/views/edge-jobs/createEdgeJobView/createEdgeJobViewController.js b/app/edge/views/edge-jobs/createEdgeJobView/createEdgeJobViewController.js index 2380c1dff..171a3e572 100644 --- a/app/edge/views/edge-jobs/createEdgeJobView/createEdgeJobViewController.js +++ b/app/edge/views/edge-jobs/createEdgeJobView/createEdgeJobViewController.js @@ -1,9 +1,19 @@ export class CreateEdgeJobViewController { + /* @ngInject */ constructor($async, $q, $state, EdgeJobService, GroupService, Notifications, TagService) { this.state = { actionInProgress: false, }; + this.model = { + Name: '', + Recurring: false, + CronExpression: '', + Endpoints: [], + FileContent: '', + File: null, + }; + this.$async = $async; this.$q = $q; this.$state = $state; @@ -43,15 +53,6 @@ export class CreateEdgeJobViewController { } async $onInit() { - this.model = { - Name: '', - Recurring: false, - CronExpression: '', - Endpoints: [], - FileContent: '', - File: null, - }; - try { const [groups, tags] = await Promise.all([this.GroupService.groups(), this.TagService.tags()]); this.groups = groups; diff --git a/app/edge/views/edge-jobs/edgeJob/edgeJobController.js b/app/edge/views/edge-jobs/edgeJob/edgeJobController.js index ab5c84dab..a87b0b16e 100644 --- a/app/edge/views/edge-jobs/edgeJob/edgeJobController.js +++ b/app/edge/views/edge-jobs/edgeJob/edgeJobController.js @@ -1,6 +1,7 @@ import _ from 'lodash-es'; export class EdgeJobController { + /* @ngInject */ constructor($async, $q, $state, EdgeJobService, EndpointService, FileSaver, GroupService, HostBrowserService, Notifications, TagService) { this.state = { actionInProgress: false, diff --git a/app/edge/views/edge-jobs/edgeJobsView/edgeJobsViewController.js b/app/edge/views/edge-jobs/edgeJobsView/edgeJobsViewController.js index 3e6fb611e..d047e4e77 100644 --- a/app/edge/views/edge-jobs/edgeJobsView/edgeJobsViewController.js +++ b/app/edge/views/edge-jobs/edgeJobsView/edgeJobsViewController.js @@ -1,6 +1,7 @@ import _ from 'lodash-es'; export class EdgeJobsViewController { + /* @ngInject */ constructor($async, $state, EdgeJobService, ModalService, Notifications) { this.$async = $async; this.$state = $state; diff --git a/app/edge/views/edge-stacks/createEdgeStackView/createEdgeStackViewController.js b/app/edge/views/edge-stacks/createEdgeStackView/createEdgeStackViewController.js index e9f11dcf9..d988b20cf 100644 --- a/app/edge/views/edge-stacks/createEdgeStackView/createEdgeStackViewController.js +++ b/app/edge/views/edge-stacks/createEdgeStackView/createEdgeStackViewController.js @@ -1,6 +1,7 @@ import _ from 'lodash-es'; export class CreateEdgeStackViewController { + /* @ngInject */ constructor($state, EdgeStackService, EdgeGroupService, EdgeTemplateService, Notifications, FormHelper, $async) { Object.assign(this, { $state, EdgeStackService, EdgeGroupService, EdgeTemplateService, Notifications, FormHelper, $async }); diff --git a/app/edge/views/edge-stacks/edgeStacksView/edgeStacksViewController.js b/app/edge/views/edge-stacks/edgeStacksView/edgeStacksViewController.js index 0c68f2af1..a7b8396dd 100644 --- a/app/edge/views/edge-stacks/edgeStacksView/edgeStacksViewController.js +++ b/app/edge/views/edge-stacks/edgeStacksView/edgeStacksViewController.js @@ -1,6 +1,7 @@ import _ from 'lodash-es'; export class EdgeStacksViewController { + /* @ngInject */ constructor($state, Notifications, EdgeStackService, $scope, $async) { this.$state = $state; this.Notifications = Notifications; diff --git a/app/edge/views/edge-stacks/editEdgeStackView/editEdgeStackViewController.js b/app/edge/views/edge-stacks/editEdgeStackView/editEdgeStackViewController.js index bc53df983..6f80e88db 100644 --- a/app/edge/views/edge-stacks/editEdgeStackView/editEdgeStackViewController.js +++ b/app/edge/views/edge-stacks/editEdgeStackView/editEdgeStackViewController.js @@ -1,6 +1,7 @@ import _ from 'lodash-es'; export class EditEdgeStackViewController { + /* @ngInject */ constructor($async, $state, EdgeGroupService, EdgeStackService, EndpointService, Notifications) { this.$async = $async; this.$state = $state;