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 user-friendly option values for spo site commsite enable. #5366

Closed
wants to merge 1 commit into from

Conversation

Saurabh7019
Copy link
Contributor

Closes #5199

@Saurabh7019 Saurabh7019 marked this pull request as ready for review August 1, 2023 08:01
@Adam-it
Copy link
Contributor

Adam-it commented Aug 1, 2023

thanks for another awesome PR. We will review this ASAP

@martinlingstuyl martinlingstuyl self-assigned this Sep 4, 2023
Copy link
Contributor

@martinlingstuyl martinlingstuyl left a comment

Choose a reason for hiding this comment

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

Hi @Saurabh7019, great work! 💪 let's get some things fixed before we merge this.

src/m365/spo/commands/site/site-commsite-enable.spec.ts Outdated Show resolved Hide resolved
src/m365/spo/commands/site/site-commsite-enable.ts Outdated Show resolved Hide resolved
src/m365/spo/commands/site/site-commsite-enable.ts Outdated Show resolved Hide resolved
src/m365/spo/commands/site/site-commsite-enable.ts Outdated Show resolved Hide resolved
src/m365/spo/commands/site/site-commsite-enable.ts Outdated Show resolved Hide resolved
src/m365/spo/commands/site/site-commsite-enable.ts Outdated Show resolved Hide resolved
@martinlingstuyl martinlingstuyl marked this pull request as draft September 4, 2023 21:15
@Saurabh7019
Copy link
Contributor Author

Hi Martin, I have removed the DesignPackage Enum to make the code easier; could you please review it and let me know your thoughts?

@Saurabh7019 Saurabh7019 marked this pull request as ready for review September 7, 2023 20:02
Copy link
Contributor

@martinlingstuyl martinlingstuyl left a comment

Choose a reason for hiding this comment

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

Hi @Saurabh7019, looks good to me. I've got some minor comments that I'll fix myself during the merge. 👏

@@ -64,10 +79,14 @@ class SpoSiteCommSiteEnableCommand extends SpoCommand {
}

public async commandAction(logger: Logger, args: CommandArgs): Promise<void> {
const designPackageId: string = args.options.designPackageId || '96c933ac-3698-44c7-9f4a-5fd17d71af9e';
const designPackageId = args.options.designPackageId || {
Copy link
Contributor

Choose a reason for hiding this comment

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

I find this code slightly hard to read. Shall we move this to a this.getDesignPackageId(args.options) function? That function can return the options.designPackageId immediately and otherwise run a switch statement on the options.designPackage.


if (this.verbose) {
logger.logToStderr(`Enabling communication site at ${args.options.url}...`);
logger.logToStderr(`Enabling communication site with design package '${args.options.designPackage || 'Topic'}' at '${args.options.url}'...`);
Copy link
Contributor

Choose a reason for hiding this comment

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

This would not log options.designPackageId in the current state. Let's just log the local designPackageId variable.


throw 'Invalid request';
});
await command.action(logger, { options: { designPackage: 'Topic', url: 'https://contoso.sharepoint.com' } } as any);
Copy link
Contributor

Choose a reason for hiding this comment

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

We're missing an assert statement here.

@martinlingstuyl
Copy link
Contributor

Merged manually, thank you for the awesome work! 👏🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Add user-friendly option values for spo site commsite enable
3 participants