-
Notifications
You must be signed in to change notification settings - Fork 92
Respect cfg.packageRoot
when creating text files using UI
#4397
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
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
724e126
make a function to create canonical key under the prefix
fiskus 295ecd3
handle packageRoot when create new text file from Catalog UI
fiskus 4f05c00
simplify joining
fiskus 4cd386d
re-use useAddFileInPackage route
fiskus 1d257bb
use consistent interface
fiskus f88d059
use consistent interface
fiskus ae26a2c
remove debug value
fiskus cef4284
restrict type
fiskus 7817b5e
packagename and logicalkeys cannot be empty strings
fiskus e6d7cc1
use syntax for default argument value
fiskus 2e5fc9b
changelog entry
fiskus 4651a60
ci deploy
fiskus b0e8d3c
simplify removing unnecessary abstraction
fiskus 7670ef6
disable ci deploy
fiskus 7995cb9
typo
fiskus 71535c9
fail early and throw error on imposible cases
fiskus 844fc7b
Apply suggestions from code review
fiskus 1d819d8
re-use toFile callback for both readme and summarize
fiskus 929982d
Merge branch 'package-root-create-file-from-catalog-ui' of github.com…
fiskus edb83a4
subscribe to the object, not individual properties
fiskus 3e579bb
this callback is always called with some string non-empty value
fiskus fce1222
Merge branch 'master' into package-root-create-file-from-catalog-ui
fiskus f3c8d9a
ci deploy
fiskus cdbed64
swap arguments
fiskus 1b708a1
disable ci deploy
fiskus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { canonicalKey } from './s3paths' | ||
|
||
describe('utils/s3paths', () => { | ||
describe('canonicalKey', () => { | ||
it('produces the key prefixed by package name', () => { | ||
expect(canonicalKey('foo/bar', 'README.md')).toBe('foo/bar/README.md') | ||
expect(canonicalKey('foo/bar', 'one/two two/three three three/README.md')).toBe( | ||
'foo/bar/one/two two/three three three/README.md', | ||
) | ||
expect(canonicalKey('foo/bar', 'one/two two/three three three/README.md', '')).toBe( | ||
'foo/bar/one/two two/three three three/README.md', | ||
) | ||
}) | ||
|
||
it('throws when logicalKey or package name is empty', () => { | ||
expect(() => canonicalKey('foo/bar', '', 'root')).toThrow() | ||
expect(() => canonicalKey('', 'foo/bar', 'root')).toThrow() | ||
}) | ||
|
||
it('produces the key prefixed by package name and packageRoot', () => { | ||
expect(canonicalKey('foo/bar', 'READ/ME.md', 'root')).toBe( | ||
'root/foo/bar/READ/ME.md', | ||
) | ||
expect(canonicalKey('foo/bar', 'READ/ME.md', '/root/')).toBe( | ||
'root/foo/bar/READ/ME.md', | ||
) | ||
fiskus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
expect(canonicalKey('foo/bar', 'READ?/!ME.md', '//root//')).toBe( | ||
'root/foo/bar/READ?/!ME.md', | ||
) | ||
expect(canonicalKey('foo/bar', 'READ/ME.md', 'one/two two/three three three')).toBe( | ||
'one/two two/three three three/foo/bar/READ/ME.md', | ||
) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.