Skip to content
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

feat: places categorization #368

Merged
merged 69 commits into from
Oct 12, 2023
Merged

feat: places categorization #368

merged 69 commits into from
Oct 12, 2023

Conversation

lauti7
Copy link
Contributor

@lauti7 lauti7 commented Oct 5, 2023

This PR:

  • add categories to places

Visual Changes:
Screenshot 2023-10-05 at 16 55 34
Screenshot 2023-10-05 at 16 55 42
Screenshot 2023-10-05 at 16 55 57
Screenshot 2023-10-05 at 16 56 13
Screenshot 2023-10-05 at 16 56 23
Screenshot 2023-10-05 at 16 56 43
Screenshot 2023-10-05 at 16 57 02

@lauti7 lauti7 requested review from braianj and 2fd October 5, 2023 19:25
@github-actions
Copy link

github-actions bot commented Oct 5, 2023

Pull Request Test Coverage Report for Build 6460577292

  • 132 of 199 (66.33%) changed or added relevant lines in 12 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.4%) to 95.309%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/entities/Place/routes/getPlaceUserVisitsList.ts 0 2 0.0%
src/entities/Category/routes.ts 6 12 50.0%
src/entities/Category/model.ts 24 31 77.42%
src/entities/Place/model.ts 44 57 77.19%
src/entities/PlaceCategories/model.ts 34 73 46.58%
Files with Coverage Reduction New Missed Lines %
src/entities/Category/model.ts 2 80.0%
Totals Coverage Status
Change from base Build 6456177857: -0.4%
Covered Lines: 13856
Relevant Lines: 14417

💛 - Coveralls

src/components/Categories/CategoriesList.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoriesModal.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoriesModal.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoriesModal.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoriesModal.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoriesModal.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoriesModal.tsx Outdated Show resolved Hide resolved
src/migrations/1666984055037_add-default-places.ts Outdated Show resolved Hide resolved
src/migrations/1695656505396_place-category-pivot-table.ts Outdated Show resolved Hide resolved
src/components/Categories/CategoriesList.tsx Outdated Show resolved Hide resolved
@@ -44,6 +40,8 @@ export type AggregatePlaceAttributes = PlaceAttributes & {
user_count?: number
user_visits?: number
realms_detail?: Realm[]
category_id?: string
category_ids?: string[]
Copy link
Contributor

Choose a reason for hiding this comment

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

why both?

Copy link
Contributor Author

@lauti7 lauti7 Oct 7, 2023

Choose a reason for hiding this comment

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

because a query can return a category_id, another query can get all the place's categories.

src/entities/Place/types.ts Show resolved Hide resolved
},
[params, track]
)
function handleCategorySelection(action: "add", categoryId: string): void
Copy link
Contributor

Choose a reason for hiding this comment

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

All this behavior could be encapsulated inside a component CampaignFilters where you only listen the changed with eventHandler

Copy link
Contributor Author

@lauti7 lauti7 Oct 7, 2023

Choose a reason for hiding this comment

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

CampaignFilters 🤔 - too much rewards sever?

let target = location.pathname
const params = newParams.toString()
target += params ? "?" + params : ""
navigate(target)
Copy link
Contributor

Choose a reason for hiding this comment

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

All URL manipulation should be isolated in src/modules/locaitons.ts

use this as reference: https://github.com/decentraland/events/blob/master/src/modules/locations.ts#L46

<Grid.Column tablet={4}>
<CategoriesList
onSelect={(categoryId) =>
handleCategorySelection("add", categoryId)
Copy link
Contributor

Choose a reason for hiding this comment

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

This pattern is no use anywhere else, try reusing already-defined patterns

@lauti7 lauti7 requested review from 2fd and braianj October 9, 2023 15:25
src/components/Categories/CategoriesFilters.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoriesFilters.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoriesList.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoriesFilters.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoriesList.tsx Outdated Show resolved Hide resolved
src/components/Categories/CategoryButton.tsx Outdated Show resolved Hide resolved
src/entities/CheckScenes/task/taskRunnerSqs.ts Outdated Show resolved Hide resolved
src/entities/CheckScenes/task/taskRunnerSqs.ts Outdated Show resolved Hide resolved
src/entities/Place/routes/index.ts Outdated Show resolved Hide resolved
src/migrations/1696876576232_compute-poi-to-category.ts Outdated Show resolved Hide resolved
@braianj braianj merged commit eee3f69 into master Oct 12, 2023
2 checks passed
@braianj braianj deleted the feat/scenes-categorization branch October 12, 2023 20:06
braianj added a commit that referenced this pull request Oct 13, 2023
braianj added a commit that referenced this pull request Oct 13, 2023
2fd added a commit that referenced this pull request Oct 13, 2023
lauti7 added a commit that referenced this pull request Oct 18, 2023
* Revert "Revert "feat: places categorization (#368)" (#378)"

This reverts commit 192ae9c.

* refactor: several components from category

* fix: CategoryFilters sort

* fix: migration based on base_position

* fix: some modal & styles fixes

* feat: accept onClick within props

* fix: move previous active to manager

* fix: compute categories update

---------

Co-authored-by: Braian Mellor <[email protected]>
Co-authored-by: lauti7 <[email protected]>
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.

3 participants