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

Bootstrap the datepicker when dynamically adding rows to an edit table, ie. hourly rates edit form

Dombi Attilad59e797a19f5
diff --git a/frontend/src/app/core/setup/global-dynamic-components.const.ts b/frontend/src/app/core/setup/global-dynamic-components.const.ts
index 687e88bc2e8..246fac0c5e6 100644
--- a/frontend/src/app/core/setup/global-dynamic-components.const.ts
+++ b/frontend/src/app/core/setup/global-dynamic-components.const.ts
@@ -270,7 +270,7 @@ export const globalDynamicComponents:OptionalBootstrapDefinition[] = [
{ selector: opModalOverlaySelector, cls: OpModalOverlayComponent },
// It is important to initialize the remoteFieldUpdaterSelector after the opSingleDatePickerSelector,
// because we need to access the input field of the opSingleDatePickerSelector inside the remoteFieldUpdaterSelector
- { selector: opSingleDatePickerSelector, cls: OpSingleDatePickerComponent },
+ { selector: opSingleDatePickerSelector, cls: OpSingleDatePickerComponent, embeddable: true },
{ selector: remoteFieldUpdaterSelector, cls: RemoteFieldUpdaterComponent },
{ selector: spotDropModalPortalComponentSelector, cls: SpotDropModalPortalComponent },
];
diff --git a/modules/budgets/frontend/module/augment/cost-subform.augment.service.ts b/modules/budgets/frontend/module/augment/cost-subform.augment.service.ts
index 2c7625ad406..31b563d116a 100644
--- a/modules/budgets/frontend/module/augment/cost-subform.augment.service.ts
+++ b/modules/budgets/frontend/module/augment/cost-subform.augment.service.ts
@@ -27,6 +27,7 @@
//++
import { Injectable } from "@angular/core";
+import { OpenProjectPluginContext } from 'core-app/features/plugins/plugin-context';
@Injectable()
export class CostSubformAugmentService {
@@ -59,7 +60,12 @@ export class CostSubformAugmentService {
container.append(row);
rowIndex += 1;
- container.find('.subform-row:last-child input:first').focus();
+ window.OpenProject.getPluginContext()
+ .then((pluginContext:OpenProjectPluginContext) => {
+ pluginContext.bootstrap(row[0]);
+ });
+
+ setTimeout(() => container.find('.subform-row:last-child input:first').focus(), 10)
return false;
});