chore(kompose): remove from settings EE-4741 (#8376)

This commit is contained in:
Ali
2023-01-26 16:03:32 +13:00
committed by GitHub
parent 674a98e432
commit c1c4dd190d
25 changed files with 237 additions and 238 deletions

View File

@@ -1,6 +1,6 @@
import { PortainerEndpointTypes } from '@/portainer/models/endpoint/models';
import { EditorType } from '@/react/edge/edge-stacks/types';
import { getValidEditorTypes } from '@/react/edge/edge-stacks/utils';
export class EditEdgeStackFormController {
/* @ngInject */
constructor($scope) {
@@ -57,6 +57,15 @@ export class EditEdgeStackFormController {
checkEndpointTypes(groups) {
const edgeGroups = groups.map((id) => this.edgeGroups.find((e) => e.Id === id));
this.state.endpointTypes = edgeGroups.flatMap((group) => group.EndpointTypes);
this.selectValidDeploymentType();
}
selectValidDeploymentType() {
const validTypes = getValidEditorTypes(this.state.endpointTypes);
if (!validTypes.includes(this.model.DeploymentType)) {
this.onChangeDeploymentType(validTypes[0]);
}
}
removeLineBreaks(value) {
@@ -81,9 +90,10 @@ export class EditEdgeStackFormController {
}
onChangeDeploymentType(deploymentType) {
this.model.DeploymentType = deploymentType;
this.model.StackFileContent = this.fileContents[deploymentType];
return this.$scope.$evalAsync(() => {
this.model.DeploymentType = deploymentType;
this.model.StackFileContent = this.fileContents[deploymentType];
});
}
validateEndpointsForDeployment() {
@@ -92,5 +102,6 @@ export class EditEdgeStackFormController {
$onInit() {
this.checkEndpointTypes(this.model.EdgeGroups);
this.fileContents[this.model.DeploymentType] = this.model.StackFileContent;
}
}