fix(my-joy-beta): add missing remove machine mutations
This commit is contained in:
parent
8f786ae278
commit
4678addd7a
@ -44,7 +44,7 @@ export const Item = ({
|
|||||||
onStart,
|
onStart,
|
||||||
onStop,
|
onStop,
|
||||||
onReboot,
|
onReboot,
|
||||||
onDelete
|
onRemove
|
||||||
}) => (
|
}) => (
|
||||||
<TableTr>
|
<TableTr>
|
||||||
<TableTd padding="0" paddingLeft={remcalc(12)} middle left>
|
<TableTd padding="0" paddingLeft={remcalc(12)} middle left>
|
||||||
@ -93,7 +93,7 @@ export const Item = ({
|
|||||||
</PopoverItem>
|
</PopoverItem>
|
||||||
<PopoverItem onClick={onReboot}>Reboot</PopoverItem>
|
<PopoverItem onClick={onReboot}>Reboot</PopoverItem>
|
||||||
<PopoverDivider />
|
<PopoverDivider />
|
||||||
<PopoverItem onClick={onDelete}>Delete</PopoverItem>
|
<PopoverItem onClick={onRemove}>Remove</PopoverItem>
|
||||||
</Popover>
|
</Popover>
|
||||||
</TableTd>
|
</TableTd>
|
||||||
</PopoverContainer>
|
</PopoverContainer>
|
||||||
|
@ -299,7 +299,7 @@ export default withTheme(
|
|||||||
type="button"
|
type="button"
|
||||||
loading={deleting}
|
loading={deleting}
|
||||||
disabled={instance.state === 'PROVISIONING'}
|
disabled={instance.state === 'PROVISIONING'}
|
||||||
onClick={() => onAction('delete')}
|
onClick={() => onAction('remove')}
|
||||||
secondary
|
secondary
|
||||||
bold
|
bold
|
||||||
right
|
right
|
||||||
@ -317,7 +317,7 @@ export default withTheme(
|
|||||||
type="button"
|
type="button"
|
||||||
loading={deleting}
|
loading={deleting}
|
||||||
disabled={instance.state === 'PROVISIONING'}
|
disabled={instance.state === 'PROVISIONING'}
|
||||||
onClick={() => onAction('delete')}
|
onClick={() => onAction('remove')}
|
||||||
secondary
|
secondary
|
||||||
bold
|
bold
|
||||||
right
|
right
|
||||||
|
@ -24,11 +24,7 @@ import ListInstances from '@graphql/list-instances.gql';
|
|||||||
import StopInstance from '@graphql/stop-instance.gql';
|
import StopInstance from '@graphql/stop-instance.gql';
|
||||||
import StartInstance from '@graphql/start-instance.gql';
|
import StartInstance from '@graphql/start-instance.gql';
|
||||||
import RebootInstance from '@graphql/reboot-instance.gql';
|
import RebootInstance from '@graphql/reboot-instance.gql';
|
||||||
import ResizeInstance from '@graphql/resize-instance.gql';
|
import RemoveInstance from '@graphql/remove-instance.gql';
|
||||||
import EnableInstanceFw from '@graphql/enable-instance-fw.gql';
|
|
||||||
import DisableInstanceFw from '@graphql/disable-instance-fw.gql';
|
|
||||||
import CreateSnapshot from '@graphql/create-snapshot.gql';
|
|
||||||
import StartSnapshot from '@graphql/start-from-snapshot.gql';
|
|
||||||
import ToolbarForm from '@components/instances/toolbar';
|
import ToolbarForm from '@components/instances/toolbar';
|
||||||
import Index from '@state/gen-index';
|
import Index from '@state/gen-index';
|
||||||
import parseError from '@state/parse-error';
|
import parseError from '@state/parse-error';
|
||||||
@ -88,7 +84,7 @@ export const List = ({
|
|||||||
const handleStart = selected => handleAction({ name: 'start', selected });
|
const handleStart = selected => handleAction({ name: 'start', selected });
|
||||||
const handleStop = selected => handleAction({ name: 'stop', selected });
|
const handleStop = selected => handleAction({ name: 'stop', selected });
|
||||||
const handleReboot = selected => handleAction({ name: 'reboot', selected });
|
const handleReboot = selected => handleAction({ name: 'reboot', selected });
|
||||||
const handleDelete = selected => handleAction({ name: 'delete', selected });
|
const handleRemove = selected => handleAction({ name: 'remove', selected });
|
||||||
|
|
||||||
const _table = !loading ? (
|
const _table = !loading ? (
|
||||||
<ReduxForm form={TABLE_FORM_NAME}>
|
<ReduxForm form={TABLE_FORM_NAME}>
|
||||||
@ -109,7 +105,7 @@ export const List = ({
|
|||||||
onStart={() => handleStart([{ id }])}
|
onStart={() => handleStart([{ id }])}
|
||||||
onStop={() => handleStop([{ id }])}
|
onStop={() => handleStop([{ id }])}
|
||||||
onReboot={() => handleReboot([{ id }])}
|
onReboot={() => handleReboot([{ id }])}
|
||||||
onDelete={() => handleDelete([{ id }])}
|
onRemove={() => handleRemove([{ id }])}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</InstanceList>
|
</InstanceList>
|
||||||
@ -126,7 +122,7 @@ export const List = ({
|
|||||||
onStart={() => handleStart(selected)}
|
onStart={() => handleStart(selected)}
|
||||||
onStop={() => handleStop(selected)}
|
onStop={() => handleStop(selected)}
|
||||||
onReboot={() => handleReboot(selected)}
|
onReboot={() => handleReboot(selected)}
|
||||||
onDelete={() => handleDelete(selected)}
|
onRemove={() => handleRemove(selected)}
|
||||||
/>
|
/>
|
||||||
) : null;
|
) : null;
|
||||||
|
|
||||||
@ -158,11 +154,7 @@ export default compose(
|
|||||||
graphql(StopInstance, { name: 'stop' }),
|
graphql(StopInstance, { name: 'stop' }),
|
||||||
graphql(StartInstance, { name: 'start' }),
|
graphql(StartInstance, { name: 'start' }),
|
||||||
graphql(RebootInstance, { name: 'reboot' }),
|
graphql(RebootInstance, { name: 'reboot' }),
|
||||||
graphql(ResizeInstance, { name: 'resize' }),
|
graphql(RemoveInstance, { name: 'remove' }),
|
||||||
graphql(EnableInstanceFw, { name: 'enableFw' }),
|
|
||||||
graphql(DisableInstanceFw, { name: 'disableFw' }),
|
|
||||||
graphql(CreateSnapshot, { name: 'createSnapshot' }),
|
|
||||||
graphql(StartSnapshot, { name: 'startSnapshot' }),
|
|
||||||
graphql(ListInstances, {
|
graphql(ListInstances, {
|
||||||
options: () => ({
|
options: () => ({
|
||||||
pollInterval: 1000
|
pollInterval: 1000
|
||||||
@ -231,7 +223,7 @@ export default compose(
|
|||||||
starting: get(values, 'instance-list-starting', false),
|
starting: get(values, 'instance-list-starting', false),
|
||||||
stopping: get(values, 'instance-list-stoping', false),
|
stopping: get(values, 'instance-list-stoping', false),
|
||||||
rebooting: get(values, 'instance-list-rebooting', false),
|
rebooting: get(values, 'instance-list-rebooting', false),
|
||||||
deleting: get(values, 'instance-list-deleteing', false)
|
deleting: get(values, 'instance-list-removeing', false)
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -18,7 +18,7 @@ import GetInstance from '@graphql/get-instance.gql';
|
|||||||
import StartInstance from '@graphql/start-instance.gql';
|
import StartInstance from '@graphql/start-instance.gql';
|
||||||
import StopInstance from '@graphql/stop-instance.gql';
|
import StopInstance from '@graphql/stop-instance.gql';
|
||||||
import RebootInstance from '@graphql/reboot-instance.gql';
|
import RebootInstance from '@graphql/reboot-instance.gql';
|
||||||
import DeleteInstance from '@graphql/delete-instance.gql';
|
import RemoveInstance from '@graphql/remove-instance.gql';
|
||||||
import SummaryScreen from '@components/instances/summary';
|
import SummaryScreen from '@components/instances/summary';
|
||||||
import parseError from '@state/parse-error';
|
import parseError from '@state/parse-error';
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ export default compose(
|
|||||||
graphql(StopInstance, { name: 'stop' }),
|
graphql(StopInstance, { name: 'stop' }),
|
||||||
graphql(StartInstance, { name: 'start' }),
|
graphql(StartInstance, { name: 'start' }),
|
||||||
graphql(RebootInstance, { name: 'reboot' }),
|
graphql(RebootInstance, { name: 'reboot' }),
|
||||||
graphql(DeleteInstance, { name: 'reboot' }),
|
graphql(RemoveInstance, { name: 'remove' }),
|
||||||
graphql(GetInstance, {
|
graphql(GetInstance, {
|
||||||
options: ({ match }) => ({
|
options: ({ match }) => ({
|
||||||
pollInterval: 1000,
|
pollInterval: 1000,
|
||||||
@ -108,7 +108,7 @@ export default compose(
|
|||||||
starting: state.values[`${id}-summary-starting`],
|
starting: state.values[`${id}-summary-starting`],
|
||||||
stopping: state.values[`${id}-summary-stoping`],
|
stopping: state.values[`${id}-summary-stoping`],
|
||||||
rebooting: state.values[`${id}-summary-rebooting`],
|
rebooting: state.values[`${id}-summary-rebooting`],
|
||||||
deleting: state.values[`${id}-summary-deleteing`],
|
deleting: state.values[`${id}-summary-removeing`],
|
||||||
mutationError: state.values[`${id}-summary-mutation-error`]
|
mutationError: state.values[`${id}-summary-mutation-error`]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -135,7 +135,7 @@ export default compose(
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!err && action === 'delete') {
|
if (!err && action === 'remove') {
|
||||||
const { history } = ownProps;
|
const { history } = ownProps;
|
||||||
return history.push(`/instances/`);
|
return history.push(`/instances/`);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
mutation startInstance($id: ID!) {
|
mutation removeInstance($id: ID!) {
|
||||||
deleteMachine(id: $id) {
|
deleteMachine(id: $id) {
|
||||||
id
|
id
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user