Skip to content

Feature: Vocabulary Management#3673

Open
andrewbrazzatti wants to merge 60 commits intodevelopfrom
feature/vocabulary-management
Open

Feature: Vocabulary Management#3673
andrewbrazzatti wants to merge 60 commits intodevelopfrom
feature/vocabulary-management

Conversation

@andrewbrazzatti
Copy link
Contributor

@andrewbrazzatti andrewbrazzatti commented Feb 10, 2026

Summary

This pull request introduces a new Angular application for vocabulary management within the admin console, along with the supporting configuration, dependencies, and build/test integration required to run it as part of the RedBox platform.

The main addition is the @researchdatabox/admin-vocabulary application, which provides a UI for curating vocabularies, importing data from Research Vocabualries Australia (RVA), and managing vocabulary entries. Supporting changes ensure the new app is built, tested, and included in local development, CI, and containerised builds.

Changes made:

  • Administrators gain a dedicated UI for managing vocabularies.
  • The new app is fully integrated into the Angular workspace and CI pipeline.
  • Build and dependency configuration has been updated to support the new functionality.

Context / related work

  • Builds on earlier vocabulary management and RVA integration work.
  • Forms part of the ongoing expansion of the admin console into discrete, focused Angular applications.
  • Aligns with existing admin apps in terms of structure, build, and test setup.

Technical implementation details

New admin vocabulary application

  • Added a new Angular application, @researchdatabox/admin-vocabulary, with full configuration in angular.json, including:
    • build
    • serve
    • test
    • i18n extraction targets
  • Implemented the main component UI, styles, and a comprehensive unit test suite.
  • Added a dedicated Karma configuration to ensure the app can be tested independently of other Angular applications.

Dependency and build integration

  • Updated package.json and package-lock.json to include @angular/cdk, required by the new application.
  • Upgraded several development dependencies (including TypeScript and ESLint-related packages) to ensure compatibility with the new app and improved tooling support.

Build and environment automation

  • Updated the root Dockerfile to install and build the rva-registry package so all required dependencies are compiled as part of CI/CD builds.
  • Added an autogenerated environment configuration file for the new redbox-portal environment to support local and automated workflows.

Testing

  • Unit tests for the new admin vocabulary application are included and run via Karma.
  • Existing CI pipelines were updated and verified to ensure the new app is built and tested correctly.
  • Manual verification of the admin vocabulary UI was performed during development.

Future work

  • Extend the admin vocabulary UI with additional management and validation features.
  • Incorporate the vocabularies in the configurable form framework
  • Refactor current VocabService and VocabController that are used to serve content to the legacy forms
  • Review localisation and i18n requirements as vocabulary usage expands

- Updated TypeScript and ESLint dependencies in sails-ng-common package.
- Refactored tsconfig.json to extend a new base configuration.
- Introduced a new base TypeScript configuration file for consistent settings across projects.
- Cleaned up the recordtype configuration by removing commented-out code and unnecessary complexity.
- Ensured compatibility with ES2024 features and improved module resolution settings.
…nfiguration

- Added ESLint and Prettier scripts for linting and formatting TypeScript files.
- Introduced a new TypeScript configuration file for strict type checking.
- Updated package.json to include new devDependencies for ESLint and Prettier.
…e variables

- Updated all service classes to use 'protected override _exportedMethods' for method declarations.
- Added non-null assertion operator (!) for class properties where applicable.
- Declared global variables for each service to improve accessibility across the application.
- Removed unnecessary variable declarations in several service files to clean up the code.
- Updated the ExportJSONTransformer class to use 'override' for transform methods.
- Cleaned up test files by removing unused variable declarations related to services.
- Updated UsersService to enhance type declarations for variables and function parameters.
- Modified ViewUtilsService, VocabService, WorkflowStepsService, WorkspaceAsyncService, WorkspaceService, and WorkspaceTypesService to use more specific types and improve type safety.
- Changed the tsconfig.json to enable strict mode for better type checking.
- Adjusted wrapper-webpack.js to handle different configurations more robustly.
- Ensured consistent use of `any` type where necessary while aiming for more specific types throughout the services.
…ices and controllers

