Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Merge pull request #166 from zapier/copy-important-hidden-from-defini…
Browse files Browse the repository at this point in the history
…tion

zapier convert: Copy important and hidden property from app definition
  • Loading branch information
eliangcs authored Oct 26, 2017
2 parents e7ba4e8 + de86467 commit 904a596
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion scaffold/convert/create.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ module.exports = {

display: {
label: '<%= LABEL %>',
description: '<%= DESCRIPTION %>'
description: '<%= DESCRIPTION %>',
hidden: <%= HIDDEN %>,
important: <%= IMPORTANT %>
},

operation: {
Expand Down
4 changes: 3 additions & 1 deletion scaffold/convert/search.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ module.exports = {

display: {
label: '<%= LABEL %>',
description: '<%= DESCRIPTION %>'
description: '<%= DESCRIPTION %>',
hidden: <%= HIDDEN %>,
important: <%= IMPORTANT %>
},

operation: {
Expand Down
2 changes: 2 additions & 0 deletions scaffold/convert/trigger.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ module.exports = {
display: {
label: '<%= LABEL %>',
description: '<%= DESCRIPTION %>'
hidden: <%= HIDDEN %>,
important: <%= IMPORTANT %>
},

operation: {
Expand Down
5 changes: 5 additions & 0 deletions src/utils/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,18 @@ const renderStep = (type, definition, key) => {
stepDescriptionTemplateMap[type]({lowerNoun: lowerNoun});
description = description.replace(/'/g, "\\'");

const hidden = Boolean(definition.hide);
const important = Boolean(definition.important);

const templateContext = {
KEY: snakeCase(key),
CAMEL: camelCase(key),
NOUN: noun,
LOWER_NOUN: lowerNoun,
DESCRIPTION: description,
LABEL: label,
HIDDEN: hidden,
IMPORTANT: important,
FIELDS: fields.join(',\n'),
SAMPLE: sample,
URL: url
Expand Down

0 comments on commit 904a596

Please sign in to comment.