|
@@ -11,6 +11,7 @@ import InputRow from '../../../components/values-form/InputRow';
|
|
|
import ConfirmOverlay from '../../../components/ConfirmOverlay';
|
|
import ConfirmOverlay from '../../../components/ConfirmOverlay';
|
|
|
|
|
|
|
|
type PropsType = {
|
|
type PropsType = {
|
|
|
|
|
+ setRefreshClusters: (x: boolean) => void,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
type StateType = {
|
|
type StateType = {
|
|
@@ -25,7 +26,7 @@ export default class UpdateClusterModal extends Component<PropsType, StateType>
|
|
|
status: null as string | null,
|
|
status: null as string | null,
|
|
|
showDeleteOverlay: false,
|
|
showDeleteOverlay: false,
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
handleDelete = () => {
|
|
handleDelete = () => {
|
|
|
let { currentProject, currentCluster } = this.context;
|
|
let { currentProject, currentCluster } = this.context;
|
|
|
this.setState({ status: 'loading' });
|
|
this.setState({ status: 'loading' });
|
|
@@ -35,10 +36,11 @@ export default class UpdateClusterModal extends Component<PropsType, StateType>
|
|
|
}, (err: any, res: any) => {
|
|
}, (err: any, res: any) => {
|
|
|
if (err) {
|
|
if (err) {
|
|
|
this.setState({ status: 'error' });
|
|
this.setState({ status: 'error' });
|
|
|
- // console.log(err)
|
|
|
|
|
|
|
+ console.log(err)
|
|
|
} else {
|
|
} else {
|
|
|
- alert('nice');
|
|
|
|
|
|
|
+ this.props.setRefreshClusters(true);
|
|
|
this.setState({ status: 'successful', showDeleteOverlay: false });
|
|
this.setState({ status: 'successful', showDeleteOverlay: false });
|
|
|
|
|
+ this.context.setCurrentModal(null, null);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
@@ -58,10 +60,9 @@ export default class UpdateClusterModal extends Component<PropsType, StateType>
|
|
|
</Subtitle>
|
|
</Subtitle>
|
|
|
|
|
|
|
|
<InputWrapper>
|
|
<InputWrapper>
|
|
|
- <ProjectIcon>
|
|
|
|
|
- <ProjectImage src={gradient} />
|
|
|
|
|
- <Letter>{this.state.clusterName ? this.state.clusterName[0].toUpperCase() : '-'}</Letter>
|
|
|
|
|
- </ProjectIcon>
|
|
|
|
|
|
|
+ <DashboardIcon>
|
|
|
|
|
+ <i className="material-icons">device_hub</i>
|
|
|
|
|
+ </DashboardIcon>
|
|
|
<InputRow
|
|
<InputRow
|
|
|
disabled={true}
|
|
disabled={true}
|
|
|
type='string'
|
|
type='string'
|
|
@@ -81,7 +82,7 @@ export default class UpdateClusterModal extends Component<PropsType, StateType>
|
|
|
|
|
|
|
|
<ConfirmOverlay
|
|
<ConfirmOverlay
|
|
|
show={this.state.showDeleteOverlay}
|
|
show={this.state.showDeleteOverlay}
|
|
|
- message={`Are you sure you want to delete ${this.state.clusterName}?`}
|
|
|
|
|
|
|
+ message={`Are you sure you want to delete this cluster?`}
|
|
|
onYes={this.handleDelete}
|
|
onYes={this.handleDelete}
|
|
|
onNo={() => this.setState({ showDeleteOverlay: false })}
|
|
onNo={() => this.setState({ showDeleteOverlay: false })}
|
|
|
/>
|
|
/>
|
|
@@ -92,25 +93,7 @@ export default class UpdateClusterModal extends Component<PropsType, StateType>
|
|
|
|
|
|
|
|
UpdateClusterModal.contextType = Context;
|
|
UpdateClusterModal.contextType = Context;
|
|
|
|
|
|
|
|
-const Letter = styled.div`
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- background: #00000028;
|
|
|
|
|
- top: 0;
|
|
|
|
|
- left: 0;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- color: white;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
-`;
|
|
|
|
|
-
|
|
|
|
|
-const ProjectImage = styled.img`
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
-`;
|
|
|
|
|
-
|
|
|
|
|
-const ProjectIcon = styled.div`
|
|
|
|
|
|
|
+const DashboardIcon = styled.div`
|
|
|
width: 25px;
|
|
width: 25px;
|
|
|
min-width: 25px;
|
|
min-width: 25px;
|
|
|
height: 25px;
|
|
height: 25px;
|
|
@@ -120,6 +103,16 @@ const ProjectIcon = styled.div`
|
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
|
margin-top: 14px;
|
|
margin-top: 14px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ background: #676C7C;
|
|
|
|
|
+ border: 2px solid #8e94aa;
|
|
|
|
|
+ color: white;
|
|
|
|
|
+
|
|
|
|
|
+ > i {
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ }
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
const InputWrapper = styled.div`
|
|
const InputWrapper = styled.div`
|