-
Notifications
You must be signed in to change notification settings - Fork 9
feat(plugin): support sandbox manifest fields (sandbox / allowed_hosts / permissions) #1447
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
Open
nameless-mc
wants to merge
18
commits into
main
Choose a base branch
from
feat/plugin-sandbox-fields
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
89051f5
feat(plugin): add sandbox / allowed_hosts / permissions accessors to …
nameless-mc 7432787
feat(plugin-info): surface sandbox / allowed_hosts / permissions
nameless-mc a4c311a
feat(plugin-upload): include sandbox fields in installation summary
nameless-mc ccb533a
test(plugin-pack): add e2e scenarios for sandbox pack and plugin info
nameless-mc 797f087
docs(plugin): add hidden experimental sandbox page (en/ja)
nameless-mc 43a8650
fix(plugin-pack): add input id to match label for in sandbox e2e fixture
nameless-mc 1147206
test(plugin-upload): cover buildSandboxSummary output (all/none/place…
nameless-mc 97a91a3
refactor(plugin): share installation summary between info and upload
nameless-mc 00b9892
refactor(plugin-info): extract buildJsonInfo and document summary pla…
nameless-mc 2699cec
test(plugin-info): cover buildJsonInfo unit and add e2e json scenario
nameless-mc 40bc402
fix(plugin): treat omitted permission children as (not set), not (none)
nameless-mc b7da05a
refactor(plugin-upload): build installation summary lines with spread
nameless-mc cb453d6
refactor(plugin-manifest): move sandbox accessor note to interface
nameless-mc 6c6b2d9
deps: update plugin-manifest-validator to 11.2.0
nameless-mc e9b7747
refactor(plugin-manifest): reuse ManifestPermissions type in v2 and info
nameless-mc 052a1d6
test(plugin-summary): drop misleading no-op assertion
nameless-mc 8a0de0c
chore(plugin): bump sandbox fixture $schema to validator 11.2.0
nameless-mc bd914e9
test(plugin-manifest): cover sandbox: true without allowed_hosts as i…
nameless-mc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
665 changes: 665 additions & 0 deletions
665
features/assets/plugin_project_sandbox/css/51-modern-default.css
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| .settings-heading { | ||
| padding: 1em 0; | ||
| } | ||
|
|
||
| .kintoneplugin-input-text { | ||
| width: 20em; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| .plugin-space-heading { | ||
| font-size: 1.5rem; | ||
| margin: 0.8rem; | ||
| } | ||
| .plugin-space-message { | ||
| display: inline-block; | ||
| font-size: 1.2em; | ||
| margin: 0.8rem; | ||
| margin-top: 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| .plugin-space-heading { | ||
| font-size: 1.5rem; | ||
| margin: 0.8rem; | ||
| } | ||
| .plugin-space-message { | ||
| display: inline-block; | ||
| font-size: 1.2em; | ||
| margin: 0.8rem; | ||
| margin-top: 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <section class="settings"> | ||
| <h2 class="settings-heading">Settings for hello-kintone</h2> | ||
| <p class="kintoneplugin-desc">This message is displayed on the app page after the app has been updated.</p> | ||
| <form class="js-submit-settings"> | ||
| <p class="kintoneplugin-row"> | ||
| <label for="message"> | ||
| Message: | ||
| <input id="message" type="text" class="js-text-message kintoneplugin-input-text"> | ||
| </label> | ||
| </p> | ||
| <p class="kintoneplugin-row"> | ||
| <button type="button" class="js-cancel-button kintoneplugin-button-dialog-cancel">Cancel</button> | ||
| <button class="kintoneplugin-button-dialog-ok">Save</button> | ||
| </p> | ||
| </form> | ||
| </section> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| (function (PLUGIN_ID) { | ||
| const formEl = document.querySelector(".js-submit-settings"); | ||
| const cancelButtonEl = document.querySelector(".js-cancel-button"); | ||
| const messageEl = document.querySelector(".js-text-message"); | ||
| if (!(formEl && cancelButtonEl && messageEl)) { | ||
| throw new Error("Required elements do not exist."); | ||
| } | ||
|
|
||
| const config = kintone.plugin.app.getConfig(PLUGIN_ID); | ||
| if (config.message) { | ||
| messageEl.value = config.message; | ||
| } | ||
|
|
||
| formEl.addEventListener("submit", (e) => { | ||
| e.preventDefault(); | ||
| kintone.plugin.app.setConfig({ message: messageEl.value }, () => { | ||
| alert("The plug-in settings have been saved. Please update the app!"); | ||
| window.location.href = "../../flow?app=" + kintone.app.getId(); | ||
| }); | ||
| }); | ||
|
|
||
| cancelButtonEl.addEventListener("click", () => { | ||
| window.location.href = "../../" + kintone.app.getId() + "/plugin/"; | ||
| }); | ||
| })(kintone.$PLUGIN_ID); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| (function (PLUGIN_ID) { | ||
| kintone.events.on("app.record.index.show", () => { | ||
| const spaceEl = kintone.app.getHeaderSpaceElement(); | ||
| if (spaceEl === null) { | ||
| throw new Error("The header element is unavailable on this page."); | ||
| } | ||
|
|
||
| const fragment = document.createDocumentFragment(); | ||
| const headingEl = document.createElement("h3"); | ||
| const messageEl = document.createElement("p"); | ||
|
|
||
| const config = kintone.plugin.app.getConfig(PLUGIN_ID); | ||
| messageEl.textContent = config.message; | ||
| messageEl.classList.add("plugin-space-message"); | ||
| headingEl.textContent = "Hello kintone plugin!"; | ||
| headingEl.classList.add("plugin-space-heading"); | ||
|
|
||
| fragment.appendChild(headingEl); | ||
| fragment.appendChild(messageEl); | ||
| spaceEl.appendChild(fragment); | ||
| }); | ||
| })(kintone.$PLUGIN_ID); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| (function (PLUGIN_ID) { | ||
| kintone.events.on("mobile.app.record.index.show", () => { | ||
| const spaceEl = kintone.mobile.app.getHeaderSpaceElement(); | ||
| if (spaceEl === null) { | ||
| throw new Error("The header element is unavailable on this page."); | ||
| } | ||
|
|
||
| const fragment = document.createDocumentFragment(); | ||
| const headingEl = document.createElement("h3"); | ||
| const messageEl = document.createElement("p"); | ||
|
|
||
| const config = kintone.plugin.app.getConfig(PLUGIN_ID); | ||
| messageEl.textContent = config.message; | ||
| messageEl.classList.add("plugin-space-message"); | ||
| headingEl.textContent = "Hello kintone plugin!"; | ||
| headingEl.classList.add("plugin-space-heading"); | ||
|
|
||
| fragment.appendChild(headingEl); | ||
| fragment.appendChild(messageEl); | ||
| spaceEl.appendChild(fragment); | ||
| }); | ||
| })(kintone.$PLUGIN_ID); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/kintone/js-sdk/%40kintone/plugin-manifest-validator%4011.2.0/packages/plugin-manifest-validator/manifest-schema.json", | ||
| "manifest_version": 1, | ||
| "version": 1, | ||
| "type": "APP", | ||
| "sandbox": true, | ||
| "allowed_hosts": ["https://example.com", "wss://example.com/ws/*"], | ||
| "permissions": { | ||
| "js_api": ["app:read", "network:connect"], | ||
| "rest_api": ["app_record:read"] | ||
| }, | ||
| "desktop": { | ||
| "js": ["js/desktop.js"], | ||
| "css": ["css/51-modern-default.css", "css/desktop.css"] | ||
| }, | ||
| "icon": "image/icon.png", | ||
| "config": { | ||
| "html": "html/config.html", | ||
| "js": ["js/config.js"], | ||
| "css": ["css/51-modern-default.css", "css/config.css"], | ||
| "required_params": ["message"] | ||
| }, | ||
| "name": { | ||
| "en": "hello-kintone-sandbox" | ||
| }, | ||
| "description": { | ||
| "en": "Sandbox-enabled plugin sample." | ||
| }, | ||
| "homepage_url": { | ||
| "en": "https://example.com/en/" | ||
| }, | ||
| "mobile": { | ||
| "js": ["js/mobile.js"], | ||
| "css": ["css/mobile.css"] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| -----BEGIN RSA PRIVATE KEY----- | ||
| MIICXgIBAAKBgQDdjV2LPB6D8OQBnJDRcRl4u5FpwVmAesqRPCrDt6UyjGl8V0Mb | ||
| c4TAo4IEmuiftgCeyPkSIzPicEW4fxySqr7U8YZPkSdvB6WaOpbuiRIqryS9scHO | ||
| wDOtSzifo9+UpZhofx155te+88VTBDIU2zCIdhmShvwr5y0L3MlcF4BTxwIDAQAB | ||
| AoGASURbwBTknouGS4YkWi8F1mhpIUkguR1iaf80wT61Me8/XzBYb/aW20H3WGCG | ||
| N3Lv55Lc04Oyv9qTI/1dTJ+Mta+ZfkAOkEp+XwF3jW1qDc25TZsP8wXOW5wSRdCs | ||
| N4MIpZXLq0OaEC5xw7C8Dt8f+BAhPkUAzD8gehbfts4UybkCQQDuV4uXdBfVcDLW | ||
| srEn1oNyIJ3uhFzvZMfEkmvxSQNpdbcL1kfpnFoSwImYN5r6AwMOYgDDjI+qL91j | ||
| NXZ/zs1dAkEA7fdhk1Qn7JHHcl3ML7w/SL59JLqpcOEF4rZ66ZKDfqKDu5+JN5Q+ | ||
| 9+86es4sl4tLN+kamgvR9bUOKkZU6R4vcwJBANjTsf1tswUMlmN1mu74Gwrnm2XS | ||
| 6s0qrQYqgqK2XrFBUu4k2bUv9U2b9VESPR33QX+DLti3djdIZiqMB6rME00CQQDZ | ||
| gWnAfgVX6A9C65T8dLXrSaGc9rh1Ilh81ooWAAMMtoJt9e43zNqZSCJNqTF8+qav | ||
| 3fKgpvkr+meOIGbwBNUdAkEA2sPlzdNLYrA6R0Bsxgwk5XixTlzYZ+BIHrrRGSUM | ||
| UsbQmXsHSbhA6rNWeBEO4fdbmPZOUbP0mDbPQpZA9TQJ2A== | ||
| -----END RSA PRIVATE KEY----- | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.