Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gem 'devise', '~> 4.8.1'
gem 'devise_invitable', '~> 2.0.9'
gem 'devise-pwned_password'
gem 'devise_uid'
gem 'pg', '1.1.4'
gem 'pg', '>= 1.4'
gem "recaptcha"
gem 'resque', '2.6.0'
gem 'resque-scheduler', '4.10.2'
Expand Down
8 changes: 6 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ GEM
parser (3.2.2.4)
ast (~> 2.4.1)
racc
pg (1.1.4)
pg (1.6.1-aarch64-linux)
pg (1.6.1-arm64-darwin)
pg (1.6.1-x86_64-darwin)
pg (1.6.1-x86_64-linux)
premailer (1.18.0)
addressable
css_parser (>= 1.12.0)
Expand Down Expand Up @@ -613,6 +616,7 @@ PLATFORMS
aarch64-linux
arm64-darwin-21
arm64-darwin-22
arm64-darwin-24
x86_64-darwin-20
x86_64-darwin-21
x86_64-linux
Expand Down Expand Up @@ -653,7 +657,7 @@ DEPENDENCIES
omniauth-facebook
omniauth-google-oauth2 (~> 1.0.1)
omniauth-rails_csrf_protection (~> 1.0.1)
pg (= 1.1.4)
pg (>= 1.4)
premailer-rails
pry-byebug
pry-rails
Expand Down
5 changes: 4 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@

<body class="content <%= (user_signed_in? && !static_page?) || secret_share_path? ? 'dashboard' : 'static' %>">
<%= react_component('SkipToContent', props: { id: 'mainContent' })%>
<%= react_component('Header', props: header_props) %>
<%= react_component('Header', props: header_props.merge(
locale: @locale.to_s,
locales: @locales.map(&:to_s)
)) %>
<main>
<%= react_component('Toast', props: {
notice: notice.present? ? notice : '',
Expand Down
1 change: 0 additions & 1 deletion app/views/shared/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<%= link_to(t('pages.resources.emergency'), "/resources?filter[]=#{t('pages.resources.tags.hotlines')}") %>
</div>
<div class="footerExtras">
<%= react_component('ToggleLocale', props: { locale: @locale, locales: @locales }) %>
<div>
<%= sanitize t('shared.footer.licence_subtitle',
licence: link_to(t('shared.footer.licence'), 'https://github.com/ifmeorg/ifme/blob/main/LICENSE.txt', target: '_blank'))
Expand Down
41 changes: 37 additions & 4 deletions client/app/components/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,31 @@ import { HeaderProfile } from 'components/Header/HeaderProfile';
import type { Profile, Link } from './types';
import css from './Header.scss';
import { useFocusTrap } from '../../hooks';
import { ToggleLocale } from '../../widgets/ToggleLocale';

export type Props = {
home: Link,
links: Link[],
mobileOnly?: any,
profile?: Profile,
locale: string,
locales: string[],
};

export type State = {
mobileNavOpen: boolean,
};

export const Header = ({
home, links, mobileOnly, profile,
home,
links,
mobileOnly,
profile,
locale,
locales,
}: Props): Node => {
console.log('Locale props:', locale, locales);

const [mobileNavOpen, setMobileNavOpen] = useState(false);
const [scrolled, setScrolled] = useState(false);
const navigationRef = useRef(null);
Expand Down Expand Up @@ -96,7 +106,18 @@ export const Header = ({
{displayToggle()}
</div>
{!mobileNavOpen && (
<div className={css.headerDesktopNavLinks}>{displayLinks()}</div>
<div className={css.headerDesktopNavLinks}>
{displayLinks()}
<div
style={{
transform: 'scale(0.88)',
transformOrigin: 'left center',
marginTop: '-15px',
}}
>
<ToggleLocale locale={locale} locales={locales} />
</div>
</div>
)}
</div>
</div>
Expand Down Expand Up @@ -147,7 +168,19 @@ export const Header = ({
};

export default ({
home, links, mobileOnly, profile,
home,
links,
mobileOnly,
profile,
locale,
locales,
}: Props): Node => (
<Header home={home} links={links} mobileOnly={mobileOnly} profile={profile} />
<Header
home={home}
links={links}
mobileOnly={mobileOnly}
profile={profile}
locale={locale}
locales={locales}
/>
);
2 changes: 1 addition & 1 deletion client/app/widgets/ToggleLocale/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type Props = {
locales: string[],
};

const options = (locales) => {
const options = (locales = []) => {
const result = [];
locales.forEach((locale: string) => {
result.push({
Expand Down
70 changes: 35 additions & 35 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@

create_table "allyships", force: :cascade do |t|
t.integer "user_id"
t.datetime "created_at", precision: nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's omit this file's changes from this PR!

t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
t.integer "ally_id"
t.integer "status"
end

create_table "bootsy_image_galleries", force: :cascade do |t|
t.integer "bootsy_resource_id"
t.string "bootsy_resource_type"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "bootsy_images", force: :cascade do |t|
t.string "image_file"
t.integer "image_gallery_id"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "care_plan_contacts", force: :cascade do |t|
Expand All @@ -47,8 +47,8 @@
create_table "categories", force: :cascade do |t|
t.string "name"
t.text "description"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
t.integer "user_id"
t.string "slug"
t.boolean "visible", default: true
Expand All @@ -60,8 +60,8 @@
t.integer "commentable_id"
t.integer "comment_by"
t.text "comment"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
t.string "visibility"
t.text "viewers"
t.index ["commentable_type", "commentable_id"], name: "index_comments_on_commentable_type_and_commentable_id"
Expand All @@ -83,14 +83,14 @@
t.integer "group_id"
t.integer "user_id"
t.boolean "leader"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "groups", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
t.text "description"
t.string "slug"
t.index ["slug"], name: "index_groups_on_slug", unique: true
Expand All @@ -99,9 +99,9 @@
create_table "medications", force: :cascade do |t|
t.string "name"
t.integer "dosage"
t.datetime "refill", precision: nil
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.timestamptz "refill"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "user_id"
t.integer "total"
t.integer "strength"
Expand All @@ -119,8 +119,8 @@
t.integer "meeting_id"
t.integer "user_id"
t.boolean "leader"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
t.string "google_cal_event_id"
end

Expand All @@ -131,8 +131,8 @@
t.string "time"
t.integer "maxmembers"
t.integer "group_id"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
t.string "date"
t.string "slug"
t.index ["slug"], name: "index_meetings_on_slug", unique: true
Expand All @@ -153,8 +153,8 @@
t.string "name"
t.text "why"
t.text "fix"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
t.integer "user_id"
t.text "viewers"
t.boolean "comment"
Expand Down Expand Up @@ -189,8 +189,8 @@
create_table "moods", force: :cascade do |t|
t.string "name"
t.text "description"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
t.integer "user_id"
t.string "slug"
t.boolean "visible", default: true
Expand Down Expand Up @@ -233,8 +233,8 @@
t.text "description"
t.text "viewers"
t.boolean "comment"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
t.string "name"
t.string "slug"
t.datetime "published_at", precision: nil
Expand All @@ -253,8 +253,8 @@
t.integer "user_id"
t.string "support_type"
t.text "support_ids"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "take_medication_reminders", id: :serial, force: :cascade do |t|
Expand All @@ -268,15 +268,15 @@
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at", precision: nil
t.datetime "remember_created_at", precision: nil
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at", precision: nil
t.datetime "last_sign_in_at", precision: nil
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.datetime "created_at"
t.datetime "updated_at"
t.string "name"
t.string "location"
t.string "timezone"
Expand Down
7 changes: 7 additions & 0 deletions spec/support/cloudinary_mock.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
RSpec.configure do |config|
config.before(:each) do
allow(Cloudinary::Utils).to receive(:cloudinary_url).and_return("https://res.cloudinary.com/test/image/upload/fake.jpg")
allow(Cloudinary::Uploader).to receive(:upload).and_return({ "public_id" => "fake_id" })
allow(Cloudinary::Uploader).to receive(:destroy).and_return({ "result" => "ok" })
end
end