Skip to content

Commit

Permalink
Merge branch 'release/v1.6.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
odinsride committed May 3, 2020
2 parents cf14b7c + f0e182f commit 8553b4c
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 222 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Expand Up @@ -5,7 +5,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] changes


## [v1.6.3] - 2020-04-17

### Fixed
- An issue with the date picker in Chrome has been fixed by removing bulma-calendar and replacing with a normal date picker field.
- New transactions now default to Debit.

### Changed
- Gems and Yarn dependencies updated

## [v1.6.2] - 2020-04-17

### Changed
Expand Down Expand Up @@ -172,7 +181,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Account overview with list of all accounts and balances for each


[Unreleased]: https://github.com/odinsride/olubalance/compare/v1.6.1...HEAD
[Unreleased]: https://github.com/odinsride/olubalance/compare/v1.6.3...HEAD
[v1.6.3]: https://github.com/odinsride/olubalance/compare/v1.6.3...v1.6.3
[v1.6.2]: https://github.com/odinsride/olubalance/compare/v1.6.1...v1.6.2
[v1.6.1]: https://github.com/odinsride/olubalance/compare/v1.6.0...v1.6.1
[v1.6.0]: https://github.com/odinsride/olubalance/compare/v1.5.0...v1.6.0
[v1.5.0]: https://github.com/odinsride/olubalance/compare/v1.4.5...v1.5.0
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Expand Up @@ -7,7 +7,7 @@ git_source(:github) do |repo_name|
"https://github.com/#{repo_name}.git"
end

ruby '2.6.5'
ruby '2.6.6'

