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

Osbl creation fourth panel locations #153

Merged
merged 31 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e4358a3
Add location management to contribution form
mpressen Jan 26, 2025
4dda147
Remove osbl.contact_email attribute & misc
mpressen Jan 26, 2025
110e2d0
Implement multiple annual finance entries with dynamic management
mpressen Jan 28, 2025
4b916c1
Refactor contribution form layout and styling for improved responsive…
mpressen Jan 29, 2025
eec70b1
Enhance annual finance form with dynamic sheet-based editing and impr…
mpressen Jan 30, 2025
95a6457
Add sorting functionality to annual finance entries
mpressen Jan 30, 2025
efbd8ec
Adjust sidebar layout and styling for improved responsiveness
mpressen Jan 30, 2025
42412e8
Replace Inertia Link with custom MyLink component for enhanced naviga…
mpressen Jan 30, 2025
d39492c
Add mobile sidebar close functionality to improve navigation UX
mpressen Jan 30, 2025
171bed1
Add accessibility labels to mobile sidebar for improved screen reader…
mpressen Jan 30, 2025
e05a2ac
Improve fund management section layout and add separators
mpressen Jan 30, 2025
9dbe572
Add error toast notification for form validation in contribution form
mpressen Jan 30, 2025
bd621d7
Improve contribution form layout and add alert for better user guidance
mpressen Jan 30, 2025
f228b15
Improve form validation and error handling in contribution form
mpressen Jan 31, 2025
6e6048a
Refactor OSBL documents section with dynamic sheet-based editing
mpressen Feb 1, 2025
250b724
Enhance MyInput and file input components with improved type safety a…
mpressen Feb 2, 2025
fb4783d
Refactor fund management and finance sections for improved form handling
mpressen Feb 3, 2025
dac71fe
Improve OsblDocumentSheet UI with smoother collapsible animations
mpressen Feb 3, 2025
66a06f3
Refactor locations section with dynamic sheet-based editing and impro…
mpressen Feb 3, 2025
170deb7
Add test mocks and factories for improved testing infrastructure
mpressen Feb 3, 2025
8b82dab
update dependencies
mpressen Feb 3, 2025
0071a29
Simplify fund management section error handling and input validation
mpressen Feb 3, 2025
4e4f989
Add database constraints for addresses, keywords, and intervention areas
mpressen Feb 3, 2025
50e8901
Enhance document and location models with improved validations and te…
mpressen Feb 4, 2025
c4ecb58
Add cascade delete and document attachment cleanup
mpressen Feb 4, 2025
4da141c
Migrate type enums to human-readable strings across models and compon…
mpressen Feb 4, 2025
a541070
Add comprehensive model validations and database constraints
mpressen Feb 4, 2025
542d2f1
Restructure frontend components and improve file organization
mpressen Feb 4, 2025
65be67f
Improve type safety for form errors and data handling
mpressen Feb 4, 2025
4aa7738
Refactor frontend imports and improve type definitions
mpressen Feb 4, 2025
9ee774b
Improve type safety and input validation across frontend components
mpressen Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/[email protected]

- name: Set up Ruby
uses: ruby/setup-ruby@v1.213.0
uses: ruby/setup-ruby@v1.215.0
with:
ruby-version: .ruby-version
bundler-cache: true
Expand All @@ -35,7 +35,7 @@ jobs:
uses: actions/[email protected]

- name: Set up Ruby
uses: ruby/setup-ruby@v1.213.0
uses: ruby/setup-ruby@v1.215.0
with:
ruby-version: .ruby-version
bundler-cache: true
Expand All @@ -52,7 +52,7 @@ jobs:
uses: actions/[email protected]

- name: Setup node
uses: actions/setup-node@v4.1.0
uses: actions/setup-node@v4.2.0
with:
node-version: 20

Expand All @@ -74,13 +74,13 @@ jobs:
uses: actions/[email protected]

- name: Set up Ruby
uses: ruby/setup-ruby@v1.213.0
uses: ruby/setup-ruby@v1.215.0
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Setup node
uses: actions/setup-node@v4.1.0
uses: actions/setup-node@v4.2.0
with:
node-version: 20

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/[email protected]

- name: Set up Ruby
uses: ruby/setup-ruby@v1.213.0
uses: ruby/setup-ruby@v1.215.0
with:
ruby-version: .ruby-version
bundler-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/[email protected]

