From efd421bff897d6909a294a8b6b476d189ee9b20c Mon Sep 17 00:00:00 2001 From: baron_l Date: Thu, 14 Mar 2019 19:47:43 +0100 Subject: [PATCH] fix(webpack): fix ng-include not loading templates with webpack --- .../services/create/createServiceController.js | 5 +++++ .../views/services/edit/serviceController.js | 18 ++++++++++++++++++ webpack/webpack.common.js | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/docker/views/services/create/createServiceController.js b/app/docker/views/services/create/createServiceController.js index ada12f668..0460d2c3b 100644 --- a/app/docker/views/services/create/createServiceController.js +++ b/app/docker/views/services/create/createServiceController.js @@ -1,6 +1,11 @@ import _ from 'lodash-es'; import { AccessControlFormData } from '../../../../portainer/components/accessControlForm/porAccessControlFormModel'; +require('./includes/update-restart.html') +require('./includes/secret.html') +require('./includes/config.html') +require('./includes/resources-placement.html') + angular.module('portainer.docker') .controller('CreateServiceController', ['$q', '$scope', '$state', '$timeout', 'Service', 'ServiceHelper', 'ConfigService', 'ConfigHelper', 'SecretHelper', 'SecretService', 'VolumeService', 'NetworkService', 'ImageHelper', 'LabelHelper', 'Authentication', 'ResourceControlService', 'Notifications', 'FormValidator', 'PluginService', 'RegistryService', 'HttpRequestHelper', 'NodeService', 'SettingsService', 'WebhookService','EndpointProvider', function ($q, $scope, $state, $timeout, Service, ServiceHelper, ConfigService, ConfigHelper, SecretHelper, SecretService, VolumeService, NetworkService, ImageHelper, LabelHelper, Authentication, ResourceControlService, Notifications, FormValidator, PluginService, RegistryService, HttpRequestHelper, NodeService, SettingsService, WebhookService,EndpointProvider) { diff --git a/app/docker/views/services/edit/serviceController.js b/app/docker/views/services/edit/serviceController.js index a42a0011a..530acb591 100644 --- a/app/docker/views/services/edit/serviceController.js +++ b/app/docker/views/services/edit/serviceController.js @@ -1,3 +1,21 @@ +require('./includes/configs.html') +require('./includes/constraints.html') +require('./includes/container-specs.html') +require('./includes/containerlabels.html') +require('./includes/environmentvariables.html') +require('./includes/hosts.html') +require('./includes/logging.html') +require('./includes/mounts.html') +require('./includes/networks.html') +require('./includes/placementPreferences.html') +require('./includes/ports.html') +require('./includes/resources.html') +require('./includes/restart.html') +require('./includes/secrets.html') +require('./includes/servicelabels.html') +require('./includes/tasks.html') +require('./includes/updateconfig.html') + angular.module('portainer.docker') .controller('ServiceController', ['$q', '$scope', '$transition$', '$state', '$location', '$timeout', '$anchorScroll', 'ServiceService', 'ConfigService', 'ConfigHelper', 'SecretService', 'ImageService', 'SecretHelper', 'Service', 'ServiceHelper', 'LabelHelper', 'TaskService', 'NodeService', 'ContainerService', 'TaskHelper', 'Notifications', 'ModalService', 'PluginService', 'Authentication', 'SettingsService', 'VolumeService', 'ImageHelper', 'WebhookService', 'EndpointProvider', 'clipboard','WebhookHelper', function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll, ServiceService, ConfigService, ConfigHelper, SecretService, ImageService, SecretHelper, Service, ServiceHelper, LabelHelper, TaskService, NodeService, ContainerService, TaskHelper, Notifications, ModalService, PluginService, Authentication, SettingsService, VolumeService, ImageHelper, WebhookService, EndpointProvider, clipboard, WebhookHelper) { diff --git a/webpack/webpack.common.js b/webpack/webpack.common.js index 9769acf42..6097782d8 100644 --- a/webpack/webpack.common.js +++ b/webpack/webpack.common.js @@ -39,7 +39,7 @@ module.exports = { { loader: 'ngtemplate-loader', options: { - relativeTo: projectRoot + relativeTo: projectRoot + '/' } }, { loader: 'html-loader' }