Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add when functionality for setting properties #4159

Merged
merged 1 commit into from Oct 3, 2023

Conversation

cdrage
Copy link
Contributor

@cdrage cdrage commented Sep 29, 2023

feat: add when functionality for setting properties

What does this PR do?

Adds the ability to use "when" statements for setting properties.

For example, if you want to only show certain settings for certain
operating systems by using "when": "isLinux".

Screenshot/screencast of this PR

Screen.Recording.2023-09-29.at.11.31.43.AM.mov

What issues does this PR fix or reference?

Closes #4141

How to test this PR?

Edit extensions/podman/package.json configuration for binary path to:

        "podman.binary.path": {
          "type": "string",
          "format": "file",
          "default": "",
          "description": "Custom path to Podman binary (Default is blank)",
          "when": "isLinux"
        },

When you check your preferences, it will now only show the binary path
if you are running Linux.

Signed-off-by: Charlie Drage charlie@charliedrage.com

@cdrage cdrage requested review from benoitf and a team as code owners September 29, 2023 15:30
@cdrage cdrage requested review from jeffmaury and lstocchi and removed request for a team September 29, 2023 15:30
@cdrage cdrage force-pushed the when-islinux-clauses-working-config branch 2 times, most recently from 8cfc68f to 2f170ee Compare September 29, 2023 18:57
### What does this PR do?

Adds the ability to use "when" statements for setting properties.

For example, if you want to only show certain settings for certain
operating systems by using `"when": "isLinux"`.

### Screenshot/screencast of this PR

### What issues does this PR fix or reference?

Closes containers#4141

### How to test this PR?

Edit `extensions/podman/package.json` configuration for binary path to:

```json
        "podman.binary.path": {
          "type": "string",
          "format": "file",
          "default": "",
          "description": "Custom path to Podman binary (Default is blank)",
          "when": "isLinux"
        },
```

When you check your preferences, it will now only show the binary path
if you are running Linux.

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
@cdrage cdrage force-pushed the when-islinux-clauses-working-config branch from 2f170ee to 10b7776 Compare September 29, 2023 18:58
@cdrage
Copy link
Contributor Author

cdrage commented Sep 29, 2023

Found some issues in the way that we wrote the context testing previously, I've updated the tests and this is ready for review 👍

Copy link
Contributor

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cdrage
Copy link
Contributor Author

cdrage commented Oct 3, 2023

It's a minor change, been reviewed by @lstocchi and lot's of tests written. Going to merge this in so #4093 is unblocked, I can rebase and ready for merge after review 👍

@cdrage cdrage merged commit 5e67b9b into containers:main Oct 3, 2023
8 checks passed
@podman-desktop-bot podman-desktop-bot added this to the 1.5.0 milestone Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Onboarding: "when" statements with isLinux / isWindows / etc not working for configuration items
3 participants