Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCC Issue 679 - Fix for issue that Super Admins unable to create new #3091

Conversation

johnpinto1
Copy link
Contributor

@johnpinto1 johnpinto1 commented Jan 13, 2022

Orgs.

Fix for DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/679

Changes:

  • in app/controllers/super_admin/orgs_controller.rb added missing params
    to orgs_params method
    :funder, :institution, :organisation
  • in app/models/org.rb removed (as it is never set on Org creation)
    validates :abbreviation, presence: { message: PRESENCE_MESSAGE }
  • in app/views/orgs/_profile_form.html.erb removed :abbreviation required
    "aria-required": true
  • in app/views/shared/org_selectors/_external_only.html.erb renamed wrongly named text field :org_name to :name
    <%= form.label :name, label %>
    <%= form.text_field :name, class: "form-control autocomplete",

Orgs.

Fix for DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/679

Changes:
- in app/controllers/super_admin/orgs_controller.rb added missing params
to orgs_params method
     :funder, :institution, :organisation
- in app/models/org.rb removed (as it is never set on Org creation)
      validates :abbreviation, presence: { message: PRESENCE_MESSAGE }
- in app/views/orgs/_profile_form.html.erb removed :abbreviation required
      "aria-required": true
- in app/views/shared/org_selectors/_external_only.html.erb renamed wrongly named text field :org_name to :name
      <%= form.label :name, label %>
      <%= form.text_field :name, class: "form-control autocomplete",
@raycarrick-ed
Copy link
Contributor

You have changes to _external_only which are not reflected in _combined or _local_only.
Is that right?
Without thinking about it a lot so I might be wrong, I'd have thought that they are interchangeable and so need to be equivalent.
So all returning org_name or all returning name.
Is that not the case?

@johnpinto1
Copy link
Contributor Author

johnpinto1 commented Jan 14, 2022

@raycarrick-ed will check based on above comment.

Well caught. Will check for :org_name elsewhere too and update.

@johnpinto1
Copy link
Contributor Author

@raycarrick-ed looks like change in app/views/shared/org_selectors/_external_only.html.erb is not quite right. As lookup of orgs fail. Need to look into it as _combined or _local_only versions work correctly.

@johnpinto1
Copy link
Contributor Author

johnpinto1 commented Jan 14, 2022

@raycarrick-ed Switching RoR on affects following:
app/views/devise/registrations/_personal_details.html.erb
82: <%= render partial: "external_identifier",

app/views/orgs/_profile_form.html.erb
12: <%= render partial: "orgs/external_identifiers",
158: <%= render partial: "orgs/external_identifiers",

app/views/shared/org_selectors/_combined.html.erb
31: type: "combined",

app/views/shared/org_selectors/_combined.html.erb is used by:
app/views/super_admin/users/edit.html.erb
30: <%= render partial: "shared/org_selectors/combined",

The app/views/orgs/_profile_form.html.erb is the used in:

app/views/super_admin/orgs/new.html.erb
26: <%= render partial: 'orgs/profile_form',

app/views/orgs/_profile_form.html.erb
9: id: "edit_org_profile_form" } ) do |f| %>

app/views/orgs/admin_edit.html.erb
42: <%= render partial: 'orgs/profile_form',

app/views/devise/registrations/_personal_details.html.erb is used by:
app/views/devise/registrations/edit.html.erb
35: <%= render partial: 'devise/registrations/personal_details', locals: {orgs: @orgs, org_partial: @org_partial} %>

Copy link
Contributor

@briri briri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok to me @johnpinto1 that 'external_only' partial is only used on that one page so changing the param names will not negatively impact other portions of the site.

briri and others added 8 commits January 31, 2022 09:52
Orgs.

Fix for DCC issue https://github.com/DigitalCurationCentre/DMPonline-Service/issues/679

Changes:
- in app/controllers/super_admin/orgs_controller.rb added missing params
to orgs_params method
     :funder, :institution, :organisation
- in app/models/org.rb removed (as it is never set on Org creation)
      validates :abbreviation, presence: { message: PRESENCE_MESSAGE }
- in app/views/orgs/_profile_form.html.erb removed :abbreviation required
      "aria-required": true
- in app/views/shared/org_selectors/_external_only.html.erb renamed wrongly named text field :org_name to :name
      <%= form.label :name, label %>
      <%= form.text_field :name, class: "form-control autocomplete",
…s' of github.com:DMPRoadmap/roadmap into bug-dcc-679-super-admins-unable-to-add-new-organisations
look at what comes out of safe_save
Schrodinger's cat, it seems
in org model spec
org spec failing with no abbrev for some reason.
Used to be that org had to have an abbrev. That stopped the Super Admin creating the org so was removed. Remove check from this test.
@raycarrick-ed raycarrick-ed merged commit a053f9f into development Feb 1, 2022
@raycarrick-ed raycarrick-ed deleted the bug-dcc-679-super-admins-unable-to-add-new-organisations branch February 1, 2022 12:11
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.

3 participants