Skip to content

Commit

Permalink
Merge pull request #286 from diegosteiner/develop
Browse files Browse the repository at this point in the history
Release 23.12.1
  • Loading branch information
diegosteiner committed Dec 20, 2023
2 parents 02d311c + 0bf385d commit 31eba4d
Show file tree
Hide file tree
Showing 114 changed files with 2,682 additions and 1,993 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## Unreleased

## Version 23.12.1

Released on 19.12.2023

- Feature: Add global searchbar and improve filters
- Feature: Add occupancies to booking form
- Feature: Set default times for bookings
- Feature: Do not show payment info when amount is not positive
- Improvement: Improve responsiveness of layout
- Bugfixes

## Version 23.11.2

Released on 28.11.2023
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### === base === ###
FROM ruby:3.2.2-alpine AS base
RUN apk add --no-cache --update postgresql-dev tzdata libssl1.1 nodejs
RUN apk add --no-cache --update postgresql-dev tzdata nodejs
RUN gem install bundler

### === development === ###
Expand Down
80 changes: 40 additions & 40 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,27 +77,27 @@ GEM
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.5)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
rake (>= 10.4, < 14.0)
ast (2.4.2)
aws-eventstream (1.2.0)
aws-partitions (1.853.0)
aws-sdk-core (3.187.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-eventstream (1.3.0)
aws-partitions (1.869.0)
aws-sdk-core (3.190.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.72.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sdk-kms (1.75.0)
aws-sdk-core (~> 3, >= 3.188.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.137.0)
aws-sdk-core (~> 3, >= 3.181.0)
aws-sdk-s3 (1.141.0)
aws-sdk-core (~> 3, >= 3.189.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.1)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
babel-source (5.8.35)
babel-transpiler (0.7.0)
Expand All @@ -108,14 +108,14 @@ GEM
statsd-ruby (~> 1.1)
base64 (0.2.0)
bcrypt (3.1.20)
bigdecimal (3.1.4)
bigdecimal (3.1.5)
blueprinter (0.30.0)
bootsnap (1.17.0)
msgpack (~> 1.2)
bootstrap_form (5.4.0)
actionpack (>= 6.1)
activemodel (>= 6.1)
brakeman (6.0.1)
brakeman (6.1.0)
builder (3.2.4)
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
Expand All @@ -140,7 +140,7 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
countries (5.7.0)
countries (5.7.1)
unaccent (~> 0.3)
country_select (8.0.3)
countries (~> 5.0)
Expand Down Expand Up @@ -185,7 +185,7 @@ GEM
railties (>= 5.0.0)
faker (3.2.2)
i18n (>= 1.8.11, < 2)
faraday (2.7.11)
faraday (2.7.12)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
Expand Down Expand Up @@ -218,19 +218,19 @@ GEM
terminal-table (>= 1.5.1)
i18n-tasks-csv (1.1)
i18n-tasks (~> 0.9)
icalendar (2.10.0)
icalendar (2.10.1)
ice_cube (~> 0.16)
ice_cube (0.16.4)
inline_svg (1.9.0)
activesupport (>= 3.0)
nokogiri (>= 1.6)
interception (0.5)
io-console (0.6.0)
irb (1.9.0)
io-console (0.7.1)
irb (1.10.1)
rdoc
reline (>= 0.3.8)
jmespath (1.6.2)
json (2.6.3)
json (2.7.1)
kramdown (2.4.0)
rexml
language_server-protocol (3.17.0.3)
Expand Down Expand Up @@ -263,7 +263,7 @@ GEM
msgpack (1.7.2)
multi_json (1.15.0)
mutex_m (0.2.0)
net-imap (0.4.5)
net-imap (0.4.8)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -272,11 +272,11 @@ GEM
timeout
net-smtp (0.4.0)
net-protocol
nio4r (2.6.0)
nio4r (2.7.0)
nokogiri (1.15.5-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.23.0)
parallel (1.24.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
Expand All @@ -302,15 +302,15 @@ GEM
pry-rescue (1.5.2)
interception (>= 0.5)
pry (>= 0.12.0)
psych (5.1.1.1)
psych (5.1.2)
stringio
public_suffix (5.0.4)
puma (6.4.0)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.7.3)
rack (3.0.8)
rack-mini-profiler (3.1.1)
rack-mini-profiler (3.3.0)
rack (>= 1.2.0)
rack-proxy (0.7.7)
rack
Expand Down Expand Up @@ -360,7 +360,7 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.6.0)
rdoc (6.6.2)
psych (>= 4.0.0)
react-rails (3.1.1)
babel-transpiler (>= 0.7.0)
Expand All @@ -370,10 +370,10 @@ GEM
tilt
redis (5.0.8)
redis-client (>= 0.17.0)
redis-client (0.18.0)
redis-client (0.19.0)
connection_pool
regexp_parser (2.8.2)
reline (0.4.0)
regexp_parser (2.8.3)
reline (0.4.1)
io-console (~> 0.5)
request_store (1.5.1)
rack (>= 1.4)
Expand All @@ -393,7 +393,7 @@ GEM
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.3)
rspec-rails (6.1.0)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
Expand All @@ -402,15 +402,15 @@ GEM
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.1)
rubocop (1.57.2)
rubocop (1.59.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
Expand All @@ -419,10 +419,10 @@ GEM
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.22.2)
rubocop-performance (1.20.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.23.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
Expand All @@ -434,7 +434,7 @@ GEM
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
selenium-webdriver (4.15.0)
selenium-webdriver (4.16.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
Expand All @@ -449,7 +449,7 @@ GEM
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
redis-client (>= 0.14.0)
sidekiq-cron (1.11.0)
sidekiq-cron (1.12.0)
fugit (~> 1.8)
globalid (>= 1.0.1)
sidekiq (>= 6)
Expand All @@ -468,9 +468,9 @@ GEM
railties (>= 3.1)
slim (>= 3.0, < 6.0, != 5.0.0)
squasher (0.7.2)
statesman (11.0.0)
statesman (12.0.0)
statsd-ruby (1.5.0)
stringio (3.0.9)
stringio (3.1.0)
temple (0.10.3)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
V23.11.2
V23.12.1
2 changes: 1 addition & 1 deletion app/concerns/timespanable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def define_timespan_scopes

def timespan_scope_lambda(arel_column)
lambda do |before: nil, after: nil|
return where(arel_column.between(after..before)) if before.present? || after.present?
where(arel_column.between(after..before)) if before.present? || after.present?
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/manage/designated_documents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class DesignatedDocumentsController < BaseController
load_and_authorize_resource :designated_document

def index
@designated_documents = @designated_documents.where(organisation: current_organisation)
@designated_documents = @designated_documents.where(organisation: current_organisation).order(created_at: :ASC)
respond_with :manage, @designated_documents
end

Expand Down
1 change: 1 addition & 0 deletions app/controllers/manage/tarifs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class TarifsController < BaseController

def index
@tarifs = @tarifs.where(organisation: current_organisation).ordered
@tarifs = @tarifs.kept if params[:all].blank?
respond_with :manage, @tarifs
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/public/homes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class HomesController < BaseController
load_and_authorize_resource :home

def index
@homes = @homes.where(organisation: current_organisation)
@homes = @homes.where(organisation: current_organisation).active
respond_with :public, @homes
end

Expand Down
6 changes: 4 additions & 2 deletions app/controllers/public/organisations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
module Public
class OrganisationsController < BaseController
before_action :set_organisation
# authorize_resource :organisation

def show
redirect_to homes_path
respond_to do |format|
format.html { redirect_to homes_path }
format.json { render json: OrganisationSerializer.render_as_json(@organisation) }
end
end

protected
Expand Down
3 changes: 2 additions & 1 deletion app/domain/booking_actions/manage/email_contract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class EmailContract < BookingActions::Base
autodeliver: false)

def call!
mail = MailTemplate.use!(:awaiting_contract_notification, booking, to: :tenant, contract:, invoices: deposits)
mail = MailTemplate.use!(:awaiting_contract_notification, booking, to: :tenant, booking:, contract:,
invoices: deposits)
mail.attach :contract, :contract_documents, deposits
mail.save! && contract.sent! && deposits.each(&:sent!)

Expand Down
2 changes: 2 additions & 0 deletions app/domain/booking_states/cancelled_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module BookingStates
class CancelledRequest < Base
templates << MailTemplate.define(:cancelled_request_notification, context: %i[booking])
templates << MailTemplate.define(:manage_cancelled_request_notification, context: %i[booking])

def checklist
[]
Expand All @@ -20,6 +21,7 @@ def self.to_sym
booking.free!
booking.conclude
booking.deadline&.clear
MailTemplate.use(:manage_cancelled_request_notification, booking, to: :administration, &:autodeliver)
MailTemplate.use(:cancelled_request_notification, booking,
to: booking.agent_booking ? :booking_agent : :tenant, &:autodeliver)
end
Expand Down
52 changes: 52 additions & 0 deletions app/javascript/components/calendar/Calendar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { Dispatch, SetStateAction, createContext, useState } from "react";
import MonthsCalendar from "./MonthsCalendar";
import YearCalendar from "./YearCalendar";
import * as React from "react";
import { DateElementFactory } from "./CalendarDate";
import { CalendarNav } from "./CalendarNav";
import getYear from "date-fns/getYear";
import addMonths from "date-fns/addMonths";
import subMonths from "date-fns/subMonths";
import { parseDate } from "../../services/date";

type CalendarProps = {
initialFirstDate?: string;
dateElementFactory: DateElementFactory;
defaultView?: ViewType;
months?: number;
};

export type ViewType = "months" | "year";
type CalendarViewContextType = {
view: ViewType;
setView?: Dispatch<SetStateAction<ViewType>>;
};
export const CalendarViewContext = createContext<CalendarViewContextType>({ view: "months" });

function Calendar({ initialFirstDate, defaultView, months, dateElementFactory }: CalendarProps) {
const [view, setView] = useState<ViewType>(defaultView || "months");
const [firstDate, setFirstDate] = useState<Date>(parseDate(initialFirstDate));
const gotoNextMonth = () => setFirstDate((prevFirstDate) => addMonths(prevFirstDate, 1));
const gotoPrevMonth = () => setFirstDate((prevFirstDate) => subMonths(prevFirstDate, 1));
const gotoToday = () => setFirstDate(new Date());

return (
<CalendarViewContext.Provider value={{ view, setView }}>
<div className="calendar">
<CalendarNav onNext={gotoNextMonth} onPrev={gotoPrevMonth} onToday={gotoToday}>
{getYear(firstDate)}
</CalendarNav>
{({ months: MonthsCalendar, year: YearCalendar }[view] || MonthsCalendar)({
firstDate,
months,
dateElementFactory,
})}
<CalendarNav onNext={gotoNextMonth} onPrev={gotoPrevMonth} onToday={gotoToday}>
{getYear(firstDate)}
</CalendarNav>
</div>
</CalendarViewContext.Provider>
);
}

export default Calendar;
Loading

0 comments on commit 31eba4d

Please sign in to comment.