8000 Add preset option to configuration · Issue #63 · crc-org/tray-electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Add preset option to configuration #63

Closed
Tracked by #2970
gbraad opened this issue Jan 6, 2022 · 3 comments · Fixed by crc-org/crc-react-components#22 or #111
Closed
Tracked by #2970

Add preset option to configuration #63

gbraad opened this issue Jan 6, 2022 · 3 comments · Fixed by crc-org/crc-react-components#22 or #111
Assignees

Comments

@gbraad
Copy link
Collaborator
gbraad commented Jan 6, 2022
  • Should this be a ToggleGroup ?
  • How about displaying the preset specific information
    • description
    • CPU, memory and disk size changes
@gbraad
Copy link
Collaborator Author
gbraad commented Jan 6, 2022

image

import React from 'react';
import { ToggleGroup, ToggleGroupItem } from '@patternfly/react-core';

class PresetSelectionExample extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      isPresetSelected: "podman"  // from config
    };
    this.handlePresetSelectClick = (isSelected, event) => {
      const id = event.currentTarget.id;
      this.setState({ isPresetSelected: id });
    };
  }

  render() {
    const { isPresetSelected } = this.state;

    return (
      <ToggleGroup aria-label="Preset">
        <ToggleGroupItem text="Podman" buttonId="podman"
            isSelected={isPresetSelected === "podman"}
            onChange={this.handlePresetSelectClick} />
        <ToggleGroupItem text="OpenShift" buttonId="openshift"
            isSelected={isPresetSelected === "openshift"}
            onChange={this.handlePresetSelectClick} />
      </ToggleGroup>
    );
  }
}

@gbraad gbraad self-assigned this Jan 11, 2022
@gbraad gbraad moved this to Todo in Project planning Jan 18, 2022
@gbraad
Copy link
Collaborator Author
gbraad commented Jan 21, 2022

Added a new component PresetSelection that allows toggling based on the preset name:

image

Styled to reflect a similar usages as in the Wizard where the selected preset is clearly shown in a blue color.

@gbraad
Copy link
Collaborator Author
gbraad commented Jan 21, 2022

image

Repository owner moved this from In Progress to Done in Project planning Jan 24, 2022
@gbraad gbraad reopened this Jan 24, 2022
gbraad added a commit to gbraad-redhat/crc-tray-electron that referenced this issue Jan 24, 2022
gbraad added a commit to gbraad-redhat/crc-tray-electron that referenced this issue Jan 24, 2022
@gbraad gbraad closed this as completed in 7b5bb87 Jan 24, 2022
@gbraad gbraad linked a pull request Jan 24, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant
0