feat(printing): add template tag modifiers and syntax help#876
Open
akira69 wants to merge 1 commit intoDonkie:masterfrom
Open
feat(printing): add template tag modifiers and syntax help#876akira69 wants to merge 1 commit intoDonkie:masterfrom
akira69 wants to merge 1 commit intoDonkie:masterfrom
Conversation
9874181 to
be550cd
Compare
4d6e109 to
aea7b56
Compare
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
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.
Summary
This PR is a focused fix for label-template formatting ergonomics (issues
#795and#669) on top ofDonkie/Spoolmanmaster.It adds formatter modifiers directly to existing template tags:
date,time,date_local,time_local,datetime_short,datetime_short_local:ymd,:mdy,:dmyround,fixed1,fixed2Examples:
{first_used|date:dmy}{first_used|datetime_short_local:mdy}{remaining_weight|fixed2}Code Quality Compliance ✅
Per https://github.com/Donkie/Spoolman/wiki/Contribute#style
Included In This PR
client/src/pages/printing/printing.tsx|modifierparsing to existing spool label templatesclient/src/pages/printing/spoolQrCodePrintingDialog.tsxAvailable Tags...button/help#template-syntaxclient/src/pages/help/index.tsx/help#template-syntaxScope Boundary
#846, because without#846there is no filament label printing surface upstream.#875.#885, but does not depend on it.Relationship To Other PRs
#846is the prerequisite for any filament-label benefit from this PR.akira69/Spoolman_Labelsas PR#12, because GitHub cannot stack that branch directly onto this fork branch inDonkie/Spoolman.Issues
Fixes #795
Fixes #669
Validation Completed
npm cinpx eslint src/pages/help/index.tsx src/pages/printing/printing.tsx src/pages/printing/spoolQrCodePrintingDialog.tsxclient/node_modules/.bin/prettier --check client/src/pages/help/index.tsx client/src/pages/printing/printing.tsx client/src/pages/printing/spoolQrCodePrintingDialog.tsx client/public/locales/en/common.jsonVITE_APIURL=/api/v1 npm run builduv run lefthook run pre-commit6957filaments,3spools)Screenshots
Before: raw values without modifiers
After: formatted values with
|fixed2and|dateAvailable Tags dialog with modifier chooser
Template syntax help page
Test Checklist
Core Functionality
Available Tags...opens the tag/modifier dialog from spool label printing{tag}value and closes the dialog{tag|modifier}value and closes the dialog{last_used|date:dmy}{remaining_weight|fixed2}Integration
extra.*paths/help#template-syntaxand lands on the Template Syntax sectionRegression
Save Presetssucceeds from the spool print dialog