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

fix: update URLs to Custom Apps documentation #220

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Unreleased
----------

- Added interface type='banner' into JSON schema.
- Updated URLs to Custom Apps documentation.

2.1.0 [2024-10-09]
------------------
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ _See more in [Local Development for Apps documentation](https://github.com/integ

## Documentation

**Read more how to [create your custom Make app](https://docs.integromat.com/apps/).**
**Read more how to [create your custom Make app](https://developers.make.com/custom-apps-documentation).**
79 changes: 6 additions & 73 deletions src/commands/PublicCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,78 +8,11 @@ const Core = require('../Core')
class PublicCommands {
static async register() {
vscode.commands.registerCommand('apps-sdk.help', async function () {
let crumbs
// If a window is open
if (vscode.window.activeTextEditor) {
// If an apps file is open
if (vscode.window.activeTextEditor.document.uri.fsPath.split('apps-sdk')[1]) {
// Parse the path
crumbs = vscode.window.activeTextEditor.document.uri.fsPath.split('apps-sdk')[1].split('/').reverse()
}
}

let docsbase = 'https://docs.integromat.com/apps/'
let options = [
{
"label": "Integromat Apps",
"description": docsbase
}
]
// If crumbs were parsed
if (crumbs) {
// If six or seven crumbs -> connection, webhook, module, rpc or function
if ([6, 7].includes(crumbs.length)) {

// Set function to iml-function because of docs path
let pathCrumb = crumbs[2] === "function" ? "iml-function" : crumbs[2]

// Add option to open general docs for a module, function, ...
options.unshift({
"label": `${crumbs[2].charAt(0).toLocaleUpperCase()}${crumbs[2].slice(1)} docs`,
"description": `${docsbase}app-structure/${pathCrumb}s`
})

// Locate a code-item
crumbs[0] = crumbs[0].split('.')[0]

// Set custom path for connections' common
pathCrumb = crumbs[0] === "common" ? "other-subblocks/connections-common-data" : crumbs[0]

// Exclude code and test of function, they don't have their own page
if (!['code', 'test'].includes(pathCrumb)) {

// Add option to open detailed docs
options.unshift({
"label": `${crumbs[0].charAt(0).toLocaleUpperCase()}${crumbs[0].slice(1)} docs`,
"description": `${docsbase}structure-blocks/${pathCrumb}`
})
}
}

// If five crumbs -> base, common or docs
else if (crumbs.length === 5) {

// Locate a code-item
crumbs[0] = crumbs[0].split('.')[0]

// If it's apps' base or common
if (['base', 'common'].includes(crumbs[0])) {

// Add option to open detailed docs
options.unshift({
"label": `${crumbs[0].charAt(0).toLocaleUpperCase()}${crumbs[0].slice(1)} docs`,
"description": `${docsbase}app-structure/general/${crumbs[0]}`
})
}
}
}
let answer = await vscode.window.showQuickPick(options, { placeHolder: "Choose a docs page you want to open" })
if (answer === undefined || answer === null) {
vscode.window.showWarningMessage("No answer has been recognized.")
return
}
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(answer.description))
})
vscode.commands.executeCommand(
'vscode.open',
vscode.Uri.parse('https://developers.make.com/custom-apps-documentation'),
);
});

vscode.commands.registerCommand('apps-sdk.udt', async function () {
const panel = vscode.window.createWebviewPanel(
Expand Down Expand Up @@ -134,4 +67,4 @@ class PublicCommands {
}
}

module.exports = PublicCommands
module.exports = PublicCommands
6 changes: 3 additions & 3 deletions src/providers/ImljsonHoverProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ImljsonHoverProvider {
let key = document.getText(range).slice(1, -2)
let help = this.provideKeyHover(key)
if (['name', 'type', 'label', 'help', 'default', 'advanced', 'required'].includes(key)) {
help = help.concat(`\r\n- For more information see the [docs](https://docs.integromat.com/apps/other/parameters#${key}).`)
help = help.concat(`\r\n- For more information see the [docs](https://developers.make.com/custom-apps-documentation/app-components/parameters#${key}).`)
}
return help ? new vscode.Hover(new vscode.MarkdownString(`## ${key}\r\n___\r\n${help}`)) : undefined
}
Expand All @@ -23,7 +23,7 @@ class ImljsonHoverProvider {
let customLink
if (type === "integer" || type === "uinteger") { customLink = 'integer-uinteger' }
if (type === "folder" || type === "file") { customLink = 'folder-file' }
return help ? new vscode.Hover(new vscode.MarkdownString(`## ${type}\r\n___\r\n${help}\r\n- For more information see the [docs](https://docs.integromat.com/apps/other/parameters/${customLink || type}).`)) : undefined
return help ? new vscode.Hover(new vscode.MarkdownString(`## ${type}\r\n___\r\n${help}\r\n- For more information see the [docs](https://developers.make.com/custom-apps-documentation/app-components/parameters/${customLink || type}).`)) : undefined
}
}

Expand Down Expand Up @@ -86,4 +86,4 @@ class ImljsonHoverProvider {
}
}
}
module.exports = ImljsonHoverProvider
module.exports = ImljsonHoverProvider
5 changes: 2 additions & 3 deletions src/providers/ParametersProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ export class ParametersProvider {
}
}


/**
* @docs https://docs.integromat.com/apps/app-components/parameters
* @docs https://developers.make.com/custom-apps-documentation/app-components/parameters
*/
interface ParameterDefinition {
name: string;
Expand All @@ -171,7 +170,7 @@ interface ParameterDefinition {
/**
* definition for type === "select"
* If string, it must start with "rpc://".
* @docs https://docs.integromat.com/apps/app-components/parameters/select
* @docs https://developers.make.com/custom-apps-documentation/app-components/parameters/select
*/
options?: {
label: string;
Expand Down
Loading