diff --git a/README.md b/README.md index d099c18..e330c92 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ crm-sfdx-plugin [![Version](https://img.shields.io/npm/v/@venkat.polisetti/crm-sfdx-plugin.svg)](https://npmjs.org/package/@venkat.polisetti/crm-sfdx-plugin) [![Downloads/week](https://img.shields.io/npm/dw/@venkat.polisetti/crm-sfdx-plugin.svg)](https://npmjs.org/package/@venkat.polisetti/crm-sfdx-plugin) -[![License](https://img.shields.io/npm/l/@venkat.polisetti/crm-sfdx-plugin.svg)](https://github.com/ecrm-plugins/@venkat.polisetti/crm-sfdx-plugin/blob/master/package.json) +[![License](https://img.shields.io/npm/l/@venkat.polisetti/crm-sfdx-plugin.svg)](https://github.com/ecrm-plugins/crm-sfdx-plugin/blob/master/package.json) ```sh-session @@ -61,7 +61,7 @@ EXAMPLE --o='myuser@testorg.com' ``` -_See code: [src/commands/crm/permset/assign.ts](https://github.com/venkatpolisetti/crm-sfdx-plugin/blob/v2.0.4/src/commands/crm/permset/assign.ts)_ +_See code: [src/commands/crm/permset/assign.ts](https://github.com/venkatpolisetti/crm-sfdx-plugin/blob/v2.0.5/src/commands/crm/permset/assign.ts)_ ## `sfdx crm:profile:fieldpermissions:set` @@ -121,7 +121,7 @@ EXAMPLE --readaccess=true --editaccess=false ``` -_See code: [src/commands/crm/profile/fieldpermissions/set.ts](https://github.com/venkatpolisetti/crm-sfdx-plugin/blob/v2.0.4/src/commands/crm/profile/fieldpermissions/set.ts)_ +_See code: [src/commands/crm/profile/fieldpermissions/set.ts](https://github.com/venkatpolisetti/crm-sfdx-plugin/blob/v2.0.5/src/commands/crm/profile/fieldpermissions/set.ts)_ ## `sfdx crm:profile:objectpermissions:set` @@ -180,7 +180,7 @@ EXAMPLE --modifyallaccess=false ``` -_See code: [src/commands/crm/profile/objectpermissions/set.ts](https://github.com/venkatpolisetti/crm-sfdx-plugin/blob/v2.0.4/src/commands/crm/profile/objectpermissions/set.ts)_ +_See code: [src/commands/crm/profile/objectpermissions/set.ts](https://github.com/venkatpolisetti/crm-sfdx-plugin/blob/v2.0.5/src/commands/crm/profile/objectpermissions/set.ts)_ ## `sfdx crm:profile:recordtypevisibilities:set` @@ -223,5 +223,5 @@ EXAMPLE "visible":true},{"name":"CustomObj__c.CustomRecType2", "visible":false}]' ``` -_See code: [src/commands/crm/profile/recordtypevisibilities/set.ts](https://github.com/venkatpolisetti/crm-sfdx-plugin/blob/v2.0.4/src/commands/crm/profile/recordtypevisibilities/set.ts)_ - \ No newline at end of file +_See code: [src/commands/crm/profile/recordtypevisibilities/set.ts](https://github.com/venkatpolisetti/crm-sfdx-plugin/blob/v2.0.5/src/commands/crm/profile/recordtypevisibilities/set.ts)_ + diff --git a/package.json b/package.json index c1b8696..7ceeebb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@venkat.polisetti/crm-sfdx-plugin", "description": "Sfdx CLI plugin for automating mundane tasks such as setting FLS etc.,", - "version": "2.0.4", + "version": "2.0.5", "author": "Venkat Polisetti", "bugs": "https://github.com/venkatpolisetti/crm-sfdx-plugin/issues", "dependencies": { diff --git a/src/commands/crm/permset/assign.ts b/src/commands/crm/permset/assign.ts index 57d8cea..b5ac62e 100644 --- a/src/commands/crm/permset/assign.ts +++ b/src/commands/crm/permset/assign.ts @@ -1,9 +1,6 @@ import { core, flags, SfdxCommand } from '@salesforce/command'; import * as _ from 'lodash'; import chalk from 'chalk'; -import { SaveResult } from 'jsforce'; -import * as interfaces from '../../../shared/interfaces'; -import * as profileInfo from '../../../shared/profile'; core.Messages.importMessagesDirectory(__dirname); const messages = core.Messages.loadMessages('@venkat.polisetti/crm-sfdx-plugin', 'assign'); @@ -84,14 +81,12 @@ export default class assign extends SfdxCommand { userResults.records.map((u:{Id, Name, Username}) => { assignments.push({PermissionSetId:permsetId, AssigneeId: u.Id}) - assignmentUserDetails.push({PermissionSetId:permsetId, UserId: u.Id, Name: u.Name, Username: u.Username}); + assignmentUserDetails.push({"Permissionset Name": this.flags.permsetlabel, "Id":permsetId, "User Id": u.Id, "Name": u.Name, "Username": u.Username}); }); if (this.flags.verbose) { - this.ux.log('PermissionSet Name, PermissionSet Id, User Name, User Login'); - assignmentUserDetails.forEach((a:{PermissionSetId, UserId, Name, Username}) => { - this.ux.log(`${this.flags.permsetlabel}, ${a.PermissionSetId}, ${a.Name}, ${a.Username}`); - }); + const heading = ["Permissionset Name", "Id", "User Id", "Name", "Username"]; + this.ux.table(assignmentUserDetails, heading); } if (this.flags.checkonly) { @@ -138,29 +133,6 @@ export default class assign extends SfdxCommand { this.ux.stopSpinner('done'); this.ux.log(chalk.greenBright('\nProcess Completed')); -/* - let results = await conn.sobject('PermissionSetAssignment').create(assignments); - let isSuccess: boolean = true; - if (Array.isArray(results)) { - results.forEach(r => { - if (r.success == false) { - isSuccess = false; - this.ux.log(r); - } - }); - } else { - if (results.success == false) { - isSuccess = false; - this.ux.log(results); - } - } - if (isSuccess) { - this.ux.log(chalk.yellowBright('Processed Successfully')); - } else { - this.ux.log(chalk.redBright('\nFailed with errros. See above error messages')); - } -*/ - return JSON.stringify(totalResults, null, 2); }