Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Remove jQuery from globals

Alexander Brandon Coles97fb055bcd7a
diff --git a/frontend/src/app/core/setup/globals/openproject.ts b/frontend/src/app/core/setup/globals/openproject.ts
index 8c6fd4b4764..90c1fc0a582 100644
--- a/frontend/src/app/core/setup/globals/openproject.ts
+++ b/frontend/src/app/core/setup/globals/openproject.ts
@@ -59,15 +59,15 @@ export class OpenProject {
}
public get urlRoot():string {
- return jQuery('meta[name=app_base_path]').attr('content') || '';
+ return this.getMetaElement('app_base_path')?.content || '';
}
public get environment():string {
- return jQuery('meta[name=openproject_initializer]').data('environment');
+ return this.getMetaElement('openproject_initializer')?.dataset.environment || '';
}
public get edition():string {
- return jQuery('meta[name=openproject_initializer]').data('edition');
+ return this.getMetaElement('openproject_initializer')?.dataset.edition || '';
}
public get isStandardEdition():boolean {
@@ -100,6 +100,10 @@ export class OpenProject {
console.error('Failed to access your browsers local storage. Is your local database corrupted?');
}
}
+
+ private getMetaElement(name:string):HTMLMetaElement|null {
+ return document.querySelector(`meta[name=${name}]`);
+ }
}
window.OpenProject = new OpenProject();