Skip to content

Commit

Permalink
Renames 'spo homesite' commands to 'spo tenant homesite'. Closes #6502
Browse files Browse the repository at this point in the history
  • Loading branch information
milanholemans committed Dec 22, 2024
1 parent a15ecbf commit f397221
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 53 deletions.
6 changes: 3 additions & 3 deletions docs/docs/about/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3259,7 +3259,7 @@ sidebar_position: 4
**SharePoint Online:**

- [spo apppage add](../cmd/spo/apppage/apppage-add.mdx) - creates a single-part app page [#874](https://github.com/pnp/cli-microsoft365/issues/874)
- [spo homesite remove](../cmd/spo/homesite/homesite-remove.mdx) - removes the current Home Site [#1002](https://github.com/pnp/cli-microsoft365/issues/1002)
- [spo homesite remove](../cmd/spo/tenant/tenant-homesite-remove.mdx) - removes the current Home Site [#1002](https://github.com/pnp/cli-microsoft365/issues/1002)
- [spo orgassetslibrary list](../cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx) - lists all libraries that are assigned as org asset library [#1041](https://github.com/pnp/cli-microsoft365/issues/1041)
- [spo get](../cmd/spo/spo-get.mdx) - gets the context URL for the root SharePoint site collection and SharePoint tenant admin site [#1071](https://github.com/pnp/cli-microsoft365/issues/1071)
- [spo set](../cmd/spo/spo-set.mdx) - sets the URL of the root SharePoint site collection for use in SPO commands [#1070](https://github.com/pnp/cli-microsoft365/issues/1070)
Expand Down Expand Up @@ -3305,8 +3305,8 @@ sidebar_position: 4

**SharePoint Online:**

- [spo homesite get](../cmd/spo/homesite/homesite-get.mdx) - gets information about the Home Site [#1000](https://github.com/pnp/cli-microsoft365/issues/1000)
- [spo homesite set](../cmd/spo/homesite/homesite-set.mdx) - sets the specified site as the Home Site [#1001](https://github.com/pnp/cli-microsoft365/issues/1001)
- [spo homesite get](../cmd/spo/tenant/tenant-homesite-get.mdx) - gets information about the Home Site [#1000](https://github.com/pnp/cli-microsoft365/issues/1000)
- [spo homesite set](../cmd/spo/tenant/tenant-homesite-set.mdx) - sets the specified site as the Home Site [#1001](https://github.com/pnp/cli-microsoft365/issues/1001)
- [spo listitem isrecord](../cmd/spo/listitem/listitem-isrecord.mdx) - checks if the specified list item is a record [#771](https://github.com/pnp/cli-microsoft365/issues/771)

**Microsoft Graph:**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spo homesite get
# spo tenant homesite get

Gets information about the Home Site

## Usage

```sh
m365 spo tenant homesite get [options]
```

## Alias

```sh
m365 spo homesite get [options]
```
Expand All @@ -21,7 +27,7 @@ m365 spo homesite get [options]
Get information about the Home Site.

```sh
m365 spo homesite get
m365 spo tenant homesite get
```

## Response
Expand Down Expand Up @@ -62,7 +68,7 @@ m365 spo homesite get
<TabItem value="Markdown">

```md
# spo homesite get
# spo tenant homesite get

Date: 2/20/2023

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spo homesite remove
# spo tenant homesite remove

Removes the current Home Site

## Usage

```sh
m365 spo tenant homesite remove [options]
```

## Alias

```sh
m365 spo homesite remove [options]
```
Expand All @@ -34,7 +40,7 @@ To use this command you must be either **SharePoint Administrator** or **Global
Removes the current Home Site without confirmation.

```sh
m365 spo homesite remove --force
m365 spo tenant homesite remove --force
```

## Response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spo homesite set
# spo tenant homesite set

Sets the specified site as the Home Site

## Usage

```sh
m365 spo tenant homesite set [options]
```

## Alias

```sh
m365 spo homesite set [options]
```
Expand Down Expand Up @@ -37,19 +43,19 @@ To use this command you must be a Global or SharePoint administrator.
Set the specified site as the Home Site.

```sh
m365 spo homesite set --siteUrl https://contoso.sharepoint.com/sites/comms
m365 spo tenant homesite set --siteUrl https://contoso.sharepoint.com/sites/comms
```

Sets the Home site to the provided site collection url and sets the Viva Connections landing experience to the SharePoint home site

```sh
m365 spo homesite set --siteUrl https://contoso.sharepoint.com/sites/comms --vivaConnectionsDefaultStart true
m365 spo tenant homesite set --siteUrl https://contoso.sharepoint.com/sites/comms --vivaConnectionsDefaultStart true
```

Sets the Home site to the provided site collection url and sets the Viva Connections landing experience to the default experience

```sh
m365 spo homesite set --siteUrl https://contoso.sharepoint.com/sites/comms --vivaConnectionsDefaultStart false
m365 spo tenant homesite set --siteUrl https://contoso.sharepoint.com/sites/comms --vivaConnectionsDefaultStart false
```

## Response
Expand Down
3 changes: 3 additions & 0 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const config: Config = {
if (routePath.includes('/entra')) {
return [routePath.replace('/entra', '/aad')];
}
if (routePath.includes('/spo/tenant/tenant-homesite-')) {
return [routePath.replace('/spo/tenant/tenant-homesite-', '/spo/homesite/homesite-')];
}

return [];
}
Expand Down
34 changes: 15 additions & 19 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2732,25 +2732,6 @@ const sidebars: SidebarsConfig = {
}
]
},
{
homesite: [
{
type: 'doc',
label: 'homesite get',
id: 'cmd/spo/homesite/homesite-get'
},
{
type: 'doc',
label: 'homesite remove',
id: 'cmd/spo/homesite/homesite-remove'
},
{
type: 'doc',
label: 'homesite set',
id: 'cmd/spo/homesite/homesite-set'
}
]
},
{
hubsite: [
{
Expand Down Expand Up @@ -3766,11 +3747,26 @@ const sidebars: SidebarsConfig = {
label: 'tenant commandset set',
id: 'cmd/spo/tenant/tenant-commandset-set'
},
{
type: 'doc',
label: 'tenant homesite get',
id: 'cmd/spo/tenant/tenant-homesite-get'
},
{
type: 'doc',
label: 'tenant homesite list',
id: 'cmd/spo/tenant/tenant-homesite-list'
},
{
type: 'doc',
label: 'tenant homesite remove',
id: 'cmd/spo/tenant/tenant-homesite-remove'
},
{
type: 'doc',
label: 'tenant homesite set',
id: 'cmd/spo/tenant/tenant-homesite-set'
},
{
type: 'doc',
label: 'tenant recyclebinitem list',
Expand Down
6 changes: 3 additions & 3 deletions src/m365/spo/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ export default {
GROUP_MEMBER_REMOVE: `${prefix} group member remove`,
HIDEDEFAULTTHEMES_GET: `${prefix} hidedefaultthemes get`,
HIDEDEFAULTTHEMES_SET: `${prefix} hidedefaultthemes set`,
HOMESITE_GET: `${prefix} homesite get`,
HOMESITE_REMOVE: `${prefix} homesite remove`,
HOMESITE_SET: `${prefix} homesite set`,
HUBSITE_CONNECT: `${prefix} hubsite connect`,
HUBSITE_DATA_GET: `${prefix} hubsite data get`,
HUBSITE_DISCONNECT: `${prefix} hubsite disconnect`,
Expand Down Expand Up @@ -318,7 +315,10 @@ export default {
TENANT_COMMANDSET_LIST: `${prefix} tenant commandset list`,
TENANT_COMMANDSET_REMOVE: `${prefix} tenant commandset remove`,
TENANT_COMMANDSET_SET: `${prefix} tenant commandset set`,
TENANT_HOMESITE_GET: `${prefix} tenant homesite get`,
TENANT_HOMESITE_LIST: `${prefix} tenant homesite list`,
TENANT_HOMESITE_REMOVE: `${prefix} tenant homesite remove`,
TENANT_HOMESITE_SET: `${prefix} tenant homesite set`,
TENANT_RECYCLEBINITEM_LIST: `${prefix} tenant recyclebinitem list`,
TENANT_RECYCLEBINITEM_REMOVE: `${prefix} tenant recyclebinitem remove`,
TENANT_RECYCLEBINITEM_RESTORE: `${prefix} tenant recyclebinitem restore`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { pid } from '../../../../utils/pid.js';
import { session } from '../../../../utils/session.js';
import { sinonUtil } from '../../../../utils/sinonUtil.js';
import commands from '../../commands.js';
import command from './homesite-get.js';
import command from './tenant-homesite-get.js';

describe(commands.HOMESITE_GET, () => {
describe(commands.TENANT_HOMESITE_GET, () => {
let log: any[];
let logger: Logger;
let loggerLogSpy: sinon.SinonSpy;
Expand Down Expand Up @@ -54,13 +54,17 @@ describe(commands.HOMESITE_GET, () => {
});

it('has correct name', () => {
assert.strictEqual(command.name, commands.HOMESITE_GET);
assert.strictEqual(command.name, commands.TENANT_HOMESITE_GET);
});

it('has a description', () => {
assert.notStrictEqual(command.description, null);
});

it('defines correct alias', () => {
assert.deepStrictEqual(command.alias(), ['spo homesite get']);
});

it('gets information about the Home Site', async () => {
sinon.stub(request, 'get').callsFake(async (opts) => {
if (opts.url === 'https://contoso.sharepoint.com/_api/SP.SPHSite/Details') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@ import { spo } from '../../../../utils/spo.js';
import SpoCommand from '../../../base/SpoCommand.js';
import commands from '../../commands.js';

class SpoHomeSiteGetCommand extends SpoCommand {
class SpoTenantHomeSiteGetCommand extends SpoCommand {
public get name(): string {
return commands.HOMESITE_GET;
return commands.TENANT_HOMESITE_GET;
}

public get description(): string {
return 'Gets information about the Home Site';
}

public alias(): string[] {
return ['spo homesite get'];
}

public async commandAction(logger: Logger): Promise<void> {
await this.showDeprecationWarning(logger, this.alias()[0], this.getCommandName());
try {
const spoUrl = await spo.getSpoUrl(logger, this.debug);
const requestOptions: CliRequestOptions = {
Expand All @@ -35,4 +40,4 @@ class SpoHomeSiteGetCommand extends SpoCommand {
}
}

export default new SpoHomeSiteGetCommand();
export default new SpoTenantHomeSiteGetCommand();
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { session } from '../../../../utils/session.js';
import { sinonUtil } from '../../../../utils/sinonUtil.js';
import { spo } from '../../../../utils/spo.js';
import commands from '../../commands.js';
import command from './homesite-remove.js';
import command from './tenant-homesite-remove.js';

describe(commands.HOMESITE_REMOVE, () => {
describe(commands.TENANT_HOMESITE_REMOVE, () => {
let log: any[];
let logger: Logger;
let promptIssued: boolean = false;
Expand Down Expand Up @@ -69,13 +69,17 @@ describe(commands.HOMESITE_REMOVE, () => {
});

it('has correct name', () => {
assert.strictEqual(command.name, commands.HOMESITE_REMOVE);
assert.strictEqual(command.name, commands.TENANT_HOMESITE_REMOVE);
});

it('has a description', () => {
assert.notStrictEqual(command.description, null);
});

it('defines correct alias', () => {
assert.deepStrictEqual(command.alias(), ['spo homesite remove']);
});

it('prompts before removing the Home Site when force option is not passed', async () => {
await command.action(logger, { options: { debug: true } } as any);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ interface Options extends GlobalOptions {
force?: boolean;
}

class SpoHomeSiteRemoveCommand extends SpoCommand {
class SpoTenantHomeSiteRemoveCommand extends SpoCommand {
public get name(): string {
return commands.HOMESITE_REMOVE;
return commands.TENANT_HOMESITE_REMOVE;
}

public get description(): string {
return 'Removes the current Home Site';
}

public alias(): string[] {
return ['spo homesite remove'];
}

constructor() {
super();

Expand All @@ -34,7 +38,7 @@ class SpoHomeSiteRemoveCommand extends SpoCommand {
#initTelemetry(): void {
this.telemetry.push((args: CommandArgs) => {
Object.assign(this.telemetryProperties, {
force: args.options.force || false
force: !!args.options.force
});
});
}
Expand All @@ -48,6 +52,7 @@ class SpoHomeSiteRemoveCommand extends SpoCommand {
}

public async commandAction(logger: Logger, args: CommandArgs): Promise<void> {
await this.showDeprecationWarning(logger, this.alias()[0], this.getCommandName());

const removeHomeSite: () => Promise<void> = async (): Promise<void> => {
try {
Expand Down Expand Up @@ -92,4 +97,4 @@ class SpoHomeSiteRemoveCommand extends SpoCommand {
}
}

export default new SpoHomeSiteRemoveCommand();
export default new SpoTenantHomeSiteRemoveCommand();
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { pid } from '../../../../utils/pid.js';
import { session } from '../../../../utils/session.js';
import { sinonUtil } from '../../../../utils/sinonUtil.js';
import commands from '../../commands.js';
import command from './homesite-set.js';
import command from './tenant-homesite-set.js';

describe(commands.HOMESITE_SET, () => {
describe(commands.TENANT_HOMESITE_SET, () => {
let log: any[];
let logger: Logger;
let commandInfo: CommandInfo;
Expand Down Expand Up @@ -79,13 +79,17 @@ describe(commands.HOMESITE_SET, () => {
});

it('has correct name', () => {
assert.strictEqual(command.name, commands.HOMESITE_SET);
assert.strictEqual(command.name, commands.TENANT_HOMESITE_SET);
});

it('has a description', () => {
assert.notStrictEqual(command.description, null);
});

it('defines correct alias', () => {
assert.deepStrictEqual(command.alias(), ['spo homesite set']);
});

it('sets the specified site as the Home Site', async () => {
const requestBody = { sphSiteUrl: siteUrl };
const postRequestStub = sinon.stub(request, 'post').callsFake(async (opts) => {
Expand Down
Loading

0 comments on commit f397221

Please sign in to comment.