- name: Set up Ruby
uses: ruby/setup-ruby@v1.213.0
uses: ruby/setup-ruby@v1.215.0
with:
ruby-version: .ruby-version
bundler-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/[email protected]

- name: Set up Ruby
uses: ruby/setup-ruby@v1.213.0
uses: ruby/setup-ruby@v1.215.0
with:
ruby-version: .ruby-version
bundler-cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remove-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/[email protected]

- name: Set up Ruby
uses: ruby/setup-ruby@v1.213.0
uses: ruby/setup-ruby@v1.215.0
with:
ruby-version: .ruby-version
bundler-cache: true
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem "vite_rails", "~> 3.0.19"
# Use sqlite3 as the database for Active Record
gem "sqlite3"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", ">= 6.5.0"
gem "puma", ">= 6.6.0"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
gem "bcrypt", "~> 3.1.20"
Expand Down
40 changes: 22 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ GEM
ast (2.4.2)
authentication-zero (4.0.3)
aws-eventstream (1.3.0)
aws-partitions (1.1040.0)
aws-sdk-core (3.216.0)
aws-partitions (1.1044.0)
aws-sdk-core (3.217.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.97.0)
aws-sdk-core (~> 3, >= 3.216.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.178.0)
aws-sdk-s3 (1.179.0)
aws-sdk-core (~> 3, >= 3.216.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
Expand Down Expand Up @@ -129,8 +129,8 @@ GEM
erubi (1.13.1)
et-orbi (1.2.11)
tzinfo
factory_bot (6.5.0)
activesupport (>= 5.0.0)
factory_bot (6.5.1)
activesupport (>= 6.1.0)
factory_bot_rails (6.4.4)
factory_bot (~> 6.5)
railties (>= 5.0.0)
Expand All @@ -150,7 +150,8 @@ GEM
inertia_rails (3.6.0)
railties (>= 6)
io-console (0.8.0)
irb (1.14.3)
irb (1.15.1)
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jmespath (1.6.2)
Expand All @@ -166,7 +167,7 @@ GEM
sshkit (>= 1.23.0, < 2.0)
thor (~> 1.3)
zeitwerk (>= 2.6.18, < 3.0)
language_server-protocol (3.17.0.3)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
logger (1.6.5)
loofah (2.24.0)
Expand Down Expand Up @@ -198,7 +199,7 @@ GEM
net-protocol
net-protocol (0.2.2)
timeout
net-scp (4.0.0)
net-scp (4.1.0)
net-ssh (>= 2.6.5, < 8.0.0)
net-sftp (4.0.0)
net-ssh (>= 5.0.0, < 8.0.0)
Expand Down Expand Up @@ -236,16 +237,19 @@ GEM
parser (3.3.7.0)
ast (~> 2.4.1)
racc
pp (0.6.2)
prettyprint
prettyprint (0.2.0)
prism (1.3.0)
psych (5.2.3)
date
stringio
public_suffix (6.0.1)
puma (6.5.0)
puma (6.6.0)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.8.1)
rack (3.1.8)
rack (3.1.9)
rack-proxy (0.7.7)
rack
rack-session (2.1.0)
Expand Down Expand Up @@ -322,7 +326,7 @@ GEM
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
rubocop-ast (1.38.0)
parser (>= 3.3.1.0)
rubocop-performance (1.23.1)
rubocop (>= 1.48.1, < 2.0)
Expand All @@ -332,14 +336,14 @@ GEM
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-lsp (0.23.6)
ruby-lsp (0.23.8)
language_server-protocol (~> 3.17.0)
prism (>= 1.2, < 2.0)
rbs (>= 3, < 4)
sorbet-runtime (>= 0.5.10782)
ruby-lsp-rails (0.3.30)
ruby-lsp-rails (0.3.31)
ruby-lsp (>= 0.23.0, < 0.24.0)
ruby-lsp-rspec (0.1.20)
ruby-lsp-rspec (0.1.21)
ruby-lsp (~> 0.23.0)
ruby-progressbar (1.13.0)
rubyzip (2.4.1)
Expand All @@ -350,7 +354,7 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
solid_cable (3.0.5)
solid_cable (3.0.7)
actioncable (>= 7.2)
activejob (>= 7.2)
activerecord (>= 7.2)
Expand All @@ -359,14 +363,14 @@ GEM
activejob (>= 7.2)
activerecord (>= 7.2)
railties (>= 7.2)
solid_queue (1.1.2)
solid_queue (1.1.3)
activejob (>= 7.1)
activerecord (>= 7.1)
concurrent-ruby (>= 1.3.1)
fugit (~> 1.11.0)
railties (>= 7.1)
thor (~> 1.3.1)
sorbet-runtime (0.5.11766)
sorbet-runtime (0.5.11798)
sqlite3 (2.5.0-aarch64-linux-gnu)
sqlite3 (2.5.0-aarch64-linux-musl)
sqlite3 (2.5.0-arm-linux-gnu)
Expand Down Expand Up @@ -466,7 +470,7 @@ DEPENDENCIES
kamal
mailjet (~> 1.8)
overmind
puma (>= 6.5.0)
puma (>= 6.6.0)
rails
rotp (~> 6.3)
rspec-rails
Expand Down
22 changes: 20 additions & 2 deletions app/controllers/users/contributions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ def index
def new
render inertia: "Contribution/New", props: {
causes: Cause.pluck(:name, :id).to_h,
labels: Label.pluck(:id, :name).map { |id, name| {value: id, label: name} }
labels: Label.pluck(:id, :name).map { |id, name| {value: id, label: name} },
location_types: Location.types.keys,
document_types: Document.types.keys,
fund_source_types: FundSource.types.keys,
fund_allocation_types: FundAllocation.types.keys
}
end

