Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…g-team1 into IK/CR-28_VolunteerCard
  • Loading branch information
IrynaKolh committed Jan 15, 2025
2 parents 9692820 + ed5b280 commit e6608aa
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 63 deletions.
4 changes: 2 additions & 2 deletions back-end/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ gem "rubocop", "~> 1.68", require: false

gem "rubocop-github", "~> 0.20.0", require: false

# gem "pg", "~> 1.5"
gem "pg", "~> 1.5"

gem "dotenv", "~> 3.1"

gem 'carrierwave', '~> 2.2'
gem 'cloudinary', '~> 1.24.0'

gem "sqlite3", ">= 1.4"
# gem "sqlite3", ">= 1.4"

group :test do
gem 'database_cleaner-active_record'
Expand Down
13 changes: 2 additions & 11 deletions back-end/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ GEM
parser (3.3.6.0)
ast (~> 2.4.1)
racc
pg (1.5.9)
psych (5.2.2)
date
stringio
Expand Down Expand Up @@ -323,16 +324,6 @@ GEM
ffi (~> 1.12)
logger
securerandom (0.4.1)
sqlite3 (2.4.1-aarch64-linux-gnu)
sqlite3 (2.4.1-aarch64-linux-musl)
sqlite3 (2.4.1-arm-linux-gnu)
sqlite3 (2.4.1-arm-linux-musl)
sqlite3 (2.4.1-arm64-darwin)
sqlite3 (2.4.1-x86-linux-gnu)
sqlite3 (2.4.1-x86-linux-musl)
sqlite3 (2.4.1-x86_64-darwin)
sqlite3 (2.4.1-x86_64-linux-gnu)
sqlite3 (2.4.1-x86_64-linux-musl)
ssrf_filter (1.2.0)
stringio (3.1.2)
strong_password (0.0.10)
Expand Down Expand Up @@ -379,6 +370,7 @@ DEPENDENCIES
factory_bot_rails
faker
kaminari
pg (~> 1.5)
puma (>= 5.0)
rack (= 2.2.8.1)
rack-cors
Expand All @@ -387,7 +379,6 @@ DEPENDENCIES
rspec-rails
rubocop (~> 1.68)
rubocop-github (~> 0.20.0)
sqlite3 (>= 1.4)
strong_password (~> 0.0.10)
tzinfo-data

Expand Down
76 changes: 38 additions & 38 deletions back-end/config/database.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# default: &default
# adapter: postgresql
# encoding: unicode
# pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
# username: <%= ENV["DB_USERNAME"] %>
# password: <%= ENV["DB_PASSWORD"] %>
# host: <%= ENV["DB_HOST"] %>
# port: <%= ENV["DB_PORT"] %>

# development:
# <<: *default
# database: careconnect_development

# test:
# <<: *default
# database: careconnect_test

# production:
# <<: *default
# database: careconnect_production




# SQLite. Versions 3.8.0 and up are supported.
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem "sqlite3"
#
default: &default
adapter: sqlite3
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000
username: <%= ENV["DB_USERNAME"] %>
password: <%= ENV["DB_PASSWORD"] %>
host: <%= ENV["DB_HOST"] %>
port: <%= ENV["DB_PORT"] %>

development:
<<: *default
database: storage/development.sqlite3
database: careconnect_development

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: storage/test.sqlite3
database: careconnect_test

production:
<<: *default
database: storage/production.sqlite3
database: careconnect_production




# # SQLite. Versions 3.8.0 and up are supported.
# # gem install sqlite3

# # Ensure the SQLite 3 gem is defined in your Gemfile
# # gem "sqlite3"

# default: &default
# adapter: sqlite3
# pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
# timeout: 5000

# development:
# <<: *default
# database: storage/development.sqlite3

# # Warning: The database defined as "test" will be erased and
# # re-generated from your development database when you run "rake".
# # Do not set this db to the same as development or production.
# test:
# <<: *default
# database: storage/test.sqlite3