- Removed unused imports and improved type definitions in CoreService, Logger, and bootstrap files.
- Enhanced type safety by replacing `any` with more specific types in various service and config files.
- Refactored methods to use `unknown` and `Record<string, unknown>` for better type safety.
- Updated logging and configuration handling to ensure consistent type usage.
- Improved handling of optional properties in authentication and role management services.
- Cleaned up code by consolidating variable declarations and ensuring consistent use of lodash methods.
… declarations

- Updated various services (ViewUtilsService, VocabService, WorkflowStepsService, etc.) to replace 'any' with 'UnsafeAny' for better type safety.
- Removed global declarations for 'sails', '_', and other variables in service files.
- Introduced a new waterline model 'RBReport' to avoid conflicts with the DOM's Report interface.
- Adjusted tests to accommodate changes in model names and types.
- Enhanced TypeScript configuration for improved type checking and global access.
- Increased timeout for BrandingService tests to ensure stability during execution.
- Updated TranslationService to comment out unused BrandingService declarations.
- Modified TriggerService to replace UnsafeAny with any in various methods and parameters for better type safety.
- Adjusted UsersService to replace UnsafeAny with any in method signatures and internal logic.
- Refined VocabService by changing UnsafeAny to specific types and improving type definitions.
- Enhanced WorkspaceService by replacing UnsafeAny with any for targetRecord and workspaces.
…vices

- Updated RolesService to introduce ConfigRoleResult type and improve getConfigRoles method signatures.
- Refined SolrSearchService by adding specific types for SolrResponse and QueueJob, enhancing clarity and type safety.
- Enhanced TriggerService with RecordLike and UserLike types for better type handling in workflow transitions and hook executions.
- Improved UsersService by ensuring failureMode is consistently treated as a string.
- Updated VocabService to include additional type definitions for user context and service parameters, ensuring better type safety in external service interactions.
… declarations to use const; improve type safety with unknown; clean up code formatting and comments across multiple service files.
- Updated FigshareService to use local variable for readstream.
- Enhanced FormsService with better type definitions for observables and added optional starting property to WorkflowStepLike.
- Improved NamedQueryService with explicit type annotations for observables.
- Refined OniService to handle Buffer creation more safely.
- Enhanced PathRulesService with type safety for observables.
- Updated RDMPService to ensure consistent return types and added user parameter to assignPermissions method.
- Refactored RecordsService for better type handling and logging.
- Improved ReportsService with explicit type annotations for observables.
- Enhanced RolesService with type safety for observable returns.
- Refined SolrSearchService to ensure string conversion for core IDs.
- Updated UsersService for better type safety and observables.
- Enhanced WorkspaceTypesService with explicit return types for methods.
- Minor adjustments to Handlebars helper registration for better type safety.
- Updated ReportsService to assert types for search service and report DTO conversion.
- Modified RolesService to ensure correct typing for branding service methods.
- Adjusted SolrSearchService to cast queue service and roles array types.
- Enhanced SvgSanitizerService to assert the return type of max bytes.
- Updated TranslationService to ensure bundles are correctly typed.
- Refined UsersService to introduce PassportLike type and assert various method calls.
- Improved VocabService to assert the search service type.
- Adjusted WorkflowStepsService to ensure workflows are correctly typed.
- Enhanced WorkspaceAsyncService to assert observable types for service methods.
- Updated WorkspaceTypesService to assert observable types for bootstrap services.
- Refined momentShim to improve type safety in date handling.
- Updated waterline models to use Record<string, unknown> for better type safety.
- Enhanced test cases for momentShim to ensure valid date formatting.
- Removed deprecated RxJS imports and adjusted usages in EmailService, FigshareService, FormsService, I18nEntriesService, NamedQueryService, OniService, RDMPService, RaidService, RecordsService, ReportsService, RolesService, SassCompilerService, SolrSearchService, TranslationService, UsersService, VocabService, WorkflowStepsService, WorkspaceAsyncService.
- Updated function parameters to use underscores for unused parameters in various services for clarity.
- Cleaned up waterline models by removing unused imports and references to JsonMap.
- Refactored Solr configuration to use autogenerated shims.
- Updated Angular test script to improve directory handling.
- Created a comprehensive task list for Vocabulary Management, detailing models, services, controllers, and testing requirements.
- Added Bruno API tests for Vocabulary CRUD operations and sync functionality.
- Developed integration tests for Vocabulary models and services to ensure proper functionality.
- Created admin UI for Vocabulary management, including necessary routes and controllers.
- Implemented Angular components for Vocabulary listing and detail views, along with import functionality.
- Added navigation configuration for the new Vocabulary feature in the admin interface.
- Updated AdminVocabularyComponent to utilize i18next for translation of error messages, success messages, and UI text.
- Added a stub for the i18next pipe in component tests to ensure proper rendering.
- Modified HTML templates across various components (RvaImport, VocabDetail, VocabList) to replace static text with i18next translations.
- Enhanced translation JSON file with new keys for vocabulary management, including error messages, labels, and placeholders.
- Updated unit tests for components to include the i18next pipe stub for consistent testing.
@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.67%. Comparing base (ad61ba3) to head (d7ca2c3).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3673      +/-   ##
===========================================
- Coverage    50.26%   49.67%   -0.60%     
===========================================
  Files          390      402      +12     
  Lines        21735    23348    +1613     
  Branches      4434     4873     +439     
===========================================
+ Hits         10926    11599     +673     
- Misses       10221    11112     +891     
- Partials       588      637      +49     
Flag Coverage Δ
backend-bruno-general 72.72% <ø> (ø)
backend-bruno-oidc 72.72% <ø> (ø)
backend-mocha 72.72% <ø> (ø)
backend-redbox-core-types 36.75% <ø> (-0.22%) ⬇️
backend-redbox-hook-kit-cli 59.13% <ø> (ø)
backend-sails-ng-common 79.78% <ø> (ø)
frontend-admin-vocabulary 53.46% <ø> (?)
frontend-app-config 80.63% <ø> (ø)
frontend-branding 52.80% <ø> (ø)
frontend-core-lib 44.16% <ø> (ø)
frontend-dashboard 69.29% <ø> (ø)
frontend-deleted-records 84.53% <ø> (ø)
frontend-export 100.00% <ø> (ø)
frontend-form 75.83% <ø> (ø)
frontend-local-auth 100.00% <ø> (ø)
frontend-manage-roles 63.33% <ø> (ø)
frontend-manage-users 64.95% <ø> (ø)
frontend-report 94.44% <ø> (ø)
frontend-translation 67.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

… and validation improvements

- Added keyboard accessibility for vocabulary rows in the admin UI, allowing users to open vocabulary details with the Enter key.
- Updated SCSS for improved table layout and focus styles for better accessibility.
- Introduced a new API endpoint for reordering vocabulary entries, ensuring atomic updates and validation of entry IDs.
- Enhanced VocabularyController to handle entry reordering requests, including validation for entry existence and order.
- Improved input sanitization in VocabularyService for create and update operations, enforcing unique constraints on identifiers.
- Updated database models to enforce unique constraints on vocabulary entry identifiers.
- Enhanced RVA import service to handle asynchronous operations and improve error handling during vocabulary synchronization.
- Updated design documentation to reflect new features and validation rules for vocabulary entries.
- Improved wireframe documentation to clarify UI interactions for vocabulary management.
…ment pagination

- Added a checkbox for marking entries as historical in the vocabulary detail view.
- Default new entries to non-historical.
- Updated the vocabulary list to include pagination controls and display total counts.
- Enhanced the vocabulary API to support querying with pagination and historical flags.
- Updated tests to cover new functionality for historical entries and pagination.
@andrewbrazzatti andrewbrazzatti self-assigned this Feb 11, 2026
@andrewbrazzatti andrewbrazzatti added this to the v5.0 milestone Feb 11, 2026
@andrewbrazzatti andrewbrazzatti marked this pull request as ready for review February 11, 2026 01:06
@andrewbrazzatti andrewbrazzatti requested review from cofiem and shilob and removed request for shilob February 11, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant