Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c778a74
Implement basic mechanics and UI
getdave Oct 6, 2021
81f1c69
Grab the selected/link text to use in Link UI
getdave Oct 6, 2021
d61170b
Try to update the existing value with the new link and text
getdave Sep 27, 2021
371492d
Retain existing formats when applying new link format
getdave Oct 6, 2021
8d1bd59
Document scenarios for clarity
getdave Oct 4, 2021
7e1b1fb
Only show text control once a link has been committed
getdave Oct 4, 2021
571cb2b
Strip HTML from Link Preview
getdave Oct 26, 2021
1676091
Strip HTML from link text control
getdave Oct 4, 2021
9df74e8
Allow submission of text changes via enter key
getdave Oct 6, 2021
f5f5776
Ensure user provided text has length before commiting as label value
getdave Oct 6, 2021
1b98c5a
Migrate to using existing title prop of LinkControl
getdave Oct 6, 2021
f49931f
Undo overzealous stripping of HTML. Leave this to escape on output.
getdave Oct 7, 2021
317fc29
No change to text should preserve all formatting
getdave Oct 7, 2021
265f83a
Avoid complications of preserving existing formats when amending link…
getdave Oct 7, 2021
e4c604a
Expand boundary seek algorithm in order to fix bugs
getdave Oct 7, 2021
dfb2e9a
Abstract walking loops to functions
getdave Oct 7, 2021
ba30f1a
Reduce and simplify boundary algorithm
getdave Oct 7, 2021
788f20a
Avoid reassignment of startIndex and prefer self documenting variable
getdave Oct 7, 2021
5357a80
Improve edge case handling and function naming
getdave Oct 7, 2021
4c65aff
Add initial unit tests for Text control
getdave Oct 11, 2021
bb61a49
Add tests for more edge cases
getdave Oct 11, 2021
94d5211
Correct text naming
getdave Oct 11, 2021
0a232c6
Don't modify value internally.
getdave Oct 11, 2021
1bada04
Add tests to ensure LinkControl does not modify the value's title pro…
getdave Oct 11, 2021
2c875b0
Have Nav Link block strip HTML formatting before passing to LinkControl
getdave Oct 11, 2021
8cf8915
Avoid passing new function ref for handleSubmit
getdave Oct 11, 2021
2cc7638
Remove outdated reference to `text` prop of value
getdave Oct 11, 2021
ed8ac7a
Add guard against empty label
getdave Oct 11, 2021
2b2a8e7
Move utils to utils to expose for testing purposes
getdave Oct 11, 2021
374c44c
Slice target text +1 beyond the end of the format boundary
getdave Oct 11, 2021
57e2103
Add tests for getFormatValue and adjust implementation to get correct…
getdave Oct 11, 2021
75085eb
Augment tests for getFormatBoundary
getdave Oct 11, 2021
b1612fd
Fix bug whereby rich text value passed to LinkControl when no active …
getdave Oct 12, 2021
3a3e773
Extract function for retrieving RichTextValue for a given selection
getdave Oct 12, 2021
c56b9e0
Add basic e2e tests for link text
getdave Oct 26, 2021
5e5da0b
Add test for preservation of whitespace
getdave Oct 12, 2021
979276a
Add e2e test covering modification of link text via Link UI
getdave Oct 12, 2021
9a94ffa
Ensure focus is reliably placed within Link UI
getdave Oct 18, 2021
a761a39
Fix test name typo
getdave Oct 18, 2021
d52a063
Standardise test nomenclature on "submit" not "commit"
getdave Oct 18, 2021
91c9d79
Restore avoiding focus on mount to ensure collapsed selection can be …
getdave Oct 18, 2021
87821d4
Improve e2e test code comments to explain creation of a collapsed sel…
getdave Oct 18, 2021
28d111c
Remove duplicate test
getdave Oct 18, 2021
ef76e08
Add doc block to getFormatBoundary function
getdave Oct 18, 2021
2a3f25b
Conditionally show the visible URL input label
getdave Oct 18, 2021
773fc9a
Remove magic numbers from submit button positioning
getdave Oct 18, 2021
03df167
Fix overflow bug introduced in earlier commit
getdave Oct 18, 2021
58f8123
Remove stripHTML dependency and hand roll internal method
getdave Oct 18, 2021
3b53454
Re-inline utility function to simplify.
getdave Oct 19, 2021
7e3d9ed
Reduce verbosity of walkToBoundary method
getdave Oct 19, 2021
e81ed6e
Add doc block to walkToBoundary
getdave Oct 19, 2021
77a5b99
Refactor to reduce verbosity of getFormatBoundary
getdave Oct 19, 2021
50e65d9
Improve comments and self documentation of e2e test
getdave Oct 19, 2021
5c7582f
Remove unwanted comment
getdave Oct 19, 2021
71a4ace
Rename helper util to disambiguate from text input focus
getdave Oct 19, 2021
00f6296
Refine e2e tests
getdave Oct 19, 2021
7d26660
Rename an annotate unit tests
getdave Oct 19, 2021
77fbb5e
Ensure boundary tests actually exercise code under test
getdave Oct 19, 2021
ab7298b
Refactor getFormatBoundary to handle more edge cases and put more of …
getdave Oct 21, 2021
ea952d2
Fix to target icon based Edit button
getdave Oct 26, 2021
6bc185b
For currently active links use the full link text as the value of Lin…
getdave Oct 26, 2021
e1f0231
Conform to style guide for coercion of Booleans
getdave Oct 26, 2021
1e94414
Fix outdated test helper refs
getdave Oct 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename an annotate unit tests
  • Loading branch information
getdave committed Oct 26, 2021
commit 7d26660b82ba2693609ba39598b7534e0ff675ab
8 changes: 4 additions & 4 deletions packages/format-library/src/link/test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ describe( 'getFormatBoundary', () => {
[ 'inside', [ 8, 8 ] ],
[ 'start', [ 6, 6 ] ],
[ 'end', [ 10, 10 ] ],
[ 'insideStart', [ 7, 7 ] ],
[ 'insideEnd', [ 9, 9 ] ],
[ 'just inside the start', [ 7, 7 ] ],
[ 'just inside the end', [ 9, 9 ] ],
] )(
'should find bounds of a format from %s of a collapsed RichTextValue',
( _ignored, [ start, end ] ) => {
Expand Down Expand Up @@ -201,10 +201,10 @@ describe( 'getFormatBoundary', () => {
}
);

it( 'should handle values with pointers at 0 with formats that start at zero-th index', () => {
it( 'should find bounds of a format which starts at zeroth index where start/end pointers are at 0', () => {
const record = {
formats: [
[ linkFormat ], // 0
[ linkFormat ], // 0 (th zeroth index)
[ linkFormat ],
[ linkFormat ],
[ linkFormat ],
Expand Down