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

Use product settings for docs & links #6718

Merged

Conversation

mzazrivec
Copy link
Contributor

Fixes #6083

@miq-bot
Copy link
Member

miq-bot commented Feb 27, 2020

Checked commit mzazrivec@b61ee1e with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.20.0, and yamllint
1 file checked, 0 offenses detected
Everything looks fine. 🏆

@himdel
Copy link
Contributor

himdel commented Feb 27, 2020

LGTM, removes the last uses of i18n.t from the UI 👍

(We still have..

manageiq/lib/vmdb/appliance.rb
37:      ::Settings.product.name || I18n.t("product.name").freeze

manageiq/app/models/dictionary.rb
38:    result = I18n.t("dictionary.#{type}.#{text}", :locale => "en")

manageiq-api/app/controllers/api/api_controller.rb
81:        :name_full            => I18n.t("product.name_full"),
82:        :copyright            => I18n.t("product.copyright"),
83:        :support_website      => I18n.t("product.support_website"),
84:        :support_website_text => I18n.t("product.support_website_text"),

manageiq-appliance_console/loads/and/loads/of/stuff

)

@chessbyte chessbyte self-assigned this Feb 27, 2020
@chessbyte chessbyte added this to the Sprint 131 Ending Mar 2, 2020 milestone Feb 27, 2020
@chessbyte chessbyte merged commit ac6ea27 into ManageIQ:master Feb 27, 2020
@mzazrivec mzazrivec deleted the use_settings_for_docs_links_and_texts branch February 27, 2020 15:23
@@ -9,3 +9,5 @@ docs:
:infra_provider: http://manageiq.org/docs/reference/latest/doc-Managing_Providers/miq/#infrastructure_providers
:network_provider: http://manageiq.org/docs/reference/latest/doc-Managing_Providers/miq/#network_providers
:physical_infra_provider: http://manageiq.org/docs/reference/latest/doc-Managing_Providers/miq/#infrastructure_providers
:product_support_website: http://www.manageiq.org
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't these be in the core repo?

Copy link
Member

Choose a reason for hiding this comment

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

Actually, the whole docs section feels like it belongs in core.

Copy link
Member

@Fryguy Fryguy Mar 25, 2020

Choose a reason for hiding this comment

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

There are a number of things wrong with this, but

  • Yes, I agree this entire section should live in core.
  • All of the links should be https
  • provider type links are fine, but then "ansible" (which should really be ansible_tower) is a provider specific link, which should be pluggable, but I'd argue that it shouldn't exist at all since we don't have any of the other providers
  • top-level docs is a string, but :ui is a symbol

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the point of the change was to use Settings instead of ui_lookup. Anything else is optional :).
(Note it didn't actually change any of the links, feel free to update them if you know what they should be.)

As for ansible - maybe it should really be automation. It's used in the "no records" screen in /automation_manager/explorer (Automation > Ansible Tower > Explorer)

Copy link
Contributor

Choose a reason for hiding this comment

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

(Except for product_support_*, none of the other keys are used anywhere outside the UI.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm having bit of a problem understanding why should this config section live in core?

Copy link
Contributor

@himdel himdel Mar 25, 2020

Choose a reason for hiding this comment

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

IMO it doesn't make sense to move these to the core without a core mechanism for "get me docs for this model kind of provider" (infra/cloud/automation...),
and the UI won't consume it over the API before we have an API endpoint for list views with all the info the UI needs. (Should we plan for pluggable provider kinds?)

What am I missing? :)

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

ManageIQ/manageiq-api#788 is how I got here. Which struck me as odd that UI settings are being used for the API.

Copy link
Member

@Fryguy Fryguy Mar 25, 2020

Choose a reason for hiding this comment

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

I think the point of the change was to use Settings instead of ui_lookup

Yeah, we're not disputing the usage of Settings, we're disputing where the Settings should live.

Anything else is optional :).

Totally agree...My list was not for this PR but for a follow up.

and the UI won't consume it over the API before we have an API endpoint for list views with all the info the UI needs. (Should we plan for pluggable provider kinds?)

Settings are already available via the API, and providers can already bring pluggable settings, though in this case they are actually provider-type which is a core construct anyway, so it doesn't matter.

@simaishi
Copy link
Contributor

Removed jansa/yes? as this was merged before branch cut.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop I18n.t used for overriding URLs
7 participants