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

zapier convert: Copy important and hidden property from app definition #166

Merged
merged 1 commit into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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