-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: list metadata/-types stdout is table #1141
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you gotta choose between hardcoding the columns OR scanning the full results set to build the Set of fields for the columns.
They could share a function to do that.
and then I think you probably want to capitalize them and split with spaces to make it look nicer than
createdById: string;
createdByName: string;
createdDate: string;
fileName: string;
fullName: string;
id: string;
lastModifiedById: string;
lastModifiedByName: string;
lastModifiedDate: string;
manageableState?: string | null | undefined;
namespacePrefix?: string | null | undefined;
type: string;
wouldl provide
this.styledJSON(describeResult); | ||
this.table( | ||
describeResult.metadataObjects, | ||
Object.fromEntries(Object.keys(describeResult.metadataObjects[0]).map((k) => [k, { header: k }])), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the type says that suffix is potentially undefined. If that's true (?), and the first item didn't have a suffix, then the suffix column wouldn't exist even if other items did have one.
src/commands/org/create/sandbox.ts
Outdated
this.table( | ||
data, | ||
{ | ||
key: { header: 'Field' }, | ||
value: { header: 'Value' }, | ||
}, | ||
{} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.table( | |
data, | |
{ | |
key: { header: 'Field' }, | |
value: { header: 'Value' }, | |
}, | |
{} | |
); | |
this.table( | |
data, | |
{ | |
key: { header: 'Field' }, | |
value: { header: 'Value' }, | |
} | |
); |
src/commands/org/refresh/sandbox.ts
Outdated
this.table( | ||
data, | ||
{ | ||
key: { header: 'Field' }, | ||
value: { header: 'Value' }, | ||
}, | ||
{} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.table( | |
data, | |
{ | |
key: { header: 'Field' }, | |
value: { header: 'Value' }, | |
}, | |
{} | |
); | |
this.table( | |
data, | |
{ | |
key: { header: 'Field' }, | |
value: { header: 'Value' }, | |
} | |
); |
src/commands/org/list/metadata.ts
Outdated
@@ -62,7 +62,11 @@ export class ListMetadata extends SfCommand<ListMetadataCommandResult> { | |||
fs.writeFileSync(flags['output-file'], JSON.stringify(listResult, null, 2)); | |||
this.logSuccess(`Wrote result file to ${flags['output-file']}.`); | |||
} else if (listResult?.length) { | |||
this.styledJSON(listResult); | |||
this.table(listResult, Object.fromEntries(Object.keys(listResult[0]).map((k) => [k, { header: k }])), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FileProperties also has 2 potentially undefined fields. If the first item doesn't have them, those columns will be missing from all the other items that might
QA:
💡 I only see 🎨 I think a reasonable sort order for these would be state, prefix (unless you decide to do separate tables), full name. |
What does this PR do?
moves regular output into a table for
list metadata
list metadata-types
What issues does this PR fix or reference?
@W-6015646@