From 43924b667881ba20c7a6342f6c898168c7d47d35 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 5 Oct 2018 12:57:13 +0300 Subject: [PATCH 01/55] Assign agendas into the meeting --- .../committee/meetings_controller.rb | 6 ++++- app/models/agenda.rb | 3 +++ app/models/committee_meeting.rb | 3 +++ app/models/meeting_agenda.rb | 12 +++++++++ app/views/committee/meetings/_form.html.erb | 15 +++++++++++ .../meetings/_meeting_agenda_fields.html.erb | 13 +++++++++ app/views/committee/meetings/index.html.erb | 2 ++ config/locales/models/committees/en.yml | 7 +++++ config/locales/models/committees/tr.yml | 7 +++++ .../20181004112631_create_meeting_agendas.rb | 12 +++++++++ db/schema.rb | 12 ++++++++- test/fixtures/agendas.yml | 7 +++++ test/fixtures/meeting_agendas.yml | 14 ++++++++++ test/models/committee/agenda_test.rb | 6 +++++ test/models/committee/meeting_agenda_test.rb | 27 +++++++++++++++++++ test/models/committee/meeting_test.rb | 10 +++++-- 16 files changed, 152 insertions(+), 4 deletions(-) create mode 100644 app/models/meeting_agenda.rb create mode 100644 app/views/committee/meetings/_meeting_agenda_fields.html.erb create mode 100644 db/migrate/20181004112631_create_meeting_agendas.rb create mode 100644 test/fixtures/meeting_agendas.yml create mode 100644 test/models/committee/meeting_agenda_test.rb diff --git a/app/controllers/committee/meetings_controller.rb b/app/controllers/committee/meetings_controller.rb index 023fe6b3b..07bf5dbef 100644 --- a/app/controllers/committee/meetings_controller.rb +++ b/app/controllers/committee/meetings_controller.rb @@ -43,7 +43,11 @@ def set_meeting end def meeting_params - params.require(:committee_meeting).permit(:meeting_no, :meeting_date) + params.require(:committee_meeting) + .permit(:meeting_no, :meeting_date, + meeting_agendas_attributes: %i[ + id agenda_id committee_meeting_id sequence_no _destroy + ]) end end end diff --git a/app/models/agenda.rb b/app/models/agenda.rb index 29d4337c4..05c32df8c 100644 --- a/app/models/agenda.rb +++ b/app/models/agenda.rb @@ -25,4 +25,7 @@ class Agenda < ApplicationRecord # enums enum status: { recent: 0, decided: 1, delayed: 2 } + + # scopes + scope :active, -> { where(status: %i[recent delayed]) } end diff --git a/app/models/committee_meeting.rb b/app/models/committee_meeting.rb index 397014e30..97319f2c4 100644 --- a/app/models/committee_meeting.rb +++ b/app/models/committee_meeting.rb @@ -3,6 +3,9 @@ class CommitteeMeeting < ApplicationRecord # relations belongs_to :unit + has_many :meeting_agendas, dependent: :destroy + has_many :agendas, through: :meeting_agendas + accepts_nested_attributes_for :meeting_agendas, allow_destroy: true # validations validates :meeting_no, presence: true, uniqueness: { scope: %i[unit year] }, diff --git a/app/models/meeting_agenda.rb b/app/models/meeting_agenda.rb new file mode 100644 index 000000000..cb0351086 --- /dev/null +++ b/app/models/meeting_agenda.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class MeetingAgenda < ApplicationRecord + # relations + belongs_to :agenda + belongs_to :committee_meeting + + # validations + validates :sequence_no, presence: true, uniqueness: { scope: %i[committee_meeting] }, + numericality: { only_integer: true, greater_than_or_equal_to: 1 } + validates :agenda_id, presence: true, uniqueness: { scope: :committee_meeting } +end diff --git a/app/views/committee/meetings/_form.html.erb b/app/views/committee/meetings/_form.html.erb index 8631e8d33..fa1d13fdf 100644 --- a/app/views/committee/meetings/_form.html.erb +++ b/app/views/committee/meetings/_form.html.erb @@ -18,6 +18,19 @@
<%= f.input :meeting_date %>
+
+
+ <%= fa_icon 'tasks', text: t('.agendas') %> +
+
+ <%= f.simple_fields_for :meeting_agendas do |meeting_agenda| %> + <%= render 'meeting_agenda_fields', f: meeting_agenda %> + <% end %> +
+ <%= link_to_add_association t('.new_agenda_link'), f, :meeting_agendas, class: 'btn btn-outline-primary btn-sm' %> +
+ + + +<%= javascript_include_tag 'shared/cocoon' %> diff --git a/app/views/committee/meetings/_meeting_agenda_fields.html.erb b/app/views/committee/meetings/_meeting_agenda_fields.html.erb new file mode 100644 index 000000000..78ed9fe24 --- /dev/null +++ b/app/views/committee/meetings/_meeting_agenda_fields.html.erb @@ -0,0 +1,13 @@ +
+
+
+
+ <%= f.input :agenda_id, collection: @committee.agendas.active, label_method: :description %> + <%= f.input :sequence_no, input_html: { min: 1 } %> +
+ +
+
+
diff --git a/app/views/committee/meetings/index.html.erb b/app/views/committee/meetings/index.html.erb index a581ef79e..3dc2c7b2c 100644 --- a/app/views/committee/meetings/index.html.erb +++ b/app/views/committee/meetings/index.html.erb @@ -16,6 +16,7 @@ <%= t('.meeting_date') %> <%= t('.year') %> <%= t('.unit') %> + <%= t('.agendas_count') %> <%= t('actions') %> @@ -26,6 +27,7 @@ <%= meeting.meeting_date %> <%= meeting.year %> <%= meeting.unit.name %> + <%= meeting.agendas.size %> <%= link_to_edit(edit_committee_meeting_path(@committee, meeting)) %> <%= link_to_destroy(committee_meeting_path(@committee, meeting)) %> diff --git a/config/locales/models/committees/en.yml b/config/locales/models/committees/en.yml index 236b70876..8dcf1a719 100644 --- a/config/locales/models/committees/en.yml +++ b/config/locales/models/committees/en.yml @@ -13,6 +13,9 @@ en: meeting_no: Committee Meeting No dashboard: name: Committee / Commission Name + meeting_agenda: + agenda_id: Agenda + sequence_no: Sequence No enums: agenda: statuses: @@ -66,7 +69,11 @@ en: warning: Committee Meeting can not be deleted! edit: form_title: Update a Committee Meeting + form: + agendas: Agendas + new_agenda_link: Add a New Agenda index: + agendas_count: Agendas Count card_header: Committee Meetings meeting_date: Committee Meeting Date meeting_no: Committee Meeting No diff --git a/config/locales/models/committees/tr.yml b/config/locales/models/committees/tr.yml index 9d490eab5..0e3bba4ac 100644 --- a/config/locales/models/committees/tr.yml +++ b/config/locales/models/committees/tr.yml @@ -13,6 +13,9 @@ tr: meeting_no: Toplantı No dashboard: name: Kurul / Komisyon Adı + meeting_agenda: + agenda_id: Gündem + sequence_no: Sıra No enums: agenda: statuses: @@ -66,7 +69,11 @@ tr: warning: Toplantı silinemedi! edit: form_title: Toplantı Güncelle + form: + agendas: Gündemler + new_agenda_link: Gündem Ekle index: + agendas_count: Gündem Sayısı card_header: Toplantılar meeting_date: Toplantı Tarihi meeting_no: Toplantı No diff --git a/db/migrate/20181004112631_create_meeting_agendas.rb b/db/migrate/20181004112631_create_meeting_agendas.rb new file mode 100644 index 000000000..79625c6c6 --- /dev/null +++ b/db/migrate/20181004112631_create_meeting_agendas.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class CreateMeetingAgendas < ActiveRecord::Migration[5.2] + def change + create_table :meeting_agendas do |t| + t.references :agenda + t.references :committee_meeting + t.integer :sequence_no, null: false + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 1d517e92c..ccec945f0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2018_10_01_111810) do +ActiveRecord::Schema.define(version: 2018_10_04_112631) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -335,6 +335,16 @@ t.string "iso", limit: 255, null: false end + create_table "meeting_agendas", force: :cascade do |t| + t.bigint "agenda_id" + t.bigint "committee_meeting_id" + t.integer "sequence_no", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["agenda_id"], name: "index_meeting_agendas_on_agenda_id" + t.index ["committee_meeting_id"], name: "index_meeting_agendas_on_committee_meeting_id" + end + create_table "positions", force: :cascade do |t| t.date "start_date", null: false t.date "end_date" diff --git a/test/fixtures/agendas.yml b/test/fixtures/agendas.yml index 4b0201f89..fa0aef630 100644 --- a/test/fixtures/agendas.yml +++ b/test/fixtures/agendas.yml @@ -9,3 +9,10 @@ two: unit: muhendislik_fakultesi_yonetim_kurulu agenda_type: three status: recent + + +three: + description: 2018-2019 eğitim öğretim yılı bahar yarıyılı mazeret sınavına girmek isteyen öğrencilerin dilekçelerinin görüşülmesi. + unit: muhendislik_fakultesi_yonetim_kurulu + agenda_type: three + status: decided diff --git a/test/fixtures/meeting_agendas.yml b/test/fixtures/meeting_agendas.yml new file mode 100644 index 000000000..5d20b2efc --- /dev/null +++ b/test/fixtures/meeting_agendas.yml @@ -0,0 +1,14 @@ +one: + agenda: one + committee_meeting: one + sequence_no: 1 + +two: + agenda: two + committee_meeting: one + sequence_no: 2 + +three: + agenda: three + committee_meeting: one + sequence_no: 3 diff --git a/test/models/committee/agenda_test.rb b/test/models/committee/agenda_test.rb index ab38e0394..8253d7e57 100644 --- a/test/models/committee/agenda_test.rb +++ b/test/models/committee/agenda_test.rb @@ -24,4 +24,10 @@ class AgendaTest < ActiveSupport::TestCase assert_not_empty agendas(:one).errors[property] end end + + # scopes + test 'active scope returns recent and delayed agendas' do + assert_equal Agenda.active.count, Agenda.recent.count + Agenda.delayed.count + assert_not_includes Agenda.active, agendas(:three) + end end diff --git a/test/models/committee/meeting_agenda_test.rb b/test/models/committee/meeting_agenda_test.rb new file mode 100644 index 000000000..2aa3b40db --- /dev/null +++ b/test/models/committee/meeting_agenda_test.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +require 'test_helper' + +class MeetingAgendaTest < ActiveSupport::TestCase + # relations + %i[ + agenda + committee_meeting + ].each do |property| + test "a meeting agenda can communicate with #{property}" do + assert meeting_agendas(:one).send(property) + end + end + + # validations: presence + %i[ + agenda_id + sequence_no + ].each do |property| + test "presence validations for #{property} of a meeting agenda" do + meeting_agendas(:one).send("#{property}=", nil) + assert_not meeting_agendas(:one).valid? + assert_not_empty meeting_agendas(:one).errors[property] + end + end +end diff --git a/test/models/committee/meeting_test.rb b/test/models/committee/meeting_test.rb index dd461888f..72c5afb03 100644 --- a/test/models/committee/meeting_test.rb +++ b/test/models/committee/meeting_test.rb @@ -4,8 +4,14 @@ class MeetingTest < ActiveSupport::TestCase # relations - test 'a meeting can communicate with unit' do - assert committee_meetings(:one).unit + %i[ + unit + meeting_agendas + agendas + ].each do |property| + test "a meeting can communicate with #{property}" do + assert committee_meetings(:one).send(property) + end end # validations: presence From 4d43fc3b63400f18563997e2a39e7aa2950fa430 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 5 Oct 2018 13:12:04 +0300 Subject: [PATCH 02/55] Update nokogiri version because vulnerabilities --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ff790eeca..21dea96a5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -170,7 +170,7 @@ GEM multi_json (1.13.1) netaddr (2.0.3) nio4r (2.3.1) - nokogiri (1.8.4) + nokogiri (1.8.5) mini_portile2 (~> 2.3.0) nori (2.6.0) orm_adapter (0.5.0) From 112b324147ed46db450eb21be6a9deedfd1f2f4b Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 5 Oct 2018 15:08:52 +0300 Subject: [PATCH 03/55] Add show path to meetings --- .../committee/meetings_controller.rb | 6 +- app/models/agenda.rb | 2 + app/models/meeting_agenda.rb | 3 + app/views/committee/meetings/index.html.erb | 1 + app/views/committee/meetings/show.html.erb | 56 +++++++++++++++++++ config/locales/models/committees/en.yml | 38 +++++++------ config/locales/models/committees/tr.yml | 38 +++++++------ config/routes.rb | 2 +- .../committee/meetings_controller_test.rb | 11 +++- test/models/committee/agenda_test.rb | 2 + 10 files changed, 118 insertions(+), 41 deletions(-) create mode 100644 app/views/committee/meetings/show.html.erb diff --git a/app/controllers/committee/meetings_controller.rb b/app/controllers/committee/meetings_controller.rb index 07bf5dbef..1a6c6c490 100644 --- a/app/controllers/committee/meetings_controller.rb +++ b/app/controllers/committee/meetings_controller.rb @@ -3,12 +3,16 @@ module Committee class MeetingsController < ApplicationController before_action :set_committee - before_action :set_meeting, only: %i[edit update destroy] + before_action :set_meeting, only: %i[show edit update destroy] def index @meetings = @committee.meetings.order(year: :desc, meeting_no: :asc) end + def show + @agendas = @meeting.meeting_agendas.includes(agenda: :agenda_type).order(:sequence_no) + end + def new @meeting = @committee.meetings.new end diff --git a/app/models/agenda.rb b/app/models/agenda.rb index 05c32df8c..d0e7de2d9 100644 --- a/app/models/agenda.rb +++ b/app/models/agenda.rb @@ -18,6 +18,8 @@ class Agenda < ApplicationRecord has_one_attached :agenda_file belongs_to :unit belongs_to :agenda_type + has_many :meeting_agendas, dependent: :destroy + has_many :meetings, through: :meeting_agendas, source: :committee_meeting # validations validates :description, presence: true diff --git a/app/models/meeting_agenda.rb b/app/models/meeting_agenda.rb index cb0351086..be6ca2a3b 100644 --- a/app/models/meeting_agenda.rb +++ b/app/models/meeting_agenda.rb @@ -9,4 +9,7 @@ class MeetingAgenda < ApplicationRecord validates :sequence_no, presence: true, uniqueness: { scope: %i[committee_meeting] }, numericality: { only_integer: true, greater_than_or_equal_to: 1 } validates :agenda_id, presence: true, uniqueness: { scope: :committee_meeting } + + # delegates + delegate :description, :status, :agenda_type, to: :agenda end diff --git a/app/views/committee/meetings/index.html.erb b/app/views/committee/meetings/index.html.erb index 3dc2c7b2c..eb39ae925 100644 --- a/app/views/committee/meetings/index.html.erb +++ b/app/views/committee/meetings/index.html.erb @@ -29,6 +29,7 @@ <%= meeting.unit.name %> <%= meeting.agendas.size %> + <%= link_to_show(committee_meeting_path(@committee, meeting)) %> <%= link_to_edit(edit_committee_meeting_path(@committee, meeting)) %> <%= link_to_destroy(committee_meeting_path(@committee, meeting)) %> diff --git a/app/views/committee/meetings/show.html.erb b/app/views/committee/meetings/show.html.erb new file mode 100644 index 000000000..8872b970a --- /dev/null +++ b/app/views/committee/meetings/show.html.erb @@ -0,0 +1,56 @@ +
+ <%= link_to_back(:back) %> +
+ +
+
+
+
+ <%= fa_icon 'archive', text: @meeting.unit.name %> +
+
+ + + + + + + + + + + + + + + + + +
<%= t('.meeting_no') %><%= t('.meeting_date') %><%= t('.year') %><%= t('actions') %>
<%= @meeting.meeting_no %><%= @meeting.meeting_date %><%= @meeting.year %><%= link_to_edit(edit_committee_meeting_path(@committee, @meeting)) %>
+
+
+ <%= fa_icon 'tasks', text: t('.agendas') %> +
+
+ + + + + + + + + + <% @agendas.each do |agenda| %> + + + + + + + <% end %> +
<%= t('.sequence_no') %><%= t('.description') %><%= t('.status') %><%= t('.agenda_type') %>
<%= agenda.sequence_no %><%= agenda.description %><%= agenda.status %><%= agenda.agenda_type.name %>
+
+
+
+
diff --git a/config/locales/models/committees/en.yml b/config/locales/models/committees/en.yml index 8dcf1a719..d299148c7 100644 --- a/config/locales/models/committees/en.yml +++ b/config/locales/models/committees/en.yml @@ -61,6 +61,18 @@ en: status: Agenda Status update: success: Agenda successfully updated. + dashboard: + index: + agendas: Agendas + card_header: Committee / Commission + detsis_id: DETSIS ID + district: Location + meetings: Meetings + name: Committee / Commission Name + new_committee_link: Create a New Committee/Commission + unit_status: Unit Status + unit_type: Unit Type + yoksis_id: YOKSIS ID meetings: create: success: Committee Meeting successfully created. @@ -83,27 +95,17 @@ en: new: <<: *committee_meeting_attributes form_title: Create a Committee Meeting - update: - success: Committee Meeting successfully updated. - dashboard: - index: - agendas: Agendas - card_header: Committee / Commission - detsis_id: DETSIS ID - district: Location - meetings: Meetings - name: Committee / Commission Name - new_committee_link: Create a New Committee/Commission - unit_status: Unit Status - unit_type: Unit Type - yoksis_id: YOKSIS ID show: - actions: Actions - agenda_card_header: Agendas + agendas: Agendas agenda_type: Agenda Type description: Description - status: Agenda Status - unit: Parent Unit + meeting_date: Meeting Date + meeting_no: Meeting No + sequence_no: Sequence No + status: Status + year: Year + update: + success: Committee Meeting successfully updated. helpers: submit: agenda: diff --git a/config/locales/models/committees/tr.yml b/config/locales/models/committees/tr.yml index 0e3bba4ac..0b72670f9 100644 --- a/config/locales/models/committees/tr.yml +++ b/config/locales/models/committees/tr.yml @@ -61,6 +61,18 @@ tr: status: Gündem Durumu update: success: Gündem başarıyla güncellendi. + dashboard: + index: + agendas: Gündemler + card_header: Kurul / Komisyon + detsis_id: DETSIS ID + district: Bulunduğu İlçe + meetings: Toplantılar + name: Kurul / Komisyon Adı + new_committee_link: Yeni Bir Kurul/Komisyon Oluştur + unit_status: Birim Durumu + unit_type: Birim Türü + yoksis_id: YOKSIS ID meetings: create: success: Toplantı başarıyla oluşturuldu. @@ -83,27 +95,17 @@ tr: new: <<: *committee_meeting_attributes form_title: Toplantı Oluştur - update: - success: Toplantı başarıyla güncellendi. - dashboard: - index: - agendas: Gündemler - card_header: Kurul / Komisyon - detsis_id: DETSIS ID - district: Bulunduğu İlçe - meetings: Toplantılar - name: Kurul / Komisyon Adı - new_committee_link: Yeni Bir Kurul/Komisyon Oluştur - unit_status: Birim Durumu - unit_type: Birim Türü - yoksis_id: YOKSIS ID show: - actions: İşlemler - agenda_card_header: Gündemler + agendas: Gündemler agenda_type: Gündem Türü description: Açıklama - status: Gündem Durumu - unit: Üst Birim + meeting_date: Toplantı Tarihi + meeting_no: Toplantı No + sequence_no: Sıra No + status: Durum + year: Yıl + update: + success: Toplantı başarıyla güncellendi. helpers: submit: agenda: diff --git a/config/routes.rb b/config/routes.rb index 6aa4ae87b..6bc4aa51d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -68,7 +68,7 @@ resources :committees, only: :index, controller: 'committee/dashboard' do scope module: :committee do resources :agendas, except: :show - resources :meetings, except: :show + resources :meetings end end end diff --git a/test/controllers/committee/meetings_controller_test.rb b/test/controllers/committee/meetings_controller_test.rb index e0396f64b..0074b7487 100644 --- a/test/controllers/committee/meetings_controller_test.rb +++ b/test/controllers/committee/meetings_controller_test.rb @@ -6,7 +6,7 @@ module Committee class CommitteeMeetingsControllerTest < ActionDispatch::IntegrationTest setup do sign_in users(:serhat) - @committee_meeting = committee_meetings(:one) + @meeting = committee_meetings(:one) @committee = units(:muhendislik_fakultesi_yonetim_kurulu) end @@ -16,6 +16,11 @@ class CommitteeMeetingsControllerTest < ActionDispatch::IntegrationTest assert_select '#add-button', translate('.index.new_committee_meeting_link') end + test 'should get show' do + get committee_meeting_path(@committee, @meeting) + assert_response :success + end + test 'should get new' do get new_committee_meeting_path(@committee) assert_response :success @@ -43,7 +48,7 @@ class CommitteeMeetingsControllerTest < ActionDispatch::IntegrationTest end test 'should get edit' do - get edit_committee_meeting_path(@committee, @committee_meeting) + get edit_committee_meeting_path(@committee, @meeting) assert_response :success assert_select '.card-header strong', translate('.edit.form_title') end @@ -71,7 +76,7 @@ class CommitteeMeetingsControllerTest < ActionDispatch::IntegrationTest test 'should destroy committee meeting' do assert_difference('@committee.meetings.count', -1) do - delete committee_meeting_path(@committee, @committee_meeting) + delete committee_meeting_path(@committee, @meeting) end assert_redirected_to committee_meetings_path(@committee) diff --git a/test/models/committee/agenda_test.rb b/test/models/committee/agenda_test.rb index 8253d7e57..74e510309 100644 --- a/test/models/committee/agenda_test.rb +++ b/test/models/committee/agenda_test.rb @@ -7,6 +7,8 @@ class AgendaTest < ActiveSupport::TestCase %i[ unit agenda_type + meeting_agendas + meetings ].each do |property| test "a agenda can communicate with #{property}" do assert agendas(:one).send(property) From 3d5e31086a9d52fe32e9bc9254d43b5639c9f24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Fri, 5 Oct 2018 20:38:14 +0300 Subject: [PATCH 04/55] Fix bogus executable permissions --- app/assets/images/profile/avatar_placeholder.svg | 0 app/controllers/course_management/curriculums_controller.rb | 0 app/models/curriculum.rb | 0 app/views/course_management/curriculums/_form.html.erb | 0 app/views/course_management/curriculums/edit.html.erb | 0 app/views/course_management/curriculums/index.html.erb | 0 app/views/course_management/curriculums/new.html.erb | 0 app/views/course_management/curriculums/show.html.erb | 0 test/controllers/course_management/curriculums_controller_test.rb | 0 test/fixtures/curriculums.yml | 0 test/fixtures/files/invalid_sh_file.jpg | 0 test/models/course/curriculum_test.rb | 0 12 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 app/assets/images/profile/avatar_placeholder.svg mode change 100755 => 100644 app/controllers/course_management/curriculums_controller.rb mode change 100755 => 100644 app/models/curriculum.rb mode change 100755 => 100644 app/views/course_management/curriculums/_form.html.erb mode change 100755 => 100644 app/views/course_management/curriculums/edit.html.erb mode change 100755 => 100644 app/views/course_management/curriculums/index.html.erb mode change 100755 => 100644 app/views/course_management/curriculums/new.html.erb mode change 100755 => 100644 app/views/course_management/curriculums/show.html.erb mode change 100755 => 100644 test/controllers/course_management/curriculums_controller_test.rb mode change 100755 => 100644 test/fixtures/curriculums.yml mode change 100755 => 100644 test/fixtures/files/invalid_sh_file.jpg mode change 100755 => 100644 test/models/course/curriculum_test.rb diff --git a/app/assets/images/profile/avatar_placeholder.svg b/app/assets/images/profile/avatar_placeholder.svg old mode 100755 new mode 100644 diff --git a/app/controllers/course_management/curriculums_controller.rb b/app/controllers/course_management/curriculums_controller.rb old mode 100755 new mode 100644 diff --git a/app/models/curriculum.rb b/app/models/curriculum.rb old mode 100755 new mode 100644 diff --git a/app/views/course_management/curriculums/_form.html.erb b/app/views/course_management/curriculums/_form.html.erb old mode 100755 new mode 100644 diff --git a/app/views/course_management/curriculums/edit.html.erb b/app/views/course_management/curriculums/edit.html.erb old mode 100755 new mode 100644 diff --git a/app/views/course_management/curriculums/index.html.erb b/app/views/course_management/curriculums/index.html.erb old mode 100755 new mode 100644 diff --git a/app/views/course_management/curriculums/new.html.erb b/app/views/course_management/curriculums/new.html.erb old mode 100755 new mode 100644 diff --git a/app/views/course_management/curriculums/show.html.erb b/app/views/course_management/curriculums/show.html.erb old mode 100755 new mode 100644 diff --git a/test/controllers/course_management/curriculums_controller_test.rb b/test/controllers/course_management/curriculums_controller_test.rb old mode 100755 new mode 100644 diff --git a/test/fixtures/curriculums.yml b/test/fixtures/curriculums.yml old mode 100755 new mode 100644 diff --git a/test/fixtures/files/invalid_sh_file.jpg b/test/fixtures/files/invalid_sh_file.jpg old mode 100755 new mode 100644 diff --git a/test/models/course/curriculum_test.rb b/test/models/course/curriculum_test.rb old mode 100755 new mode 100644 From edda1469381d35953e9f4365649cd7b5cdaee3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Fri, 5 Oct 2018 22:11:36 +0300 Subject: [PATCH 05/55] Add nitpicking tests to catch various ugliness --- .circleci/config.yml | 1 + lib/tasks/nitpick.rake | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 lib/tasks/nitpick.rake diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a5aa7d67..f0e63356d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,6 +109,7 @@ jobs: - run: bin/yarn install - run: bundle exec rake quality:rails - run: bundle exec rake security:all + - run: bundle exec rake nitpick:all deploy: machine: enabled: true diff --git a/lib/tasks/nitpick.rake b/lib/tasks/nitpick.rake new file mode 100644 index 000000000..40921db95 --- /dev/null +++ b/lib/tasks/nitpick.rake @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +namespace :nitpick do + desc 'Nitpick for executables' + task :executable do + suspicious_executables = + `find . -type f -executable -print | grep -Ev '^[.]/(vendor|node_modules|.git|bin|sbin|scripts)'` + .split("\n").reject do |filename| + File.open(filename).first.start_with? '#!' + end + + next if suspicious_executables.empty? + + warn 'Files with the executable bit set found:' + + warn '' + suspicious_executables.each do |filename| + warn "\t#{filename}" + end + warn '' + + warn <<~ERR + Please fix the issue by one of the following methods: + + - Remove the executable bits with the "chmod -x" command and commit changes. + + - Move the files to the toplevel bin, sbin or scripts directory. + ERR + + abort + end + + desc 'Runs all nitpickings' + task all: %w[executable] +end From 3d60517fb2efe4bbaf3d8d8231a2ed4c0c1f0e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Fri, 5 Oct 2018 22:55:33 +0300 Subject: [PATCH 06/55] Improve detection --- lib/tasks/nitpick.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/nitpick.rake b/lib/tasks/nitpick.rake index 40921db95..47517806c 100644 --- a/lib/tasks/nitpick.rake +++ b/lib/tasks/nitpick.rake @@ -4,7 +4,7 @@ namespace :nitpick do desc 'Nitpick for executables' task :executable do suspicious_executables = - `find . -type f -executable -print | grep -Ev '^[.]/(vendor|node_modules|.git|bin|sbin|scripts)'` + `find . -type f -executable -print | grep -Ev '^[.]/([.]git|vendor|node_modules|tmp|log|bin|sbin|scripts)'` .split("\n").reject do |filename| File.open(filename).first.start_with? '#!' end From 7f75925d9d7737040dcbef355b4c80ac268e2272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Recai=20Okta=C5=9F?= Date: Sat, 6 Oct 2018 01:22:03 +0300 Subject: [PATCH 07/55] Move nitpicking tasks to quality namespace --- .circleci/config.yml | 1 - lib/tasks/nitpick.rake | 35 ----------------------------------- lib/tasks/quality.rake | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 36 deletions(-) delete mode 100644 lib/tasks/nitpick.rake diff --git a/.circleci/config.yml b/.circleci/config.yml index f0e63356d..7a5aa7d67 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,7 +109,6 @@ jobs: - run: bin/yarn install - run: bundle exec rake quality:rails - run: bundle exec rake security:all - - run: bundle exec rake nitpick:all deploy: machine: enabled: true diff --git a/lib/tasks/nitpick.rake b/lib/tasks/nitpick.rake deleted file mode 100644 index 47517806c..000000000 --- a/lib/tasks/nitpick.rake +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -namespace :nitpick do - desc 'Nitpick for executables' - task :executable do - suspicious_executables = - `find . -type f -executable -print | grep -Ev '^[.]/([.]git|vendor|node_modules|tmp|log|bin|sbin|scripts)'` - .split("\n").reject do |filename| - File.open(filename).first.start_with? '#!' - end - - next if suspicious_executables.empty? - - warn 'Files with the executable bit set found:' - - warn '' - suspicious_executables.each do |filename| - warn "\t#{filename}" - end - warn '' - - warn <<~ERR - Please fix the issue by one of the following methods: - - - Remove the executable bits with the "chmod -x" command and commit changes. - - - Move the files to the toplevel bin, sbin or scripts directory. - ERR - - abort - end - - desc 'Runs all nitpickings' - task all: %w[executable] -end diff --git a/lib/tasks/quality.rake b/lib/tasks/quality.rake index 3597cda28..14b766376 100644 --- a/lib/tasks/quality.rake +++ b/lib/tasks/quality.rake @@ -5,4 +5,36 @@ namespace :quality do task :rails do sh 'bundle exec rubocop -f fu -R -D' end + + desc 'Checks for suspicious executables' + task :executables do + suspicious_executables = + `find . -type f -executable -print | grep -Ev '^[.]/([.]git|vendor|node_modules|tmp|log|bin|sbin|scripts)'` + .split("\n").reject do |filename| + File.open(filename).first.start_with? '#!' + end + + next if suspicious_executables.empty? + + warn 'Files with the executable bit set found:' + + warn '' + suspicious_executables.each do |filename| + warn "\t#{filename}" + end + warn '' + + warn <<~ERR + Please fix the issue by one of the following methods: + + - Remove the executable bits with the "chmod -x" command and commit changes. + + - Move the files to the toplevel bin, sbin or scripts directory. + ERR + + abort + end + + desc 'Runs all quality tasks' + task all: %w[rails executables] end From fc6e49336663ba6500603ca9167dfe0ba8d9b841 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 8 Oct 2018 11:11:08 +0300 Subject: [PATCH 08/55] Check delegates in meeting_agenda test --- test/models/committee/meeting_agenda_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/models/committee/meeting_agenda_test.rb b/test/models/committee/meeting_agenda_test.rb index 2aa3b40db..6e38884ab 100644 --- a/test/models/committee/meeting_agenda_test.rb +++ b/test/models/committee/meeting_agenda_test.rb @@ -24,4 +24,15 @@ class MeetingAgendaTest < ActiveSupport::TestCase assert_not_empty meeting_agendas(:one).errors[property] end end + + # delegates + %i[ + agenda_type + description + status + ].each do |property| + test "a meeting agenda reach agenda's #{property} parameter" do + assert meeting_agendas(:one).send(property) + end + end end From 86cc40f5575d79fe6ef3f21f225f9db18c4077f8 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 8 Oct 2018 16:16:50 +0300 Subject: [PATCH 09/55] Refactor administrative_units.yml file --- db/static_data/administrative_units.yml | 305 ++++++++++++------------ 1 file changed, 155 insertions(+), 150 deletions(-) diff --git a/db/static_data/administrative_units.yml b/db/static_data/administrative_units.yml index 5c7347758..2b79da29c 100644 --- a/db/static_data/administrative_units.yml +++ b/db/static_data/administrative_units.yml @@ -11,7 +11,7 @@ - name: Alaçam Meslek Yüksekokulu Sekreterliği detsis_id: 80234327 - parent_yoksis_id: 68459231 + parent_detsis_id: 68459231 district_id: Alaçam - name: Ulaştırma Hizmetleri Bölüm Başkanlığı @@ -26,17 +26,17 @@ - name: Alaçam Meslek Yüksekokulu Disiplin Kurulu detsis_id: 67787986 - parent_yoksis_id: 68459231 + parent_detsis_id: 68459231 district_id: Alaçam - name: Alaçam Meslek Yüksekokulu Kurulu detsis_id: 63300708 - parent_yoksis_id: 68459231 + parent_detsis_id: 68459231 district_id: Alaçam - name: Alaçam Meslek Yüksekokulu Yönetim Kurulu detsis_id: 49709020 - parent_yoksis_id: 68459231 + parent_detsis_id: 68459231 district_id: Alaçam - name: Bafra Meslek Yüksekokulu Müdürlüğü @@ -51,7 +51,7 @@ - name: Bafra Meslek Yüksekokulu Sekreterliği detsis_id: 63395826 - parent_yoksis_id: 50713553 + parent_detsis_id: 50713553 district_id: Bafra - name: Muhasebe Ve Vergi Bölüm Başkanlığı @@ -66,17 +66,17 @@ - name: Bafra Meslek Yüksekokulu Disiplin Kurulu detsis_id: 65871243 - parent_yoksis_id: 50713553 + parent_detsis_id: 50713553 district_id: Bafra - name: Bafra Meslek Yüksekokulu Kurulu detsis_id: 14895932 - parent_yoksis_id: 50713553 + parent_detsis_id: 50713553 district_id: Bafra - name: Bafra Meslek Yüksekokulu Yönetim Kurulu detsis_id: 58151099 - parent_yoksis_id: 50713553 + parent_detsis_id: 50713553 district_id: Bafra - name: Bafra Turizm Meslek Yüksekokulu Müdürlüğü @@ -86,7 +86,7 @@ - name: Bafra Turizm Meslek Yüksekokulu Sekreterliği detsis_id: 94861059 - parent_yoksis_id: 27516806 + parent_detsis_id: 27516806 district_id: Bafra - name: Otel, Lokanta Ve İkram Hizmetleri Bölüm Başkanlığı @@ -106,7 +106,7 @@ - name: Turizm Fakülte Sekreterliği detsis_id: 43784936 - parent_yoksis_id: 37195700 + parent_detsis_id: 37195700 district_id: Bafra - name: Turizm İşletmeciliği Bölüm Başkanlığı @@ -121,17 +121,17 @@ - name: Turizm Fakülte Disiplin Kurulu detsis_id: 58508002 - parent_yoksis_id: 37195700 + parent_detsis_id: 37195700 district_id: Bafra - name: Turizm Fakülte Kurulu detsis_id: 61878927 - parent_yoksis_id: 37195700 + parent_detsis_id: 37195700 district_id: Bafra - name: Turizm Fakülte Yönetim Kurulu detsis_id: 36987262 - parent_yoksis_id: 37195700 + parent_detsis_id: 37195700 district_id: Bafra - name: Adalet Meslek Yüksekokulu Müdürlüğü @@ -151,17 +151,17 @@ - name: Adalet Meslek Yüksekokulu Disiplin Kurulu detsis_id: 70808284 - parent_yoksis_id: 15086663 + parent_detsis_id: 15086663 district_id: Çarşamba - name: Adalet Meslek Yüksekokulu Kurulu detsis_id: 25420189 - parent_yoksis_id: 15086663 + parent_detsis_id: 15086663 district_id: Çarşamba - name: Adalet Meslek Yüksekokulu Yönetim Kurulu detsis_id: 37724678 - parent_yoksis_id: 15086663 + parent_detsis_id: 15086663 district_id: Çarşamba - name: Ali Fuad Başgil Hukuk Fakültesi Dekanlığı @@ -171,7 +171,7 @@ - name: Ali Fuat Başgil Hukuk Fakültesi Sekreterliği detsis_id: 47375421 - parent_yoksis_id: 80803429 + parent_detsis_id: 80803429 district_id: Çarşamba - name: Kamu Hukuku Bölüm Başkanlığı @@ -241,17 +241,17 @@ - name: Ali Fuat Başgil Hukuk Fakültesi Disiplin Kurulu detsis_id: 89389677 - parent_yoksis_id: 80803429 + parent_detsis_id: 80803429 district_id: Çarşamba - name: Ali Fuat Başgil Hukuk Fakültesi Kurulu detsis_id: 50698085 - parent_yoksis_id: 80803429 + parent_detsis_id: 80803429 district_id: Çarşamba - name: Ali Fuat Başgil Hukuk Fakültesi Yönetim Kurulu detsis_id: 36961307 - parent_yoksis_id: 80803429 + parent_detsis_id: 80803429 district_id: Çarşamba - name: Çarşamba İnsan Ve Toplum Bilimleri Fakültesi Dekanlığı @@ -261,22 +261,22 @@ - name: Çarşamba İnsan Ve Toplum Bilimleri Fakülte Sekreterliği detsis_id: 19904871 - parent_yoksis_id: 93417155 + parent_detsis_id: 93417155 district_id: Çarşamba - name: Çarşamba İnsan Ve Toplum Bilimleri Fakülte Disiplin Kurulu detsis_id: 71370999 - parent_yoksis_id: 93417155 + parent_detsis_id: 93417155 district_id: Çarşamba - name: Çarşamba İnsan Ve Toplum Bilimleri Fakülte Kurulu detsis_id: 90739052 - parent_yoksis_id: 93417155 + parent_detsis_id: 93417155 district_id: Çarşamba - name: Çarşamba İnsan Ve Toplum Bilimleri Fakülte Yönetim Kurulu detsis_id: 19171612 - parent_yoksis_id: 93417155 + parent_detsis_id: 93417155 district_id: Çarşamba - name: Çarşamba Ticaret Borsası Meslek Yüksekokulu Müdürlüğü @@ -306,7 +306,7 @@ - name: Çarşamba Ticaret Borsası Meslek Yüksekokulu Sekreterliği detsis_id: 87953753 - parent_yoksis_id: 21071378 + parent_detsis_id: 21071378 district_id: Çarşamba - name: Muhasebe Ve Vergi Bölüm Başkanlığı @@ -321,17 +321,17 @@ - name: Çarşamba Ticaret Borsası Meslek Yüksekokulu Disiplin Kurulu detsis_id: 35949938 - parent_yoksis_id: 21071378 + parent_detsis_id: 21071378 district_id: Çarşamba - name: Çarşamba Ticaret Borsası Meslek Yüksekokulu Kurulu detsis_id: 65993268 - parent_yoksis_id: 21071378 + parent_detsis_id: 21071378 district_id: Çarşamba - name: Çarşamba Ticaret Borsası Meslek Yüksekokulu Yönetim Kurulu detsis_id: 32165550 - parent_yoksis_id: 21071378 + parent_detsis_id: 21071378 district_id: Çarşamba - name: İletişim Fakültesi Dekanlığı @@ -341,7 +341,7 @@ - name: İletişim Fakültesi Sekreterliği detsis_id: 50925799 - parent_yoksis_id: 34806956 + parent_detsis_id: 34806956 district_id: Çarşamba - name: Gazetecilik Bölüm Başkanlığı @@ -366,17 +366,17 @@ - name: İletişim Fakülte Disiplin Kurulu detsis_id: 55547789 - parent_yoksis_id: 34806956 + parent_detsis_id: 34806956 district_id: Çarşamba - name: İletişim Fakülte Kurulu detsis_id: 70731287 - parent_yoksis_id: 34806956 + parent_detsis_id: 34806956 district_id: Çarşamba - name: İletişim Fakülte Yönetim Kurulu detsis_id: 51368560 - parent_yoksis_id: 34806956 + parent_detsis_id: 34806956 district_id: Çarşamba - name: Havza Meslek Yüksekokulu Müdürlüğü @@ -396,7 +396,7 @@ - name: Havza Meslek Yüksekokulu Sekreterliği detsis_id: 43413601 - parent_yoksis_id: 78645283 + parent_detsis_id: 78645283 district_id: Havza - name: Mülkiyet Koruma Ve Güvenlik Bölüm Başkanlığı @@ -426,17 +426,17 @@ - name: Havza Meslek Yüksekokulu Disiplin Kurulu detsis_id: 12896414 - parent_yoksis_id: 78645283 + parent_detsis_id: 78645283 district_id: Havza - name: Havza Meslek Yüksekokulu Kurulu detsis_id: 28348975 - parent_yoksis_id: 78645283 + parent_detsis_id: 78645283 district_id: Havza - name: Havza Meslek Yüksekokulu Yönetim Kurulu detsis_id: 45728884 - parent_yoksis_id: 78645283 + parent_detsis_id: 78645283 district_id: Havza - name: Terme Meslek Yüksekokulu Müdürlüğü @@ -456,7 +456,7 @@ - name: Terme Meslek Yüksekokulu Sekreterliği detsis_id: 89716816 - parent_yoksis_id: 90709859 + parent_detsis_id: 90709859 district_id: Terme - name: Muhasebe Ve Vergi Bölüm Başkanlığı @@ -471,17 +471,17 @@ - name: Terme Meslek Yüksekokulu Disiplin Kurulu detsis_id: 37225687 - parent_yoksis_id: 36024139 + parent_detsis_id: 36024139 district_id: Terme - name: Terme Meslek Yüksekokulu Kurulu detsis_id: 86846638 - parent_yoksis_id: 36024139 + parent_detsis_id: 36024139 district_id: Terme - name: Terme Meslek Yüksekokulu Yönetim Kurulu detsis_id: 28679253 - parent_yoksis_id: 36024139 + parent_detsis_id: 36024139 district_id: Terme - name: Vezirköprü Meslek Yüksekokulu Müdürlüğü @@ -506,7 +506,7 @@ - name: Vezirköprü Meslek Yüksekokulu Sekreterliği detsis_id: 48974914 - parent_yoksis_id: 61206311 + parent_detsis_id: 61206311 district_id: Vezirköprü - name: Muhasebe Ve Vergi Bölüm Başkanlığı @@ -519,14 +519,19 @@ parent_yoksis_id: 207454 district_id: Vezirköprü - - name: Vezirköprü Meslek Yüksekokulu Kurulu + name: Vezirköprü Meslek Yüksekokulu Disiplin Kurulu detsis_id: 46275906 - parent_yoksis_id: 61206311 + parent_detsis_id: 61206311 + district_id: Vezirköprü +- + name: Vezirköprü Meslek Yüksekokulu Kurulu + detsis_id: 19993096 + parent_detsis_id: 61206311 district_id: Vezirköprü - name: Vezirköprü Meslek Yüksekokulu Yönetim Kurulu detsis_id: 43583466 - parent_yoksis_id: 61206311 + parent_detsis_id: 61206311 district_id: Vezirköprü - name: Havacılık Ve Uzay Teknolojileri Uygulama Araştırma Merkezi Müdürlüğü @@ -571,7 +576,7 @@ - name: Yeşilyurt Demir Çelik Meslek Yüksekokulu Sekreterliği detsis_id: 37077418 - parent_yoksis_id: 30423168 + parent_detsis_id: 30423168 district_id: Tekkeköy - name: Motorlu Araçlar Ve Ulaştırma Teknolojileri Bölüm Başkanlığı @@ -581,17 +586,17 @@ - name: Yeşilyurt Demir Çelik Meslek Yüksekokulu Disiplin Kurulu detsis_id: 55101226 - parent_yoksis_id: 30423168 + parent_detsis_id: 30423168 district_id: Tekkeköy - name: Yeşilyurt Demir Çelik Meslek Yüksekokulu Kurulu detsis_id: 75674136 - parent_yoksis_id: 30423168 + parent_detsis_id: 30423168 district_id: Tekkeköy - name: Yeşilyurt Demir Çelik Meslek Yüksekokulu Yönetim Kurulu detsis_id: 66604919 - parent_yoksis_id: 30423168 + parent_detsis_id: 30423168 district_id: Tekkeköy - name: Atatürk İlkeleri Ve İnkılap Tarihi Araştırma Ve Uygulama Merkezi Müdürlüğü @@ -616,7 +621,7 @@ - name: Yazılım Talepleri Değerlendirme Komisyonu detsis_id: 35354231 - parent_yoksis_id: 38418139 + parent_detsis_id: 38418139 district_id: Atakum - name: Bölgesel Kalkınma Ve Stratejik Araştırmalar Uygulama Ve Araştırma Merkezi Müdürlüğü @@ -646,12 +651,12 @@ - name: Ağız Ve Diş Sağlığı Eğitim Ve Araştırma Hastanesi Başhekimliği detsis_id: 99439659 - parent_yoksis_id: 45458912 + parent_detsis_id: 45458912 district_id: Atakum - name: Diş Hekimliği Fakültesi Sekreterliği detsis_id: 60761909 - parent_yoksis_id: 45458912 + parent_detsis_id: 45458912 district_id: Atakum - name: Klinik Bilimler Bölüm Başkanlığı @@ -691,17 +696,17 @@ - name: Diş Hekimliği Fakülte Disiplin Kurulu detsis_id: 64223946 - parent_yoksis_id: 45458912 + parent_detsis_id: 45458912 district_id: Atakum - name: Diş Hekimliği Fakülte Kurulu detsis_id: 76916655 - parent_yoksis_id: 45458912 + parent_detsis_id: 45458912 district_id: Atakum - name: Diş Hekimliği Fakülte Yönetim Kurulu detsis_id: 5618961 - parent_yoksis_id: 45458912 + parent_detsis_id: 45458912 district_id: Atakum - name: Eğitim Bilimleri Enstitüsü Müdürlüğü @@ -711,22 +716,22 @@ - name: Eğitim Bilimleri Enstitü Sekreterliği detsis_id: 27148102 - parent_yoksis_id: 42301062 + parent_detsis_id: 42301062 district_id: Atakum - name: Eğitim Bilimleri Enstitü Disiplin Kurulu detsis_id: 60162193 - parent_yoksis_id: 42301062 + parent_detsis_id: 42301062 district_id: Atakum - name: Eğitim Bilimleri Enstitü Kurulu detsis_id: 39971369 - parent_yoksis_id: 42301062 + parent_detsis_id: 42301062 district_id: Atakum - name: Eğitim Bilimleri Enstitü Yönetim Kurulu detsis_id: 90709856 - parent_yoksis_id: 42301062 + parent_detsis_id: 42301062 district_id: Atakum - name: Eğitim Fakültesi Dekanlığı @@ -776,7 +781,7 @@ - name: Eğitim Fakültesi Sekreterliği detsis_id: 97972159 - parent_yoksis_id: 98725097 + parent_detsis_id: 98725097 district_id: Atakum - name: Güzel Sanatlar Eğitimi Bölüm Başkanlığı @@ -901,17 +906,17 @@ - name: Eğitim Fakültesi Disiplin Kurulu detsis_id: 86432742 - parent_yoksis_id: 98725097 + parent_detsis_id: 98725097 district_id: Atakum - name: Eğitim Fakültesi Kurulu detsis_id: 55818690 - parent_yoksis_id: 98725097 + parent_detsis_id: 98725097 district_id: Atakum - name: Eğitim Fakültesi Yönetim Kurulu detsis_id: 47695088 - parent_yoksis_id: 98725097 + parent_detsis_id: 98725097 district_id: Atakum - name: Erasmus Değişim Programı Koordinatörlüğü @@ -931,22 +936,22 @@ - name: Fen Bilimleri Enstitü Sekreterliği detsis_id: 75119924 - parent_yoksis_id: 43847920 + parent_detsis_id: 43847920 district_id: Atakum - name: Fen Bilimleri Enstitü Disiplin Kurulu detsis_id: 96900798 - parent_yoksis_id: 43847920 + parent_detsis_id: 43847920 district_id: Atakum - name: Fen Bilimleri Enstitü Kurulu detsis_id: 11805131 - parent_yoksis_id: 43847920 + parent_detsis_id: 43847920 district_id: Atakum - name: Fen Bilimleri Enstitü Yönetim Kurulu detsis_id: 17608650 - parent_yoksis_id: 43847920 + parent_detsis_id: 43847920 district_id: Atakum - name: Fen Edebiyat Fakültesi Dekanlığı @@ -1036,7 +1041,7 @@ - name: Fen Edebiyat Fakülte Sekreterliği detsis_id: 67917440 - parent_yoksis_id: 41130367 + parent_detsis_id: 41130367 district_id: Atakum - name: Felsefe Bölüm Başkanlığı @@ -1141,7 +1146,7 @@ - name: Atom Ve Molekül Fiziği Anabilim Dalı Başkanlığı detsis_id: 70813888 - parent_yoksis_id: 122018 + parent_detsis_id: 71950693 district_id: Atakum - name: Biyokimya Anabilim Dalı Başkanlığı @@ -1341,17 +1346,17 @@ - name: Fen Edebiyat Fakülte Disiplin Kurulu detsis_id: 68341997 - parent_yoksis_id: 41130367 + parent_detsis_id: 41130367 district_id: Atakum - name: Fen Edebiyat Fakülte Kurulu detsis_id: 20824451 - parent_yoksis_id: 41130367 + parent_detsis_id: 41130367 district_id: Atakum - name: Fen Edebiyat Fakülte Yönetim Kurulu detsis_id: 14753958 - parent_yoksis_id: 41130367 + parent_detsis_id: 41130367 district_id: Atakum - name: Gelişimsel Eğitim Araştırma Uygulama Merkezi Müdürlüğü @@ -1371,7 +1376,7 @@ - name: Güzel Sanatlar Enstitü Sekreterliği detsis_id: 64024110 - parent_yoksis_id: 28913907 + parent_detsis_id: 28913907 district_id: Atakum - name: Tıbbi Resimleme Anabilim Dalı Başkanlığı @@ -1381,17 +1386,17 @@ - name: Güzel Sanatlar Enstitü Disiplin Kurulu detsis_id: 94725245 - parent_yoksis_id: 28913907 + parent_detsis_id: 28913907 district_id: Atakum - name: Güzel Sanatlar Enstitü Kurulu detsis_id: 86004387 - parent_yoksis_id: 28913907 + parent_detsis_id: 28913907 district_id: Atakum - name: Güzel Sanatlar Enstitü Yönetim Kurulu detsis_id: 28791890 - parent_yoksis_id: 28913907 + parent_detsis_id: 28913907 district_id: Atakum - name: Hukuk Müşavirliği @@ -1496,17 +1501,17 @@ - name: İktisadi Ve İdari Bilimler Fakülte Disiplin Kurulu detsis_id: 58745977 - parent_yoksis_id: 50569681 + parent_detsis_id: 50569681 district_id: Atakum - name: İktisadi Ve İdari Bilimler Fakülte Kurulu detsis_id: 58611596 - parent_yoksis_id: 50569681 + parent_detsis_id: 50569681 district_id: Atakum - name: İktisadi Ve İdari Bilimler Fakülte Yönetim Kurulu detsis_id: 81660084 - parent_yoksis_id: 50569681 + parent_detsis_id: 50569681 district_id: Atakum - name: İlahiyat Fakültesi Dekanlığı @@ -1516,7 +1521,7 @@ - name: İlahiyat Fakülte Sekreterliği detsis_id: 10986835 - parent_yoksis_id: 79586685 + parent_detsis_id: 79586685 district_id: Atakum - name: Felsefe Ve Din Bilimleri Bölüm Başkanlığı @@ -1646,17 +1651,17 @@ - name: İlahiyat Fakülte Disiplin Kurulu detsis_id: 76774637 - parent_yoksis_id: 79586685 + parent_detsis_id: 79586685 district_id: Atakum - name: İlahiyat Fakülte Kurulu detsis_id: 90949410 - parent_yoksis_id: 79586685 + parent_detsis_id: 79586685 district_id: Atakum - name: İlahiyat Fakülte Yönetim Kurulu detsis_id: 55929602 - parent_yoksis_id: 79586685 + parent_detsis_id: 79586685 district_id: Atakum - name: İş Sağlığı Ve Güvenliği, Meslekhastalıkları Uygulama Ve Araştırma Merkezi Müdürlüğü @@ -1791,7 +1796,7 @@ - name: Mühendislik Fakülte Sekreterliği detsis_id: 45476048 - parent_yoksis_id: 81181891 + parent_detsis_id: 81181891 district_id: Atakum - name: Gıda Mühendisliği Bölüm Başkanlığı @@ -1936,17 +1941,17 @@ - name: Mühendislik Fakülte Disiplin Kurulu detsis_id: 35273770 - parent_yoksis_id: 81181891 + parent_detsis_id: 81181891 district_id: Atakum - name: Mühendislik Fakülte Kurulu detsis_id: 43335087 - parent_yoksis_id: 81181891 + parent_detsis_id: 81181891 district_id: Atakum - name: Mühendislik Fakülte Yönetim Kurulu detsis_id: 96980227 - parent_yoksis_id: 81181891 + parent_detsis_id: 81181891 district_id: Atakum - name: Okul Öncesi Eğitimi Uygulama Ve Araştırma Merkezi Müdürlüğü @@ -1996,17 +2001,17 @@ - name: Sağlık Bilimleri Enstitü Disiplin Kurulu detsis_id: 29283638 - parent_yoksis_id: 93771576 + parent_detsis_id: 93771576 district_id: Atakum - name: Sağlık Bilimleri Enstitü Kurulu detsis_id: 99323623 - parent_yoksis_id: 93771576 + parent_detsis_id: 93771576 district_id: Atakum - name: Sağlık Bilimleri Enstitü Yönetim Kurulu detsis_id: 99576486 - parent_yoksis_id: 93771576 + parent_detsis_id: 93771576 district_id: Atakum - name: Sağlık Bilimleri Fakültesi Dekanlığı @@ -2061,7 +2066,7 @@ - name: Sağlık Bilimleri Fakülte Sekreterliği detsis_id: 82204150 - parent_yoksis_id: 28050591 + parent_detsis_id: 28050591 district_id: Atakum - name: Hemşirelik Bölüm Başkanlığı @@ -2131,17 +2136,17 @@ - name: Sağlık Bilimleri Fakülte Disiplin Kurulu detsis_id: 30104911 - parent_yoksis_id: 28050591 + parent_detsis_id: 28050591 district_id: Atakum - name: Sağlık Bilimleri Fakülte Kurulu detsis_id: 78048140 - parent_yoksis_id: 28050591 + parent_detsis_id: 28050591 district_id: Atakum - name: Sağlık Bilimleri Fakülte Yönetim Kurulu detsis_id: 29075217 - parent_yoksis_id: 28050591 + parent_detsis_id: 28050591 district_id: Atakum - name: Sağlık Hizmetleri Meslek Yüksekokulu Müdürlüğü @@ -2156,7 +2161,7 @@ - name: Sağlık Hizmetleri Meslek Yüksekokulu Sekreterliği detsis_id: 90501840 - parent_yoksis_id: 45664456 + parent_detsis_id: 45664456 district_id: Atakum - name: Sağlık Bakım Hizmetleri Bölüm Başkanlığı @@ -2171,17 +2176,17 @@ - name: Sağlık Hizmetleri Meslek Yüksekokulu Disiplin Kurulu detsis_id: 81688174 - parent_yoksis_id: 45664456 + parent_detsis_id: 45664456 district_id: Atakum - name: Sağlık Hizmetleri Meslek Yüksekokulu Kurulu detsis_id: 69429532 - parent_yoksis_id: 45664456 + parent_detsis_id: 45664456 district_id: Atakum - name: Sağlık Hizmetleri Meslek Yüksekokulu Disiplin Kurulu detsis_id: 60577894 - parent_yoksis_id: 45664456 + parent_detsis_id: 45664456 district_id: Atakum - name: Sağlık Kültür Ve Spor Daire Başkanlığı @@ -2191,37 +2196,37 @@ - name: Güzel Sanatlar Kampüsü Şube Müdürlüğü detsis_id: 64211159 - parent_yoksis_id: 53521241 + parent_detsis_id: 53521241 district_id: Atakum - name: İdari İşler Şube Müdürlüğü detsis_id: 87380393 - parent_yoksis_id: 53521241 + parent_detsis_id: 53521241 district_id: Atakum - name: İktisadi İşletme Şube Müdürlüğü detsis_id: 88096012 - parent_yoksis_id: 53521241 + parent_detsis_id: 53521241 district_id: Atakum - name: Kültür Ve Spor Şube Müdürlüğü detsis_id: 27290195 - parent_yoksis_id: 53521241 + parent_detsis_id: 53521241 district_id: Atakum - name: Mali İşler Şube Müdürlüğü detsis_id: 69264226 - parent_yoksis_id: 53521241 + parent_detsis_id: 53521241 district_id: Atakum - name: Sağlık Hizmetleri Şube Müdürlüğü detsis_id: 50881910 - parent_yoksis_id: 53521241 + parent_detsis_id: 53521241 district_id: Atakum - name: Sosyal Hizmetler Şube Müdürlüğü detsis_id: 10539022 - parent_yoksis_id: 53521241 + parent_detsis_id: 53521241 district_id: Atakum - name: Sosyal Bilimler Enstitüsü Müdürlüğü @@ -2231,22 +2236,22 @@ - name: Sosyal Bilimler Enstitü Sekreterliği detsis_id: 35792979 - parent_yoksis_id: 61232311 + parent_detsis_id: 61232311 district_id: Atakum - name: Sosyal Bilimler Enstitü Disiplin Kurulu detsis_id: 96478647 - parent_yoksis_id: 61232311 + parent_detsis_id: 61232311 district_id: Atakum - name: Sosyal Bilimler Enstitü Kurulu detsis_id: 24254010 - parent_yoksis_id: 61232311 + parent_detsis_id: 61232311 district_id: Atakum - name: Sosyal Bilimler Enstitü Yönetim Kurulu detsis_id: 83752120 - parent_yoksis_id: 61232311 + parent_detsis_id: 61232311 district_id: Atakum - name: Strateji Geliştirme Daire Başkanlığı @@ -2256,22 +2261,22 @@ - name: Bütçe Performans Program Şube Müdürlüğü detsis_id: 18036936 - parent_yoksis_id: 91511444 + parent_detsis_id: 91511444 district_id: Atakum - name: İç Kontrol Ve Ön Mali Kontrol Şube Müdürlüğü detsis_id: 37272602 - parent_yoksis_id: 91511444 + parent_detsis_id: 91511444 district_id: Atakum - name: Muhasebe Kesin Hesap Ve Raporlama Şube Müdürlüğü detsis_id: 46578399 - parent_yoksis_id: 91511444 + parent_detsis_id: 91511444 district_id: Atakum - name: Stratejik Planlama Şube Müdürlüğü detsis_id: 56016456 - parent_yoksis_id: 91511444 + parent_detsis_id: 91511444 district_id: Atakum - name: Sürekli Eğitim Merkezi Müdürlüğü @@ -2471,7 +2476,7 @@ - name: Tıp Fakültesi Sekreterliği detsis_id: 19054817 - parent_yoksis_id: 45829229 + parent_detsis_id: 45829229 district_id: Atakum - name: Temel Tıp Bilimleri Bölüm Başkanlığı @@ -2531,22 +2536,22 @@ - name: Ameliyathane Koordinasyon Kurulu detsis_id: 64933695 - parent_yoksis_id: 45829229 + parent_detsis_id: 45829229 district_id: Atakum - name: Tıp Fakülte Disiplin Kurulu detsis_id: 95040631 - parent_yoksis_id: 45829229 + parent_detsis_id: 45829229 district_id: Atakum - name: Tıp Fakülte Kurulu detsis_id: 32835143 - parent_yoksis_id: 45829229 + parent_detsis_id: 45829229 district_id: Atakum - name: Tıp Fakülte Yönetim Kurulu detsis_id: 73169471 - parent_yoksis_id: 45829229 + parent_detsis_id: 45829229 district_id: Atakum - name: Türk Dili Bölüm Başkanlığı @@ -2581,12 +2586,12 @@ - name: Eğitim Uygulama Ve Araştırma Hastanesi Başhekimliği detsis_id: 96596525 - parent_yoksis_id: 32319693 + parent_detsis_id: 32319693 district_id: Atakum - name: Veteriner Fakültesi Sekreterliği detsis_id: 22223993 - parent_yoksis_id: 32319693 + parent_detsis_id: 32319693 district_id: Atakum - name: Klinik Bilimler Bölüm Başkanlığı @@ -2716,17 +2721,17 @@ - name: Veteriner Fakültesi Disiplin Kurulu detsis_id: 68979211 - parent_yoksis_id: 32319693 + parent_detsis_id: 32319693 district_id: Atakum - name: Veteriner Fakültesi Kurulu detsis_id: 12369507 - parent_yoksis_id: 32319693 + parent_detsis_id: 32319693 district_id: Atakum - name: Veteriner Fakültesi Yönetim Kurulu detsis_id: 85685189 - parent_yoksis_id: 32319693 + parent_detsis_id: 32319693 district_id: Atakum - name: Yabancı Diller Bölüm Başkanlığı @@ -2746,22 +2751,22 @@ - name: Yabancı Diller Yüksekokulu Sekreterliği detsis_id: 90040670 - parent_yoksis_id: 19676956 + parent_detsis_id: 19676956 district_id: Atakum - name: Yabancı Diller Yüksekokulu Disiplin Kurulu detsis_id: 56360828 - parent_yoksis_id: 19676956 + parent_detsis_id: 19676956 district_id: Atakum - name: Yabancı Diller Yüksekokulu Kurulu detsis_id: 43044129 - parent_yoksis_id: 19676956 + parent_detsis_id: 19676956 district_id: Atakum - name: Yabancı Diller Yüksekokulu Yönetim Kurulu detsis_id: 98617224 - parent_yoksis_id: 19676956 + parent_detsis_id: 19676956 district_id: Atakum - name: Yaratıcı Yazarlık Uygulama Ve Araştırma Merkezi Müdürlüğü @@ -2786,7 +2791,7 @@ - name: Yaşar Doğu Spor Bilimleri Fakülte Sekreterliği detsis_id: 88279611 - parent_yoksis_id: 80270232 + parent_detsis_id: 80270232 district_id: Atakum - name: Rekreasyon Bölüm Başkanlığı @@ -2801,17 +2806,17 @@ - name: Yaşar Doğu Spor Bilimleri Fakülte Disiplin Kurulu detsis_id: 43682562 - parent_yoksis_id: 80270232 + parent_detsis_id: 80270232 district_id: Atakum - name: Yaşar Doğu Spor Bilimleri Fakülte Kurulu detsis_id: 92455265 - parent_yoksis_id: 80270232 + parent_detsis_id: 80270232 district_id: Atakum - name: Yaşar Doğu Spor Bilimleri Fakülte Yönetim Kurulu detsis_id: 15350033 - parent_yoksis_id: 80270232 + parent_detsis_id: 80270232 district_id: Atakum - name: Ziraat Fakültesi Dekanlığı @@ -2831,7 +2836,7 @@ - name: Ziraat Fakülte Sekreterliği detsis_id: 20802809 - parent_yoksis_id: 52180288 + parent_detsis_id: 52180288 district_id: Atakum - name: Tarım Ekonomisi Bölüm Başkanlığı @@ -2871,17 +2876,17 @@ - name: Ziraat Fakülte Disiplin Kurulu detsis_id: 88222046 - parent_yoksis_id: 52180288 + parent_detsis_id: 52180288 district_id: Atakum - name: Ziraat Fakülte Kurulu detsis_id: 44737134 - parent_yoksis_id: 52180288 + parent_detsis_id: 52180288 district_id: Atakum - name: Ziraat Fakülte Yönetim Kurulu detsis_id: 62111144 - parent_yoksis_id: 52180288 + parent_detsis_id: 52180288 district_id: Atakum - name: Genel Sekreterlik @@ -2891,17 +2896,17 @@ - name: Genel Sekreter Yardımcılığı detsis_id: 30142872 - parent_yoksis_id: 90404739 + parent_detsis_id: 90404739 district_id: Atakum - name: İş Sağlığı Ve Güvenliği Şube Müdürlüğü detsis_id: 82259522 - parent_yoksis_id: 90404739 + parent_detsis_id: 90404739 district_id: Atakum - name: Arabuluculuk Komisyonu detsis_id: 51407721 - parent_yoksis_id: 90404739 + parent_detsis_id: 90404739 district_id: Atakum - name: Akademik Değerlendirme Ve Kalite Geliştirme Kurulu @@ -2966,7 +2971,7 @@ - name: Devlet Konservatuvarı Sekreterliği detsis_id: 52718513 - parent_yoksis_id: 95441125 + parent_detsis_id: 95441125 district_id: İlkadım - name: Müzik Bölüm Başkanlığı @@ -3006,7 +3011,7 @@ - name: Güzel Sanatlar Fakülte Sekreterliği detsis_id: 84694922 - parent_yoksis_id: 32859882 + parent_detsis_id: 32859882 district_id: İlkadım - name: Görsel İletişim Tasarımı Bölüm Başkanlığı @@ -3046,17 +3051,17 @@ - name: Güzel Sanatlar Fakülte Disiplin Kurulu detsis_id: 97565555 - parent_yoksis_id: 32859882 + parent_detsis_id: 32859882 district_id: İlkadım - name: Güzel Sanatlar Fakülte Kurulu detsis_id: 25054318 - parent_yoksis_id: 32859882 + parent_detsis_id: 32859882 district_id: İlkadım - name: Güzel Sanatlar Fakülte Yönetim Kurulu detsis_id: 52757481 - parent_yoksis_id: 32859882 + parent_detsis_id: 32859882 district_id: İlkadım - name: Mimarlık Fakültesi Dekanlığı @@ -3066,7 +3071,7 @@ - name: Mimarlık Fakülte Sekreterliği detsis_id: 80040216 - parent_yoksis_id: 85074962 + parent_detsis_id: 85074962 district_id: İlkadım - name: İç Mimarlık Bölüm Başkanlığı @@ -3101,17 +3106,17 @@ - name: Mimarlık Fakülte Disiplin Kurulu detsis_id: 35933795 - parent_yoksis_id: 85074962 + parent_detsis_id: 85074962 district_id: İlkadım - name: Mimarlık Fakülte Kurulu detsis_id: 36259705 - parent_yoksis_id: 85074962 + parent_detsis_id: 85074962 district_id: İlkadım - name: Mimarlık Fakülte Yönetim Kurulu detsis_id: 17012768 - parent_yoksis_id: 85074962 + parent_detsis_id: 85074962 district_id: İlkadım - name: Samsun Meslek Yüksekokulu Müdürlüğü @@ -3151,7 +3156,7 @@ - name: Samsun Meslek Yüksekokulu Sekreterliği detsis_id: 88496548 - parent_yoksis_id: 56591305 + parent_detsis_id: 56591305 district_id: İlkadım - name: Muhasebe Ve Vergi Bölüm Başkanlığı @@ -3181,15 +3186,15 @@ - name: Samsun Meslek Yüksekokulu Disiplin Kurulu detsis_id: 19817726 - parent_yoksis_id: 56591305 + parent_detsis_id: 56591305 district_id: İlkadım - name: Samsun Meslek Yüksekokulu Kurulu detsis_id: 25664880 - parent_yoksis_id: 56591305 + parent_detsis_id: 56591305 district_id: İlkadım - name: Samsun Meslek Yüksekokulu Yönetim Kurulu detsis_id: 10123157 - parent_yoksis_id: 56591305 + parent_detsis_id: 56591305 district_id: İlkadım From 98fe3584303050045806e32da94dd56f3d915cc5 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 8 Oct 2018 16:34:15 +0300 Subject: [PATCH 10/55] Check existing unit and update if there is --- lib/tasks/import/administrative_units.rake | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/tasks/import/administrative_units.rake b/lib/tasks/import/administrative_units.rake index 9e7b48436..04648fad5 100644 --- a/lib/tasks/import/administrative_units.rake +++ b/lib/tasks/import/administrative_units.rake @@ -7,16 +7,20 @@ namespace :import do progress_bar = ProgressBar.spawn('Administrative Units', file.count) file.each do |unit| - unit['district_id'] = District.find_by( - name: unit['district_id'] - ).id - unit['parent'] = Unit.find_by( - yoksis_id: unit['parent_yoksis_id'] - ) - unit['unit_status_id'] = UnitStatus.find_by( - name: 'Aktif' - ).id - Unit.create(unit.except('parent_yoksis_id')) + parent = + if unit['parent_yoksis_id'] + Unit.find_by(yoksis_id: unit['parent_yoksis_id']) + else + Unit.find_by(detsis_id: unit['parent_detsis_id']) + end + existing_unit = Unit.find_by(detsis_id: unit['detsis_id']) + + unit['district_id'] = District.find_by(name: unit['district_id']).id + unit['parent'] = parent + unit['unit_status_id'] = UnitStatus.find_by(name: 'Aktif').id + unit_params = unit.except('parent_yoksis_id', 'parent_detsis_id') + + existing_unit.present? ? existing_unit.update(unit_params) : Unit.create(unit_params) progress_bar&.increment end end From f6890b588e98c5294cbaa51894ba2743dc8607fc Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 9 Oct 2018 11:50:53 +0300 Subject: [PATCH 11/55] Create committee_decision model --- app/models/committee_decision.rb | 10 ++++++ app/models/meeting_agenda.rb | 1 + ...181009073057_create_committee_decisions.rb | 12 +++++++ db/schema.rb | 11 ++++++- test/fixtures/committee_decisions.yml | 14 ++++++++ test/models/committee/decision_test.rb | 32 +++++++++++++++++++ test/models/committee/meeting_agenda_test.rb | 1 + 7 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 app/models/committee_decision.rb create mode 100644 db/migrate/20181009073057_create_committee_decisions.rb create mode 100644 test/fixtures/committee_decisions.yml create mode 100644 test/models/committee/decision_test.rb diff --git a/app/models/committee_decision.rb b/app/models/committee_decision.rb new file mode 100644 index 000000000..204b5daa0 --- /dev/null +++ b/app/models/committee_decision.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class CommitteeDecision < ApplicationRecord + # relations + belongs_to :meeting_agenda + + # validations + validates :description, presence: true + validates :decision_no, presence: true, uniqueness: true +end diff --git a/app/models/meeting_agenda.rb b/app/models/meeting_agenda.rb index be6ca2a3b..349b70d64 100644 --- a/app/models/meeting_agenda.rb +++ b/app/models/meeting_agenda.rb @@ -4,6 +4,7 @@ class MeetingAgenda < ApplicationRecord # relations belongs_to :agenda belongs_to :committee_meeting + has_one :committee_decision # validations validates :sequence_no, presence: true, uniqueness: { scope: %i[committee_meeting] }, diff --git a/db/migrate/20181009073057_create_committee_decisions.rb b/db/migrate/20181009073057_create_committee_decisions.rb new file mode 100644 index 000000000..302aa30af --- /dev/null +++ b/db/migrate/20181009073057_create_committee_decisions.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class CreateCommitteeDecisions < ActiveRecord::Migration[5.2] + def change + create_table :committee_decisions do |t| + t.text :description, null: false, limit: 65535 + t.string :decision_no, null: false + t.references :meeting_agenda + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index ccec945f0..3b22cc3e7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2018_10_04_112631) do +ActiveRecord::Schema.define(version: 2018_10_09_073057) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -188,6 +188,15 @@ t.index ["country_id"], name: "index_cities_on_country_id" end + create_table "committee_decisions", force: :cascade do |t| + t.text "description", null: false + t.string "decision_no", null: false + t.bigint "meeting_agenda_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["meeting_agenda_id"], name: "index_committee_decisions_on_meeting_agenda_id" + end + create_table "committee_meetings", force: :cascade do |t| t.integer "meeting_no", null: false t.date "meeting_date", null: false diff --git a/test/fixtures/committee_decisions.yml b/test/fixtures/committee_decisions.yml new file mode 100644 index 000000000..6cf9c7dff --- /dev/null +++ b/test/fixtures/committee_decisions.yml @@ -0,0 +1,14 @@ +one: + description: Mühendislik Fakültesi Yönetim Kurulu test kararı 1 + decision_no: 2018/1 + meeting_agenda: one + +two: + description: Mühendislik Fakültesi Yönetim Kurulu test kararı 2 + decision_no: 2018/2 + meeting_agenda: one + +three: + description: Mühendislik Fakültesi Yönetim Kurulu test kararı 3 + decision_no: 2018/3 + meeting_agenda: one \ No newline at end of file diff --git a/test/models/committee/decision_test.rb b/test/models/committee/decision_test.rb new file mode 100644 index 000000000..b55e6ee86 --- /dev/null +++ b/test/models/committee/decision_test.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'test_helper' + +class DecisionTest < ActiveSupport::TestCase + setup do + @decision = committee_decisions(:one) + end + + # relations + test 'decision can communicate with meeting_agenda' do + assert @decision.meeting_agenda + end + + # validations: presence + %i[ + description + decision_no + ].each do |property| + test "presence validations for #{property} of a decision" do + @decision.send("#{property}=", nil) + assert_not @decision.valid? + assert_not_empty @decision.errors[property] + end + end + + # validations: uniqueness + test 'uniqueness validations for decision_no of a desicion' do + fake_decision = @decision.dup + assert_not fake_decision.valid? + end +end diff --git a/test/models/committee/meeting_agenda_test.rb b/test/models/committee/meeting_agenda_test.rb index 6e38884ab..e6c10a92e 100644 --- a/test/models/committee/meeting_agenda_test.rb +++ b/test/models/committee/meeting_agenda_test.rb @@ -7,6 +7,7 @@ class MeetingAgendaTest < ActiveSupport::TestCase %i[ agenda committee_meeting + committee_decision ].each do |property| test "a meeting agenda can communicate with #{property}" do assert meeting_agendas(:one).send(property) From 651a3d9bcfb5f034dc2171c82c161d8abe643b0f Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Tue, 9 Oct 2018 16:11:50 +0300 Subject: [PATCH 12/55] Add shortcut link agendas and meetings --- app/models/meeting_agenda.rb | 1 + app/views/committee/agendas/index.html.erb | 5 +++ app/views/committee/meetings/index.html.erb | 5 +++ config/locales/models/committees/en.yml | 34 +++++++++++---------- config/locales/models/committees/tr.yml | 34 +++++++++++---------- 5 files changed, 47 insertions(+), 32 deletions(-) diff --git a/app/models/meeting_agenda.rb b/app/models/meeting_agenda.rb index 349b70d64..575c52e5d 100644 --- a/app/models/meeting_agenda.rb +++ b/app/models/meeting_agenda.rb @@ -13,4 +13,5 @@ class MeetingAgenda < ApplicationRecord # delegates delegate :description, :status, :agenda_type, to: :agenda + delegate :meeting_no, :meeting_date, :year, :unit, to: :committee_meeting end diff --git a/app/views/committee/agendas/index.html.erb b/app/views/committee/agendas/index.html.erb index 80f391e7a..dffeead0b 100644 --- a/app/views/committee/agendas/index.html.erb +++ b/app/views/committee/agendas/index.html.erb @@ -1,5 +1,10 @@
<%= link_to_new new_committee_agenda_path(@committee), t('.new_agenda_link') %> + + <%= link_to(fa_icon('archive', text: t('.meetings')), + committee_meetings_path(@committee), + class: 'btn btn-dark btn-sm') %> +
diff --git a/app/views/committee/meetings/index.html.erb b/app/views/committee/meetings/index.html.erb index eb39ae925..af4240984 100644 --- a/app/views/committee/meetings/index.html.erb +++ b/app/views/committee/meetings/index.html.erb @@ -1,5 +1,10 @@
<%= link_to_new new_committee_meeting_path(@committee), t('.new_committee_meeting_link') %> + + <%= link_to(fa_icon('tasks', text: t('.agendas')), + committee_agendas_path(@committee), + class: 'btn btn-dark btn-sm') %> +
diff --git a/config/locales/models/committees/en.yml b/config/locales/models/committees/en.yml index d299148c7..be8de7f28 100644 --- a/config/locales/models/committees/en.yml +++ b/config/locales/models/committees/en.yml @@ -23,22 +23,6 @@ en: delayed: Delayed recent: Recent committee: - agenda_types: - create: - success: Agenda Type successfully created. - destroy: - success: Agenda Type successfully deleted. - warning: Agenda Type can not be deleted! - edit: - form_title: Update the Agenda Type - index: - <<: *agenda_type_attributes - card_header: Agenda Types - new_agenda_type_link: Create a New Agenda Type - new: - form_title: Create a Agenda Type - update: - success: Agenda Type successfully updated. agendas: create: success: Agenda successfully created. @@ -53,6 +37,7 @@ en: card_header: Agendas new_agenda_link: Create a New Agenda unit: Unit + meetings: Meetings new: form_title: Create a Agenda search: @@ -61,6 +46,22 @@ en: status: Agenda Status update: success: Agenda successfully updated. + agenda_types: + create: + success: Agenda Type successfully created. + destroy: + success: Agenda Type successfully deleted. + warning: Agenda Type can not be deleted! + edit: + form_title: Update the Agenda Type + index: + <<: *agenda_type_attributes + card_header: Agenda Types + new_agenda_type_link: Create a New Agenda Type + new: + form_title: Create a Agenda Type + update: + success: Agenda Type successfully updated. dashboard: index: agendas: Agendas @@ -85,6 +86,7 @@ en: agendas: Agendas new_agenda_link: Add a New Agenda index: + agendas: Agendas agendas_count: Agendas Count card_header: Committee Meetings meeting_date: Committee Meeting Date diff --git a/config/locales/models/committees/tr.yml b/config/locales/models/committees/tr.yml index 0b72670f9..2a943b2c2 100644 --- a/config/locales/models/committees/tr.yml +++ b/config/locales/models/committees/tr.yml @@ -23,22 +23,6 @@ tr: delayed: Ertelendi recent: Yeni committee: - agenda_types: - create: - success: Gündem Türü başarıyla oluşturuldu. - destroy: - success: Gündem Türü başarıyla silindi. - warning: Gündem Türü silinemedi! - edit: - form_title: Gündem Türü Güncelle - index: - <<: *agenda_type_attributes - card_header: Gündem Türleri - new_agenda_type_link: Yeni Bir Gündem Türü Oluştur - new: - form_title: Gündem Türü Oluştur - update: - success: Gündem Türü başarıyla güncellendi. agendas: create: success: Gündem başarıyla oluşturuldu. @@ -53,6 +37,7 @@ tr: card_header: Gündemler new_agenda_link: Yeni Bir Gündem Oluştur unit: Birim + meetings: Toplantılar new: form_title: Gündem Oluştur search: @@ -61,6 +46,22 @@ tr: status: Gündem Durumu update: success: Gündem başarıyla güncellendi. + agenda_types: + create: + success: Gündem Türü başarıyla oluşturuldu. + destroy: + success: Gündem Türü başarıyla silindi. + warning: Gündem Türü silinemedi! + edit: + form_title: Gündem Türü Güncelle + index: + <<: *agenda_type_attributes + card_header: Gündem Türleri + new_agenda_type_link: Yeni Bir Gündem Türü Oluştur + new: + form_title: Gündem Türü Oluştur + update: + success: Gündem Türü başarıyla güncellendi. dashboard: index: agendas: Gündemler @@ -85,6 +86,7 @@ tr: agendas: Gündemler new_agenda_link: Gündem Ekle index: + agendas: Gündemler agendas_count: Gündem Sayısı card_header: Toplantılar meeting_date: Toplantı Tarihi From c99f8b9bc1bbf9b91a8773c89c367358f8160a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20Can=20Y=C4=B1lmaz?= Date: Tue, 9 Oct 2018 21:26:09 +0300 Subject: [PATCH 13/55] Fix secret_key_base From a81c5cefe094a1ae7b0e4bb46985965b6d411258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20Can=20Y=C4=B1lmaz?= Date: Tue, 9 Oct 2018 23:29:08 +0300 Subject: [PATCH 14/55] Dokku Dockerfile deployment --- .buildpacks | 4 ---- Dockerfile | 27 +++++++++++++++++++++++++++ bin/paas | 4 +++- 3 files changed, 30 insertions(+), 5 deletions(-) delete mode 100644 .buildpacks create mode 100644 Dockerfile diff --git a/.buildpacks b/.buildpacks deleted file mode 100644 index 6aeba6dfe..000000000 --- a/.buildpacks +++ /dev/null @@ -1,4 +0,0 @@ -https://github.com/heroku/heroku-buildpack-activestorage-preview.git -https://github.com/heroku/heroku-buildpack-nodejs.git#v123 -https://github.com/heroku/heroku-buildpack-ruby.git#v190 -https://github.com/mokolabs/heroku-buildpack-vips.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..9f283263c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM ondokuz/ruby-stretch:0.10.0 + +ARG RAILS_ENV +ENV RAILS_ENV=$RAILS_ENV + +ARG RAILS_MASTER_KEY +ENV RAILS_MASTER_KEY=$RAILS_MASTER_KEY + +ENV RAILS_SERVE_STATIC_FILES=enabled +ENV RAILS_LOG_TO_STDOUT=enabled + +WORKDIR /app + +COPY .ruby-version ./ +COPY Gemfile Gemfile.lock ./ +COPY package.json yarn.lock ./ + +RUN bundle install --without development:test -j4 --deployment +RUN yarn install + +COPY . ./ + +RUN bundle exec rake assets:precompile + +EXPOSE 3000 + +CMD bundle exec puma -C config/puma.rb diff --git a/bin/paas b/bin/paas index 21ccdffc7..3db69ea8c 100755 --- a/bin/paas +++ b/bin/paas @@ -52,7 +52,9 @@ main() { dokku redis:create $application-redis &>/dev/null || true dokku redis:link $application-redis $application - dokku config:set $application RAILS_ENV=beta RAILS_LOG_TO_STDOUT=true RAILS_MASTER_KEY=$RAILS_MASTER_KEY + dokku docker-options:add $application build '--build-arg RAILS_ENV=beta' + dokku docker-options:add $application build '--build-arg RAILS_MASTER_KEY=$RAILS_MASTER_KEY' + dokku config:set $application RAILS_ENV=beta RAILS_MASTER_KEY=$RAILS_MASTER_KEY dokku ssh-keys:remove op &>/dev/null || true SCRIPT From 01d9f360e527e6c8198cbff658d0b1cf917e38c6 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 10 Oct 2018 14:23:04 +0300 Subject: [PATCH 15/55] Configure decision adding mechanism --- .../committee/decisions_controller.rb | 46 ++++++++++++++++++ .../committee/meetings_controller.rb | 2 +- app/models/meeting_agenda.rb | 2 +- app/models/unit.rb | 2 + app/views/committee/decisions/_form.html.erb | 48 +++++++++++++++++++ app/views/committee/decisions/edit.html.erb | 3 ++ app/views/committee/decisions/new.html.erb | 3 ++ app/views/committee/meetings/show.html.erb | 15 ++++++ config/locales/models/committees/en.yml | 28 +++++++++++ config/locales/models/committees/tr.yml | 29 +++++++++++ config/routes.rb | 3 ++ test/models/committee/meeting_agenda_test.rb | 2 +- test/models/unit_test.rb | 3 ++ 13 files changed, 183 insertions(+), 3 deletions(-) create mode 100644 app/controllers/committee/decisions_controller.rb create mode 100644 app/views/committee/decisions/_form.html.erb create mode 100644 app/views/committee/decisions/edit.html.erb create mode 100644 app/views/committee/decisions/new.html.erb diff --git a/app/controllers/committee/decisions_controller.rb b/app/controllers/committee/decisions_controller.rb new file mode 100644 index 000000000..03c70c029 --- /dev/null +++ b/app/controllers/committee/decisions_controller.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Committee + class DecisionsController < ApplicationController + before_action :set_committee_and_agenda + before_action :setup_decision, only: %i[edit update destroy] + + def new + @decision = @agenda.build_decision + end + + def create + @decision = @agenda.build_decision(decision_params) + @decision.save ? redirect_with('success') : render(:new) + end + + def edit; end + + def update + @decision.update(decision_params) ? redirect_with('success') : render(:edit) + end + + def destroy + @decision.destroy ? redirect_with('success') : redirect_with('warning') + end + + private + + def redirect_with(message) + redirect_to(committee_meeting_path(@committee, @agenda.committee_meeting), notice: t(".#{message}")) + end + + def set_committee_and_agenda + @committee = Unit.committees.find(params[:committee_id]) + @agenda = @committee.meeting_agendas.find(params[:meeting_agenda_id]) + end + + def setup_decision + @decision = @agenda.decision + end + + def decision_params + params.require(:committee_decision).permit(:description, :decision_no) + end + end +end diff --git a/app/controllers/committee/meetings_controller.rb b/app/controllers/committee/meetings_controller.rb index 1a6c6c490..4cf28f5b1 100644 --- a/app/controllers/committee/meetings_controller.rb +++ b/app/controllers/committee/meetings_controller.rb @@ -10,7 +10,7 @@ def index end def show - @agendas = @meeting.meeting_agendas.includes(agenda: :agenda_type).order(:sequence_no) + @agendas = @meeting.meeting_agendas.includes(:decision, agenda: :agenda_type).order(:sequence_no) end def new diff --git a/app/models/meeting_agenda.rb b/app/models/meeting_agenda.rb index 575c52e5d..c1d0ff2c1 100644 --- a/app/models/meeting_agenda.rb +++ b/app/models/meeting_agenda.rb @@ -4,7 +4,7 @@ class MeetingAgenda < ApplicationRecord # relations belongs_to :agenda belongs_to :committee_meeting - has_one :committee_decision + has_one :decision, dependent: :destroy, class_name: 'CommitteeDecision' # validations validates :sequence_no, presence: true, uniqueness: { scope: %i[committee_meeting] }, diff --git a/app/models/unit.rb b/app/models/unit.rb index 8d1b74781..884ea9e59 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -30,6 +30,8 @@ class Unit < ApplicationRecord has_many :administrative_functions, through: :duties has_many :agendas, dependent: :nullify has_many :meetings, dependent: :nullify, class_name: 'CommitteeMeeting' + has_many :meeting_agendas, through: :meetings + has_many :decisions, through: :meeting_agendas, class_name: 'CommitteeDecision' has_many :courses, dependent: :nullify has_many :registration_documents, dependent: :destroy has_many :prospective_students, dependent: :destroy diff --git a/app/views/committee/decisions/_form.html.erb b/app/views/committee/decisions/_form.html.erb new file mode 100644 index 000000000..38be234f6 --- /dev/null +++ b/app/views/committee/decisions/_form.html.erb @@ -0,0 +1,48 @@ +
+
+
+
+ <%= fa_icon 'tasks' %> + <%= form_title %> +
+
+ <%= simple_form_for([:committee, agenda, decision], url: url, method: method ) do |f| %> +
+
+ <%= f.error_notification %> + <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %> +
+ + + + + + + + + + + + + + + + + +
<%= t('.sequence_no') %><%= @agenda.sequence_no %>
<%= t('.description') %><%= @agenda.description %>
<%= t('.status') %><%= @agenda.status %>
<%= t('.agenda_type') %><%= @agenda.agenda_type.name %>
+
+ <%= f.input :description, required: true %> +
+
+ <%= f.input :decision_no, required: true %> +
+
+ <%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> + <%= link_to_back(:back) %> +
+
+ <% end %> +
+
+
+
diff --git a/app/views/committee/decisions/edit.html.erb b/app/views/committee/decisions/edit.html.erb new file mode 100644 index 000000000..53855e6c6 --- /dev/null +++ b/app/views/committee/decisions/edit.html.erb @@ -0,0 +1,3 @@ +<%= render 'form', agenda: @agenda, decision: @decision, + url: committee_meeting_agenda_decision_path(@committee, @agenda, @decision), + method: :patch, form_title: t('.form_title') %> diff --git a/app/views/committee/decisions/new.html.erb b/app/views/committee/decisions/new.html.erb new file mode 100644 index 000000000..8cc683b06 --- /dev/null +++ b/app/views/committee/decisions/new.html.erb @@ -0,0 +1,3 @@ +<%= render 'form', agenda: @agenda, decision: @decision, + url: committee_meeting_agenda_decisions_path(@committee, @agenda), + method: :post, form_title: t('.form_title') %> diff --git a/app/views/committee/meetings/show.html.erb b/app/views/committee/meetings/show.html.erb index 8872b970a..2f93d4535 100644 --- a/app/views/committee/meetings/show.html.erb +++ b/app/views/committee/meetings/show.html.erb @@ -39,6 +39,9 @@ <%= t('.description') %> <%= t('.status') %> <%= t('.agenda_type') %> + <%= t('.decision_no')%> + <%= t('.decision_description') %> + <%= t('actions') %> <% @agendas.each do |agenda| %> @@ -47,6 +50,18 @@ <%= agenda.description %> <%= agenda.status %> <%= agenda.agenda_type.name %> + <%= agenda.decision.try(:decision_no) %> + <%= agenda.decision.try(:description) %> + + <%= link_to_new(new_committee_meeting_agenda_decision_path(@committee, agenda), + t('.create_decision')) unless agenda.decision.present? %> + <% if agenda.decision.present? %> + <%= link_to_edit(edit_committee_meeting_agenda_decision_path(@committee, agenda), + t('.update_decision')) %> + <%= link_to_destroy(committee_meeting_agenda_decision_path(@committee, agenda), + t('.destroy_decision')) %> + <% end %> + <% end %> diff --git a/config/locales/models/committees/en.yml b/config/locales/models/committees/en.yml index be8de7f28..d961254c1 100644 --- a/config/locales/models/committees/en.yml +++ b/config/locales/models/committees/en.yml @@ -8,6 +8,9 @@ en: status: Agenda Status agenda_type: &agenda_type_attributes name: Name of Agenda Type + committee_decision: + description: Decision Description + decision_no: Decision No committee_meeting: &committee_meeting_attributes meeting_date: Committee Meeting Date meeting_no: Committee Meeting No @@ -74,6 +77,23 @@ en: unit_status: Unit Status unit_type: Unit Type yoksis_id: YOKSIS ID + decisions: + destroy: + success: Committee decision successfully deleted. + warning: Committee decision can not be deleted! + create: + success: Committee decision successfully created. + edit: + form_title: Update the Committee Decision + form: + agenda_type: Agenda Type + description: Agenda Description + sequence_no: Agenda Sequence No + status: Agenda Durum + new: + form_title: Create a New Committee Decision + update: + success: Committee Decision successfully updated. meetings: create: success: Committee Meeting successfully created. @@ -100,11 +120,16 @@ en: show: agendas: Agendas agenda_type: Agenda Type + create_decision: Create Decision + decision_description: Decision Description + decision_no: Decision No description: Description + destroy_decision: Destroy Decision meeting_date: Meeting Date meeting_no: Meeting No sequence_no: Sequence No status: Status + update_decision: Update Decision year: Year update: success: Committee Meeting successfully updated. @@ -116,6 +141,9 @@ en: agenda_type: create: Create Agenda Type update: Update Agenda Type + committee_decision: + create: Create Committee Decision + update: Create Committee Decision committee_meeting: create: Create Committee Meeting update: Update Committee Meeting diff --git a/config/locales/models/committees/tr.yml b/config/locales/models/committees/tr.yml index 2a943b2c2..7b8288dc3 100644 --- a/config/locales/models/committees/tr.yml +++ b/config/locales/models/committees/tr.yml @@ -8,6 +8,9 @@ tr: status: Gündem Durumu agenda_type: &agenda_type_attributes name: Gündem Türü Adı + committee_decision: + description: Karar Açıklaması + decision_no: Karar No committee_meeting: &committee_meeting_attributes meeting_date: Toplantı Tarihi meeting_no: Toplantı No @@ -74,6 +77,24 @@ tr: unit_status: Birim Durumu unit_type: Birim Türü yoksis_id: YOKSIS ID + decisions: + create: + success: Kurul kararı başarıyla oluşturuldu. + destroy: + success: Kurul kararı başarıyla silindi. + warning: Kurul kararı silinemedi! + edit: + form_title: Kurul Kararı Güncelle + form: + agenda_type: Gündem Türü + description: Gündem Açıklama + sequence_no: Gündem Sıra No + status: Gündem Durumu + new: + form_title: Kurul Kararı Oluştur + description: Kurul Kararı + update: + success: Kurul kararı başarıyla güncellendi. meetings: create: success: Toplantı başarıyla oluşturuldu. @@ -100,11 +121,16 @@ tr: show: agendas: Gündemler agenda_type: Gündem Türü + create_decision: Karar Ekle + decision_description: Toplantı Kararı + decision_no: Karar No description: Açıklama + destroy_decision: Karar Sil meeting_date: Toplantı Tarihi meeting_no: Toplantı No sequence_no: Sıra No status: Durum + update_decision: Karar Güncelle year: Yıl update: success: Toplantı başarıyla güncellendi. @@ -116,6 +142,9 @@ tr: agenda_type: create: Gündem Türü Oluştur update: Gündem Türü Güncelle + committee_decision: + create: Karar Oluştur + update: Karar Güncelle committee_meeting: create: Toplantı Oluştur update: Toplantı Güncelle diff --git a/config/routes.rb b/config/routes.rb index 6bc4aa51d..7b11809e2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -69,6 +69,9 @@ scope module: :committee do resources :agendas, except: :show resources :meetings + resources :meeting_agendas, only: [] do + resources :decisions, except: %i[show index] + end end end end diff --git a/test/models/committee/meeting_agenda_test.rb b/test/models/committee/meeting_agenda_test.rb index e6c10a92e..333264c4a 100644 --- a/test/models/committee/meeting_agenda_test.rb +++ b/test/models/committee/meeting_agenda_test.rb @@ -7,7 +7,7 @@ class MeetingAgendaTest < ActiveSupport::TestCase %i[ agenda committee_meeting - committee_decision + decision ].each do |property| test "a meeting agenda can communicate with #{property}" do assert meeting_agendas(:one).send(property) diff --git a/test/models/unit_test.rb b/test/models/unit_test.rb index 032969aa7..f9552b0d9 100644 --- a/test/models/unit_test.rb +++ b/test/models/unit_test.rb @@ -14,10 +14,13 @@ class UnitTest < ActiveSupport::TestCase duties employees students + users positions administrative_functions agendas meetings + meeting_agendas + decisions courses registration_documents prospective_students From e6d4771e4a90daa79467686025693771bdb63276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20Can=20Y=C4=B1lmaz?= Date: Wed, 10 Oct 2018 14:35:32 +0300 Subject: [PATCH 16/55] =?UTF-8?q?Develop=20dal=C4=B1=20otomatik=20deploy?= =?UTF-8?q?=20edilsin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7a5aa7d67..b5076a5c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,6 +109,16 @@ jobs: - run: bin/yarn install - run: bundle exec rake quality:rails - run: bundle exec rake security:all + deploy_develop: + machine: + enabled: true + steps: + - checkout + - run: + name: Deploy Develop to Dokku + command: | + git remote add develop dokku@app.omu.sh:nokul-develop && + git push develop develop:master deploy: machine: enabled: true @@ -138,6 +148,12 @@ workflows: - karma: requires: - bundle_assets + - deploy_develop: + requires: + - karma + filters: + branches: + only: develop - deploy: requires: - karma From f95ecc82371a8f26cd81d412e3a9de4e7571a36b Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 10 Oct 2018 14:47:50 +0300 Subject: [PATCH 17/55] Fix some view pages --- app/views/committee/decisions/_form.html.erb | 34 ++++++++++---------- app/views/committee/meetings/index.html.erb | 3 +- app/views/committee/meetings/show.html.erb | 6 ++++ config/locales/models/committees/en.yml | 1 + config/locales/models/committees/tr.yml | 3 +- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/app/views/committee/decisions/_form.html.erb b/app/views/committee/decisions/_form.html.erb index 38be234f6..af901e3f5 100644 --- a/app/views/committee/decisions/_form.html.erb +++ b/app/views/committee/decisions/_form.html.erb @@ -6,29 +6,29 @@ <%= form_title %>
- <%= simple_form_for([:committee, agenda, decision], url: url, method: method ) do |f| %> + <%= simple_form_for(decision, url: url, method: method ) do |f| %>
<%= f.error_notification %> <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
- - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +
<%= t('.sequence_no') %><%= @agenda.sequence_no %>
<%= t('.description') %><%= @agenda.description %>
<%= t('.status') %><%= @agenda.status %>
<%= t('.agenda_type') %><%= @agenda.agenda_type.name %>
<%= t('.sequence_no') %><%= @agenda.sequence_no %>
<%= t('.description') %><%= @agenda.description %>
<%= t('.status') %><%= @agenda.status %>
<%= t('.agenda_type') %><%= @agenda.agenda_type.name %>
<%= f.input :description, required: true %> diff --git a/app/views/committee/meetings/index.html.erb b/app/views/committee/meetings/index.html.erb index af4240984..ce8ac4ac6 100644 --- a/app/views/committee/meetings/index.html.erb +++ b/app/views/committee/meetings/index.html.erb @@ -1,8 +1,7 @@
<%= link_to_new new_committee_meeting_path(@committee), t('.new_committee_meeting_link') %> - <%= link_to(fa_icon('tasks', text: t('.agendas')), - committee_agendas_path(@committee), + <%= link_to(fa_icon('tasks', text: t('.agendas')), committee_agendas_path(@committee), class: 'btn btn-dark btn-sm') %>
diff --git a/app/views/committee/meetings/show.html.erb b/app/views/committee/meetings/show.html.erb index 2f93d4535..e35442428 100644 --- a/app/views/committee/meetings/show.html.erb +++ b/app/views/committee/meetings/show.html.erb @@ -1,5 +1,9 @@
<%= link_to_back(:back) %> + + <%= link_to(fa_icon('tasks', text: t('.agendas')), committee_agendas_path(@committee), + class: 'btn btn-dark btn-sm') %> +
@@ -41,6 +45,7 @@ <%= t('.agenda_type') %> <%= t('.decision_no')%> <%= t('.decision_description') %> + <%= t('.decision_date') %> <%= t('actions') %> @@ -52,6 +57,7 @@ <%= agenda.agenda_type.name %> <%= agenda.decision.try(:decision_no) %> <%= agenda.decision.try(:description) %> + <%= agenda.decision.try(:created_at).try(:to_date) %> <%= link_to_new(new_committee_meeting_agenda_decision_path(@committee, agenda), t('.create_decision')) unless agenda.decision.present? %> diff --git a/config/locales/models/committees/en.yml b/config/locales/models/committees/en.yml index d961254c1..9d6ab7c23 100644 --- a/config/locales/models/committees/en.yml +++ b/config/locales/models/committees/en.yml @@ -122,6 +122,7 @@ en: agenda_type: Agenda Type create_decision: Create Decision decision_description: Decision Description + decision_date: Decision Date decision_no: Decision No description: Description destroy_decision: Destroy Decision diff --git a/config/locales/models/committees/tr.yml b/config/locales/models/committees/tr.yml index 7b8288dc3..195ac36a2 100644 --- a/config/locales/models/committees/tr.yml +++ b/config/locales/models/committees/tr.yml @@ -122,7 +122,8 @@ tr: agendas: Gündemler agenda_type: Gündem Türü create_decision: Karar Ekle - decision_description: Toplantı Kararı + decision_description: Gündem Kararı + decision_date: Karar Tarihi decision_no: Karar No description: Açıklama destroy_decision: Karar Sil From 999979a3d9268bb6840f10a6c4f5f4c8b35bf9a6 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Wed, 10 Oct 2018 16:39:04 +0300 Subject: [PATCH 18/55] Make it appear agenda status enums --- app/views/committee/meetings/show.html.erb | 2 +- config/locales/models/committees/en.yml | 4 +++- config/locales/models/committees/tr.yml | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/committee/meetings/show.html.erb b/app/views/committee/meetings/show.html.erb index e35442428..bacd39e7b 100644 --- a/app/views/committee/meetings/show.html.erb +++ b/app/views/committee/meetings/show.html.erb @@ -53,7 +53,7 @@ <%= agenda.sequence_no %> <%= agenda.description %> - <%= agenda.status %> + <%= enum_t(agenda, :status) %> <%= agenda.agenda_type.name %> <%= agenda.decision.try(:decision_no) %> <%= agenda.decision.try(:description) %> diff --git a/config/locales/models/committees/en.yml b/config/locales/models/committees/en.yml index 9d6ab7c23..2c112427f 100644 --- a/config/locales/models/committees/en.yml +++ b/config/locales/models/committees/en.yml @@ -21,10 +21,12 @@ en: sequence_no: Sequence No enums: agenda: - statuses: + statuses: &agenda_statuses decided: Decided delayed: Delayed recent: Recent + meeting_agenda: + statuses: *agenda_statuses committee: agendas: create: diff --git a/config/locales/models/committees/tr.yml b/config/locales/models/committees/tr.yml index 195ac36a2..78e820371 100644 --- a/config/locales/models/committees/tr.yml +++ b/config/locales/models/committees/tr.yml @@ -21,10 +21,12 @@ tr: sequence_no: Sıra No enums: agenda: - statuses: + statuses: &agenda_statuses decided: Karar Verildi delayed: Ertelendi recent: Yeni + meeting_agenda: + statuses: *agenda_statuses committee: agendas: create: From c4c2337e69e4b37d4c5c0fa4851c81e954e5c129 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 11 Oct 2018 09:56:27 +0300 Subject: [PATCH 19/55] Fix view --- app/views/committee/decisions/_form.html.erb | 4 ++++ config/locales/models/committees/en.yml | 3 ++- config/locales/models/committees/tr.yml | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/committee/decisions/_form.html.erb b/app/views/committee/decisions/_form.html.erb index af901e3f5..a25bbeaa3 100644 --- a/app/views/committee/decisions/_form.html.erb +++ b/app/views/committee/decisions/_form.html.erb @@ -13,6 +13,10 @@ <%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
+ + + + diff --git a/config/locales/models/committees/en.yml b/config/locales/models/committees/en.yml index 2c112427f..9af2f1c0a 100644 --- a/config/locales/models/committees/en.yml +++ b/config/locales/models/committees/en.yml @@ -91,7 +91,8 @@ en: agenda_type: Agenda Type description: Agenda Description sequence_no: Agenda Sequence No - status: Agenda Durum + status: Agenda Status + unit: Unit new: form_title: Create a New Committee Decision update: diff --git a/config/locales/models/committees/tr.yml b/config/locales/models/committees/tr.yml index 78e820371..05e60f036 100644 --- a/config/locales/models/committees/tr.yml +++ b/config/locales/models/committees/tr.yml @@ -92,6 +92,7 @@ tr: description: Gündem Açıklama sequence_no: Gündem Sıra No status: Gündem Durumu + unit: Birim new: form_title: Kurul Kararı Oluştur description: Kurul Kararı From b67ebb60e84f60634594dbca16f6c9c4a19c53cd Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 11 Oct 2018 11:21:30 +0300 Subject: [PATCH 20/55] Ensure the committee decision is not deleted --- app/controllers/committee/decisions_controller.rb | 6 +----- app/views/committee/meetings/show.html.erb | 8 ++------ config/locales/models/committees/en.yml | 3 --- config/locales/models/committees/tr.yml | 3 --- config/routes.rb | 2 +- 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/app/controllers/committee/decisions_controller.rb b/app/controllers/committee/decisions_controller.rb index 03c70c029..387f120c2 100644 --- a/app/controllers/committee/decisions_controller.rb +++ b/app/controllers/committee/decisions_controller.rb @@ -3,7 +3,7 @@ module Committee class DecisionsController < ApplicationController before_action :set_committee_and_agenda - before_action :setup_decision, only: %i[edit update destroy] + before_action :setup_decision, only: %i[edit update] def new @decision = @agenda.build_decision @@ -20,10 +20,6 @@ def update @decision.update(decision_params) ? redirect_with('success') : render(:edit) end - def destroy - @decision.destroy ? redirect_with('success') : redirect_with('warning') - end - private def redirect_with(message) diff --git a/app/views/committee/meetings/show.html.erb b/app/views/committee/meetings/show.html.erb index bacd39e7b..379b97dcc 100644 --- a/app/views/committee/meetings/show.html.erb +++ b/app/views/committee/meetings/show.html.erb @@ -61,12 +61,8 @@ <% end %> diff --git a/config/locales/models/committees/en.yml b/config/locales/models/committees/en.yml index 9af2f1c0a..4d619bb97 100644 --- a/config/locales/models/committees/en.yml +++ b/config/locales/models/committees/en.yml @@ -80,9 +80,6 @@ en: unit_type: Unit Type yoksis_id: YOKSIS ID decisions: - destroy: - success: Committee decision successfully deleted. - warning: Committee decision can not be deleted! create: success: Committee decision successfully created. edit: diff --git a/config/locales/models/committees/tr.yml b/config/locales/models/committees/tr.yml index 05e60f036..5667a803d 100644 --- a/config/locales/models/committees/tr.yml +++ b/config/locales/models/committees/tr.yml @@ -82,9 +82,6 @@ tr: decisions: create: success: Kurul kararı başarıyla oluşturuldu. - destroy: - success: Kurul kararı başarıyla silindi. - warning: Kurul kararı silinemedi! edit: form_title: Kurul Kararı Güncelle form: diff --git a/config/routes.rb b/config/routes.rb index 7b11809e2..153c6b7a8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -70,7 +70,7 @@ resources :agendas, except: :show resources :meetings resources :meeting_agendas, only: [] do - resources :decisions, except: %i[show index] + resources :decisions, except: %i[show index destroy] end end end From c138990f41a169e114d6b5a5f65325a32dffb290 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 11 Oct 2018 13:54:26 +0300 Subject: [PATCH 21/55] Generate automatic of decision number --- app/controllers/committee/decisions_controller.rb | 2 +- app/models/committee_decision.rb | 12 ++++++++++++ app/views/committee/decisions/_form.html.erb | 3 --- .../20181009073057_create_committee_decisions.rb | 1 + db/schema.rb | 1 + test/fixtures/committee_decisions.yml | 3 +++ 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/controllers/committee/decisions_controller.rb b/app/controllers/committee/decisions_controller.rb index 387f120c2..116f2e73f 100644 --- a/app/controllers/committee/decisions_controller.rb +++ b/app/controllers/committee/decisions_controller.rb @@ -36,7 +36,7 @@ def setup_decision end def decision_params - params.require(:committee_decision).permit(:description, :decision_no) + params.require(:committee_decision).permit(:description, :decision_no, :year) end end end diff --git a/app/models/committee_decision.rb b/app/models/committee_decision.rb index 204b5daa0..a4acac870 100644 --- a/app/models/committee_decision.rb +++ b/app/models/committee_decision.rb @@ -7,4 +7,16 @@ class CommitteeDecision < ApplicationRecord # validations validates :description, presence: true validates :decision_no, presence: true, uniqueness: true + validates :year, presence: true + + # callbacks + before_validation { self.year = meeting_agenda_year } + before_validation { self.decision_no = "#{year}/#{count_of_decisions_by_year(year) + 1}" } + + # delegates + delegate :meeting_no, :meeting_date, :year, :unit, to: :meeting_agenda, prefix: true + + def count_of_decisions_by_year(year) + meeting_agenda_unit.decisions.where(year: year).count + end end diff --git a/app/views/committee/decisions/_form.html.erb b/app/views/committee/decisions/_form.html.erb index a25bbeaa3..24eae28d2 100644 --- a/app/views/committee/decisions/_form.html.erb +++ b/app/views/committee/decisions/_form.html.erb @@ -37,9 +37,6 @@
<%= f.input :description, required: true %>
-
- <%= f.input :decision_no, required: true %> -
<%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> <%= link_to_back(:back) %> diff --git a/db/migrate/20181009073057_create_committee_decisions.rb b/db/migrate/20181009073057_create_committee_decisions.rb index 302aa30af..459a6811c 100644 --- a/db/migrate/20181009073057_create_committee_decisions.rb +++ b/db/migrate/20181009073057_create_committee_decisions.rb @@ -5,6 +5,7 @@ def change create_table :committee_decisions do |t| t.text :description, null: false, limit: 65535 t.string :decision_no, null: false + t.integer :year, null: false t.references :meeting_agenda t.timestamps end diff --git a/db/schema.rb b/db/schema.rb index 3b22cc3e7..8952c0be4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -191,6 +191,7 @@ create_table "committee_decisions", force: :cascade do |t| t.text "description", null: false t.string "decision_no", null: false + t.integer "year", null: false t.bigint "meeting_agenda_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false diff --git a/test/fixtures/committee_decisions.yml b/test/fixtures/committee_decisions.yml index 6cf9c7dff..500b5c5f2 100644 --- a/test/fixtures/committee_decisions.yml +++ b/test/fixtures/committee_decisions.yml @@ -1,14 +1,17 @@ one: description: Mühendislik Fakültesi Yönetim Kurulu test kararı 1 decision_no: 2018/1 + year: 2018 meeting_agenda: one two: description: Mühendislik Fakültesi Yönetim Kurulu test kararı 2 decision_no: 2018/2 + year: 2018 meeting_agenda: one three: description: Mühendislik Fakültesi Yönetim Kurulu test kararı 3 decision_no: 2018/3 + year: 2018 meeting_agenda: one \ No newline at end of file From b5e89dc2acb5adb33df25ddc9de99d39a25d7ac1 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 11 Oct 2018 13:54:46 +0300 Subject: [PATCH 22/55] Refactor decision test --- test/models/committee/decision_test.rb | 27 +++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/test/models/committee/decision_test.rb b/test/models/committee/decision_test.rb index b55e6ee86..0ef245838 100644 --- a/test/models/committee/decision_test.rb +++ b/test/models/committee/decision_test.rb @@ -15,7 +15,6 @@ class DecisionTest < ActiveSupport::TestCase # validations: presence %i[ description - decision_no ].each do |property| test "presence validations for #{property} of a decision" do @decision.send("#{property}=", nil) @@ -24,9 +23,27 @@ class DecisionTest < ActiveSupport::TestCase end end - # validations: uniqueness - test 'uniqueness validations for decision_no of a desicion' do - fake_decision = @decision.dup - assert_not fake_decision.valid? + # delegates + %i[ + meeting_agenda_meeting_no + meeting_agenda_meeting_date + meeting_agenda_year + meeting_agenda_unit + ].each do |property| + test "a decision reach committee_meeting's #{property} parameter" do + assert @decision.send(property) + end + end + + # callbacks + test 'before initialize callback must run for year and decision_no attribute' do + decision = CommitteeDecision.create(description: 'Test Karar', meeting_agenda: meeting_agendas(:one)) + assert_equal 2018, decision.year + assert_equal '2018/4', decision.decision_no + end + + # custom + test 'count_of_decisions_by_year return decision count by year' do + assert_equal 3, @decision.count_of_decisions_by_year(2018) end end From a7435749a23f39fa6e411d4b2ab9a7475b68fa11 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 11 Oct 2018 14:25:08 +0300 Subject: [PATCH 23/55] Run before validation for only create action --- app/models/committee_decision.rb | 10 ++++++++-- test/models/committee/decision_test.rb | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/models/committee_decision.rb b/app/models/committee_decision.rb index a4acac870..39a839344 100644 --- a/app/models/committee_decision.rb +++ b/app/models/committee_decision.rb @@ -10,8 +10,7 @@ class CommitteeDecision < ApplicationRecord validates :year, presence: true # callbacks - before_validation { self.year = meeting_agenda_year } - before_validation { self.decision_no = "#{year}/#{count_of_decisions_by_year(year) + 1}" } + before_validation :set_year_and_decision_no, on: :create # delegates delegate :meeting_no, :meeting_date, :year, :unit, to: :meeting_agenda, prefix: true @@ -19,4 +18,11 @@ class CommitteeDecision < ApplicationRecord def count_of_decisions_by_year(year) meeting_agenda_unit.decisions.where(year: year).count end + + private + + def set_year_and_decision_no + self.year = meeting_agenda_year + self.decision_no = "#{year}/#{count_of_decisions_by_year(year) + 1}" + end end diff --git a/test/models/committee/decision_test.rb b/test/models/committee/decision_test.rb index 0ef245838..1f97a60fc 100644 --- a/test/models/committee/decision_test.rb +++ b/test/models/committee/decision_test.rb @@ -44,6 +44,6 @@ class DecisionTest < ActiveSupport::TestCase # custom test 'count_of_decisions_by_year return decision count by year' do - assert_equal 3, @decision.count_of_decisions_by_year(2018) + assert_equal 3, @decision.send(:count_of_decisions_by_year, 2018) end end From b63c422eabcab336572403c8a0a5d25bc77059b6 Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 11 Oct 2018 15:12:13 +0300 Subject: [PATCH 24/55] =?UTF-8?q?Ders=20ve=20m=C3=BCfradatlar=C4=B1n=20s?= =?UTF-8?q?=C4=B1ral=C4=B1=20gelmesini=20sa=C4=9Fla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/course_management/courses_controller.rb | 2 ++ .../course_management/curriculums_controller.rb | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/controllers/course_management/courses_controller.rb b/app/controllers/course_management/courses_controller.rb index 537bc8f61..dcdd44412 100644 --- a/app/controllers/course_management/courses_controller.rb +++ b/app/controllers/course_management/courses_controller.rb @@ -8,7 +8,9 @@ class CoursesController < ApplicationController def index courses = Course.includes(:unit, :language) + .order('units.name, courses.name') .dynamic_search(search_params(Course)) + @pagy, @courses = pagy(courses) end diff --git a/app/controllers/course_management/curriculums_controller.rb b/app/controllers/course_management/curriculums_controller.rb index 9b3fbfbca..ee2262754 100644 --- a/app/controllers/course_management/curriculums_controller.rb +++ b/app/controllers/course_management/curriculums_controller.rb @@ -6,9 +6,11 @@ class CurriculumsController < ApplicationController before_action :set_curriculum, only: %i[show edit update destroy] def index - @pagy, @curriculums = pagy( - Curriculum.includes(:unit).dynamic_search(search_params(Curriculum)) - ) + curriculums = Curriculum.includes(:unit) + .order(status: :desc, name: :asc) + .order('units.name') + .dynamic_search(search_params(Curriculum)) + @pagy, @curriculums = pagy(curriculums) end def show; end From 492b3d27980a4111075cae0874d57130e1d427b5 Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 11 Oct 2018 15:16:41 +0300 Subject: [PATCH 25/55] =?UTF-8?q?Birim=20modeline=20curriculumable=20ad?= =?UTF-8?q?=C4=B1nda=20scope=20ekle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Müfredat oluşturabilecek birimlere erişmek amacıyla oluşturulmuştur. --- app/models/unit.rb | 1 + test/models/unit_test.rb | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/app/models/unit.rb b/app/models/unit.rb index 8d1b74781..93d9f3e31 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -63,4 +63,5 @@ class Unit < ApplicationRecord .or(institutes) .or(rectorships) } + scope :curriculumable, -> { coursable } end diff --git a/test/models/unit_test.rb b/test/models/unit_test.rb index 032969aa7..02537713c 100644 --- a/test/models/unit_test.rb +++ b/test/models/unit_test.rb @@ -117,4 +117,15 @@ class UnitTest < ActiveSupport::TestCase Unit.rectorships.count assert_not_includes Unit.coursable, units(:uzem) end + + test 'curriculumable scope returns curriculumable units' do + assert_equal Unit.curriculumable.count.to_i, + Unit.departments.count + + Unit.faculties.count + + Unit.universities.count + + Unit.majors.count + + Unit.institutes.count + + Unit.rectorships.count + assert_not_includes Unit.curriculumable, units(:uzem) + end end From 978dc115a0a2679ad592ddc151f4f3473d0db70e Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 11 Oct 2018 15:17:24 +0300 Subject: [PATCH 26/55] =?UTF-8?q?Dynamic=20search=20i=C3=A7in=20test=20ekl?= =?UTF-8?q?e=20ve=20hata=20d=C3=BCzelt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/concerns/dynamic_search.rb | 4 +- test/models/concerns/dynamic_search_test.rb | 83 +++++++++++++++++++++ 2 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 test/models/concerns/dynamic_search_test.rb diff --git a/app/models/concerns/dynamic_search.rb b/app/models/concerns/dynamic_search.rb index b6aa5087d..d736b6bd9 100644 --- a/app/models/concerns/dynamic_search.rb +++ b/app/models/concerns/dynamic_search.rb @@ -19,14 +19,14 @@ def dynamic_search(params = {}) results = dynamic_where(params) - params[:term].present? ? results.search(params[:term]) : results + params[:term].present? ? results.reorder(nil).search(params[:term]) : results end private def dynamic_where(params) query = build_query_for_dynamic_where(params) - query.present? ? where(query) : current_scope + query.present? ? where(query) : (current_scope || all) end def build_query_for_dynamic_where(params) diff --git a/test/models/concerns/dynamic_search_test.rb b/test/models/concerns/dynamic_search_test.rb new file mode 100644 index 000000000..e990df966 --- /dev/null +++ b/test/models/concerns/dynamic_search_test.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +require 'test_helper' + +class DynamicSearchTest < ActiveSupport::TestCase + class DynamicSearchModel + include DynamicSearch + + def self.init + search_keys :foo, :bar + end + + def self.reset + remove_instance_variable(:@dynamic_search_keys) if defined?(@dynamic_search_keys) + end + end + + test 'should defined search keys for model' do + DynamicSearchModel.init + assert_equal DynamicSearchModel.dynamic_search_keys, %i[foo bar] + end + + test 'search keys not defined throws an error message when raised' do + DynamicSearchModel.reset + exception = assert_raise(ArgumentError) { DynamicSearchModel.dynamic_search_keys } + assert_equal 'must be defined in search_keys', exception.message + end + + test 'dynamic search parameters should only Hash' do + DynamicSearchModel.init + + ['Test', 5, nil].each do |parameter| + assert_raise(ArgumentError) { DynamicSearchModel.dynamic_search(parameter) } + end + + exception = assert_raise(ArgumentError) { + DynamicSearchModel.dynamic_search(->(item) { puts item }) + } + assert_equal 'parameter must be Hash', exception.message + end + + test 'queries can be generated according to parameters' do + DynamicSearchModel.init + + param1 = { foo: 'Test Foo', bar: '', term: 'Foo' } + param2 = { unkown: 'Test', term: 'Foo' } + param3 = {} + + query1 = DynamicSearchModel.send(:build_query_for_dynamic_where, param1) + query2 = DynamicSearchModel.send(:build_query_for_dynamic_where, param2) + query3 = DynamicSearchModel.send(:build_query_for_dynamic_where, param3) + + assert_equal query1, foo: 'Test Foo' + assert_equal query2, {} + assert_equal query3, {} + end + + test 'should dynamic search with empty parameter for course model' do + assert_equal Course.dynamic_search({}).count, Course.count + end + + test 'should dynamic search only term parameter for course model' do + courses = Course.dynamic_search(term: 'ATI101') + assert_includes courses, courses(:ati) + assert_not_includes courses, courses(:test) + end + + test 'dynamic search without term parameters' do + parameters = { unit_id: units(:omu).id, language_id: languages(:turkce).id, status: :passive } + assert_includes Course.dynamic_search(parameters), Course.where(parameters).first + assert_equal Course.dynamic_search(parameters).count, Course.where(parameters).count + end + + test 'blank query returns current_scope' do + courses = Course.where(unit_id: units(:omu).id).order(:name) + parameters = { unit_id: '', status: nil } + assert_equal courses.dynamic_search(parameters), courses + end + + test 'blank query and empty returns all' do + assert_equal Course.dynamic_search({}), Course.all + end +end From 8df07831ef8c3cca0b40f4b30bca65efedf79bd7 Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 11 Oct 2018 15:18:40 +0300 Subject: [PATCH 27/55] =?UTF-8?q?Employee=20modeli=20i=C3=A7in=20eksik=20m?= =?UTF-8?q?etod=20testini=20ekle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/fixtures/employees.yml | 4 ++++ test/models/employee/employee_test.rb | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/test/fixtures/employees.yml b/test/fixtures/employees.yml index f172d20a5..0e4a3eae8 100644 --- a/test/fixtures/employees.yml +++ b/test/fixtures/employees.yml @@ -6,3 +6,7 @@ serhat_passive: user: serhat title: associate_professor active: false +chief_john: + user: john + title: chief + active: true \ No newline at end of file diff --git a/test/models/employee/employee_test.rb b/test/models/employee/employee_test.rb index 501dfaab4..5d484f1c9 100644 --- a/test/models/employee/employee_test.rb +++ b/test/models/employee/employee_test.rb @@ -69,4 +69,10 @@ class EmployeeTest < ActiveSupport::TestCase assert active.to_a.include?(employees(:serhat_active)) assert_not active.to_a.include?(employees(:serhat_passive)) end + + # custom methods + test 'is an employee title academic' do + assert employees(:serhat_active).academic? + assert_not employees(:chief_john).academic? + end end From a73da62800c5b1f521e39e75a4ba84bb5464a5d2 Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 11 Oct 2018 15:20:38 +0300 Subject: [PATCH 28/55] =?UTF-8?q?Maksimum=20d=C3=B6nem=20say=C4=B1s=C4=B1n?= =?UTF-8?q?=C4=B1=20modelde=20sabit=20de=C4=9Fi=C5=9Fken=20ile=20tan=C4=B1?= =?UTF-8?q?mla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/curriculum.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/curriculum.rb b/app/models/curriculum.rb index 164305392..7eeb10ce2 100644 --- a/app/models/curriculum.rb +++ b/app/models/curriculum.rb @@ -5,6 +5,8 @@ class Curriculum < ApplicationRecord include PgSearch include DynamicSearch + MAX_NUMBER_OF_SEMESTERS = 12 + pg_search_scope( :search, against: %i[name], @@ -21,7 +23,9 @@ class Curriculum < ApplicationRecord # validations validates :name, presence: true, uniqueness: { scope: :unit_id } - validates :number_of_semesters, numericality: { greater_than: 0 } + validates :number_of_semesters, numericality: { + greater_than: 0, less_than_or_equal_to: MAX_NUMBER_OF_SEMESTERS + } validates :status, presence: true # enumerations From ec98cdbafbac891536f558ce47e067c5a4939d9d Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 11 Oct 2018 15:21:03 +0300 Subject: [PATCH 29/55] =?UTF-8?q?M=C3=BCfredat=20ekleme=20formunu=20d?= =?UTF-8?q?=C3=BCzelt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/course_management/curriculums/_form.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/course_management/curriculums/_form.html.erb b/app/views/course_management/curriculums/_form.html.erb index dbc87aaff..372398769 100644 --- a/app/views/course_management/curriculums/_form.html.erb +++ b/app/views/course_management/curriculums/_form.html.erb @@ -13,10 +13,10 @@ <%= f.input :name %>
- <%= f.association :unit, collection: Unit.active.departments %> + <%= f.association :unit, collection: Unit.active.curriculumable %>
- <%= f.input :number_of_semesters, collection: (2..12) %> + <%= f.input :number_of_semesters, collection: (2..Curriculum::MAX_NUMBER_OF_SEMESTERS) %>
<%= f.input :status, From b861e8693175a11ad780866593e7f7b7b420c532 Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 11 Oct 2018 15:22:06 +0300 Subject: [PATCH 30/55] =?UTF-8?q?Simplecov=20i=C3=A7in=20dizin=20gruplamal?= =?UTF-8?q?ar=C4=B1n=C4=B1=20ekle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_helper.rb b/test/test_helper.rb index 9147a9877..d1f0c91c1 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -6,6 +6,8 @@ require 'simplecov' SimpleCov.start 'rails' do add_filter '/app/channels' + add_group 'Services', 'app/services' + add_group 'Validators', 'app/validators' end require 'codacy-coverage' if ENV['CI'] From 3a511159dfdc4a18ef92519bf737b533fcbf7147 Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 11 Oct 2018 15:27:35 +0300 Subject: [PATCH 31/55] Fix rubocop offense --- test/models/concerns/dynamic_search_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/models/concerns/dynamic_search_test.rb b/test/models/concerns/dynamic_search_test.rb index e990df966..abc9ef04b 100644 --- a/test/models/concerns/dynamic_search_test.rb +++ b/test/models/concerns/dynamic_search_test.rb @@ -33,9 +33,9 @@ def self.reset assert_raise(ArgumentError) { DynamicSearchModel.dynamic_search(parameter) } end - exception = assert_raise(ArgumentError) { + exception = assert_raise(ArgumentError) do DynamicSearchModel.dynamic_search(->(item) { puts item }) - } + end assert_equal 'parameter must be Hash', exception.message end From d0b32719cfebec3c183492ea6261eb69aade08f5 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 11 Oct 2018 16:33:35 +0300 Subject: [PATCH 32/55] Fix typo and strong parameter --- app/controllers/committee/decisions_controller.rb | 2 +- config/locales/models/committees/en.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/committee/decisions_controller.rb b/app/controllers/committee/decisions_controller.rb index 116f2e73f..0fd7d5bc0 100644 --- a/app/controllers/committee/decisions_controller.rb +++ b/app/controllers/committee/decisions_controller.rb @@ -36,7 +36,7 @@ def setup_decision end def decision_params - params.require(:committee_decision).permit(:description, :decision_no, :year) + params.require(:committee_decision).permit(:description) end end end diff --git a/config/locales/models/committees/en.yml b/config/locales/models/committees/en.yml index 4d619bb97..6cbfa20ce 100644 --- a/config/locales/models/committees/en.yml +++ b/config/locales/models/committees/en.yml @@ -144,7 +144,7 @@ en: update: Update Agenda Type committee_decision: create: Create Committee Decision - update: Create Committee Decision + update: Update Committee Decision committee_meeting: create: Create Committee Meeting update: Update Committee Meeting From d73467aa4c8e1b4ceabd08391111d920c9046ce2 Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 11 Oct 2018 17:05:29 +0300 Subject: [PATCH 33/55] Add eslint config --- .circleci/config.yml | 1 + .eslintrc.json | 3 + package.json | 12 + yarn.lock | 1128 +++++++++++++++++++++++++++++++++++++++++- 4 files changed, 1143 insertions(+), 1 deletion(-) create mode 100644 .eslintrc.json diff --git a/.circleci/config.yml b/.circleci/config.yml index b5076a5c2..b688ef660 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -109,6 +109,7 @@ jobs: - run: bin/yarn install - run: bundle exec rake quality:rails - run: bundle exec rake security:all + - run: bin/yarn run lint deploy_develop: machine: enabled: true diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..d65823629 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "standard" +} \ No newline at end of file diff --git a/package.json b/package.json index 4c83b89b7..af9c3be88 100644 --- a/package.json +++ b/package.json @@ -7,5 +7,17 @@ "jquery.maskedinput": "^1.4.1", "select2": "^4.0.6-rc.1", "toastr": "^2.1.4" + }, + "devDependencies": { + "eslint": "^5.6.1", + "eslint-config-standard": "^12.0.0", + "eslint-plugin-import": "^2.14.0", + "eslint-plugin-node": "^7.0.1", + "eslint-plugin-promise": "^4.0.1", + "eslint-plugin-standard": "^4.0.0" + }, + "scripts": { + "lint": "eslint ./app/assets --color", + "lint-fix": "eslint ./app/assets --color --fix" } } diff --git a/yarn.lock b/yarn.lock index d9152df31..dc928aed2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,22 @@ # yarn lockfile v1 +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + "@coreui/coreui-free-bootstrap-admin-template@https://github.com/coreui/coreui-free-bootstrap-admin-template.git": version "2.1.1" resolved "https://github.com/coreui/coreui-free-bootstrap-admin-template.git#7210f054036504297db8b8e1de4df8857cef11e8" @@ -22,16 +38,19 @@ "@coreui/coreui-plugin-chartjs-custom-tooltips@1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@coreui/coreui-plugin-chartjs-custom-tooltips/-/coreui-plugin-chartjs-custom-tooltips-1.2.0.tgz#de251422454edbba6ba925da451cfecdf9b48b22" + integrity sha512-+dCytUJQ4xlMqlLoA9oOTCoxWEJSX9Kv+bCxSFJNqR1PvYzcpXGu/B6AO38GgLfanK0KDKe+uhf1jod7agsMJA== dependencies: ms "^2.1.1" "@coreui/coreui-plugin-npm-postinstall@^1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@coreui/coreui-plugin-npm-postinstall/-/coreui-plugin-npm-postinstall-1.0.2.tgz#6daeb2ec786580d9c0849b05bc3e8d0222d5c463" + integrity sha512-yeeoWp+bNS84nP1977Y8UCiQ9pssO+f4QuVj3i0/gYZFjjvOgxx0dnyWhtowD5sLYnCRMPlPpqyjwXze3SlkYg== "@coreui/coreui@2.0.4": version "2.0.4" resolved "https://registry.yarnpkg.com/@coreui/coreui/-/coreui-2.0.4.tgz#30afdbc86ec2c4672e21625ab192fc34439c16ed" + integrity sha512-OGmLVoNXknxyjfK2N2ELputhyy7qs4yA9imlEL7iZCgctsWASkh6YWzYz4UxY8ZeRp3LI48dWBLokUK6YETPEw== dependencies: "@coreui/coreui-plugin-npm-postinstall" "^1.0.2" bootstrap "^4.1.2" @@ -39,36 +58,139 @@ "@coreui/icons@0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@coreui/icons/-/icons-0.3.0.tgz#d5bece91b1442a9543593d1146bc8042b18489e3" + integrity sha512-RbBi5K5hUA8LUI9mM/i1BTaLjlyoS6kHwKbxWsH62+/j9L9WF8gAiJUhrNjMt1br8TY9RLeolyQys0E9480fIg== + +acorn-jsx@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e" + integrity sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw== + dependencies: + acorn "^5.0.3" + +acorn@^5.0.3, acorn@^5.6.0: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + +ajv-keywords@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" + integrity sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo= + +ajv@^6.0.1, ajv@^6.5.3: + version "6.5.4" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.4.tgz#247d5274110db653706b550fcc2b797ca28cfc59" + integrity sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" almond@~0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/almond/-/almond-0.3.3.tgz#a0e7c95ac7624d6417b4494b1e68bff693168a20" + integrity sha1-oOfJWsdiTWQXtElLHmi/9pMWiiA= + +ansi-escapes@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" + integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + bootstrap@4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.2.tgz#aee2a93472e61c471fc79fb475531dcbc87de326" + integrity sha512-3bP609EdMc/8EwgGp8KgpN8HwnR4V4lZ9CTi5pImMrXNxpkw7dK1B05aMwQWpG1ZWmTLlBSN/uzkuz5GsmQNFA== bootstrap@^4.1.2: version "4.1.3" resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.3.tgz#0eb371af2c8448e8c210411d0cb824a6409a12be" + integrity sha512-rDFIzgXcof0jDyjNosjv4Sno77X4KuPeFxG2XZZv1/Kc8DRVGVADdoQyyOVDwPqL36DDmtCQbrpMCqvpPLJQ0w== -chalk@^2.4.1: +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= + +chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + chart.js@^2.7.2: version "2.7.2" resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-2.7.2.tgz#3c9fde4dc5b95608211bdefeda7e5d33dffa5714" + integrity sha512-90wl3V9xRZ8tnMvMlpcW+0Yg13BelsGS9P9t0ClaDxv/hdypHDr/YAGf+728m11P5ljwyB0ZHfPKCapZFqSqYA== dependencies: chartjs-color "^2.1.0" moment "^2.10.2" @@ -76,101 +198,1105 @@ chart.js@^2.7.2: chartjs-color-string@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/chartjs-color-string/-/chartjs-color-string-0.5.0.tgz#8d3752d8581d86687c35bfe2cb80ac5213ceb8c1" + integrity sha512-amWNvCOXlOUYxZVDSa0YOab5K/lmEhbFNKI55PWc4mlv28BDzA7zaoQTGxSBgJMHIW+hGX8YUrvw/FH4LyhwSQ== dependencies: color-name "^1.0.0" chartjs-color@^2.1.0: version "2.2.0" resolved "https://registry.yarnpkg.com/chartjs-color/-/chartjs-color-2.2.0.tgz#84a2fb755787ed85c39dd6dd8c7b1d88429baeae" + integrity sha1-hKL7dVeH7YXDndbdjHsdiEKbrq4= dependencies: chartjs-color-string "^0.5.0" color-convert "^0.5.3" +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + color-convert@^0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-0.5.3.tgz#bdb6c69ce660fadffe0b0007cc447e1b9f7282bd" + integrity sha1-vbbGnOZg+t/+CwAHzER+G59ygr0= color-convert@^1.9.0: version "1.9.2" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" + integrity sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg== dependencies: color-name "1.1.1" color-name@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" + integrity sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok= color-name@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" + integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== + dependencies: + ms "^2.1.1" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + integrity sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag= + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +error-ex@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-config-standard@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz#638b4c65db0bd5a41319f96bba1f15ddad2107d9" + integrity sha512-COUz8FnXhqFitYj4DTqHzidjIL/t4mumGZto5c7DrBpvWoie+Sn3P4sLEzUGeYhRElWuFEf8K1S1EfvD1vixCQ== + +eslint-import-resolver-node@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" + integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== + dependencies: + debug "^2.6.9" + resolve "^1.5.0" + +eslint-module-utils@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" + integrity sha1-snA2LNiLGkitMIl2zn+lTphBF0Y= + dependencies: + debug "^2.6.8" + pkg-dir "^1.0.0" + +eslint-plugin-es@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-1.3.1.tgz#5acb2565db4434803d1d46a9b4cbc94b345bd028" + integrity sha512-9XcVyZiQRVeFjqHw8qHNDAZcQLqaHlOGGpeYqzYh8S4JYCWTCO3yzyen8yVmA5PratfzTRWDwCOFphtDEG+w/w== + dependencies: + eslint-utils "^1.3.0" + regexpp "^2.0.0" + +eslint-plugin-import@^2.14.0: + version "2.14.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" + integrity sha512-FpuRtniD/AY6sXByma2Wr0TXvXJ4nA/2/04VPlfpmUDPOpOY264x+ILiwnrk/k4RINgDAyFZByxqPUbSQ5YE7g== + dependencies: + contains-path "^0.1.0" + debug "^2.6.8" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.1" + eslint-module-utils "^2.2.0" + has "^1.0.1" + lodash "^4.17.4" + minimatch "^3.0.3" + read-pkg-up "^2.0.0" + resolve "^1.6.0" + +eslint-plugin-node@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz#a6e054e50199b2edd85518b89b4e7b323c9f36db" + integrity sha512-lfVw3TEqThwq0j2Ba/Ckn2ABdwmL5dkOgAux1rvOk6CO7A6yGyPI2+zIxN6FyNkp1X1X/BSvKOceD6mBWSj4Yw== + dependencies: + eslint-plugin-es "^1.3.1" + eslint-utils "^1.3.1" + ignore "^4.0.2" + minimatch "^3.0.4" + resolve "^1.8.1" + semver "^5.5.0" + +eslint-plugin-promise@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.0.1.tgz#2d074b653f35a23d1ba89d8e976a985117d1c6a2" + integrity sha512-Si16O0+Hqz1gDHsys6RtFRrW7cCTB6P7p3OJmKp3Y3dxpQE2qwOA7d3xnV+0mBmrPoi0RBnxlCKvqu70te6wjg== + +eslint-plugin-standard@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.0.0.tgz#f845b45109c99cd90e77796940a344546c8f6b5c" + integrity sha512-OwxJkR6TQiYMmt1EsNRMe5qG3GsbjlcOhbGUBY4LtavF9DsLaTcoR+j2Tdjqi23oUwKNUqX7qcn5fPStafMdlA== + +eslint-scope@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" + integrity sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.0, eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + +eslint@^5.6.1: + version "5.6.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.6.1.tgz#348134e32ccc09abb2df1bf282b3f6eed8c7b480" + integrity sha512-hgrDtGWz368b7Wqf+v1Z69O3ZebNR0+GA7PtDdbmuz4rInFVUV9uw7whjZEiWyLzCjVb5Rs5WRN1TAS6eo7AYA== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.5.3" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^2.1.0" + eslint-scope "^4.0.0" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^4.0.0" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + imurmurhash "^0.1.4" + inquirer "^6.1.0" + is-resolvable "^1.1.0" + js-yaml "^3.12.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.5" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + regexpp "^2.0.0" + require-uncached "^1.0.3" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^4.0.3" + text-table "^0.2.0" + +espree@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634" + integrity sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg== + dependencies: + acorn "^5.6.0" + acorn-jsx "^4.1.1" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + +external-editor@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= + dependencies: + locate-path "^2.0.0" flag-icon-css@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/flag-icon-css/-/flag-icon-css-3.0.0.tgz#a67cb3913973e38a8117e738ebbe9081049d8127" + integrity sha512-Dy5xpXT2wKIx7oxTuimedeNymmCAFf1Tnq4ec9o3wxTBD9qESVMYti2SBLh4XMiKZzlTIy+msEtOfa/e5Na5iQ== + +flat-cache@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" + integrity sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE= + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" font-awesome@4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/font-awesome/-/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133" + integrity sha1-j6jPBBGhoxr9B7BtKQK7n8gVoTM= + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.7.0: + version "11.8.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.8.0.tgz#c1ef45ee9bed6badf0663c5cb90e8d1adec1321d" + integrity sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA== + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + integrity sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0= + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^4.0.2, ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +inquirer@^6.1.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.0.tgz#51adcd776f661369dc1e894859c2560a224abdd8" + integrity sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg== + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.0" + figures "^2.0.0" + lodash "^4.17.10" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.1.0" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + integrity sha1-VAVy0096wxGfj3bDDLwbHgN6/74= + dependencies: + builtin-modules "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= + +is-path-in-cwd@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" + integrity sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ== + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + integrity sha1-jvW33lBDej/cprToZe96pVy0gDY= + dependencies: + path-is-inside "^1.0.1" + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + +is-resolvable@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== + +isarray@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= jquery-mousewheel@~3.1.13: version "3.1.13" resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5" + integrity sha1-BvAzXxbjU6aV5yBr9QUDy1I6buU= jquery.maskedinput@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/jquery.maskedinput/-/jquery.maskedinput-1.4.1.tgz#3ea8f4cdc4eafce7354c27b66a73d0f44defc327" + integrity sha1-Pqj0zcTq/Oc1TCe2anPQ9E3vwyc= jquery@3.3.1, jquery@>=1.12.0: version "3.3.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.3.1.tgz#958ce29e81c9790f31be7792df5d4d95fc57fbca" + integrity sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg== + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +load-json-file@^2.0.0: + version "2.0.0" + resolved "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +minimatch@^3.0.3, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" moment@^2.10.2: version "2.22.2" resolved "https://registry.yarnpkg.com/moment/-/moment-2.22.2.tgz#3c257f9839fc0e93ff53149632239eb90783ff66" + integrity sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y= + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= ms@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +normalize-package-data@^2.3.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + integrity sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw== + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= + dependencies: + p-limit "^1.1.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= pace-progress@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pace-progress/-/pace-progress-1.0.2.tgz#fdc565c57dd91725a3167b360bf2578d3c3b548d" + integrity sha1-/cVlxX3ZFyWjFns2C/JXjTw7VI0= + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= + dependencies: + error-ex "^1.2.0" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-is-inside@^1.0.1, path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= + dependencies: + pify "^2.0.0" perfect-scrollbar@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/perfect-scrollbar/-/perfect-scrollbar-1.4.0.tgz#5d014ef9775e1f43058a1dbae9ed1daf0e7091f1" + integrity sha512-/2Sk/khljhdrsamjJYS5NjrH+GKEHEwh7zFSiYyxROyYKagkE4kSn2zDQDRTOMo8mpT2jikxx6yI1dG7lNP/hw== + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= + dependencies: + find-up "^1.0.0" + +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== popper.js@1.14.3: version "1.14.3" resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.14.3.tgz#1438f98d046acf7b4d78cd502bf418ac64d4f095" + integrity sha1-FDj5jQRqz3tNeM1QK/QYrGTU8JU= + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + integrity sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8= + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + +regexpp@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= + +resolve@^1.5.0, resolve@^1.6.0, resolve@^1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== + dependencies: + path-parse "^1.0.5" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +rimraf@^2.2.8: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== + dependencies: + glob "^7.0.5" + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + +rxjs@^6.1.0: + version "6.3.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz#3c6a7fa420e844a81390fb1158a9ec614f4bad55" + integrity sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw== + dependencies: + tslib "^1.9.0" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== select2@^4.0.6-rc.1: version "4.0.6-rc.1" resolved "https://registry.yarnpkg.com/select2/-/select2-4.0.6-rc.1.tgz#aa6c3038a7f0f2e91ffade38f0a21c15e1813276" + integrity sha1-qmwwOKfw8ukf+t448KIcFeGBMnY= dependencies: almond "~0.3.1" jquery-mousewheel "~3.1.13" +"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.5.1: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + simple-line-icons@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/simple-line-icons/-/simple-line-icons-2.4.1.tgz#b75bc5a0d87e530928c2ccda5735274bb256f234" + integrity sha1-t1vFoNh+UwkowszaVzUnS7JW8jQ= + +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== + dependencies: + is-fullwidth-code-point "^2.0.0" + +spdx-correct@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.2.tgz#19bb409e91b47b1ad54159243f7312a858db3c2e" + integrity sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz#e2a303236cac54b04031fa7a5a79c7e701df852f" + integrity sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-json-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= supports-color@^5.3.0: version "5.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== dependencies: has-flag "^3.0.0" +table@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" + integrity sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg== + dependencies: + ajv "^6.0.1" + ajv-keywords "^3.0.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + toastr@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/toastr/-/toastr-2.1.4.tgz#8b43be64fb9d0c414871446f2db8e8ca4e95f181" + integrity sha1-i0O+ZPudDEFIcURvLbjoyk6V8YE= dependencies: jquery ">=1.12.0" + +tslib@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= + dependencies: + mkdirp "^0.5.1" From bffab8a41db1cb5687ac800d24bdf91cd8affdad Mon Sep 17 00:00:00 2001 From: isubas Date: Thu, 11 Oct 2018 17:05:54 +0300 Subject: [PATCH 34/55] Fix eslint offenses --- app/assets/javascripts/application.js | 2 +- app/assets/javascripts/cable.js | 2 +- app/assets/javascripts/helpers/dynamic_select.js | 4 ++-- app/assets/javascripts/shared/cocoon.js | 2 +- app/assets/javascripts/shared/toastr_config.js | 8 +++++--- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index b62a61d47..934ab4236 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -11,4 +11,4 @@ //= require select2/dist/js/select2.min //= require jquery.maskedinput/src/jquery.maskedinput //= require Chart.bundle -//= require chartkick \ No newline at end of file +//= require chartkick diff --git a/app/assets/javascripts/cable.js b/app/assets/javascripts/cable.js index c21faf4cc..26f6f6a12 100644 --- a/app/assets/javascripts/cable.js +++ b/app/assets/javascripts/cable.js @@ -12,4 +12,4 @@ // App.cable = ActionCable.createConsumer(); }).call(this); -*/ \ No newline at end of file +*/ diff --git a/app/assets/javascripts/helpers/dynamic_select.js b/app/assets/javascripts/helpers/dynamic_select.js index 320b0a355..f433c452b 100644 --- a/app/assets/javascripts/helpers/dynamic_select.js +++ b/app/assets/javascripts/helpers/dynamic_select.js @@ -2,7 +2,7 @@ 'use strict' -var DynamicSelect = function (parameters) { +var DynamicSelect = function (parameters) { // eslint-disable-line no-unused-vars function init () { $.each(parameters, function (k, parameter) { $(parameter['el']).change(function (event) { @@ -87,4 +87,4 @@ var OptionsBuilder = function (datas, placeholder, config = {}) { build: build, setSelectBox: setSelectBox } -} \ No newline at end of file +} diff --git a/app/assets/javascripts/shared/cocoon.js b/app/assets/javascripts/shared/cocoon.js index 93d5074d1..357aa612d 100644 --- a/app/assets/javascripts/shared/cocoon.js +++ b/app/assets/javascripts/shared/cocoon.js @@ -1 +1 @@ -//= require cocoon \ No newline at end of file +//= require cocoon diff --git a/app/assets/javascripts/shared/toastr_config.js b/app/assets/javascripts/shared/toastr_config.js index 818c6ba8e..ffa54d58f 100644 --- a/app/assets/javascripts/shared/toastr_config.js +++ b/app/assets/javascripts/shared/toastr_config.js @@ -1,3 +1,5 @@ -toastr.options.closeButton = true; -toastr.options.showMethod = "slideDown"; -toastr.options.progressBar = true; \ No newline at end of file +/* global toastr:true */ + +toastr.options.closeButton = true +toastr.options.showMethod = 'slideDown' +toastr.options.progressBar = true From 47c0743490b8674af1b7ea46ea1640f528e2cc0e Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 11 Oct 2018 21:32:30 +0300 Subject: [PATCH 35/55] =?UTF-8?q?Dynamic=20select=20i=C3=A7in=20birimin=20?= =?UTF-8?q?t=C3=BCm=20programlar=C4=B1=20methodu=20ekle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/units_controller.rb | 10 +++++++++- config/routes.rb | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/controllers/units_controller.rb b/app/controllers/units_controller.rb index ce8c3ae2e..1741092f8 100644 --- a/app/controllers/units_controller.rb +++ b/app/controllers/units_controller.rb @@ -2,7 +2,7 @@ class UnitsController < ApplicationController include PagyBackendWithHelpers - before_action :set_unit, only: %i[edit update destroy show courses programs] + before_action :set_unit, only: %i[edit update destroy show courses programs all_programs] def index units = Unit.includes( @@ -48,6 +48,14 @@ def programs render json: @units end + def all_programs + @units = @unit.children.active + ancestries = @units.without_programs.collect { |unit| "#{unit.ancestry}/#{unit.id}" } + @programs = @units.programs + Unit.programs.active.where(ancestry: ancestries) + + render json: @programs + end + private def set_unit diff --git a/config/routes.rb b/config/routes.rb index 6bc4aa51d..e0800d45e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,6 +16,7 @@ member do get :courses, defaults: { format: :json } get :programs, defaults: { format: :json } + get :all_programs, defaults: { format: :json } end end From b682a044dcec8c6ee3a744ca0f809b279cf49b5e Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 11 Oct 2018 21:33:06 +0300 Subject: [PATCH 36/55] =?UTF-8?q?Birim=20ve=20program=20i=C3=A7in=20dynami?= =?UTF-8?q?c=20select=20ekle,=20d=C3=BCzenle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../prospective_students/_js.html.erb | 20 ++++++++++ .../prospective_students/_search.html.erb | 38 ++++++++++--------- 2 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 app/views/student_management/prospective_students/_js.html.erb diff --git a/app/views/student_management/prospective_students/_js.html.erb b/app/views/student_management/prospective_students/_js.html.erb new file mode 100644 index 000000000..84632e028 --- /dev/null +++ b/app/views/student_management/prospective_students/_js.html.erb @@ -0,0 +1,20 @@ + diff --git a/app/views/student_management/prospective_students/_search.html.erb b/app/views/student_management/prospective_students/_search.html.erb index 4cc266d1d..8fe71b493 100644 --- a/app/views/student_management/prospective_students/_search.html.erb +++ b/app/views/student_management/prospective_students/_search.html.erb @@ -33,7 +33,7 @@ class: 'form-control' %>
-
+
<%= label_tag :meb_status, t('.meb_status') %> <%= select_tag(:meb_status, @@ -42,7 +42,7 @@ class: 'form-control') %>
-
+
<%= label_tag :military_status, t('.military_status') %> <%= select_tag(:military_status, @@ -51,7 +51,7 @@ class: 'form-control') %>
-
+
<%= label_tag :obs_status, t('.obs_status') %> <%= select_tag(:obs_status, @@ -60,23 +60,29 @@ class: 'form-control') %>
-
+
- <%= label_tag :unit_id, t('.unit') %> - <%= select_tag(:unit_id, - options_from_collection_for_select(Unit.active.programs.order(:name), :id, :name), + + <%= select_tag(:student_entrance_type_id, + options_from_collection_for_select(StudentEntranceType.order(:name), :id, :name), + include_blank: true, + class: 'form-control') %> +
+
+
+
+ <%= label_tag :root_unit_id, t('.root_unit') %> + <%= select_tag(:root_unit_id, + options_from_collection_for_select(Unit.active.without_programs.order(:name), :id, :name), include_blank: true, class: 'form-control', style: 'width: 100%') %>
-
+
- - <%= select_tag(:student_entrance_type_id, - options_from_collection_for_select(StudentEntranceType.order(:name), :id, :name), - include_blank: true, - class: 'form-control') %> + <%= label_tag :unit_id, t('.unit') %> + <%= select_tag(:unit_id, include_blank: true, class: 'form-control', style: 'width: 100%') %>
@@ -91,8 +97,4 @@
- \ No newline at end of file +<%= render 'js' %> From e7ee4b8e2c40e38b1ce37cb5ce4b09973bc4b161 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 11 Oct 2018 21:33:42 +0300 Subject: [PATCH 37/55] =?UTF-8?q?'Aday'=20yerine=20'Yerle=C5=9Fen'=20kulla?= =?UTF-8?q?n,=20y=C4=B1l=20ve=20birim=20ekle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/models/student_management/en.yml | 2 ++ config/locales/models/student_management/tr.yml | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/locales/models/student_management/en.yml b/config/locales/models/student_management/en.yml index e568d60ea..0ecff400e 100644 --- a/config/locales/models/student_management/en.yml +++ b/config/locales/models/student_management/en.yml @@ -45,8 +45,10 @@ en: student_entrance_type: Entrance Type student_in_a_different_unit: Student in a different university/unit top_student: Top Student + root_unit: Unit unit: Placement Program unproblematic: Unproblematic + year: Year enums: prospective_student: additional_score: diff --git a/config/locales/models/student_management/tr.yml b/config/locales/models/student_management/tr.yml index f08e3e31b..4a7a6ec7c 100644 --- a/config/locales/models/student_management/tr.yml +++ b/config/locales/models/student_management/tr.yml @@ -39,14 +39,16 @@ tr: preference_order: Tercih Sırası registration_city: Nüfusa Kayıtlı Olduğu İl registration_district: Nüfusa Kayıtlı Olduğu İlçe - smart_search_placeholder: Aday öğrenci kimlik numarası, adı veya soyadı + smart_search_placeholder: Yerleşen öğrenci kimlik numarası, adı veya soyadı state_of_education: Öğrenim Durumu student_disability_type_id: Öğrenci Engel Türü student_entrance_type: Giriş Türü student_in_a_different_unit: Başka Bir Üniversite/Birimde Öğrenci top_student: Okul Birincisi + root_unit: Birim unit: Yerleştiği Program unproblematic: Sorunsuz + year: Yıl enums: prospective_student: additional_score: @@ -69,7 +71,7 @@ tr: prospective_students: index: <<: *prospective_student_attributes - prospective_students: Aday Öğrenciler + prospective_students: Yerleşen Öğrenciler register: can_not_register: Kayıt Yapılamaz warning: Öğrenci kayıt edilemedi @@ -82,7 +84,7 @@ tr: last_update: Son Güncelleme other_information: Diğer Bilgileri permanently_register: Kesin Kayıt Yap - prospective_student: Aday Öğrenci + prospective_student: Yerleşen Öğrenci registered_to: '%{program} isimli programda kayıtlı.' temporarily_register: Geçici Kayıt Yap redirect_with_success: From 6a85890f595728bfe3b5652bd069aec44df5547e Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 11 Oct 2018 21:34:14 +0300 Subject: [PATCH 38/55] =?UTF-8?q?Listeleme=20ekran=C4=B1na=20y=C4=B1l=20bi?= =?UTF-8?q?lgisi=20ekle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student_management/prospective_students/index.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/student_management/prospective_students/index.html.erb b/app/views/student_management/prospective_students/index.html.erb index 1c9124038..9aa9bc80f 100644 --- a/app/views/student_management/prospective_students/index.html.erb +++ b/app/views/student_management/prospective_students/index.html.erb @@ -17,6 +17,7 @@
+ @@ -31,6 +32,7 @@ + From 3a16a324d8915e2bd77f9c2d3ae7ca54776edf9e Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 11 Oct 2018 22:13:23 +0300 Subject: [PATCH 39/55] Add decision controller test --- .../committee/decisions_controller_test.rb | 66 +++++++++++++++++++ test/fixtures/agendas.yml | 13 +++- test/fixtures/committee_decisions.yml | 4 +- test/fixtures/meeting_agendas.yml | 7 +- 4 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 test/controllers/committee/decisions_controller_test.rb diff --git a/test/controllers/committee/decisions_controller_test.rb b/test/controllers/committee/decisions_controller_test.rb new file mode 100644 index 000000000..d680e8a22 --- /dev/null +++ b/test/controllers/committee/decisions_controller_test.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +require 'test_helper' + +module Committee + class DecisionsControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in users(:serhat) + @committee = units(:muhendislik_fakultesi_yonetim_kurulu) + @meeting_agenda = meeting_agendas(:one) + @decision = committee_decisions(:one) + end + + test 'should get new' do + get new_committee_meeting_agenda_decision_path(@committee, @meeting_agenda) + assert_response :success + end + + test 'should create committee decision' do + meeting_agenda = meeting_agendas(:four) + assert_difference('CommitteeDecision.count') do + post committee_meeting_agenda_decisions_path(@committee, meeting_agenda), + params: { + committee_decision: { + description: 'Karar test', + meeeting_agenda: meeting_agendas(:four) + } + } + end + + decision = CommitteeDecision.last + assert_equal 'Karar test', decision.description + assert_equal '2018/4', decision.decision_no + assert_equal 2018, decision.year + assert_redirected_to committee_meeting_path(@committee, meeting_agenda.committee_meeting) + assert_equal translate('.create.success'), flash[:notice] + end + + test 'should get edit' do + get edit_committee_meeting_agenda_decision_path(@committee, @meeting_agenda, @decision) + assert_response :success + assert_select '.card-header strong', translate('.edit.form_title') + end + + test 'should update committee decision' do + decision = @committee.decisions.last + patch committee_meeting_agenda_decision_path(@committee, @meeting_agenda, @decision), + params: { + committee_decision: { + description: 'Karar güncellendi' + } + } + decision.reload + + assert_equal 'Karar güncellendi', decision.description + assert_redirected_to committee_meeting_path(@committee, @meeting_agenda.committee_meeting) + assert_equal translate('.update.success'), flash[:notice] + end + + private + + def translate(key) + t("committee.decisions#{key}") + end + end +end diff --git a/test/fixtures/agendas.yml b/test/fixtures/agendas.yml index fa0aef630..0b9630ad9 100644 --- a/test/fixtures/agendas.yml +++ b/test/fixtures/agendas.yml @@ -10,9 +10,20 @@ two: agenda_type: three status: recent - three: description: 2018-2019 eğitim öğretim yılı bahar yarıyılı mazeret sınavına girmek isteyen öğrencilerin dilekçelerinin görüşülmesi. unit: muhendislik_fakultesi_yonetim_kurulu agenda_type: three status: decided + +four: + description: 2018-2019 Eğitim öğretim yılı ders kayıtlanmaları hakkında alınan dilekçelerin görüşülmesi. + unit: muhendislik_fakultesi_yonetim_kurulu + agenda_type: three + status: recent + +five: + description: 2018-2019 eğitim öğretim yılı güz yarıyılı mazeret sınavına girmek isteyen öğrencilerin dilekçelerinin görüşülmesi. + unit: muhendislik_fakultesi_yonetim_kurulu + agenda_type: three + status: recent diff --git a/test/fixtures/committee_decisions.yml b/test/fixtures/committee_decisions.yml index 500b5c5f2..9612a72bd 100644 --- a/test/fixtures/committee_decisions.yml +++ b/test/fixtures/committee_decisions.yml @@ -8,10 +8,10 @@ two: description: Mühendislik Fakültesi Yönetim Kurulu test kararı 2 decision_no: 2018/2 year: 2018 - meeting_agenda: one + meeting_agenda: two three: description: Mühendislik Fakültesi Yönetim Kurulu test kararı 3 decision_no: 2018/3 year: 2018 - meeting_agenda: one \ No newline at end of file + meeting_agenda: three diff --git a/test/fixtures/meeting_agendas.yml b/test/fixtures/meeting_agendas.yml index 5d20b2efc..95a668d13 100644 --- a/test/fixtures/meeting_agendas.yml +++ b/test/fixtures/meeting_agendas.yml @@ -9,6 +9,11 @@ two: sequence_no: 2 three: - agenda: three + agenda: four committee_meeting: one sequence_no: 3 + +four: + agenda: five + committee_meeting: one + sequence_no: 4 From dc860a53f1c3a869e6d4e3724000b461876cc291 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Thu, 11 Oct 2018 22:23:49 +0300 Subject: [PATCH 40/55] =?UTF-8?q?Controller'a=20all=5Fprograms=20i=C3=A7in?= =?UTF-8?q?=20test=20ekle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/controllers/units_controller_test.rb | 8 ++++++++ test/fixtures/units.yml | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/test/controllers/units_controller_test.rb b/test/controllers/units_controller_test.rb index d907232d4..56c34b1d7 100644 --- a/test/controllers/units_controller_test.rb +++ b/test/controllers/units_controller_test.rb @@ -93,4 +93,12 @@ class UnitsControllerTest < ActionDispatch::IntegrationTest assert_redirected_to units_path assert_equal translate('units.destroy.success'), flash[:notice] end + + test 'should get all_programs' do + get all_programs_unit_path(units(:egitim_bilimleri_enstitusu), format: :json) + json_response = JSON.parse(response.body) + assert_equal 1, json_response.length + assert_equal units(:alman_dili_egitimi_dr).id, json_response[0]['id'] + assert_response :success + end end diff --git a/test/fixtures/units.yml b/test/fixtures/units.yml index ba3d726ea..b174b7090 100644 --- a/test/fixtures/units.yml +++ b/test/fixtures/units.yml @@ -142,3 +142,14 @@ egitim_bilimleri_enstitusu: unit_instruction_type: turkish unit_instruction_type: normal_education unit_type: institute + +alman_dili_egitimi_dr: + name: Alman Dili Eğitimi (dr) + yoksis_id: 267762 + duration: 4 + district: atakum + unit_status: active + unit_instruction_language: turkish + unit_instruction_type: normal_education + unit_type: program + ancestry: <%= ActiveRecord::FixtureSet.identify(:egitim_bilimleri_enstitusu) %> From b315387efcfdb3c5220d7514f1e6ffcbe099809f Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Thu, 11 Oct 2018 22:31:33 +0300 Subject: [PATCH 41/55] Fixes view --- app/views/committee/meetings/show.html.erb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/committee/meetings/show.html.erb b/app/views/committee/meetings/show.html.erb index 379b97dcc..a8efa97a9 100644 --- a/app/views/committee/meetings/show.html.erb +++ b/app/views/committee/meetings/show.html.erb @@ -59,10 +59,11 @@ <% end %> From fe031b2e79ec77e4b6042f65afd802be08b3ab03 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 12 Oct 2018 10:36:57 +0300 Subject: [PATCH 42/55] Use enum_t method for agenda status --- app/views/committee/decisions/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/committee/decisions/_form.html.erb b/app/views/committee/decisions/_form.html.erb index 24eae28d2..4c7f55e0e 100644 --- a/app/views/committee/decisions/_form.html.erb +++ b/app/views/committee/decisions/_form.html.erb @@ -27,7 +27,7 @@ - + From 1f94393331051813cdbfc6316c3b3559b6bc3717 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 12 Oct 2018 10:57:19 +0300 Subject: [PATCH 43/55] Change method prefix --- app/controllers/committee/decisions_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/committee/decisions_controller.rb b/app/controllers/committee/decisions_controller.rb index 0fd7d5bc0..e71f8ed9d 100644 --- a/app/controllers/committee/decisions_controller.rb +++ b/app/controllers/committee/decisions_controller.rb @@ -3,7 +3,7 @@ module Committee class DecisionsController < ApplicationController before_action :set_committee_and_agenda - before_action :setup_decision, only: %i[edit update] + before_action :set_decision, only: %i[edit update] def new @decision = @agenda.build_decision @@ -31,7 +31,7 @@ def set_committee_and_agenda @agenda = @committee.meeting_agendas.find(params[:meeting_agenda_id]) end - def setup_decision + def set_decision @decision = @agenda.decision end From ce5c76d565d4be142c8ab27cee2e597285f9a284 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Fri, 12 Oct 2018 11:45:00 +0300 Subject: [PATCH 44/55] Label tag kullan --- .../student_management/prospective_students/_search.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_management/prospective_students/_search.html.erb b/app/views/student_management/prospective_students/_search.html.erb index 8fe71b493..36606544f 100644 --- a/app/views/student_management/prospective_students/_search.html.erb +++ b/app/views/student_management/prospective_students/_search.html.erb @@ -62,7 +62,7 @@
- + <%= label_tag :student_entrance_type_id, t('.student_entrance_type') %> <%= select_tag(:student_entrance_type_id, options_from_collection_for_select(StudentEntranceType.order(:name), :id, :name), include_blank: true, From e487bc515f7e52bbddef33124e46bea7a4ef0832 Mon Sep 17 00:00:00 2001 From: Dilara Koca Date: Fri, 12 Oct 2018 11:49:11 +0300 Subject: [PATCH 45/55] =?UTF-8?q?All=5Fprograms'=C4=B1=20kald=C4=B1r,=20i?= =?UTF-8?q?=C5=9Flevi=20programs=20=C3=BCstlensin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/units_controller.rb | 14 ++------------ .../prospective_students/_js.html.erb | 2 +- config/routes.rb | 1 - test/controllers/units_controller_test.rb | 4 ++-- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/app/controllers/units_controller.rb b/app/controllers/units_controller.rb index 1741092f8..d408c0f48 100644 --- a/app/controllers/units_controller.rb +++ b/app/controllers/units_controller.rb @@ -2,7 +2,7 @@ class UnitsController < ApplicationController include PagyBackendWithHelpers - before_action :set_unit, only: %i[edit update destroy show courses programs all_programs] + before_action :set_unit, only: %i[edit update destroy show courses programs] def index units = Unit.includes( @@ -42,20 +42,10 @@ def courses end def programs - @units = @unit.children.includes( - :unit_status, :unit_instruction_language, :unit_instruction_type, :unit_type, district: [:city] - ).programs.active + @units = @unit.descendants.programs.active render json: @units end - def all_programs - @units = @unit.children.active - ancestries = @units.without_programs.collect { |unit| "#{unit.ancestry}/#{unit.id}" } - @programs = @units.programs + Unit.programs.active.where(ancestry: ancestries) - - render json: @programs - end - private def set_unit diff --git a/app/views/student_management/prospective_students/_js.html.erb b/app/views/student_management/prospective_students/_js.html.erb index 84632e028..dad027d9d 100644 --- a/app/views/student_management/prospective_students/_js.html.erb +++ b/app/views/student_management/prospective_students/_js.html.erb @@ -9,7 +9,7 @@ el: '#root_unit_id', target: '#unit_id', params: { 'unit_id': '#root_unit_id' }, - source: '/units/:unit_id/all_programs/', + source: '/units/:unit_id/programs/', label_attribute: 'name', reset_selectors: '#unit_id' } diff --git a/config/routes.rb b/config/routes.rb index e0800d45e..6bc4aa51d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,7 +16,6 @@ member do get :courses, defaults: { format: :json } get :programs, defaults: { format: :json } - get :all_programs, defaults: { format: :json } end end diff --git a/test/controllers/units_controller_test.rb b/test/controllers/units_controller_test.rb index 56c34b1d7..fb3e0ef4c 100644 --- a/test/controllers/units_controller_test.rb +++ b/test/controllers/units_controller_test.rb @@ -94,8 +94,8 @@ class UnitsControllerTest < ActionDispatch::IntegrationTest assert_equal translate('units.destroy.success'), flash[:notice] end - test 'should get all_programs' do - get all_programs_unit_path(units(:egitim_bilimleri_enstitusu), format: :json) + test 'should get programs' do + get programs_unit_path(units(:egitim_bilimleri_enstitusu), format: :json) json_response = JSON.parse(response.body) assert_equal 1, json_response.length assert_equal units(:alman_dili_egitimi_dr).id, json_response[0]['id'] From 63128b229d153fee2b7bf4888b85ff47cab9661c Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 12 Oct 2018 14:31:17 +0300 Subject: [PATCH 46/55] Add show pages to committee decision --- .../committee/decisions_controller.rb | 4 +- app/views/committee/decisions/_form.html.erb | 6 +-- app/views/committee/decisions/show.html.erb | 46 +++++++++++++++++++ app/views/committee/meetings/show.html.erb | 5 +- config/locales/models/committees/en.yml | 15 ++++-- config/locales/models/committees/tr.yml | 24 ++++++---- config/routes.rb | 2 +- .../committee/decisions_controller_test.rb | 5 ++ 8 files changed, 83 insertions(+), 24 deletions(-) create mode 100644 app/views/committee/decisions/show.html.erb diff --git a/app/controllers/committee/decisions_controller.rb b/app/controllers/committee/decisions_controller.rb index e71f8ed9d..15dfa160f 100644 --- a/app/controllers/committee/decisions_controller.rb +++ b/app/controllers/committee/decisions_controller.rb @@ -3,7 +3,9 @@ module Committee class DecisionsController < ApplicationController before_action :set_committee_and_agenda - before_action :set_decision, only: %i[edit update] + before_action :set_decision, only: %i[show edit update] + + def show; end def new @decision = @agenda.build_decision diff --git a/app/views/committee/decisions/_form.html.erb b/app/views/committee/decisions/_form.html.erb index 4c7f55e0e..3d751c933 100644 --- a/app/views/committee/decisions/_form.html.erb +++ b/app/views/committee/decisions/_form.html.erb @@ -18,15 +18,15 @@
- + - + - + diff --git a/app/views/committee/decisions/show.html.erb b/app/views/committee/decisions/show.html.erb new file mode 100644 index 000000000..25fb5c3cd --- /dev/null +++ b/app/views/committee/decisions/show.html.erb @@ -0,0 +1,46 @@ +
+ <%= link_to_back(:back) %> +
+ +
+
+
+
+ <%= fa_icon 'file-o', text: "#{@committee.name} " + t('.decision_description') %> +
+
+
<%= t('.unit') %><%= @agenda.unit.name %>
<%= t('.sequence_no') %> <%= @agenda.sequence_no %> <%= link_to_new(new_committee_meeting_agenda_decision_path(@committee, agenda), t('.create_decision')) unless agenda.decision.present? %> - <% if agenda.decision.present? %> - <%= link_to_edit(edit_committee_meeting_agenda_decision_path(@committee, agenda), - t('.update_decision')) %> - <%= link_to_destroy(committee_meeting_agenda_decision_path(@committee, agenda), - t('.destroy_decision')) %> - <% end %> + <%= link_to_edit(edit_committee_meeting_agenda_decision_path(@committee, agenda), + t('.update_decision')) if agenda.decision.present? %>
<%= t('.military_status') %> <%= t('.obs_status') %> <%= t('.student_entrance_type') %><%= t('.year') %> <%= t('actions') %>
<%= prospective_student.military_status ? t('.unproblematic') : t('.must_see_recruiting_office') %> <%= prospective_student.obs_status ? t('.unproblematic') : t('.student_in_a_different_unit') %> <%= prospective_student.student_entrance_type.name %><%= prospective_student.created_at.year %> <%= link_to_show(prospective_student_path(prospective_student)) %> <%= agenda.decision.try(:description) %> <%= agenda.decision.try(:created_at).try(:to_date) %> - <%= link_to_new(new_committee_meeting_agenda_decision_path(@committee, agenda), - t('.create_decision')) unless agenda.decision.present? %> - <%= link_to_edit(edit_committee_meeting_agenda_decision_path(@committee, agenda), - t('.update_decision')) if agenda.decision.present? %> + <% if agenda.decision.present? %> + <%= link_to_edit(edit_committee_meeting_agenda_decision_path(@committee, agenda), t('.update_decision')) %> + <% else %> + <%= link_to_new(new_committee_meeting_agenda_decision_path(@committee, agenda), t('.create_decision')) %> + <% end %>
<%= t('.status') %><%= @agenda.status %><%= enum_t(@agenda, :status) %>
<%= t('.agenda_type') %><%= @agenda.unit.name %>
<%= t('.sequence_no') %><%= t('.agenda_sequence_no') %> <%= @agenda.sequence_no %>
<%= t('.description') %><%= t('.agenda_description') %> <%= @agenda.description %>
<%= t('.status') %><%= t('.agenda_status') %> <%= enum_t(@agenda, :status) %>
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
<%= t('.agenda_sequence_no') %><%= @agenda.sequence_no %>
<%= t('.agenda_description') %><%= @agenda.description %>
<%= t('.agenda_status') %><%= enum_t(@agenda, :status) %>
<%= t('.agenda_type') %><%= @agenda.agenda_type.name %>
<%= t('.decision_no')%><%= @agenda.decision.try(:decision_no) %>
<%= t('.decision_description') %><%= @agenda.decision.try(:description) %>
+
+ +
+
+
diff --git a/app/views/committee/meetings/show.html.erb b/app/views/committee/meetings/show.html.erb index a8efa97a9..8fdea1c26 100644 --- a/app/views/committee/meetings/show.html.erb +++ b/app/views/committee/meetings/show.html.erb @@ -44,8 +44,6 @@ <%= t('.status') %> <%= t('.agenda_type') %> <%= t('.decision_no')%> - <%= t('.decision_description') %> - <%= t('.decision_date') %> <%= t('actions') %> @@ -56,10 +54,9 @@ <%= enum_t(agenda, :status) %> <%= agenda.agenda_type.name %> <%= agenda.decision.try(:decision_no) %> - <%= agenda.decision.try(:description) %> - <%= agenda.decision.try(:created_at).try(:to_date) %> <% if agenda.decision.present? %> + <%= link_to_show(committee_meeting_agenda_decision_path(@committee, agenda, agenda.decision), t('.show_decision')) %> <%= link_to_edit(edit_committee_meeting_agenda_decision_path(@committee, agenda), t('.update_decision')) %> <% else %> <%= link_to_new(new_committee_meeting_agenda_decision_path(@committee, agenda), t('.create_decision')) %> diff --git a/config/locales/models/committees/en.yml b/config/locales/models/committees/en.yml index 6cbfa20ce..bced06337 100644 --- a/config/locales/models/committees/en.yml +++ b/config/locales/models/committees/en.yml @@ -84,14 +84,19 @@ en: success: Committee decision successfully created. edit: form_title: Update the Committee Decision - form: + form: &agendas agenda_type: Agenda Type - description: Agenda Description - sequence_no: Agenda Sequence No - status: Agenda Status + agenda_description: Agenda Description + agenda_sequence_no: Agenda Sequence No + agenda_status: Agenda Status unit: Unit new: form_title: Create a New Committee Decision + show: + <<: *agendas + decision_description: Decision Description + decision_no: Decision No + update_decision: Update Decision update: success: Committee Decision successfully updated. meetings: @@ -122,13 +127,13 @@ en: agenda_type: Agenda Type create_decision: Create Decision decision_description: Decision Description - decision_date: Decision Date decision_no: Decision No description: Description destroy_decision: Destroy Decision meeting_date: Meeting Date meeting_no: Meeting No sequence_no: Sequence No + show_decision: Show Decision status: Status update_decision: Update Decision year: Year diff --git a/config/locales/models/committees/tr.yml b/config/locales/models/committees/tr.yml index 5667a803d..7bcf7e5bb 100644 --- a/config/locales/models/committees/tr.yml +++ b/config/locales/models/committees/tr.yml @@ -4,12 +4,12 @@ tr: agenda: &agenda_attributes agenda_file: Gündem Dosyası agenda_type_id: Gündem Türü - description: Gündem Açıklaması + description: Gündem İçeriği status: Gündem Durumu agenda_type: &agenda_type_attributes name: Gündem Türü Adı committee_decision: - description: Karar Açıklaması + description: Karar İçeriği decision_no: Karar No committee_meeting: &committee_meeting_attributes meeting_date: Toplantı Tarihi @@ -84,15 +84,19 @@ tr: success: Kurul kararı başarıyla oluşturuldu. edit: form_title: Kurul Kararı Güncelle - form: + form: &agendas agenda_type: Gündem Türü - description: Gündem Açıklama - sequence_no: Gündem Sıra No - status: Gündem Durumu + agenda_description: Gündem İçeriği + agenda_sequence_no: Gündem Sıra No + agenda_status: Gündem Durumu unit: Birim new: form_title: Kurul Kararı Oluştur - description: Kurul Kararı + show: + <<: *agendas + decision_description: Karar İçeriği + decision_no: Karar No + update_decision: Karar Güncelle update: success: Kurul kararı başarıyla güncellendi. meetings: @@ -122,14 +126,14 @@ tr: agendas: Gündemler agenda_type: Gündem Türü create_decision: Karar Ekle - decision_description: Gündem Kararı - decision_date: Karar Tarihi + decision_description: Karar İçeriği decision_no: Karar No - description: Açıklama + description: Gündem İçeriği destroy_decision: Karar Sil meeting_date: Toplantı Tarihi meeting_no: Toplantı No sequence_no: Sıra No + show_decision: Karar Görüntüle status: Durum update_decision: Karar Güncelle year: Yıl diff --git a/config/routes.rb b/config/routes.rb index 153c6b7a8..305f79797 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -70,7 +70,7 @@ resources :agendas, except: :show resources :meetings resources :meeting_agendas, only: [] do - resources :decisions, except: %i[show index destroy] + resources :decisions, except: %i[index destroy] end end end diff --git a/test/controllers/committee/decisions_controller_test.rb b/test/controllers/committee/decisions_controller_test.rb index d680e8a22..94a175540 100644 --- a/test/controllers/committee/decisions_controller_test.rb +++ b/test/controllers/committee/decisions_controller_test.rb @@ -11,6 +11,11 @@ class DecisionsControllerTest < ActionDispatch::IntegrationTest @decision = committee_decisions(:one) end + test 'should get show' do + get committee_meeting_agenda_decision_path(@committee, @meeting_agenda, @decision) + assert_response :success + end + test 'should get new' do get new_committee_meeting_agenda_decision_path(@committee, @meeting_agenda) assert_response :success From ab648693304c414edcfaa0fa6b74308dc46b2182 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Fri, 12 Oct 2018 15:23:28 +0300 Subject: [PATCH 47/55] Update agenda status when decision is created --- app/models/committee_decision.rb | 2 ++ app/models/committee_meeting.rb | 1 + test/models/committee/decision_test.rb | 14 ++++++++++++-- test/models/committee/meeting_test.rb | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/models/committee_decision.rb b/app/models/committee_decision.rb index 39a839344..750ea85aa 100644 --- a/app/models/committee_decision.rb +++ b/app/models/committee_decision.rb @@ -3,6 +3,7 @@ class CommitteeDecision < ApplicationRecord # relations belongs_to :meeting_agenda + has_one :agenda, through: :meeting_agenda # validations validates :description, presence: true @@ -11,6 +12,7 @@ class CommitteeDecision < ApplicationRecord # callbacks before_validation :set_year_and_decision_no, on: :create + after_create { agenda.update(status: :decided) } # delegates delegate :meeting_no, :meeting_date, :year, :unit, to: :meeting_agenda, prefix: true diff --git a/app/models/committee_meeting.rb b/app/models/committee_meeting.rb index 97319f2c4..17aa56ca5 100644 --- a/app/models/committee_meeting.rb +++ b/app/models/committee_meeting.rb @@ -5,6 +5,7 @@ class CommitteeMeeting < ApplicationRecord belongs_to :unit has_many :meeting_agendas, dependent: :destroy has_many :agendas, through: :meeting_agendas + has_many :decisions, through: :meeting_agendas, class_name: 'CommitteeDecision' accepts_nested_attributes_for :meeting_agendas, allow_destroy: true # validations diff --git a/test/models/committee/decision_test.rb b/test/models/committee/decision_test.rb index 1f97a60fc..b40c40e08 100644 --- a/test/models/committee/decision_test.rb +++ b/test/models/committee/decision_test.rb @@ -8,8 +8,13 @@ class DecisionTest < ActiveSupport::TestCase end # relations - test 'decision can communicate with meeting_agenda' do - assert @decision.meeting_agenda + %i[ + meeting_agenda + agenda + ].each do |property| + test "decision can communicate with #{property}" do + assert @decision.send(property) + end end # validations: presence @@ -42,6 +47,11 @@ class DecisionTest < ActiveSupport::TestCase assert_equal '2018/4', decision.decision_no end + test 'agenda status must update after decision is created' do + decision = CommitteeDecision.create(description: 'Test Karar', meeting_agenda: meeting_agendas(:four)) + assert_equal 'decided', decision.agenda.status + end + # custom test 'count_of_decisions_by_year return decision count by year' do assert_equal 3, @decision.send(:count_of_decisions_by_year, 2018) diff --git a/test/models/committee/meeting_test.rb b/test/models/committee/meeting_test.rb index 72c5afb03..ad95302a7 100644 --- a/test/models/committee/meeting_test.rb +++ b/test/models/committee/meeting_test.rb @@ -8,6 +8,7 @@ class MeetingTest < ActiveSupport::TestCase unit meeting_agendas agendas + decisions ].each do |property| test "a meeting can communicate with #{property}" do assert committee_meetings(:one).send(property) From 137e836b187935c075fd2a74242b2191b6a4d769 Mon Sep 17 00:00:00 2001 From: isubas Date: Mon, 15 Oct 2018 11:12:46 +0300 Subject: [PATCH 48/55] Delete year field from prospective_students/index --- .../student_management/prospective_students/index.html.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/views/student_management/prospective_students/index.html.erb b/app/views/student_management/prospective_students/index.html.erb index 9aa9bc80f..1c9124038 100644 --- a/app/views/student_management/prospective_students/index.html.erb +++ b/app/views/student_management/prospective_students/index.html.erb @@ -17,7 +17,6 @@ <%= t('.military_status') %> <%= t('.obs_status') %> <%= t('.student_entrance_type') %> - <%= t('.year') %> <%= t('actions') %> @@ -32,7 +31,6 @@ <%= prospective_student.military_status ? t('.unproblematic') : t('.must_see_recruiting_office') %> <%= prospective_student.obs_status ? t('.unproblematic') : t('.student_in_a_different_unit') %> <%= prospective_student.student_entrance_type.name %> - <%= prospective_student.created_at.year %> <%= link_to_show(prospective_student_path(prospective_student)) %> From d07f544134cf686a5fef052b1fad3481f621bbf1 Mon Sep 17 00:00:00 2001 From: isubas Date: Mon, 15 Oct 2018 11:16:01 +0300 Subject: [PATCH 49/55] Search page optimization for prospective students --- .../prospective_students/_search.html.erb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/student_management/prospective_students/_search.html.erb b/app/views/student_management/prospective_students/_search.html.erb index 36606544f..9ac3a00c6 100644 --- a/app/views/student_management/prospective_students/_search.html.erb +++ b/app/views/student_management/prospective_students/_search.html.erb @@ -73,7 +73,7 @@
<%= label_tag :root_unit_id, t('.root_unit') %> <%= select_tag(:root_unit_id, - options_from_collection_for_select(Unit.active.without_programs.order(:name), :id, :name), + options_from_collection_for_select(Unit.active.without_programs.order(:name), :id, :name, params[:root_unit_id]), include_blank: true, class: 'form-control', style: 'width: 100%') %> @@ -82,7 +82,12 @@
<%= label_tag :unit_id, t('.unit') %> - <%= select_tag(:unit_id, include_blank: true, class: 'form-control', style: 'width: 100%') %> + <%= select_tag(:unit_id, + options_from_collection_for_select( + (params[:root_unit_id].present? ? Unit.find(params[:root_unit_id]).sub_programs.active.order(:name) : []), :id, :name, params[:unit_id] + ), + include_blank: true, + class: 'form-control', style: 'width: 100%') %>
From a49e6b5a5281c90fc6bfaee24411d1bcd2fe439b Mon Sep 17 00:00:00 2001 From: isubas Date: Mon, 15 Oct 2018 11:25:14 +0300 Subject: [PATCH 50/55] Add method to unit model for subprograms --- app/controllers/units_controller.rb | 2 +- app/models/unit.rb | 5 +++++ .../prospective_students/_search.html.erb | 2 +- test/models/unit_test.rb | 7 ++++++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/controllers/units_controller.rb b/app/controllers/units_controller.rb index d408c0f48..ac4560dfc 100644 --- a/app/controllers/units_controller.rb +++ b/app/controllers/units_controller.rb @@ -42,7 +42,7 @@ def courses end def programs - @units = @unit.descendants.programs.active + @units = @unit.subprograms.active.order(:name) render json: @units end diff --git a/app/models/unit.rb b/app/models/unit.rb index 8d1b74781..6026be662 100644 --- a/app/models/unit.rb +++ b/app/models/unit.rb @@ -63,4 +63,9 @@ class Unit < ApplicationRecord .or(institutes) .or(rectorships) } + + # custom methods + def subprograms + descendants.programs + end end diff --git a/app/views/student_management/prospective_students/_search.html.erb b/app/views/student_management/prospective_students/_search.html.erb index 9ac3a00c6..ed38c8086 100644 --- a/app/views/student_management/prospective_students/_search.html.erb +++ b/app/views/student_management/prospective_students/_search.html.erb @@ -84,7 +84,7 @@ <%= label_tag :unit_id, t('.unit') %> <%= select_tag(:unit_id, options_from_collection_for_select( - (params[:root_unit_id].present? ? Unit.find(params[:root_unit_id]).sub_programs.active.order(:name) : []), :id, :name, params[:unit_id] + (params[:root_unit_id].present? ? Unit.find(params[:root_unit_id]).subprograms.active.order(:name) : []), :id, :name, params[:unit_id] ), include_blank: true, class: 'form-control', style: 'width: 100%') %> diff --git a/test/models/unit_test.rb b/test/models/unit_test.rb index 032969aa7..0931803ad 100644 --- a/test/models/unit_test.rb +++ b/test/models/unit_test.rb @@ -108,7 +108,7 @@ class UnitTest < ActiveSupport::TestCase end test 'coursable scope returns coursable units' do - assert_equal Unit.coursable.count.to_i, + assert_equal Unit.coursable.count, Unit.departments.count + Unit.faculties.count + Unit.universities.count + @@ -117,4 +117,9 @@ class UnitTest < ActiveSupport::TestCase Unit.rectorships.count assert_not_includes Unit.coursable, units(:uzem) end + + test 'subprograms method returns a unit subprograms' do + assert_equal units(:omu).subprograms.count, units(:omu).descendants.programs.count + assert_not_includes units(:omu).subprograms, units(:uzem) + end end From 80b646af19a744c5824cd49ec140cbfc7d275b91 Mon Sep 17 00:00:00 2001 From: isubas Date: Mon, 15 Oct 2018 14:18:31 +0300 Subject: [PATCH 51/55] Minor change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Müfredat ekleme formundaki inputlarında yer değişikliği yapıldı --- app/views/course_management/curriculums/_form.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/course_management/curriculums/_form.html.erb b/app/views/course_management/curriculums/_form.html.erb index 372398769..d7606ae9b 100644 --- a/app/views/course_management/curriculums/_form.html.erb +++ b/app/views/course_management/curriculums/_form.html.erb @@ -12,19 +12,19 @@
<%= f.input :name %>
+
+ <%= f.input :number_of_semesters, collection: (2..Curriculum::MAX_NUMBER_OF_SEMESTERS) %> +
<%= f.association :unit, collection: Unit.active.curriculumable %>
- <%= f.input :number_of_semesters, collection: (2..Curriculum::MAX_NUMBER_OF_SEMESTERS) %> + <%= f.association :programs, + collection: f.object.new_record? ? [] : f.object.unit.children.programs %>
<%= f.input :status, collection: enum_options_for_select(f.object.class, :status) %> -
-
- <%= f.association :programs, - collection: f.object.new_record? ? [] : f.object.unit.children.programs %>
<%= f.button :submit, class: 'btn btn-outline-success btn-sm' %> From 4d9128bbc11ab06e22650aaca0059799a21ad2de Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 15 Oct 2018 14:57:27 +0300 Subject: [PATCH 52/55] Add missing some locale for prospective students --- config/locales/models/student_management/en.yml | 3 ++- config/locales/models/student_management/tr.yml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/locales/models/student_management/en.yml b/config/locales/models/student_management/en.yml index 0ecff400e..95b18c863 100644 --- a/config/locales/models/student_management/en.yml +++ b/config/locales/models/student_management/en.yml @@ -74,7 +74,8 @@ en: prospective_students: Prospective Students register: can_not_register: Can Not Register - warning: Student could not be registered. + success: Student successfully registered + warning: Student could not be registered search: <<: *prospective_student_attributes show: diff --git a/config/locales/models/student_management/tr.yml b/config/locales/models/student_management/tr.yml index 4a7a6ec7c..995af4b55 100644 --- a/config/locales/models/student_management/tr.yml +++ b/config/locales/models/student_management/tr.yml @@ -74,6 +74,7 @@ tr: prospective_students: Yerleşen Öğrenciler register: can_not_register: Kayıt Yapılamaz + success: Öğrenci başarıyla kaydedildi warning: Öğrenci kayıt edilemedi search: <<: *prospective_student_attributes From df05b8909a9323a16bf52ebbaeadb44963351e57 Mon Sep 17 00:00:00 2001 From: ecmelkytz Date: Mon, 15 Oct 2018 15:02:17 +0300 Subject: [PATCH 53/55] Use unit's scope in related committee controllers --- app/controllers/committee/agendas_controller.rb | 2 +- app/controllers/committee/meetings_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/committee/agendas_controller.rb b/app/controllers/committee/agendas_controller.rb index 33b3ecba5..f948015d9 100644 --- a/app/controllers/committee/agendas_controller.rb +++ b/app/controllers/committee/agendas_controller.rb @@ -39,7 +39,7 @@ def redirect_with(message) end def set_committee - @committee = Unit.find(params[:committee_id]) + @committee = Unit.committees.find(params[:committee_id]) end def set_agenda diff --git a/app/controllers/committee/meetings_controller.rb b/app/controllers/committee/meetings_controller.rb index 4cf28f5b1..84395af83 100644 --- a/app/controllers/committee/meetings_controller.rb +++ b/app/controllers/committee/meetings_controller.rb @@ -39,7 +39,7 @@ def redirect_with(message) end def set_committee - @committee = Unit.find(params[:committee_id]) + @committee = Unit.committees.find(params[:committee_id]) end def set_meeting From 2a305be6e084345417619d59f0ffe1319b0a2f18 Mon Sep 17 00:00:00 2001 From: isubas Date: Tue, 23 Oct 2018 09:33:28 +0300 Subject: [PATCH 54/55] =?UTF-8?q?Tasklerinde=20kullan=C4=B1lan=20yard?= =?UTF-8?q?=C4=B1mc=C4=B1=20metodlar=C4=B1=20rake=5Futils=20alt=C4=B1na=20?= =?UTF-8?q?topla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ImportFromYml.parse metodu rake_utils'e taşındı ve kullanımı Support.create_entities_from_yaml olarak değiştirildi. --- Rakefile | 2 +- lib/support/import_from_yml.rb | 13 ------------- lib/support/utils/rake_utils.rb | 16 ++++++++++++++++ lib/tasks/import/countries.rake | 4 ++-- lib/tasks/import/high_school_types.rake | 4 ++-- lib/tasks/import/languages.rake | 4 ++-- lib/tasks/import/titles.rake | 4 ++-- 7 files changed, 25 insertions(+), 22 deletions(-) delete mode 100644 lib/support/import_from_yml.rb create mode 100644 lib/support/utils/rake_utils.rb diff --git a/Rakefile b/Rakefile index 862f12651..d841fe27e 100644 --- a/Rakefile +++ b/Rakefile @@ -4,7 +4,7 @@ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require_relative 'config/application' -require_relative 'lib/support/import_from_yml' +require_relative 'lib/support/utils/rake_utils' require_relative 'lib/support/ext/progress_bar' Rails.application.load_tasks diff --git a/lib/support/import_from_yml.rb b/lib/support/import_from_yml.rb deleted file mode 100644 index 9280b9ec0..000000000 --- a/lib/support/import_from_yml.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module ImportFromYml - def self.parse(klass) - file = YAML.load_file(Rails.root.join('db', 'static_data', "#{klass.tableize}.yml")) - progress_bar = ProgressBar.spawn(klass.pluralize.to_s, file.count) - - file.each do |line| - klass.constantize.create(line) - progress_bar&.increment - end - end -end diff --git a/lib/support/utils/rake_utils.rb b/lib/support/utils/rake_utils.rb new file mode 100644 index 000000000..cb7f43828 --- /dev/null +++ b/lib/support/utils/rake_utils.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Support + module_function + + def create_entities_from_yaml(entity_class, filename: nil, basepath: Rails.root.join('db', 'static_data')) + filename ||= entity_class.tableize + file = YAML.load_file(basepath.join("#{filename}.yml")) + progress_bar = ProgressBar.spawn(entity_class.pluralize.to_s, file.count) + + file.each do |line| + entity_class.constantize.create(line) + progress_bar&.increment + end + end +end diff --git a/lib/tasks/import/countries.rake b/lib/tasks/import/countries.rake index 4ec35ab73..e4c0f4bb9 100644 --- a/lib/tasks/import/countries.rake +++ b/lib/tasks/import/countries.rake @@ -1,8 +1,8 @@ # frozen_string_literal: true namespace :import do - desc 'Imports countries from db/static_data' + desc 'Imports countries from yaml' task countries: :environment do - ImportFromYml.parse('Country') + Support.create_entities_from_yaml('Country') end end diff --git a/lib/tasks/import/high_school_types.rake b/lib/tasks/import/high_school_types.rake index 13fd026b0..c5f42d7b0 100644 --- a/lib/tasks/import/high_school_types.rake +++ b/lib/tasks/import/high_school_types.rake @@ -1,8 +1,8 @@ # frozen_string_literal: true namespace :import do - desc 'Imports high_school_types from db/static_data' + desc 'Imports high_school_types from yaml' task high_school_types: :environment do - ImportFromYml.parse('HighSchoolType') + Support.create_entities_from_yaml('HighSchoolType') end end diff --git a/lib/tasks/import/languages.rake b/lib/tasks/import/languages.rake index 183ac9aa8..3a9f871f8 100644 --- a/lib/tasks/import/languages.rake +++ b/lib/tasks/import/languages.rake @@ -1,8 +1,8 @@ # frozen_string_literal: true namespace :import do - desc 'Imports languages from db/static_data' + desc 'Imports languages from yaml' task languages: :environment do - ImportFromYml.parse('Language') + Support.create_entities_from_yaml('Language') end end diff --git a/lib/tasks/import/titles.rake b/lib/tasks/import/titles.rake index c0a6e1844..98d0f3fb9 100644 --- a/lib/tasks/import/titles.rake +++ b/lib/tasks/import/titles.rake @@ -1,8 +1,8 @@ # frozen_string_literal: true namespace :import do - desc 'Imports titles from db/static_data' + desc 'Imports titles from yaml' task titles: :environment do - ImportFromYml.parse('Title') + Support.create_entities_from_yaml('Title') end end From 3060b8f791e5f217b75058e7b6352adf880896e7 Mon Sep 17 00:00:00 2001 From: isubas Date: Tue, 23 Oct 2018 09:42:09 +0300 Subject: [PATCH 55/55] =?UTF-8?q?Test=20dizinlerinde=20d=C3=BCzenleme=20ya?= =?UTF-8?q?p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - lib/support altındaki modullerin testleri dizin yapısı korunarak test/support altına taşındı. --- .../core_ext}/string_test.rb | 0 .../file_encryptor_test.rb | 0 test/support/utils/rake_utils_test.rb | 20 +++++++++++++++++++ 3 files changed, 20 insertions(+) rename test/{extensions => support/core_ext}/string_test.rb (100%) rename test/{extensions => support}/file_encryptor_test.rb (100%) create mode 100644 test/support/utils/rake_utils_test.rb diff --git a/test/extensions/string_test.rb b/test/support/core_ext/string_test.rb similarity index 100% rename from test/extensions/string_test.rb rename to test/support/core_ext/string_test.rb diff --git a/test/extensions/file_encryptor_test.rb b/test/support/file_encryptor_test.rb similarity index 100% rename from test/extensions/file_encryptor_test.rb rename to test/support/file_encryptor_test.rb diff --git a/test/support/utils/rake_utils_test.rb b/test/support/utils/rake_utils_test.rb new file mode 100644 index 000000000..017600b9e --- /dev/null +++ b/test/support/utils/rake_utils_test.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +require 'test_helper' + +class RakeUtilsTest < ActiveSupport::TestCase + class FakeModel + class_attribute :collections, default: [] + + def self.create(item) + collections << item + end + end + + test 'entities should be created from yaml' do + created_titles = Support.create_entities_from_yaml( + 'RakeUtilsTest::FakeModel', filename: 'titles', basepath: Rails.root.join('test', 'fixtures') + ) + assert_equal created_titles.size, Title.count + end +end