Skip to content

Commit

Permalink
Merge pull request #13 from datocms/new-plugin-methods
Browse files Browse the repository at this point in the history
Allow fetching fields by itemTypeId
  • Loading branch information
souljuse authored Mar 22, 2021
2 parents 0633ac9 + 2e58540 commit 1a2a9df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Please refer to the [SDK docs](https://www.datocms.com/docs/building-plugins/sdk-reference) for furthe information about APIs.

## [0.1.1] - 2021-03-16

### Added

- `loadItemTypeFields(itemTypeId)` - Plugins can use this method to load all fields belonging to a specific model or block.
- `environment` - Information about the current environment.

## [0.1.0] - 2020-11-09

### Added

- `selectItem(itemTypeId, { multiple })` - Plugins can use this method do show the modal dialog to select one or multiple existing records.
- `selectUpload({ multiple: boolean })` - Plugins can use this method do show the modal dialog to select one or multiple uploads.
- `selectItem(itemTypeId, { multiple })` - Plugins can use this method to show the modal dialog to select one or multiple existing records.
- `selectUpload({ multiple: boolean })` - Plugins can use this method to show the modal dialog to select one or multiple uploads.
- `editUpload(uploadId)` - Plugins can use this method to show the modal dialog to edit an upload.
- `editUploadMetadata(uploadMetadata)` - Plugins can use this method to show the modal dialog to edit an upload metadata.

Expand Down
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class Plugin {
this._parent.setFieldValue(path, value);
}

loadItemTypeFields(itemTypeId) {
return this._parent.loadItemTypeFields(itemTypeId);
}

toggleField(...args) {
if (args.length < 2) {
console.error('toggleField requires path and a new value');
Expand Down

0 comments on commit 1a2a9df

Please sign in to comment.