Skip to content

Commit

Permalink
Add support for copyInstanceOnItemCopy field for metadata templates (#…
Browse files Browse the repository at this point in the history
…572)

* Add support for copyInstanceOnItemCopy field for metadata templates

* Update CHANGELOG.md
  • Loading branch information
swfree authored Mar 15, 2021
1 parent f603481 commit 843e094
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Next Release

**New Features and Enhancements:**

- Add support for copyInstanceOnItemCopy field for metadata templates ([#572](https://github.com/box/box-node-sdk/pull/572))

**Bug Fixes:**

- Fix webhook signature validation ([#568](https://github.com/box/box-node-sdk/pull/568))
Expand Down
4 changes: 3 additions & 1 deletion docs/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ client.metadata.createTemplate(
],
{
hidden: true,
templateKey: 'vcontract'
templateKey: 'vcontract',
copyInstanceOnItemCopy: false
}
)
.then(template => {
Expand All @@ -93,6 +94,7 @@ client.metadata.createTemplate(
scope: 'enterprise_12345',
displayName: 'Vendor Contract',
hidden: true,
copyInstanceOnItemCopy: false,
fields:
[ { type: 'date',
key: 'signed',
Expand Down
1 change: 1 addition & 0 deletions lib/managers/metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ Metadata.prototype = {
* @param {string} [options.templateKey] - The programmatic key for the template
* @param {boolean} [options.hidden] - Whether the template should be hidden in the UI
* @param {string} [options.scope=enterprise] - The scope for the template, only 'enterprise' is supported for now
* @param {string} [options.copyInstanceOnItemCopy] - Whether to include the metadata when a file or folder is copied
* @param {Function} [callback] - Passed the template if successful, error otherwise
* @returns {Promise<Object>} A promise resolving to the created template
*/
Expand Down
6 changes: 4 additions & 2 deletions tests/lib/managers/metadata-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ describe('Metadata', function() {
}
];
options = {
hidden: true
hidden: true,
copyInstanceOnItemCopy: true
};
});

Expand All @@ -182,7 +183,8 @@ describe('Metadata', function() {
scope: 'enterprise',
displayName: name,
fields,
hidden: true
hidden: true,
copyInstanceOnItemCopy: true
}
};

Expand Down

0 comments on commit 843e094

Please sign in to comment.