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

Renames 'spo tenant homesite list' command. #6598

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/about/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ sidebar_position: 4

**SharePoint:**

- [spo tenant homesite list](../cmd/spo/tenant/tenant-homesite-list.mdx) - lists all home sites [#6492](https://github.com/pnp/cli-microsoft365/issues/6492)
- [spo tenant homesite list](../cmd/spo/homesite/homesite-list.mdx) - lists all home sites [#6492](https://github.com/pnp/cli-microsoft365/issues/6492)

**SharePoint Embedded:**

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 tenant homesite list
# spo homesite list

Lists all home sites

## Usage

```sh
m365 spo homesite list [options]
```

## Alias

```sh
m365 spo tenant homesite list [options]
```
Expand All @@ -21,7 +27,7 @@ m365 spo tenant homesite list [options]
List all home sites

```sh
m365 spo tenant homesite list
m365 spo homesite list
```

## Response
Expand Down Expand Up @@ -72,7 +78,7 @@ m365 spo tenant homesite list
<TabItem value="Markdown">

```md
# spo tenant homesite list
# spo homesite list

Date: 11/18/2024

Expand Down
10 changes: 5 additions & 5 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2833,6 +2833,11 @@ const sidebars: SidebarsConfig = {
label: 'homesite get',
id: 'cmd/spo/homesite/homesite-get'
},
{
type: 'doc',
label: 'homesite list',
id: 'cmd/spo/homesite/homesite-list'
},
{
type: 'doc',
label: 'homesite remove',
Expand Down Expand Up @@ -3880,11 +3885,6 @@ const sidebars: SidebarsConfig = {
label: 'tenant commandset set',
id: 'cmd/spo/tenant/tenant-commandset-set'
},
{
type: 'doc',
label: 'tenant homesite list',
id: 'cmd/spo/tenant/tenant-homesite-list'
},
{
type: 'doc',
label: 'tenant recyclebinitem list',
Expand Down
1 change: 1 addition & 0 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ describe('Lazy loading commands', () => {
'spo folder rename',
'spo site list',
'spo page template remove',
'spo tenant homesite list',
'spo sp grant add',
'spo sp grant list',
'spo sp grant revoke',
Expand Down
1 change: 1 addition & 0 deletions src/m365/spo/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default {
HIDEDEFAULTTHEMES_GET: `${prefix} hidedefaultthemes get`,
HIDEDEFAULTTHEMES_SET: `${prefix} hidedefaultthemes set`,
HOMESITE_GET: `${prefix} homesite get`,
HOMESITE_LIST: `${prefix} homesite list`,
HOMESITE_REMOVE: `${prefix} homesite remove`,
HOMESITE_SET: `${prefix} homesite set`,
HUBSITE_CONNECT: `${prefix} hubsite connect`,
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 './tenant-homesite-list.js';
import command from './homesite-list.js';

describe(commands.TENANT_HOMESITE_LIST, () => {
describe(commands.HOMESITE_LIST, () => {
let log: string[];
let logger: Logger;
let loggerLogSpy: sinon.SinonSpy;
Expand Down Expand Up @@ -91,13 +91,17 @@ describe(commands.TENANT_HOMESITE_LIST, () => {
});

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

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

it('has an alias', () => {
assert.notStrictEqual(command.alias(), commands.TENANT_HOMESITE_LIST);
});

it('defines correct properties for the default output', () => {
assert.deepStrictEqual(command.defaultProperties(), ['Url', 'Title']);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,26 @@ import SpoCommand from '../../../base/SpoCommand.js';
import commands from '../../commands.js';
import { CliRequestOptions } from "../../../../request.js";

class SpoTenantHomeSiteListCommand extends SpoCommand {
class SpoHomeSiteListCommand extends SpoCommand {
public get name(): string {
return commands.TENANT_HOMESITE_LIST;
return commands.HOMESITE_LIST;
}

public get description(): string {
return 'Lists all home sites';
}

public alias(): string[] | undefined {
return [commands.TENANT_HOMESITE_LIST];
}

public defaultProperties(): string[] | undefined {
return ['Url', 'Title'];
}

public async commandAction(logger: Logger): Promise<void> {
await this.showDeprecationWarning(logger, commands.TENANT_HOMESITE_LIST, commands.HOMESITE_LIST);

try {
const spoAdminUrl: string = await spo.getSpoAdminUrl(logger, this.verbose);
const requestOptions: CliRequestOptions = {
Expand All @@ -40,4 +46,4 @@ class SpoTenantHomeSiteListCommand extends SpoCommand {
}
}

export default new SpoTenantHomeSiteListCommand();
export default new SpoHomeSiteListCommand();