Skip to content

Instantly share code, notes, and snippets.

@sergiopena
Created January 3, 2020 13:51
Show Gist options
  • Save sergiopena/1bb6499cc45789a24dc35c1ca391dac4 to your computer and use it in GitHub Desktop.
Save sergiopena/1bb6499cc45789a24dc35c1ca391dac4 to your computer and use it in GitHub Desktop.
import React, { useState } from 'react';
import { module } from 'angular';
import { react2angular } from 'react2angular';
import { StageConfigField } from '@spinnaker/core';
import { IStage } from '@spinnaker/core';
export interface ICloudFromationChangeSetInfoProps {
stage: IStage[];
}
export const CloudFormationChangeSetInfo = ( props: ICloudFormationChangeSetInfoProps ) => {
const [changeSetName, setChangeSetName] = useState('default');
const { stage } = props;
const onChange = (value: string) => {
setChangeSetName(value);
stage.changeSetName = value;
console.log(value);
console.log(props);
};
return (
<div>
<hr />
<h4>ChangeSet Configuration</h4>
<StageConfigField label="ChangeSet Name">
<input
className="form-control input-sm"
type="text"
value={ changeSetName }
onChange={ e => onChange(e.target.value)}
/>
</StageConfigField>
</div>
)
};
export const CLOUD_FORMATION_CHANGE_SET_INFO = 'spinnaker.amazon.cloudformation.changetset.info.component';
module(CLOUD_FORMATION_CHANGE_SET_INFO, []).component(
'cloudFormationChangeSetInfo',
react2angular(CloudFormationChangeSetInfo, ['stage']),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment