feat(model): add clone method to QTableMEtaData and all composed classes #32

Merged
darinkelkhoff merged 1 commits from feature/table-meta-data-clone into develop 2025-10-16 01:30:51 +00:00
darinkelkhoff commented 2025-10-14 21:39:16 +00:00 (Migrated from github.com)

🎨 Frontend Core Library Pull Request

📝 Description

What does this PR do?
Add clone methods to QTableMetaData (and all objects that it contains (and so on)).

  • Doing this so that form adjusters in QFMD can clone a table meta data object and then manipulate it w/o changing the object that is returned in QController's loadTableMetaData method.

What type of change is this?

  • Bug fix
  • New feature
  • Core component improvement
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Other (please describe)

Does this PR introduce a breaking change?

  • Yes
  • No

If yes, please describe the breaking change:
:(
In this call: <FilterCriteriaRowValues criteria={} this change made an error that the object being built didn't have a clone method...

The patch in qfmd was:

               criteria={QFilterCriteriaWithId.buildFromCriteria(criteria, id)}

and then adding that method to the QFilterCriteriaWithId class:

   public static buildFromCriteria(criteria: QFilterCriteria, id: number)
   {
      const rs = new QFilterCriteria(criteria.fieldName, criteria.operator, criteria.values) as QFilterCriteriaWithId;
      rs.id = id;
      return (rs);
   }

🧪 Testing

How have you tested this PR?

  • Manual testing in browser
  • Unit tests
  • Integration tests (in qfmd)
  • Cross-browser testing
  • Mobile responsiveness testing

Test environment:

  • OS:
  • Browser:
  • QQQ version:

📸 Screenshots

🔗 Related Issues

This repository contains the core frontend library for the QQQ framework. Please ensure your changes are appropriate for a frontend core library.

📋 Pull Request Checklist

  • I have read the contributing guidelines
  • My changes are focused on frontend core library components only
  • I have tested my changes in the browser
  • My changes follow the existing code style and patterns
  • I have updated documentation if necessary
  • My changes do not break existing functionality

Reminders

🎯 What This Repository Is

This repository contains:

  • Reusable React components and hooks
  • Core UI utilities and helpers
  • Shared TypeScript types and interfaces
  • Common styling and theming utilities
  • Frontend state management utilities
  • Authentication and routing utilities

🚫 What This Repository Is NOT

This repository does NOT contain:

  • QQQ server or backend logic
  • Core framework functionality
  • Business logic or process engine
  • Database operations or API endpoints

🔄 For Major Changes

If your changes involve:

  • Core framework functionality
  • Backend integration changes
  • Major architectural decisions
  • Breaking changes to the QQQ API

Remember: This is a frontend core library. For complete QQQ functionality, please consider submitting to the main QQQ repository instead:
👉 https://github.com/Kingsrook/qqq

# 🎨 Frontend Core Library Pull Request ## 📝 Description **What does this PR do?** Add clone methods to QTableMetaData (and all objects that it contains (and so on)). - Doing this so that form adjusters in QFMD can clone a table meta data object and then manipulate it w/o changing the object that is returned in QController's loadTableMetaData method. **What type of change is this?** - [ ] Bug fix - [ ] New feature - [x] Core component improvement - [ ] Documentation update - [ ] Code refactoring - [ ] Performance improvement - [ ] Other (please describe) **Does this PR introduce a breaking change?** - [x] Yes - [ ] No **If yes, please describe the breaking change:** :( In this call: `<FilterCriteriaRowValues criteria={}` this change made an error that the object being built didn't have a clone method... The patch in qfmd was: ```typescript criteria={QFilterCriteriaWithId.buildFromCriteria(criteria, id)} ``` and then adding that method to the `QFilterCriteriaWithId` class: ```typescript public static buildFromCriteria(criteria: QFilterCriteria, id: number) { const rs = new QFilterCriteria(criteria.fieldName, criteria.operator, criteria.values) as QFilterCriteriaWithId; rs.id = id; return (rs); } ``` ## 🧪 Testing **How have you tested this PR?** - [x] Manual testing in browser - [x] Unit tests - [x] Integration tests (in qfmd) - [ ] Cross-browser testing - [ ] Mobile responsiveness testing **Test environment:** - OS: - Browser: - QQQ version: ## 📸 Screenshots <!-- If applicable, add screenshots to help explain your changes --> ## 🔗 Related Issues <!-- Link to any related issues in the main QQQ repository --> This repository contains the **core frontend library** for the QQQ framework. Please ensure your changes are appropriate for a frontend core library. ## 📋 Pull Request Checklist - [ ] I have read the [contributing guidelines](https://github.com/Kingsrook/qqq.wiki) - [ ] My changes are focused on frontend core library components only - [ ] I have tested my changes in the browser - [ ] My changes follow the existing code style and patterns - [ ] I have updated documentation if necessary - [ ] My changes do not break existing functionality ## Reminders ### 🎯 What This Repository Is This repository contains: - Reusable React components and hooks - Core UI utilities and helpers - Shared TypeScript types and interfaces - Common styling and theming utilities - Frontend state management utilities - Authentication and routing utilities ### 🚫 What This Repository Is NOT This repository does NOT contain: - QQQ server or backend logic - Core framework functionality - Business logic or process engine - Database operations or API endpoints ### 🔄 For Major Changes If your changes involve: - **Core framework functionality** - **Backend integration changes** - **Major architectural decisions** - **Breaking changes to the QQQ API** **Remember**: This is a frontend core library. For complete QQQ functionality, please consider submitting to the **main QQQ repository** instead: 👉 **[https://github.com/Kingsrook/qqq](https://github.com/Kingsrook/qqq)**
Sign in to join this conversation.