-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Space admins can create "Menu/Product Groups" and reorder the…
…m for display on their marketplace" (#2422) Revert "Space admins can create "Menu/Product Groups" and reorder them for di…" This reverts commit 67dc740.
- Loading branch information
Showing
23 changed files
with
515 additions
and
810 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,16 +1,5 @@ | ||
<%- marketplace.tags.group_tag.by_position.each do |tag| %> | ||
<%- unless tag.products.empty? %> | ||
<h1><%= tag.label %></h1> | ||
<div class="grid lg:grid-cols-3 gap-3"> | ||
<%- tag.products.with_all_rich_text.unarchived.each do |product| %> | ||
<%= render Marketplace::Menu::ProductComponent.new(product:, cart:) %> | ||
<%- end %> | ||
</div> | ||
<%- end %> | ||
<%- end %> | ||
<h1>Other</h1> | ||
<div class="grid lg:grid-cols-3 gap-3"> | ||
<%- marketplace.products.unarchived.without_group_tag.each do |product| %> | ||
<%= render Marketplace::Menu::ProductComponent.new(product:, cart:) %> | ||
<div class="grid sm:grid-cols-2 lg:grid-cols-3 gap-3"> | ||
<%- marketplace.products.with_all_rich_text.unarchived.each do |product| %> | ||
<%= render Marketplace::Menu::ProductComponent.new(product:, cart:)%> | ||
<%- end %> | ||
</div> |
This file contains 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 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 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 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,10 +1,6 @@ | ||
<%= form_with(model: tag.location) do |form| %> | ||
<div class="flex flex-col gap-5"> | ||
<div> | ||
<%= render "text_field", attribute: :label, form: form %> | ||
<%= form.label :is_group, "Is this a menu group?" %> | ||
<%= form.check_box :is_group %> | ||
</div> | ||
<%= form.submit %> | ||
</div> | ||
|
||
<%= render "text_field", attribute: :label, form: form %> | ||
|
||
<%= form.submit %> | ||
<%- end %> |
This file was deleted.
Oops, something went wrong.
This file contains 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,40 +1,16 @@ | ||
<%- breadcrumb :marketplace_tags, marketplace %> | ||
<%= render CardComponent.new do |card| %> | ||
<div class="flex flex-col gap-4"> | ||
<div> | ||
<h1>Menu Groups</h1> | ||
<%- if marketplace.tags.group_tag.empty? %> | ||
There are currently no tags marked as Menu Groups | ||
<% else %> | ||
<p>Drag and drop to change the order in which groups will display on your Marketplace</p> | ||
<ul data-tag-list-test data-controller="sortable" data-sortable-animation-value="150" data-sortable-resource-name-value="tag" class="flex flex-col gap-2 p-0"> | ||
<%- marketplace.tags.group_tag.by_position.each do |tag| %> | ||
<li data-sortable-update-url="<%= polymorphic_path(tag.location) %>" id="<%= dom_id(tag)%>" class="items-center rounded-md bg-gray-50 px-2 py-1 font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 list-none cursor-move"> | ||
<%= render SvgComponent.new(icon: "bars_3", classes: "w-6 h-6 inline-block") %> | ||
<%= link_to tag.label, tag.location(:edit) %> | ||
</li> | ||
<%- end %> | ||
<%- end%> | ||
</ul> | ||
<%- marketplace.tags.each do |tag| %> | ||
<div id="<%= dom_id(tag)%>" class="flex flex-row gap-3"> | ||
<span class="flex-grow"> | ||
<%= tag.label %> | ||
</span> | ||
</div> | ||
<div> | ||
<h1>Tags</h1> | ||
<p>Adding tags to your products like "vegan" or "discounted" will help shoppers more easily find what they want</p> | ||
<div class="flex space-x-2"> | ||
<%- marketplace.tags.not_group.each do |tag| %> | ||
<span id="<%= dom_id(tag)%>" class="rounded-md bg-gray-50 px-2 py-1 font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10"> | ||
<%= link_to tag.label, tag.location(:edit) %> | ||
</span> | ||
<%- end %> | ||
</div> | ||
</div> | ||
<div> | ||
<%- card.with_footer(variant: :action_bar) do %> | ||
<%- new_tag = marketplace.tags.new %> | ||
<%- if policy(new_tag).create? %> | ||
<%= link_to t("marketplace.tags.new.link_to"), marketplace.location(:new, child: :tag), class: "button w-full" %> | ||
<%- end %> | ||
<%- end %> | ||
</div> | ||
</div> | ||
<%- end %> | ||
<%- card.with_footer(variant: :action_bar) do %> | ||
<%- new_tag = marketplace.tags.new %> | ||
<%- if policy(new_tag).create? %> | ||
<%= link_to t("marketplace.tags.new.link_to"), marketplace.location(:new, child: :tag), class: "button w-full" %> | ||
<%- end %> | ||
<%- end %> | ||
<%- end %> |
This file contains 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 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
7 changes: 0 additions & 7 deletions
7
db/migrate/20240514174529_add_position_index_to_marketplace_tags.rb
This file was deleted.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
|
@@ -4,8 +4,6 @@ | |
OPERATOR_EMAIL = "[email protected]" | ||
MEMBER_EMAIL = "[email protected]" | ||
|
||
raise "Your database contains data. Run `rails db:seed:replant` to truncate and re-seed it." if Space.exists? | ||
|
||
FactoryBot.create(:person, :operator, name: "Ollie Operator", email: OPERATOR_EMAIL) | ||
|
||
space = FactoryBot.create(:space, :with_members, :with_entrance, name: "Stevie's Space") | ||
|
@@ -32,15 +30,7 @@ | |
description: "A marvelous marketplace for magic merchandise.", | ||
hero_image: FactoryBot.create(:media) | ||
) | ||
marketplace = FactoryBot.create(:marketplace, :ready_for_shopping, product_quantity: 16, room: marketplace_section) | ||
magic_menu_group = FactoryBot.create(:marketplace_tag, :group, marketplace: marketplace, label: "Magic") | ||
fire_tag = FactoryBot.create(:marketplace_tag, marketplace: marketplace, label: "🔥") | ||
marketplace.products.sample(8).each do |product| | ||
product.tags << magic_menu_group | ||
end | ||
marketplace.products.sample(8).each do |product| | ||
product.tags << fire_tag | ||
end | ||
FactoryBot.create(:marketplace, :full, room: marketplace_section) | ||
|
||
journal_section = FactoryBot.create( | ||
:room, space:, name: "Jazzy Journal", | ||
|
This file contains 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
File renamed without changes.
7 changes: 1 addition & 6 deletions
7
.../furniture/marketplace/marketplace_tag.rb → spec/factories/marketplace/tags.rb
This file contains 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,11 +1,6 @@ | ||
FactoryBot.define do | ||
factory :marketplace_tag, class: "Marketplace::Tag" do | ||
marketplace { association(:marketplace) } | ||
sequence(:label) { |n| "#{Faker::Food.allergen} #{n}" } | ||
sequence(:position) { |n| n } | ||
|
||
trait :group do | ||
is_group { true } | ||
end | ||
marketplace | ||
end | ||
end |
68 changes: 0 additions & 68 deletions
68
spec/furniture/marketplace/marketplace_tags_system_spec.rb
This file was deleted.
Oops, something went wrong.
This file contains 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 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
Oops, something went wrong.