import { environment } from 'environment';
import * as jsyaml from 'js-yaml';
import { RestService } from 'RestService';
import { environment } from 'environment';
import * as jsyaml from 'js-yaml';
import { RestService } from 'RestService';
public deploymentMethodsSubmit: Map<string, boolean>;
/** Contains all deployment methods selected */
public deploymentMethodsSubmit: Map<string, boolean>;
/** Contains all deployment methods selected */
// Transform Map to json object
const jsonDMObject: {} = {};
this.deploymentMethodsSubmit.forEach((value: boolean, key: string): void => {
// Transform Map to json object
const jsonDMObject: {} = {};
this.deploymentMethodsSubmit.forEach((value: boolean, key: string): void => {
if (files && files.length === 1) {
this.sharedService.getFileString(files, 'json').then((fileContent: string): void => {
const getNetsJson: string = jsyaml.load(fileContent, { json: true });
if (files && files.length === 1) {
this.sharedService.getFileString(files, 'json').then((fileContent: string): void => {
const getNetsJson: string = jsyaml.load(fileContent, { json: true });
this.k8sclusterForm.get('nets').setValue(JSON.stringify(getNetsJson));
}).catch((err: string): void => {
if (err === 'typeError') {
this.k8sclusterForm.get('nets').setValue(JSON.stringify(getNetsJson));
}).catch((err: string): void => {
if (err === 'typeError') {
if (files && files.length === 1) {
this.sharedService.getFileString(files, 'yaml').then((fileContent: string): void => {
const getCredentialsJson: string = jsyaml.load(fileContent, { json: true });
if (files && files.length === 1) {
this.sharedService.getFileString(files, 'yaml').then((fileContent: string): void => {
const getCredentialsJson: string = jsyaml.load(fileContent, { json: true });
this.k8sclusterForm.get('credentials').setValue(JSON.stringify(getCredentialsJson));
}).catch((err: string): void => {
if (err === 'typeError') {
this.k8sclusterForm.get('credentials').setValue(JSON.stringify(getCredentialsJson));
}).catch((err: string): void => {
if (err === 'typeError') {
this.fileInputCredentialsLabel.nativeElement.innerText = files[0].name;
this.fileInputCredentials.nativeElement.value = null;
}
this.fileInputCredentialsLabel.nativeElement.innerText = files[0].name;
this.fileInputCredentials.nativeElement.value = null;
}