Skip to content

Commit

Permalink
Renames 'spo hubsite disconnect' to 'spo site hubsite disconnect'. Cl…
Browse files Browse the repository at this point in the history
…oses #3878
  • Loading branch information
milanholemans committed Oct 28, 2022
1 parent a2c798d commit 2364466
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# spo hubsite disconnect
# spo site hubsite disconnect

Disconnects the specified site collection from its hub site

## Usage

```sh
m365 spo hubsite disconnect [options]
m365 spo site hubsite disconnect [options]
```

## Options
Expand All @@ -14,7 +14,7 @@ m365 spo hubsite disconnect [options]
: URL of the site collection to disconnect from its hub site

`--confirm`
: Don't prompt for confirming disconnecting from the hub site
: Don't prompt for confirmation

--8<-- "docs/cmd/_global.md"

Expand All @@ -25,16 +25,16 @@ m365 spo hubsite disconnect [options]

## Examples

Disconnect the site collection with URL _https://contoso.sharepoint.com/sites/sales_ from its hub site. Will prompt for confirmation before disconnecting from the hub site.
Disconnect a specific site collection from its hub site. Will prompt for confirmation before disconnecting from the hub site.

```sh
m365 spo hubsite disconnect --siteUrl https://contoso.sharepoint.com/sites/sales
m365 spo site hubsite disconnect --siteUrl https://contoso.sharepoint.com/sites/sales
```

Disconnect the site collection with URL _https://contoso.sharepoint.com/sites/sales_ from its hub site without prompting for confirmation
Disconnect a specific site collection from its hub site without prompting for confirmation.

```sh
m365 spo hubsite disconnect --siteUrl https://contoso.sharepoint.com/sites/sales --confirm
m365 spo site hubsite disconnect --siteUrl https://contoso.sharepoint.com/sites/sales --confirm
```

## More information
Expand Down
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ nav:
- homesite set: 'cmd/spo/homesite/homesite-set.md'
- hubsite:
- hubsite data get: 'cmd/spo/hubsite/hubsite-data-get.md'
- hubsite disconnect: 'cmd/spo/hubsite/hubsite-disconnect.md'
- hubsite get: 'cmd/spo/hubsite/hubsite-get.md'
- hubsite list: 'cmd/spo/hubsite/hubsite-list.md'
- hubsite register: 'cmd/spo/hubsite/hubsite-register.md'
Expand Down Expand Up @@ -521,6 +520,7 @@ nav:
- site ensure: 'cmd/spo/site/site-ensure.md'
- site get: 'cmd/spo/site/site-get.md'
- site groupify: 'cmd/spo/site/site-groupify.md'
- site hubsite disconnect: 'cmd/spo/site/site-hubsite-disconnect.md'
- site hubsite connect: 'cmd/spo/site/site-hubsite-connect.md'
- site list: 'cmd/spo/site/site-list.md'
- site recyclebinitem list: 'cmd/spo/site/site-recyclebinitem-list.md'
Expand Down
2 changes: 1 addition & 1 deletion src/m365/spo/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default {
HOMESITE_REMOVE: `${prefix} homesite remove`,
HOMESITE_SET: `${prefix} homesite set`,
HUBSITE_DATA_GET: `${prefix} hubsite data get`,
HUBSITE_DISCONNECT: `${prefix} hubsite disconnect`,
HUBSITE_GET: `${prefix} hubsite get`,
HUBSITE_LIST: `${prefix} hubsite list`,
HUBSITE_REGISTER: `${prefix} hubsite register`,
Expand Down Expand Up @@ -206,6 +205,7 @@ export default {
SITE_ENSURE: `${prefix} site ensure`,
SITE_GET: `${prefix} site get`,
SITE_GROUPIFY: `${prefix} site groupify`,
SITE_HUBSITE_DISCONNECT: `${prefix} site hubsite disconnect`,
SITE_HUBSITE_CONNECT: `${prefix} site hubsite connect`,
SITE_LIST: `${prefix} site list`,
SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { pid } from '../../../../utils/pid';
import { sinonUtil } from '../../../../utils/sinonUtil';
import { spo } from '../../../../utils/spo';
import commands from '../../commands';
const command: Command = require('./hubsite-disconnect');
const command: Command = require('./site-hubsite-disconnect');

describe(commands.HUBSITE_DISCONNECT, () => {
describe(commands.SITE_HUBSITE_DISCONNECT, () => {
let log: string[];
let logger: Logger;
let loggerLogSpy: sinon.SinonSpy;
Expand Down Expand Up @@ -74,7 +74,7 @@ describe(commands.HUBSITE_DISCONNECT, () => {
});

it('has correct name', () => {
assert.strictEqual(command.name.startsWith(commands.HUBSITE_DISCONNECT), true);
assert.strictEqual(command.name.startsWith(commands.SITE_HUBSITE_DISCONNECT), true);
});

it('has a description', () => {
Expand All @@ -83,7 +83,7 @@ describe(commands.HUBSITE_DISCONNECT, () => {

it('disconnects the site from its hub site without prompting for confirmation when confirm option specified', async () => {
sinon.stub(request, 'post').callsFake((opts) => {
if ((opts.url as string).indexOf(`/_api/site/JoinHubSite('00000000-0000-0000-0000-000000000000')`) > -1) {
if (opts.url === `https://contoso.sharepoint.com/sites/Sales/_api/site/JoinHubSite('00000000-0000-0000-0000-000000000000')`) {
return Promise.resolve({
"odata.null": true
});
Expand All @@ -98,7 +98,7 @@ describe(commands.HUBSITE_DISCONNECT, () => {

it('disconnects the site from its hub site without prompting for confirmation when confirm option specified (debug)', async () => {
sinon.stub(request, 'post').callsFake((opts) => {
if ((opts.url as string).indexOf(`/_api/site/JoinHubSite('00000000-0000-0000-0000-000000000000')`) > -1) {
if (opts.url === `https://contoso.sharepoint.com/sites/Sales/_api/site/JoinHubSite('00000000-0000-0000-0000-000000000000')`) {
return Promise.resolve({
"odata.null": true
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ interface Options extends GlobalOptions {
confirm?: boolean;
}

class SpoHubSiteDisconnectCommand extends SpoCommand {
class SpoSiteHubSiteDisconnectCommand extends SpoCommand {
public get name(): string {
return commands.HUBSITE_DISCONNECT;
return commands.SITE_HUBSITE_DISCONNECT;
}

public get description(): string {
Expand Down Expand Up @@ -68,7 +68,7 @@ class SpoHubSiteDisconnectCommand extends SpoCommand {
}

const requestOptions: any = {
url: `${args.options.url}/_api/site/JoinHubSite('00000000-0000-0000-0000-000000000000')`,
url: `${args.options.siteUrl}/_api/site/JoinHubSite('00000000-0000-0000-0000-000000000000')`,
headers: {
'X-RequestDigest': res.FormDigestValue,
accept: 'application/json;odata=nometadata'
Expand Down Expand Up @@ -101,4 +101,4 @@ class SpoHubSiteDisconnectCommand extends SpoCommand {
}
}

module.exports = new SpoHubSiteDisconnectCommand();
module.exports = new SpoSiteHubSiteDisconnectCommand();

0 comments on commit 2364466

Please sign in to comment.