-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* transform testing part 1 - error Handlers * transform testing part 1 - eval args * transform testing part 1 - misc * transform testing part 1 - code style * transform testing part 1 - review changes * transform testing part 1 - change url to preparedUrl
- Loading branch information
Showing
15 changed files
with
871 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright (c) 2017, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or | ||
* https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
|
||
/** | ||
* src/remoteCollection/errorSamples.js | ||
*/ | ||
const debug = require('debug') | ||
('refocus-collector:remoteCollection:errorSamples'); | ||
|
||
module.exports = (collectResponse, messageBody) => { | ||
debug('errorSamples', collectResponse.name, messageBody); | ||
const samples = []; | ||
collectResponse.aspects.forEach((a) => { | ||
collectResponse.subjects.forEach((s) => { | ||
const relatedLinks = []; | ||
|
||
if (collectResponse.apiLinks) { | ||
relatedLinks.push({ | ||
name: 'Sample Generator', | ||
url: collectResponse.apiLinks.GET, | ||
}); | ||
} | ||
|
||
const repository = collectResponse.generatorTemplate.repository; | ||
if (repository && repository.url) { | ||
relatedLinks.push({ | ||
name: 'Sample Generator Template', | ||
url: repository.url, | ||
}); | ||
} | ||
|
||
samples.push({ | ||
name: `${s.absolutePath}|${a.name}`, | ||
messageCode: 'ERROR', | ||
messageBody, | ||
value: 'ERROR', | ||
relatedLinks, | ||
}); | ||
}); | ||
}); | ||
return samples; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.