Skip to content

Update master prior to v3.1.1#3174

Merged
raycarrick-ed merged 35 commits into
masterfrom
development
May 12, 2022
Merged

Update master prior to v3.1.1#3174
raycarrick-ed merged 35 commits into
masterfrom
development

Conversation

@raycarrick-ed

Copy link
Copy Markdown
Contributor

Summary of fixes:

  • expand/collapse all buttons in multi-section plans
  • 'View All' when looking at templates as Org Admin
  • margins and default zoom settings of exported PDFs
  • font-face of PDF downloads
  • download plan with coversheet
  • API calls which were failing due to a timeout.
  • plan with conditional questions causing page to go blank
  • download template with pre-ticked answers not working
  • research outputs metadata standards not always appearing
  • sharing plans where plan has to be 100% complete.

pengyin-shan and others added 30 commits April 8, 2022 17:20
DCC Issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/698

Changes:
 - added
    format: json
   and
    changed sort option to
    sort_field: 'templates.version', sort_direction: :desc
  to the paginable_renderise call in the history() method of
paginable/templates_controller.
Referenced in a comment in DCC bug 698 https://github.com/DigitalCurationCentre/DMPonline-Service/issues/698#issuecomment-1096577463

Fix involved following change:
 - in app/policies/department_policy the index?() policy method
 reference @department (which does not exist). Even changing @department
to @record fails as @record is the Department class (not an instance of
Department). Inspect of @record in index?() shows
 "Department(id: integer, name: string, code: string, org_id: integer,
created_at: datetime, updated_at: datetime)".
So replaced
    (@user.can_org_admin? && @user.org.id == @department.org_id) ||
     @user.can_super_admin?
by    @user.can_org_admin? || @user.can_super_admin?
as @department is nil and @record.org_id id not defined for a Class
object Department.
…_view_all_broken

DCC Bug 698 - Fix for broken Template History functionality.
…rtments_broken

Referenced in DCC Bug 698 - The School departments functionality broken.
Fix the 'expand/collapse button not work on after creating multiple sections on org_admin/template section
DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/703

Problem is that in concerns/exportable_plan.rb the method  prepare_coversheet_for_csv(csv, _headings, hash) assumes  hash[:attribution] is an  ActiveRecord::Relation when it is always a string with a single author created in prepare_coversheet() method.
Hence hash[:attribution].many? throws an error in
   csv << [if hash[:attribution].many?.

Changes for fix:
- in prepare_coversheet_for_csv(csv, _headings, hash) added
   csv << [_('Creator:'), format(_('%{author}'), author: hash[:attribution])]
instead and removed
  csv << [if hash[:attribution].many?...]
remove margin settings from PDF stylesheet and set initial zoom level…
…_plan_page

DCC bug 406 - Download plan with coversheet is broken.
          "/api/v0/plans?page=ALL"
was timing out because the processing was taking too long.

Fix for bug https://github.com/DigitalCurationCentre/DMPonline-Service/issues/722

The following change seems to make a difference:
- in /api/v0/plans_controller.rb the index() method
   replaced includes() with preload():
    @plans = org_admin_plans.includes([{ roles: :user }, { answers: :question_options },
                                           template: [{ phases: {
                                             sections: { questions: %i[question_format themes] }
                                           } }, :org]])
…ans_call_timing_out

DCC bug 722 - Fix for dealing with situation where Rest API call
…o disappear."

Cause is commit bb5941e
"Added toggleable guidance/comments section"  the following changes were made
to file  app/javascript/src/utils/sectionUpdate.js:
the question containers classes were changed as follows .row -> .question-body & .col-md-8 -> .question-section:

-                <div class="row">
-                  <div class="col-md-8">
+                <div class="question-body">
+                  <div class="question-section">

This broke the function getQuestionDiv() in app/javascript/src/utils/sectionUpdate.js.
Fix for issue #3163.

Changes:
- in  app/javascript/src/utils/sectionUpdate.js the function was updated
as follows:
-export const getQuestionDiv = (id) => $(`#answer-form-${id}`).closest('.row');
+export const getQuestionDiv = (id) => $(`#answer-form-${id}`).closest('.question-body');
…ns_causing_plans_display_none

Roadmap bug #3163 -  Fix for bug "Conditional question causing plans …
Add array judgement for creators in text and csv download
download.

Fix for Roadmap issue #3104.

Changes:
- added <%= option.is_default? ? ' - ' + _('default') : '' %> to
  option text in export template in docx and pdf.
…_answers_do_not_download

Bug #3104 - Fix for pre-ticked answers do not appear in Template
nicolasfranck and others added 4 commits May 10, 2022 12:03
one could only share plan if it is 100% completed. When this is set in
property config/initializers/_dmproadmap.rb, e.g.,
188:    config.x.plans.default_percentage_answered = 50.

Fix for Roadmap bug #3086.

In app/models/phase.rb method visibility_allowed?(plan) is broken
because the first line in method always return 0 unless the Rational()
is 1 in
  value = Rational(num_answered_questions(plan), plan.num_questions) * 100

Change:
- we fix issue by converting the Rational() value to a float as follows
    value = Rational(num_answered_questions(plan), plan.num_questions).to_f * 100
…ity_plan_public_DMPs_only_appear_if_100_per_filled

Roadmap bug 3086 - The share feature for Org plan visibility was broken:
metadata standard does not always have locations
@raycarrick-ed raycarrick-ed changed the title Update master to latest development Update master prior to v3.1.1 May 12, 2022
@raycarrick-ed raycarrick-ed merged commit 47be9ba into master May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants