Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for copyInstanceOnItemCopy field for metadata templates #572

Merged
merged 2 commits into from
Mar 15, 2021
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: 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