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

Add editEnvironmentVariableName command #796

Merged
merged 26 commits into from
Dec 17, 2024
Merged

Conversation

MicroFish91
Copy link
Contributor

No description provided.

@MicroFish91 MicroFish91 requested a review from a team as a code owner December 3, 2024 18:43
{
"command": "containerApps.editEnvironmentVariableName",
"when": "view =~ /(azureResourceGroups|azureFocusView)/ && viewItem =~ /environmentVariableItem/i",
"group": "1@1"
Copy link
Member

Choose a reason for hiding this comment

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

I think technically this should be 1@2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think 1@1 is correct, but it's confusing because the one above it is environmentVariablesItem with an s and they look super similar 😆

import { type EnvironmentVariablesBaseContext } from "../EnvironmentVariablesContext";
import { type EnvironmentVariableType } from "../addEnvironmentVariable/EnvironmentVariableTypeListStep";

export interface EnvironmentVariableEditBaseContext extends EnvironmentVariablesBaseContext, Pick<ISecretContext, 'secretName'> {
Copy link
Member

Choose a reason for hiding this comment

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

Seems to be very similar to the EnvironmentVariableAddBaseContext. Any reason to make a new one?

Copy link
Contributor Author

@MicroFish91 MicroFish91 Dec 17, 2024

Choose a reason for hiding this comment

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

Yeah you're right, they are super similar. To simplify a bit, I extended from the add context and just made the environmentVariable required because it's needed up front for the edits. I think I still prefer to keep a separate context just because I'm trying to keep the two command paths decoupled for the most part (mostly because I don't want to complicate the draft step with both add and edit logic).

import { RevisionDraftUpdateBaseStep } from "../../revisionDraft/RevisionDraftUpdateBaseStep";
import { type EnvironmentVariableEditContext } from "./EnvironmentVariableEditContext";

export class EnvironmentVariableEditDraftStep<T extends EnvironmentVariableEditContext> extends RevisionDraftUpdateBaseStep<T> {
Copy link
Member

Choose a reason for hiding this comment

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

It's not a huge deal, but I feel like this step could almost entirely be consolidated with the "AddStep".

But if you like having them separate just for organization/logical purposes, makes sense to me too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, although there are a lot of overlaps, there's enough differences that I'd prefer to leave them uncoupled to reduce complexity if we ever need to come back and alter the behavior.

Base automatically changed from mwf/reduced-apricot to main December 17, 2024 16:24
@MicroFish91 MicroFish91 merged commit 8619562 into main Dec 17, 2024
2 checks passed
@MicroFish91 MicroFish91 deleted the mwf/ministerial-magenta branch December 17, 2024 17:57
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.

2 participants