rfellows opened a new pull request, #10358:
URL: https://github.com/apache/nifi/pull/10358

   # Summary
   
   [NIFI-15029](https://issues.apache.org/jira/browse/NIFI-15029)
   
   ### Changes Made
   
   **Core Implementation:**
   - Created `TABBED_DIALOG_ID` injection token for passing custom dialog IDs
   - Updated `TabbedDialog` constructor to use `inject(TABBED_DIALOG_ID, { 
optional: true })`
   - Added proper null/undefined checking to handle empty string dialog IDs
   - Added try-catch error handling for localStorage operations
   
   **Component Integration:**
   - Updated `EditParameterContext` to provide `TABBED_DIALOG_ID` token with 
`NiFiCommon.EDIT_PARAMETER_CONTEXT_DIALOG_ID`
   - Maintained backward compatibility - components without providers use 
default dialog ID
   
   **Testing:**
   - Created comprehensive test suite (15 tests) covering:
     - Default vs custom dialog ID behavior
     - LocalStorage integration scenarios
     - Error handling and edge cases
     - Integration scenarios with multiple dialog instances
   
   ### Usage Pattern
   ```typescript
   @Component({
     providers: [
       {
         provide: TABBED_DIALOG_ID,
         useValue: 'your-custom-dialog-id'
       }
     ]
   })
   export class YourComponent extends TabbedDialog {
     constructor() {
       super(); // Automatically receives injected dialog ID
     }
   }
   ```
   
   ### Benefits
   - ✅ Maintains backward compatibility
   - ✅ Proper error handling for localStorage failures
   - ✅ Comprehensive test coverage
   - ✅ Type-safe implementation
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to