gem 'aws-sdk-s3', '~> 1.60.0'
gem 'devise', '~> 4.7.1'
Expand All @@ -18,9 +18,9 @@ gem 'jquery-rails'
gem 'jquery-turbolinks'
gem 'mini_magick', '~> 4.9.5'
gem 'pagy', '~> 3.7.1'
gem 'pg', '~> 1.1.4'
gem 'pg', '~> 1.2.3'
gem 'puma', '~> 4.3.3'
gem 'rails', '~> 6.0.2.1'
gem 'rails', '~> 6.0.2.2'
gem 'rails-ujs', '~> 0.1.0'
gem 'sassc', '~> 2.2.1'
gem 'sassc-rails', '~> 2.1.2'
Expand Down
26 changes: 13 additions & 13 deletions Gemfile.lock
Expand Up @@ -64,7 +64,7 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.0)
aws-eventstream (1.1.0)
aws-partitions (1.298.0)
aws-partitions (1.308.0)
aws-sdk-core (3.94.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
Expand All @@ -77,17 +77,17 @@ GEM
aws-sdk-core (~> 3, >= 3.83.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.2)
aws-sigv4 (1.1.3)
aws-eventstream (~> 1.0, >= 1.0.2)
bcrypt (3.1.13)
better_errors (2.6.0)
better_errors (2.7.0)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
builder (3.2.4)
byebug (11.1.2)
byebug (11.1.3)
capybara (3.32.1)
addressable
mini_mime (>= 0.1.3)
Expand Down Expand Up @@ -164,9 +164,9 @@ GEM
orm_adapter (0.5.0)
pagy (3.7.5)
parallel (1.19.1)
parser (2.7.1.1)
parser (2.7.1.2)
ast (~> 2.4.0)
pg (1.1.4)
pg (1.2.3)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -217,7 +217,7 @@ GEM
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
rb-fsevent (0.10.3)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (1.7.0)
Expand All @@ -227,8 +227,8 @@ GEM
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.4)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-core (3.9.2)
rspec-support (~> 3.9.3)
rspec-expectations (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
Expand All @@ -243,7 +243,7 @@ GEM
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.2)
rspec-support (3.9.3)
rubocop (0.82.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
Expand Down Expand Up @@ -326,11 +326,11 @@ DEPENDENCIES
listen
mini_magick (~> 4.9.5)
pagy (~> 3.7.1)
pg (~> 1.1.4)
pg (~> 1.2.3)
pry-byebug
pry-rails
puma (~> 4.3.3)
rails (~> 6.0.2.1)
rails (~> 6.0.2.2)
rails-controller-testing (~> 1.0.4)
rails-ujs (~> 0.1.0)
rspec-rails (~> 3.9.0)
Expand All @@ -347,7 +347,7 @@ DEPENDENCIES
webpacker (~> 4.2.2)

RUBY VERSION
ruby 2.6.5p114
ruby 2.6.6p146

BUNDLED WITH
2.1.4
1 change: 0 additions & 1 deletion app/assets/javascripts/bulma-calendar.js

This file was deleted.

14 changes: 10 additions & 4 deletions app/decorators/transaction_decorator.rb
Expand Up @@ -32,7 +32,7 @@ def trx_type_credit_form
end

def trx_type_debit_form
amount.present? ? amount.negative? : false
object.new_record? ? true : amount.present? ? amount.negative? : false
end
###

Expand All @@ -49,15 +49,21 @@ def running_balance_display
end

def trx_date_decorated
transaction.pending ? 'PENDING' : trx_date_formatted
transaction.pending ? 'PENDING' : trx_date_display
end

def trx_date_formatted
def trx_date_display
trx_date.in_time_zone(current_user.timezone).strftime('%m/%d/%Y')
end

def trx_date_formatted
# trx_date.in_time_zone(current_user.timezone).strftime('%m/%d/%Y')
trx_date.in_time_zone(current_user.timezone).strftime('%Y-%m-%d')
end

def trx_date_form_value
trx_date.present? ? trx_date_formatted : Time.current.strftime('%m/%d/%Y')
# trx_date.present? ? trx_date_formatted : Time.current.strftime('%m/%d/%Y')
trx_date.present? ? trx_date_formatted : Time.current.strftime('%Y-%m-%d')
end

def created_at_decorated
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/application.html.erb
Expand Up @@ -27,7 +27,6 @@
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'bulma' %>
<%= javascript_include_tag 'bulma-calendar' %>
</head>

<body>
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/home.html.erb
Expand Up @@ -27,7 +27,6 @@
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'bulma' %>
<%= javascript_include_tag 'bulma-calendar' %>
</head>

<body>
Expand Down
52 changes: 3 additions & 49 deletions app/views/transactions/components/_form.html.erb
Expand Up @@ -20,19 +20,6 @@
<% end %>

<div class="columns">
<!-- Datepicker -->
<div class="column is-hidden-mobile">
<div class="field">
<label class="label has-text-grey">Date</label>
<div class="control">
<%= f.text_field :trx_date, id: "trx_date",
class: "input is-primary",
type: "date",
value: @transaction.trx_date_form_value %>
</div>
</div>
</div>

<!-- Fields -->
<div class="column">

Expand All @@ -48,14 +35,11 @@
</div>
</div>

<!-- Datepicker Mobile -->
<div class="field is-hidden-tablet">
<!-- Transaction Type -->
<div class="field">
<label class="label has-text-grey">Date</label>
<div class="control">
<%= f.text_field :trx_date, id: "trx_date_mobile",
class: "input is-primary",
type: "date",
value: @transaction.trx_date_form_value %>
<%= f.date_field :trx_date, class: "input is-primary", type: "date", value: @transaction.trx_date_form_value %>
</div>
</div>

Expand Down Expand Up @@ -143,20 +127,6 @@
<% end %>

<script>
// Initialize all input of type date
var calendar = bulmaCalendar.attach('#trx_date', {
dateFormat: 'YYYY-MM-DD',
displayMode: 'inline',
startDate: '<%= @transaction.trx_date_form_value %>'
});

// The mobile calendar will be shown in a different position
var calendarMobile = bulmaCalendar.attach('#trx_date_mobile', {
dateFormat: 'YYYY-MM-DDTHH:mm:ss',
displayMode: 'inline',
startDate: '<%= @transaction.trx_date_form_value %>'
})

// When an attachment file is selected, set the file-name field
document.getElementById('upload').onchange = uploadOnChange;

Expand All @@ -168,20 +138,4 @@
}
document.getElementById('filename').innerHTML = filename;
}

// Copy the date value to the mobile datepicker
var trxDate = document.querySelector('#trx_date');
var trxDateMobile = document.querySelector('#trx_date_mobile')

if (trxDate) {
trxDate.bulmaCalendar.on('select', function(datepicker) {
trxDateMobile.value = datepicker.data.value();
});
}

if (trxDateMobile) {
trxDateMobile.bulmaCalendar.on('select', function(datepicker) {
trxDate.value = datepicker.data.value();
});
}
</script>
Expand Up @@ -4,7 +4,7 @@
<%= @transaction.description %>
</p>
<p class="card-header-icon has-text-white has-text-weight-bold">
<%= @transaction.trx_date_formatted %>
<%= @transaction.trx_date_display %>
</p>
</header>

Expand Down
1 change: 0 additions & 1 deletion config/initializers/assets.rb
Expand Up @@ -13,7 +13,6 @@
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
Rails.application.config.assets.precompile += %w( bulma.js )
Rails.application.config.assets.precompile += %w( bulma-calendar.js )

# Precompile fonts
Rails.application.config.assets.precompile << ["*.svg", "*.eot", "*.woff", "*.ttf"]
17 changes: 1 addition & 16 deletions db/structure.sql
Expand Up @@ -5,27 +5,12 @@ SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


SET default_tablespace = '';

SET default_with_oids = false;

--
-- Name: accounts; Type: TABLE; Schema: public; Owner: -
--
Expand Down

0 comments on commit 8553b4c

Please sign in to comment.