4
4
* Licensed under the BSD 3-Clause license.
5
5
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
6
*/
7
- import { ux } from '@oclif/ core' ;
7
+ import { Ux } from '@salesforce/sf-plugins- core' ;
8
8
import { DeployResult , FileResponse , FileResponseSuccess , RequestStatus } from '@salesforce/source-deploy-retrieve' ;
9
9
import { ensureArray } from '@salesforce/kit' ;
10
10
import chalk from 'chalk' ;
@@ -18,6 +18,8 @@ import {
18
18
} from '../utils/output.js' ;
19
19
import { TestResultsFormatter } from '../formatters/testResultsFormatter.js' ;
20
20
21
+ const ux = new Ux ( ) ;
22
+
21
23
export class DeleteResultFormatter extends TestResultsFormatter implements Formatter < DeleteSourceJson > {
22
24
public constructor (
23
25
protected result : DeployResult ,
@@ -99,20 +101,18 @@ export class DeleteResultFormatter extends TestResultsFormatter implements Forma
99
101
const failures = ensureArray ( this . result . response . details . componentFailures ) ;
100
102
if ( ! failures . length ) return ;
101
103
102
- const columns = {
103
- problemType : { header : 'Type' } ,
104
- fullName : { header : 'Name' } ,
105
- error : { header : 'Problem' } ,
106
- } ;
107
- const options : ux . Table . table . Options = {
108
- title : StandardColors . error ( chalk . bold ( `Component Failures [${ failures . length } ]` ) ) ,
109
- 'no-truncate' : true ,
110
- } ;
111
104
ux . log ( ) ;
112
105
ux . table (
113
106
failures . map ( ( f ) => ( { problemType : f . problemType , fullName : f . fullName , error : f . problem } ) ) ,
114
- columns ,
115
- options
107
+ {
108
+ problemType : { header : 'Type' } ,
109
+ fullName : { header : 'Name' } ,
110
+ error : { header : 'Problem' } ,
111
+ } ,
112
+ {
113
+ title : StandardColors . error ( chalk . bold ( `Component Failures [${ failures . length } ]` ) ) ,
114
+ 'no-truncate' : true ,
115
+ }
116
116
) ;
117
117
}
118
118
}
0 commit comments