Skip to content

Conversation

@bakbakbakbakbak
Copy link
Collaborator

Resolves #357

This is built upon fixes of item drag'n'drop that I've written for #356. I'll keep this in draft until #356 is merged into 1.8.x as well as the fixes I've yet to create a PR for.

This introduces a simple check that if the item is being dragged onto itself, it does nothing in terms of rearranging the inventory.

@bakbakbakbakbak bakbakbakbakbak changed the title Fix/container 357 fix(item): Dragging a container onto itself pops it from inventory sheet Feb 27, 2023
@bakbakbakbakbak bakbakbakbakbak marked this pull request as ready for review March 28, 2023 17:37
Copy link
Member

@anthonyronda anthonyronda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

if you don't get around to updating the comment, no big deal. Don't go out of your way for it

/* Specific cases */
/* --------------------------------------------- */
// Issue#357
it("Issue#357 Dragging container onto itself should retain container in inventory", async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the issue label here, wish I did the same in other tests

const isContainer = this.actor.items.get(item.system.containerId);

if (isContainer) return this._onContainerItemRemove(item, isContainer);
// Issue #357
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer a link to the issue when doing this in comments

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with a link!

@anthonyronda anthonyronda merged commit baf5e8d into vttred:1.8.x Apr 6, 2023
anthonyronda added a commit that referenced this pull request Apr 7, 2023
* feat: Add linting packages and config

* chore: Get ready for Prettier

* chore: Get eslint --fix ready to roll; add eslint globals

* fix: Explicitly support array-flat and array-includes

* fix: Don't fix linting issues during the build step

* feat: Add linting packages and config

* chore: Get ready for Prettier

* chore: Get eslint --fix ready to roll; add eslint globals

* fix: Explicitly support array-flat and array-includes

* fix: Don't fix linting issues during the build step

* fix: async restores treasure result text (#272)

* fix: async restores treasure result text

* fix: avoid race conditions with flag "async:false"

* fix: Monster Data Model bugfixes (#279)

* fix: On dropping item onto actor, check for existence before checking for anything related to containers

* fix: Remove pre-container-data-model code for handling containers on monsters

* fix: Programmers and linguists agree: Why Plurals?

* fix: don't reroll on round 1 if already rolled (#280)

* Create CNAME

* docs: add Haxxer as a contributor for code (#281)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* fix(temporary): removed caching from the build ci

* fix: AC/AAC display fix + party overview fix (#286)

* fix: Add missing usesAscendingAC key

* fix: Update deprecated code

* fix: use game.system.id instead of OSE.systemName when getting party members

* fix: `lint:js` script now lints the correct folder

* fix: == to ===

* chore: Disable some less useful linting rules

* chore: Add file summary to ose.scss.js

* chore: Fix ose.js per linting rules

* feat: Get prettier set up to sort imports

* chore: Use prettier-eslint to sort imports

* fix: Macro for same item name now creates (#314)

* fix: async restores treasure result text (#272)

* fix: async restores treasure result text

* fix: avoid race conditions with flag "async:false"

* fix: Monster Data Model bugfixes (#279)

* fix: On dropping item onto actor, check for existence before checking for anything related to containers

* fix: Remove pre-container-data-model code for handling containers on monsters

* fix: Programmers and linguists agree: Why Plurals?

* fix: don't reroll on round 1 if already rolled (#280)

* Create CNAME

* docs: add Haxxer as a contributor for code (#281)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* fix(temporary): removed caching from the build ci

* fix: AC/AAC display fix + party overview fix (#286)

* fix: Add missing usesAscendingAC key

* fix: Update deprecated code

* fix: use game.system.id instead of OSE.systemName when getting party members

* fix: Additional v1.7.x fixes (#289)

* fix: Character generator now properly sets scores

* fix: Items should once again properly display their descriptions.

* fix: Treasure items should be created under the Treasure inventory heading

* fix: Item and armor descriptions should target the correct fields

* fix: replaced broken chart with "translated" badge

* chore: update README to where people can find the Discord invite

* feat: add Catalan and Chinese support to manifest

* Updates to Item Piles system integration (#292)

* Updates to system integration

* Added unstackable item types

* [enhancement] Added option to revert Ctrl/Meta behavior (#294)

* [enhancement] Added option to revert Ctrl/Meta behavior

* Extracted skipDialogCheck to method

* Removed comment about monster testing.

* Moved skipRollDialogcheck to helper collection

* cleanup

Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* docs: add bakbakbakbakbak as a contributor for code (#302)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* docs: add adn770 as a contributor for translation (#303)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* [enhancement] Container delete confirmation (#299)

* [enhancement] Added confirmation when deleting containers containing items

* [fix] Container now pushes out containing items.

* Changed to Dialog.confirm

* Cleanup

* cleanup

* Allow first item check condition to allow no item

Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* fix: shopping cart now deducts gold

* Remove confusing monster options (#308)

Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* [fix] Correctly creating link anchors in TextEditor & dragging items to hotbar (#304)

* [fix] Use item.getDragData to fix bad link

* [fix] Macro creation when dragging item from actor

* Fixed macro warning for non-actor items

* Tests for item macros

* Cleanup

* Unlinked token macro fix

* Fixed typo in en.json

* Fixed bug on row 67

* Non-destructive macro removal

* Macro logic

* Cleanup

Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* fix: Macro for same item name now creates

Co-authored-by: Anthony Ronda <anthonyronda@gmail.com>
Co-authored-by: Tim <tim.snyder.work@gmail.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Adam Oresten <adamoresten@gmail.com>
Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* chore: eslint-prettier automatic fixes

* chore: Ignore unused expressions when writing tests

* chore: Oh no

* chore: Autofix rebased changes

* chore: Requested PR fixes

* chore: Remove unnecessary eslint disables

* chore: Combine two ESlint disables into one

* chore(tests): helpers, actor, dialog, item, party

* chore: renaming helpers & imports

* fix: exporting functions for test for treasure

* fix(test): missing method import

* chore(test): make sure token vision

* Cleanup & comment fix

* fix: entity-tweaks-tests

* fix: Config tag_images not returning properly

* fix(macro): Allow macro to be dragged to hotbar

* fix(party): Fix recursive folder adding for 1.8.x (#346)

* fix(party): Fix recursive folder adding

* fix: Actor, not Folder

---------

Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* fix(item): Make spendSpell async for 1.8.x (#352)

* fix(item): Make spendSpell async

* cleanup & lint

---------

Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* fix(dice): Dice rolling fixes for 1.8.x (#345)

* fix: dice rolling fixes

* chore(test): dice rolling

* chore(test): sendAttackRoll cleanup

* chore(desc): Added description to attackIsSuccess

* Added descriptions to helpers-dice.js

* chore(test): Added tests for issue #340

* chore(desc): Better test descriptions for #340

* cleanup

* fix(dice): Always allow hit when untargeted, #333

* cleanup

---------

Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* fix(treasure): Make drawTreasure asynchronous

* fix: making percent call synchronous

* chore(utils): testUtils tweaks

* chore(test): Actor testing up to sheet

* chore(lint): Test linting & remova assert(false)

* chore(structure): Better naming of test suite

* chore(structure): Fixed remaining test names

* fix(test): revert closeSheets to standard delay

* fix(test): renamed cleanUpActorsKey

* chore(lint): spacing and linting to dice tests

* chore(lint): sheet linewidth linting

* fix: defined type for key in cleanUpActorsByKey

* fix(tweaks): Added class to entity tweaks

* fix: wyrmisis comments

* Symlinker now supports array of dataPaths (#360)

* fix(symlink): support path array

* fix(symlink): capitalization & typedef

* fix: Array for right term

---------

Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* chore: data migration to default img (#325)

* chore: data migration to default img

* fix: checking for empty instead of undef

---------

Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* fix(item): Dragging a container onto itself pops it from inventory sheet (#359)

* fix(actor-sheet): use item in _removeItemFromActor

* fix(actor-sheet): dropping items on container

* chore(test): Issue #357 tests

* fix(container): Container drop onto itself #357

* chore: Updated comment

---------

Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>

* fix: isNew() tests now check against saves (#386)

* feat: added itemId tag to spell card for AA compat

* fix: the isNew tests now check against saves

* fix: undo ItemIds commit

* feat: added itemId tag to spell card for AA compat

* fix: resolve conflicts mistakes part 1

* fix: character creation autoroll no longer broken

* fix: actor's language delete button

* fix: additional "data" to "system" fixes

---------

Co-authored-by: wyrmisis <tim.snyder.work@gmail.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: bakbakbakbakbak <105067023+bakbakbakbakbak@users.noreply.github.com>
Co-authored-by: Adam Oresten <adamoresten@gmail.com>
Co-authored-by: bakbakbakbakbak <bakbakbakbak@protonmail.com>
@bakbakbakbakbak bakbakbakbakbak deleted the fix/container_357 branch April 9, 2023 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants