-
-
Notifications
You must be signed in to change notification settings - Fork 5
Price Filters #7
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
Open
darkzmaj
wants to merge
7
commits into
BlueprintFramework:master
Choose a base branch
from
darkzmaj:fix-nuxt-config
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
66797c7
feat: Add price filter to extension/theme browse page
darkzmaj f3d5c70
Browse: binary price filter (Free/Paid) with simplified slider; fix t…
darkzmaj d821066
fix: correct devProxy configuration in nuxt.config.ts
darkzmaj 9a480d4
Update apps/frontend/src/components/ui/browse/Filters.vue
darkzmaj 2718ce3
Update apps/frontend/src/pages/browse/index.vue
darkzmaj b7af198
Update apps/frontend/nuxt.config.ts
darkzmaj ec27318
Update apps/frontend/src/pages/browse/index.vue
darkzmaj 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| TURNSTILE_PUBLIC=1x00000000000000000000AA | ||
| DEV_API_TARGET=http://localhost:8000 |
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 |
|---|---|---|
|
|
@@ -151,8 +151,22 @@ const form = ref({ | |
| sortBy: 'popularity', | ||
| showExtensions: true, | ||
| showThemes: true, | ||
darkzmaj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Note: Despite the name, this is used as a pricing filter flag: | ||
| // 0 = show free only, non-zero = show paid only. | ||
| maxPrice: 0, | ||
| }) | ||
|
|
||
| const getMinPrice = (extension: Extension): number => { | ||
| const prices = Object.values(extension.platforms) | ||
| .map(p => p.price) | ||
| .filter(p => p >= 0) | ||
| return prices.length > 0 ? Math.min(...prices) : 0 | ||
| } | ||
|
|
||
| const isFree = (extension: Extension): boolean => { | ||
| return getMinPrice(extension) === 0 | ||
| } | ||
|
Comment on lines
+166
to
+168
|
||
|
|
||
| const filteredAndSortedExtensions = computed(() => { | ||
| if (!extensions.value) return [] | ||
|
|
||
|
|
@@ -178,6 +192,15 @@ const filteredAndSortedExtensions = computed(() => { | |
| return true | ||
| }) | ||
|
|
||
| filtered = filtered.filter((extension) => { | ||
| const minPrice = getMinPrice(extension) | ||
| if (form.value.maxPrice === 0) { | ||
| return minPrice === 0 | ||
| } | ||
| // any non-zero maxPrice shows all price tiers (free and paid) | ||
| return true | ||
| }) | ||
|
|
||
| switch (form.value.sortBy) { | ||
| case 'popularity': | ||
| filtered.sort((a, b) => b.stats.panels - a.stats.panels) | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The proxy target URL transformation is incomplete. The original target was 'http://localhost:8000/api' but now it's 'http://localhost:8000'. When proxying '/api' requests, the path '/api' will be appended to the target, resulting in 'http://localhost:8000/api' which matches the original behavior. However, if DEV_API_TARGET is set to 'https://blueprint.zip', requests to '/api/endpoint' will be proxied to 'https://blueprint.zip/api/endpoint', which may be incorrect if the API is actually at 'https://blueprint.zip/api'. Verify that this path handling is intentional and matches your API structure.