Skip to content

Commit a58228a

Browse files
sokiealessiocappa
authored andcommitted
Category improvements (we-promise#232)
* Category improvements - Updated default categories to a more inclusive set - Updated default icon set for categories - Updated default categories colors to better separate then. * FIX tests * Better color pallettes for a few
1 parent be1169d commit a58228a

File tree

2 files changed

+34
-14
lines changed

2 files changed

+34
-14
lines changed

app/models/category.rb

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,20 @@ def initialize(category, subcategories = nil)
4747

4848
class << self
4949
def icon_codes
50-
%w[bus circle-dollar-sign ambulance apple award baby battery lightbulb bed-single beer bluetooth book briefcase building credit-card camera utensils cooking-pot cookie dices drama dog drill drum dumbbell gamepad-2 graduation-cap house hand-helping ice-cream-cone phone piggy-bank pill pizza printer puzzle ribbon shopping-cart shield-plus ticket trees]
50+
%w[
51+
ambulance apple award baby banknote barcode bath battery bed-single beer bike
52+
bluetooth bone book book-open briefcase building bus cake calculator camera
53+
car cat circle-dollar-sign coffee coins compass cookie cooking-pot credit-card
54+
dices dog drama drill droplet drum dumbbell film flame flower fuel gamepad-2
55+
gift glasses globe graduation-cap hammer hand-helping headphones heart
56+
heart-pulse home house ice-cream-cone key landmark laptop leaf lightbulb
57+
luggage mail map-pin mic monitor moon music package palette paw-print pen
58+
pencil phone piggy-bank pill pizza plane plug power printer puzzle receipt
59+
ribbon scale scissors settings shield shield-plus shirt shopping-bag
60+
shopping-cart smartphone sparkles sprout stethoscope store sun tag target
61+
tent thermometer ticket train trees trophy truck tv umbrella users utensils
62+
video wallet waves wifi wine wrench zap
63+
]
5164
end
5265

5366
def bootstrap!
@@ -71,20 +84,27 @@ def uncategorized
7184
private
7285
def default_categories
7386
[
74-
[ "Income", "#e99537", "circle-dollar-sign", "income" ],
75-
[ "Loan Payments", "#6471eb", "credit-card", "expense" ],
76-
[ "Fees", "#6471eb", "credit-card", "expense" ],
77-
[ "Entertainment", "#df4e92", "drama", "expense" ],
78-
[ "Food & Drink", "#eb5429", "utensils", "expense" ],
79-
[ "Shopping", "#e99537", "shopping-cart", "expense" ],
80-
[ "Home Improvement", "#6471eb", "house", "expense" ],
87+
[ "Income", "#22c55e", "circle-dollar-sign", "income" ],
88+
[ "Food & Drink", "#f97316", "utensils", "expense" ],
89+
[ "Groceries", "#407706", "shopping-bag", "expense" ],
90+
[ "Shopping", "#3b82f6", "shopping-cart", "expense" ],
91+
[ "Transportation", "#0ea5e9", "bus", "expense" ],
92+
[ "Travel", "#2563eb", "plane", "expense" ],
93+
[ "Entertainment", "#a855f7", "drama", "expense" ],
8194
[ "Healthcare", "#4da568", "pill", "expense" ],
82-
[ "Personal Care", "#4da568", "pill", "expense" ],
83-
[ "Services", "#4da568", "briefcase", "expense" ],
95+
[ "Personal Care", "#14b8a6", "scissors", "expense" ],
96+
[ "Home Improvement", "#d97706", "house", "expense" ],
97+
[ "Mortgage / Rent", "#b45309", "home", "expense" ],
98+
[ "Utilities", "#eab308", "lightbulb", "expense" ],
99+
[ "Subscriptions", "#6366f1", "wifi", "expense" ],
100+
[ "Insurance", "#0284c7", "shield", "expense" ],
101+
[ "Sports & Fitness", "#10b981", "dumbbell", "expense" ],
84102
[ "Gifts & Donations", "#61c9ea", "hand-helping", "expense" ],
85-
[ "Transportation", "#df4e92", "bus", "expense" ],
86-
[ "Travel", "#df4e92", "plane", "expense" ],
87-
[ "Rent & Utilities", "#db5a54", "lightbulb", "expense" ]
103+
[ "Taxes", "#dc2626", "landmark", "expense" ],
104+
[ "Loan Payments", "#e11d48", "credit-card", "expense" ],
105+
[ "Services", "#7c3aed", "briefcase", "expense" ],
106+
[ "Fees", "#6b7280", "receipt", "expense" ],
107+
[ "Savings & Investments", "#059669", "piggy-bank", "expense" ]
88108
]
89109
end
90110
end

test/controllers/categories_controller_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class CategoriesControllerTest < ActionDispatch::IntegrationTest
8484
end
8585

8686
test "bootstrap" do
87-
assert_difference "Category.count", 12 do
87+
assert_difference "Category.count", 19 do
8888
post bootstrap_categories_url
8989
end
9090

0 commit comments

Comments
 (0)