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 helpful ShellFeaturesManager extensions #16191

Merged
merged 3 commits into from
May 30, 2024

Conversation

MikeAlhayek
Copy link
Member

@MikeAlhayek MikeAlhayek commented May 29, 2024

Adding the following two extensions

Task EnableFeaturesAsync(params string[] featureIds);

Task<bool> IsFeatureEnabledAsync(string featureId);

@agriffard agriffard changed the title Add helpful ShellFeaturesManager extenssins Add helpful ShellFeaturesManager extensions May 29, 2024
@gvkries
Copy link
Contributor

gvkries commented May 29, 2024

Great, thanks a lot 🤗 This is such a needed thing...

return featuresToEnable;
}

public static async Task EnableFeaturesAsync(this IShellFeaturesManager shellFeaturesManager, params string[] featureIds)
{
ArgumentNullException.ThrowIfNull(featureIds);
Copy link
Member

Choose a reason for hiding this comment

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

You need to check if the array is empty too

Copy link
Member Author

@MikeAlhayek MikeAlhayek May 29, 2024

Choose a reason for hiding this comment

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

It would do nothing when array is empty as this is handled by the underlying method.

Copy link
Member

Choose a reason for hiding this comment

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

IMHO know need to call GetAvailableFeaturesAsync() if the featureIds is empty

Copy link
Member Author

Choose a reason for hiding this comment

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

@hishamco done. anything else?

Copy link
Member

Choose a reason for hiding this comment

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

The second time you can request a review rather than mention

@MikeAlhayek MikeAlhayek merged commit 265e586 into main May 30, 2024
6 checks passed
@MikeAlhayek MikeAlhayek deleted the ma/featuremanager-extensions branch May 30, 2024 02:04
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.

None yet

3 participants