diff --git a/.erb-lint.yml b/.erb-lint.yml index f6ab4ce..384fcec 100644 --- a/.erb-lint.yml +++ b/.erb-lint.yml @@ -9,7 +9,10 @@ linters: enabled: true PartialInstanceVariable: enabled: true - # DeprecatedClasses: - # enabled: true - # HardCodedString: - # enabled: true + DeprecatedClasses: + enabled: true + HardCodedString: + enabled: true + exclude: + - "app/views/dashboard/show.html.erb" + - "app/views/public/landing_page.html.erb" diff --git a/.rubocop.yml b/.rubocop.yml index 6a02b2a..6d05743 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,2 +1,4 @@ inherit_gem: standard: config/base.yml +AllCops: + SuggestExtensions: false diff --git a/app/components/navbar/account_selector/component.html.erb b/app/components/navbar/account_selector/component.html.erb index 34b96d4..e26dde0 100644 --- a/app/components/navbar/account_selector/component.html.erb +++ b/app/components/navbar/account_selector/component.html.erb @@ -6,9 +6,15 @@ <%= Current.account.name %> <% if Current.account.personal? %> - Personal account + + + <%= t('.personal_account') %> + <% else %> - Team account + + + <%= t('.team_account') %> + <% end %> @@ -16,7 +22,10 @@ <% end %> - Switch account + + <%= t('.switch_button') %> + + <%= link_to dashboard_path(account_id: nil), class: "flex items-center justify-between px-4 py-2.5 hover:bg-background" do %> <%= Current.user.personal_account.name %> @@ -30,5 +39,5 @@ <% end %> <% end %> - <%= link_to "Create a new team", "#", class: "block px-4 py-2.5 hover:bg-background" %> + <%= link_to t('.new_account_button'), "#", class: "block px-4 py-2.5 hover:bg-background" %> <% end %> diff --git a/app/components/navbar/account_selector/component.yml b/app/components/navbar/account_selector/component.yml new file mode 100644 index 0000000..3e4a66c --- /dev/null +++ b/app/components/navbar/account_selector/component.yml @@ -0,0 +1,5 @@ +en: + personal_account: Personal account + team_account: Team account + switch_button: Switch account + new_account_button: Create a new team diff --git a/app/views/accounts/edit.html.erb b/app/views/accounts/edit.html.erb index 4c78378..f63092b 100644 --- a/app/views/accounts/edit.html.erb +++ b/app/views/accounts/edit.html.erb @@ -1,4 +1,4 @@ <% title "Edit your account profile" %> <%= render(PageLayouts::Settings::Component.new) do %> - <%= render "form", account: %> + <%= render "form", account: @account %> <% end %> diff --git a/app/views/partials/navigations/_settings.html.erb b/app/views/partials/navigations/_settings.html.erb index bd68eb4..1f2fcd1 100644 --- a/app/views/partials/navigations/_settings.html.erb +++ b/app/views/partials/navigations/_settings.html.erb @@ -1,23 +1,23 @@
- Account settings + <%= t(".account_settings") %>
<%= render(PageLayouts::Settings::NavigationItem::Component.new( - label: "Profile settings", - description: "Edit your account profile.", + label: t('.items.account.label'), + description: t('.items.account.description'), icon: "fa fa-user", path: edit_account_path )) %>
- User settings + <%= t(".user_settings") %>
<%= render(PageLayouts::Settings::NavigationItem::Component.new( - label: "Login credentials", - description: "Change user email or password.", + label: t('.items.user.label'), + description: t('.items.user.description'), icon: "fa fa-lock", path: edit_user_registration_path )) %> diff --git a/config/locales/kiqr.en.yml b/config/locales/kiqr.en.yml new file mode 100644 index 0000000..caaa0f0 --- /dev/null +++ b/config/locales/kiqr.en.yml @@ -0,0 +1,13 @@ +en: + partials: + navigations: + settings: + account_settings: "Account settings" + user_settings: "Login & security" + items: + account: + label: "Profile settings" + description: "Edit your account profile" + user: + label: "Login credentials" + description: "Change user email or password." diff --git a/lib/generators/view_component/templates/component.rb.tt b/lib/generators/view_component/templates/component.rb.tt index 86aa29e..ad92ac1 100644 --- a/lib/generators/view_component/templates/component.rb.tt +++ b/lib/generators/view_component/templates/component.rb.tt @@ -1,8 +1,4 @@ # frozen_string_literal: true class <%= class_name %>::Component < <%= parent_class %> - # with_collection_parameter :<%= singular_name %> -<%- if initialize_signature -%> - <%= initialize_signature %> -<%- end -%> end