-
-
Notifications
You must be signed in to change notification settings - Fork 101
[stable31] feat: footer template editor #6008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update to latest version which includes: - initialScale prop for setting initial zoom level - @scale-changed event for zoom updates - @pdf-editor:ready event for initialization Signed-off-by: Vitor Mattos <[email protected]>
- Auto-save footer template with 500ms debounce - Live PDF preview with zoom controls - Persistent zoom level using AppConfig - Reset to default functionality - Uses VuePdfEditor v1.5.0 events to eliminate workarounds - Dynamic textarea height adjustment Signed-off-by: Vitor Mattos <[email protected]>
Replace inline footer template editing with dedicated component providing better UX with live preview and zoom controls Signed-off-by: Vitor Mattos <[email protected]>
Store zoom level preference for footer template preview Signed-off-by: Vitor Mattos <[email protected]>
- Add footer_preview_width (default: 595) - Add footer_preview_height (default: 80) - Used by FooterTemplateEditor component for preview dimensions Signed-off-by: Vitor Mattos <[email protected]>
- Add width and height controls with validation (100-2000, 10-500) - Add reset button for dimensions (UndoVariant icon) - Implement auto-save with debounce (500ms) - Delete AppConfig keys when dimensions are default (595x80) - Add watchers for dimension changes to regenerate PDF - Separate saveDimensions() method for cleaner logic - Show reset button only when dimensions differ from default - Fix containerHeight variable naming conflict Signed-off-by: Vitor Mattos <[email protected]>
- Remove inline SPDX comment from footer.twig template - Add lib/Handler/Templates/footer.twig to REUSE.toml annotations Signed-off-by: Vitor Mattos <[email protected]>
- Add [email protected] for code editing - Add [email protected] for syntax highlighting - Required for CodeEditor component with Twig support Signed-off-by: Vitor Mattos <[email protected]>
- Create reusable CodeEditor component using vue-codemirror - Add Twig mode for syntax highlighting - Enable bracket matching and auto-close - Use Material theme integrated with Nextcloud colors - Support line numbers, line wrapping, and auto-indent Signed-off-by: Vitor Mattos <[email protected]>
- Replace simple textarea with CodeEditor component - Add syntax highlighting for Twig templates - Remove manual textarea resize logic (CodeMirror handles it) - Improve developer experience with professional code editor Signed-off-by: Vitor Mattos <[email protected]>
Signed-off-by: Vitor Mattos <[email protected]>
- Add IL10N dependency injection for translations - Replace const ALLOWED_VARIABLES with instance property - Add initializeVariablesMetadata() method with full metadata - Add getVariablesMetadata() method returning associative array - Include type, description, example, and optional default for each variable - Add defaults for signedBy, linkToSite, and validateIn variables - Update tests with IL10N mock and comprehensive coverage - Add DataProviders for testing defaults and types Signed-off-by: Vitor Mattos <[email protected]>
- Add TemplateVariables as constructor parameter - Remove manual instantiation with 'new TemplateVariables()' - Add getTemplateVariablesMetadata() method exposing metadata - Update tests to use real TemplateVariables instance instead of mock - Test getTemplateVariablesMetadata returns complete metadata structure Signed-off-by: Vitor Mattos <[email protected]>
- Add getTemplateVariablesMetadata() method delegating to FooterHandler - Update tests to validate metadata retrieval - Fix UUID regex in preview tests to match new format (36 chars with hyphens) Signed-off-by: Vitor Mattos <[email protected]>
- Add GET /api/v1/admin/footer-template/variables endpoint - Return complete metadata for all available Twig variables - Include type, description, example, and optional default values - Add NoCSRFRequired attribute for read-only endpoint - Document response schema with psalm annotations Signed-off-by: Vitor Mattos <[email protected]>
- Add getFooterTemplateVariables endpoint to OpenAPI specs - Generate TypeScript types for template variables metadata - Document response schema with variable metadata structure - Update both administration and full API specifications Signed-off-by: Vitor Mattos <[email protected]>
- Add space after fn in arrow function callback Signed-off-by: Vitor Mattos <[email protected]>
- Add FooterService injection to Admin settings - Provide footer_template_variables in initial state - Remove API endpoint getFooterTemplateVariables (no longer needed) - Update OpenAPI specs removing the endpoint - Variables now loaded at page load instead of via separate API call Signed-off-by: Vitor Mattos <[email protected]>
- Add label prop to display accessible label for screen readers - Generate unique ID for editor instance - Bind label to editor via for attribute Signed-off-by: Vitor Mattos <[email protected]>
- Add dialog with list of available Twig template variables - Display variable metadata: type, description, example, default value - Implement click-to-copy functionality with icon feedback - Use NcFormBoxButton for consistent UI with Nextcloud standards - Variables loaded via initial state for performance - Icon changes from copy to check mark for 2 seconds after copying - Fallback to prompt() if Clipboard API unavailable Signed-off-by: Vitor Mattos <[email protected]>
- Add footer_template to initial state - Add footer_template_is_default to initial state - Update footer_preview_height default from 80 to 100 - Eliminates extra API call on settings page load Signed-off-by: Vitor Mattos <[email protected]>
- Clarify that empty template parameter resets to default - Document width and height parameters with defaults - Add response type annotations Signed-off-by: Vitor Mattos <[email protected]>
- Add FooterTemplateEditor component with Twig template editor - Implement template variables helper dialog with click-to-copy - Add preview controls (zoom, width, height) with reset functionality - Display variable metadata (type, description, example, default) - Use constants for default dimensions (595x100) - Integrate with Validation settings via template-reset event - Load template data from initial state to avoid extra API call Signed-off-by: Vitor Mattos <[email protected]>
- Return preview_width and preview_height in response - Update PHPDoc return type annotation - Regenerate OpenAPI specs Signed-off-by: Vitor Mattos <[email protected]>
Signed-off-by: Vitor Mattos <[email protected]>
- Add FooterService to test dependencies - Fix constructor argument count mismatch Signed-off-by: Vitor Mattos <[email protected]> [skip ci]
Signed-off-by: Vitor Mattos <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #6006
Warning, This backport's changes differ from the original and might be incomplete⚠️
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.