Expand Down Expand Up @@ -51,7 +55,6 @@ def osbl_params
:public_utility,
:creation_year,
{osbls_labels_attributes: [:label_id]},
:contact_email,
{annual_finances_attributes: [
:year,
:certified,
Expand All @@ -77,6 +80,21 @@ def osbl_params
:year,
:description
]}
]},
{locations_attributes: [
:type,
:name,
:description,
:website,
{address_attributes: [
:street_number,
:street_name,
:additional_info,
:postal_code,
:city,
:latitude,
:longitude
]}
]}
)
end
Expand Down
6 changes: 3 additions & 3 deletions app/frontend/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { SidebarProvider, SidebarTrigger } from '@/components/ui/sidebar'
const flashTypes = ['message', 'success', 'info', 'warning', 'error'] as const

interface LayoutProps {
children: ReactElement
showSidebar?: boolean
flash: { [key in typeof flashTypes[number]]?: string }
showSidebar: boolean
mpressen marked this conversation as resolved.
Show resolved Hide resolved
flash: any
mpressen marked this conversation as resolved.
Show resolved Hide resolved
children?: ReactElement
}

export default function Layout ({
Expand Down
55 changes: 0 additions & 55 deletions app/frontend/components/forms/MyInput.tsx

This file was deleted.

18 changes: 14 additions & 4 deletions app/frontend/components/layout/AppSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { FilePlus2, Library, NotebookPen } from 'lucide-react'
import { Link, usePage } from '@inertiajs/react'
import { usePage } from '@inertiajs/react'
import { ReactElement } from 'react'
import MyLink from '@/components/shared/MyLink'

import {
Sidebar,
Expand All @@ -9,7 +10,8 @@ import {
SidebarGroupContent,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem
SidebarMenuItem,
useSidebar
} from '@/components/ui/sidebar'

const items = [
Expand All @@ -32,6 +34,13 @@ const items = [

export default function AppSidebar (): ReactElement {
const { url } = usePage()
const { setOpenMobile, isMobile } = useSidebar()

const handleClick = (): void => {
if (isMobile) {
setOpenMobile(false)
}
}

return (
<Sidebar>
Expand All @@ -42,17 +51,18 @@ export default function AppSidebar (): ReactElement {
{items.map((item) => (
<SidebarMenuItem key={item.title}>
<SidebarMenuButton asChild>
<Link
<MyLink
href={item.url}
className={
url === item.url
? ' bg-secondary'
: ' hover:bg-secondary/50'
}
onClick={handleClick}
>
<item.icon />
<span className='font-semibold'>{item.title}</span>
</Link>
</MyLink>
</SidebarMenuButton>
</SidebarMenuItem>
))}
Expand Down
Loading