Skip to content

v3.14.1 #616

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

Merged
merged 6 commits into from
Apr 17, 2021
Merged
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 .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Style/SpecialGlobalVars:
Enabled: false

Style/StringLiterals:
EnforcedStyle: single_quotes
EnforcedStyle: double_quotes

Style/VariableInterpolation:
Enabled: false
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TimeOverflow
[![View performance data on Skylight](https://badges.skylight.io/problem/grDTNuzZRnyu.svg)](https://oss.skylight.io/app/applications/grDTNuzZRnyu)
[![Build Status](https://travis-ci.org/coopdevs/timeoverflow.svg)](https://travis-ci.org/coopdevs/timeoverflow)
[![Build Status](https://travis-ci.com/coopdevs/timeoverflow.svg?branch=develop)](https://travis-ci.com/coopdevs/timeoverflow)
[![Maintainability](https://api.codeclimate.com/v1/badges/f82c6d98a2441c84f2ef/maintainability)](https://codeclimate.com/github/coopdevs/timeoverflow/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/f82c6d98a2441c84f2ef/test_coverage)](https://codeclimate.com/github/coopdevs/timeoverflow/test_coverage)

Expand Down
3 changes: 1 addition & 2 deletions app/admin/category.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ActiveAdmin.register Category do
index do
selectable_column
id_column
column :name, sortable: false
actions
Expand All @@ -13,7 +12,7 @@
f.actions
end

show(title: :name) do |cat|
show do |cat|
attributes_table do
row :created_at
row :updated_at
Expand Down
1 change: 0 additions & 1 deletion app/admin/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
permit_params *Document.attribute_names

index do
selectable_column
id_column
column :documentable
column :label
Expand Down
3 changes: 3 additions & 0 deletions app/admin/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ def destroy
end
end

filter :id
filter :name
filter :web
filter :phone
filter :city, as: :select, collection: -> { Organization.pluck(:city).uniq }
filter :neighborhood

Expand Down
12 changes: 8 additions & 4 deletions app/admin/post.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
ActiveAdmin.register Post do
index do
selectable_column
id_column
column :class
column :title
column :created_at do |post|
l post.created_at.to_date, format: :long
end
column :organization
column :user
column :category
column :tag_list
Expand All @@ -15,23 +15,27 @@

form do |f|
f.semantic_errors *f.object.errors.keys
f.inputs "Admin Details" do
f.inputs do
f.input :type, as: :select, collection: %w[Offer Inquiry]
f.input :title
f.input :user
f.input :organization
f.input :user, hint: "* should be member of the selected organization"
f.input :category
f.input :description
f.input :tag_list
f.input :active
end
f.actions
end

permit_params :type, :tag_list, *Post.attribute_names

filter :type, as: :select, collection: -> { Post.subclasses }
filter :id
filter :title
filter :user
filter :organization
filter :user
filter :category
filter :active
filter :created_at
end
4 changes: 2 additions & 2 deletions app/admin/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@

form do |f|
f.semantic_errors *f.object.errors.keys
f.inputs "Admin Details" do
f.inputs do
f.input :username
f.input :email
f.input :gender, as: :select, collection: User::GENDERS
f.input :identity_document
end
f.inputs "Members" do
f.inputs "Memberships" do
f.has_many :members do |m|
m.input :organization, collection: Organization.order(id: :asc).pluck(:name, :id)
m.input :active
Expand Down
9 changes: 4 additions & 5 deletions app/assets/javascripts/application/give_time.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ $( document ).ready(function () {
}

if ($(form).valid()) {
form.submit();
// submit the form via Rails-UJS to fire data-disable-with
Rails.fire(form, 'submit');
}
}

var config = {
$("#multi_transfer, #new_transfer").validate({
submitHandler: submitHandler
};

$("#multi_transfer, #new_transfer").validate(config);
});
})
3 changes: 0 additions & 3 deletions app/models/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ def add_organization
end
end


private

# Checks whether the balance falls within the max and min allowed balance,
# none of these included
#
Expand Down
9 changes: 0 additions & 9 deletions app/views/transfers/_sources.html.erb

This file was deleted.

12 changes: 10 additions & 2 deletions app/views/transfers/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@
<%= f.input :destination, as: :hidden %>

<% if sources.present? %>
<%= render partial: 'sources', locals: { form: f, sources: sources, accountable: accountable } %>
<div class="form-group">
<%= f.label :source %>
<%= f.select :source,
options_for_select(
TransferSourcesOptions.new(sources).to_a,
selected: current_user.member(current_organization).account.id
), {}, id: "select2", class: "form-control"
%>
</div>
<% end %>

<%= render partial: "#{accountable.model_name.singular}_offer", locals: { form: f, offer: offer, accountable: accountable } %>
</div>

<div class="form-actions">
<%= f.button :submit, class: "btn btn-default" %>
<%= f.button :submit, class: "btn btn-default", data: { disable_with: "..." } %>
<label class="js-error-amount error invisible"><%= t ".error_amount" %></label>
</div>
<% end %>
1 change: 1 addition & 0 deletions config/initializers/active_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
config.current_user_method = :current_user
config.logout_link_path = :destroy_user_session_path
config.logout_link_method = :delete
config.batch_actions = false
config.comments = false
config.namespace :admin do |admin|
admin.build_menu :utility_navigation do |menu|
Expand Down
Loading