Skip to content

Commit

Permalink
Changed 'api-modules' extension point location, enabled legacy templa…
Browse files Browse the repository at this point in the history
…tes, fixed generate dialog
  • Loading branch information
StanZGenchev committed Jan 14, 2025
1 parent b574c80 commit 11ecb51
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ function isModule(path) {

function isIgnoredModulePath(path) {
return path.startsWith("ide-") // Ignore IDE packages

|| path.startsWith("editor-") // Ignore platform editor packages
|| path.startsWith("view-") // Ignore platform view packages
|| path.startsWith("shell-") // Ignore platform shell packages
|| path.startsWith("menu-") // Ignore platform menu packages
|| path.startsWith("perspective-") // Ignore platform perspective packages
|| path.startsWith("platform-") // Ignore platform packages
|| path.startsWith("theme-") // Ignore platform theme packages
|| path.startsWith("indexing/") // Ignore system JavaScript API packages
|| path.startsWith("io/") // Ignore system JavaScript API packages
|| path.startsWith("net/") // Ignore system JavaScript API packages
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"location": "/ide-monaco-extensions/extensions/api.extensionpoint",
"location": "/editor-monaco-extensions/extensions/api.extensionpoint",
"name": "api-modules",
"description": "API Modules Extension Point",
"createdBy": "system"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
// TODO: Cache response
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
xhr.open("GET", "/services/js/ide-monaco/api/fileTypes.js");
xhr.open("GET", "/services/js/editor-monaco/api/fileTypes.js");
xhr.onload = () => {
if (xhr.status === 200) {
let fileTypes = JSON.parse(xhr.responseText);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ projectsView.controller('ProjectsViewController', function (
if (contextMenuNodes[0].type !== 'project') {
const pnode = getProjectNode(contextMenuNodes[0].parents);
project = pnode.text;
generatePath = contextMenuNodes[0].data.path.substring(pnode.text.length + 1);
generatePath = contextMenuNodes[0].data.path.substring(pnode.data.path.length);
if (generatePath.endsWith('/')) generatePath += 'filename';
else generatePath += '/filename';
} else {
Expand Down Expand Up @@ -886,7 +886,7 @@ projectsView.controller('ProjectsViewController', function (
});
});
} else if (id === 'generateModel') {
let pnode = getProjectNode(contextMenuNodes[0].parents);
const pnode = getProjectNode(contextMenuNodes[0].parents);
project = pnode.text;
const templateItems = getModelTemplates(getFileExtension(contextMenuNodes[0].text));
Dialogs.showFormDialog({
Expand All @@ -911,12 +911,12 @@ projectsView.controller('ProjectsViewController', function (
label: 'Model (must be in the root of the project)',
controlType: 'input',
type: 'text',
placeholder: '/path/file',
placeholder: 'filename.model',
inputRules: {
// excluded: [], // TODO
patterns: ['^[^/:]*$'],
},
value: contextMenuNodes[0].data.path.substring(project.length + 2),
value: contextMenuNodes[0].data.path.substring(pnode.data.path.length + 1),
submitOnEnter: true,
required: true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ for (let i = 0; i < templateExtensions?.length; i++) {
try {
// @ts-ignore
const templateExtension = await import(`../../${module}`);
const template = templateExtension.getTemplate();
let template = templateExtension.getTemplate();
template.id = module;
templates.push(template);
} catch (e) {
// Fallback for not migrated extensions
const templateExtension = require(module);
const template = templateExtension.getTemplate();
let template = templateExtension.getTemplate();
template.id = module;
templates.push(template);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
{
"guid": "template-application-odata"
}
]
],
"actions": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"extensionPoint":"ide-template","module":"template-application-angular/template/template.js","description":"Application Template (with Angular UI)"}
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{"extensionPoint":"ide-template","module":"template-application-angular/template/template.js","description":"Application Template (with Angular UI)"}
{
"extensionPoint": "platform-templates",
"module": "template-application-angular/template/template.js",
"description": "Application Template (with Angular UI)"
}
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{"module":"template-application-rest/template/template.js","extensionPoint":"ide-template","description":"Application Template - REST"}
{
"module": "template-application-rest/template/template.js",
"extensionPoint": "platform-templates",
"description": "Application Template - REST"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"module":"template-application-ui-angular/template/template.js","extensionPoint":"ide-template","description":"Application Template - UI (Angular)"}
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{"module":"template-application-ui-angular/template/template.js","extensionPoint":"ide-template","description":"Application Template - UI (Angular)"}
{
"module": "template-application-ui-angular/template/template.js",
"extensionPoint": "platform-templates",
"description": "Application Template - UI (Angular)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extensionPoint": "ide-template",
"module": "template-bookstore/template.js",
"description": "Bookstore Template"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extensionPoint": "ide-template",
"extensionPoint": "platform-templates",
"module": "template-bookstore/template.js",
"description": "Bookstore Template"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extensionPoint": "ide-template",
"module": "template-extension-perspective/template.js",
"description": "Extension Perspective Template"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extensionPoint": "ide-template",
"module": "template-extension-perspective/template.js",
"description": "Extension Perspective Template"
"extensionPoint": "platform-templates",
"module": "template-extension-perspective/template.js",
"description": "Extension Perspective Template"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"module": "template-form-builder-angularjs/template/template.js",
"extensionPoint": "ide-template",
"description": "The generator template from form to AngularJS format"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"module": "template-form-builder-angularjs/template/template.js",
"extensionPoint": "ide-template",
"extensionPoint": "platform-templates",
"description": "The generator template from form to AngularJS format"
}

0 comments on commit 11ecb51

Please sign in to comment.