Skip to content

Commit

Permalink
Updated based in review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ktskumar committed Oct 19, 2024
1 parent 42b125f commit 2d51726
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/docs/cmd/pp/copilot/copilot-get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Get information about the specified copilot
m365 pp copilot get [options]
```

## alias
## Alias

```sh
m365 pp chatbot get [options]
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/cmd/pp/copilot/copilot-list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Lists Microsoft Power Platform copilots in the specified Power Platform environm
m365 pp copilot list [options]
```

## alias
## Alias

```sh
m365 pp chatbot list [options]
Expand Down Expand Up @@ -83,9 +83,9 @@ m365 pp copilot list --environmentName "Default-d87a7535-dd31-4437-bfe1-95340acd
<TabItem value="Text">

```text
name botid publishedOn createdOn botModifiedOn
------------ ------------------------------------ -------------------- -------------------- --------------------
CLI Copilot 23f5f586-97fd-43d5-95eb-451c9797a53d 2022-11-19T19:19:53Z 2022-11-19T10:42:22Z 2022-11-19T20:19:57Z
name botid publishedOn createdOn botModifiedOn
----------- ------------------------------------ -------------------- -------------------- --------------------
CLI Copilot 23f5f586-97fd-43d5-95eb-451c9797a53d 2022-11-19T19:19:53Z 2022-11-19T10:42:22Z 2022-11-19T20:19:57Z
```

</TabItem>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/cmd/pp/copilot/copilot-remove.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Removes the specified copilot
m365 pp copilot remove [options]
```

## alias
## Alias

```sh
m365 pp chatbot remove [options]
Expand Down
3 changes: 3 additions & 0 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const config: Config = {
'client-redirects',
{
createRedirects(routePath) {
if (routePath.includes('/copilot')) {
return [routePath.replace('/copilot', '/chatbot')];
}
if (routePath.includes('/entra')) {
return [routePath.replace('/entra', '/aad')];
}
Expand Down
10 changes: 10 additions & 0 deletions src/m365/pp/commands/copilot/copilot-get.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,16 @@ describe(commands.COPILOT_GET, () => {
assert.notStrictEqual(command.description, null);
});

it('defines alias', () => {
const alias = command.alias();
assert.notStrictEqual(typeof alias, 'undefined');
});

it('defines correct alias', () => {
const alias = command.alias();
assert.deepStrictEqual(alias, [commands.COPILOT_GET]);
});

it('defines correct properties for the default output', () => {
assert.deepStrictEqual(command.defaultProperties(), ['name', 'botid', 'publishedon', 'createdon', 'modifiedon']);
});
Expand Down
1 change: 1 addition & 0 deletions src/m365/pp/commands/copilot/copilot-get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class PpCopilotGetCommand extends PowerPlatformCommand {
}

public async commandAction(logger: Logger, args: CommandArgs): Promise<void> {
await this.showDeprecationWarning(logger, "pp chatbot get", "pp copilot get");
if (this.verbose) {
await logger.logToStderr(`Retrieving copilot '${args.options.id || args.options.name}'...`);
}
Expand Down
8 changes: 7 additions & 1 deletion src/m365/pp/commands/copilot/copilot-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ describe(commands.COPILOT_LIST, () => {

it('defines alias', () => {
const alias = command.alias();
assert.notStrictEqual(typeof alias, 'undefined');
assert.notStrictEqual(typeof alias, 'copilot');
});

it('defines correct alias', () => {
const alias = command.alias();
assert.deepStrictEqual(alias, [commands.COPILOT_LIST]);
});

});
1 change: 1 addition & 0 deletions src/m365/pp/commands/copilot/copilot-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class PpCopilotListCommand extends PowerPlatformCommand {
}

public async commandAction(logger: Logger, args: CommandArgs): Promise<void> {
await this.showDeprecationWarning(logger, "pp chatbot list", "pp copilot list");
if (this.verbose) {
await logger.logToStderr(`Retrieving list of copilots for environment '${args.options.environmentName}'.`);
}
Expand Down
10 changes: 10 additions & 0 deletions src/m365/pp/commands/copilot/copilot-remove.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ describe(commands.COPILOT_REMOVE, () => {
assert.notStrictEqual(command.description, null);
});

it('defines alias', () => {
const alias = command.alias();
assert.notStrictEqual(typeof alias, 'undefined');
});

it('defines correct alias', () => {
const alias = command.alias();
assert.deepStrictEqual(alias, [commands.COPILOT_REMOVE]);
});

it('fails validation if id is not a valid guid.', async () => {
const actual = await command.validate({
options: {
Expand Down
1 change: 1 addition & 0 deletions src/m365/pp/commands/copilot/copilot-remove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class PpCopilotRemoveCommand extends PowerPlatformCommand {
}

public async commandAction(logger: Logger, args: CommandArgs): Promise<void> {
await this.showDeprecationWarning(logger, "pp chatbot remove", "pp copilot remove");
if (this.verbose) {
await logger.logToStderr(`Removing copilot '${args.options.id || args.options.name}'...`);
}
Expand Down

0 comments on commit 2d51726

Please sign in to comment.