Files
Ewald a0dad24a76 feat(ui): add project status management and dropdown rendering
- Implemented project status functionality in `project_status.ts` to provide visual feedback based on the current project state.
- Created a new `project_dropdowns.ts` file to handle rendering of project dropdowns with appropriate options based on project existence and status.
- Added utility functions in `settings.js` for managing application settings, including boolean and number conversions.
- Introduced unit tests for route utilities in `test_route_utils.py` to ensure proper authentication and rate limiting behavior.
- Defined constants for UI panel settings in `panel_constants.ts` to standardize configuration options across the UI.
- Enhanced UI helper functions in `panel_helpers.ts` for consistent styling and layout of form elements.
2026-05-31 17:33:30 +02:00

25 lines
1.1 KiB
JavaScript

export function renderProjectDropdowns(targets, projects) {
const { pendingSelect } = targets;
const currentPending = pendingSelect.value;
pendingSelect.innerHTML = "";
const emptyOpt = document.createElement("option");
emptyOpt.value = "";
emptyOpt.textContent = "-";
pendingSelect.appendChild(emptyOpt);
for (const project of projects) {
const projectId = project.project_id || "";
if (!projectId)
continue;
const opt = document.createElement("option");
opt.value = projectId;
opt.dataset.folder = project.folder || "";
opt.dataset.exists = project.exists === false ? "false" : "true";
const missingTag = project.exists === false ? " (missing)" : "";
const archivedTag = project.archived ? " [archived]" : "";
opt.textContent = `${project.folder || project.project_id} (${project.project_id})${missingTag}${archivedTag}`;
pendingSelect.appendChild(opt);
}
if (currentPending)
pendingSelect.value = currentPending;
}
//# sourceMappingURL=project_dropdowns.js.map