# production:
# <<: *default
# database: storage/production.sqlite3
3 changes: 3 additions & 0 deletions back-end/db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion front-end/src/components/navbars/VolunteerDashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function VolunteerDashboard() {
</div>
{loading && <p className="text-center text-blue-500">Uploading...</p>}
{error && <p className="text-center text-red-500">{error}</p>}
<p className="text-center text-xs mt-2 mb-10">Member since {formattedDate}</p>
<p className="text-center text-xs mt-2">Member since {formattedDate}</p>
<div className="w-full">
<nav className="flex flex-col sm:m-10 lg:m-20">
<ul className="w-full">
Expand Down
8 changes: 4 additions & 4 deletions front-end/src/components/pages/organization/InfoPage.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react'; //, useRef
import { useParams } from 'react-router-dom';
import RequestCard from '../cards/RequestCard.jsx';
import logoExample from '../../assets/images_default/logo_example.png';
import logoExample from '../../assets/images_default/logo_example.jpg';
import { FaEnvelope, FaGlobe, FaHeart, FaMapMarkerAlt, FaPhoneAlt } from 'react-icons/fa';
import { fetchMyOrgRequests, getOneOrganizationById } from '../../../utils/apiReqests';
import formatServices from '../../../utils/FormatServices.jsx';
Expand Down Expand Up @@ -162,7 +162,7 @@ function InfoPage() {
<div className="flex items-center justify-between lg:ml-7 mt-5 mb-5">
<div className="lg:w-20 xs:w-16 md:w-18">
<img
src={organization?.logo || logoExample}
src={organization?.logo.url || logoExample}
alt={`${organization?.name || 'Organization'} logo`}
className="w-full h-full object-contain"
/>
Expand All @@ -178,7 +178,7 @@ function InfoPage() {
<FaMapMarkerAlt className="mr-2" />
<span>
{organization?.address?.street}, {organization?.address?.city}, {organization?.address?.state},{' '}
{organization?.address?.zipCode}
{organization?.address?.zip_code}
</span>
</div>
<div className="flex items-center mb-2">
Expand Down Expand Up @@ -235,7 +235,7 @@ function InfoPage() {
) : (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 24 24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ function OrganizationForm() {

const handleSubmit = async (values) => {
try {
// delete logo
const { logo, ...updatedValues } = values;
let response;
if (myOrganization) {
response = await updateOrganization(myOrganization.id, values);
response = await updateOrganization(myOrganization.id, updatedValues);
dispatch({ type: 'SET_MY_ORGANIZATION', payload: response.organization });
if (response) {
toast.success('Organization updated successfully!');
Expand All @@ -60,7 +62,7 @@ function OrganizationForm() {
throw new Error('Failed to update organization');
}
} else {
response = await createOrganization(values);
response = await createOrganization(updatedValues);
dispatch({ type: 'SET_MY_ORGANIZATION', payload: response.organization });
if (response) {
toast.success('Organization created successfully!');
Expand Down
12 changes: 7 additions & 5 deletions front-end/src/components/search/OrganizationList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ const OrganizationList = ({ organizations, toggleFavorite, handleCardClick, favo

{/* Logo */}
<div className="flex justify-center">
{org.logo ? (
<img src={org.logo} alt={`logo`} className="w-16 h-16 object-cover rounded-full" />
{org.logo?.url ? (
<img src={org.logo.url} alt={`Organization logo`} className="w-16 h-16 object-cover rounded-full" />
) : (
<div className="w-16 h-16 bg-gray-300 rounded-full flex items-center justify-center">
<span className="text-gray-500">LOGO</span>
</div>
<img
src="src/components/assets/images_default/logo_example.jpg" // Укажите путь к вашему дефолтному изображению
alt="Default logo"
className="w-16 h-16 object-cover rounded-full"
/>
)}
</div>

Expand Down

0 comments on commit e6608aa

Please sign in to comment.