Skip to content

Generic Admin Import Support#1699

Open
CloCkWeRX wants to merge 2 commits into
masterfrom
generic-admin-import-16709899828126939314
Open

Generic Admin Import Support#1699
CloCkWeRX wants to merge 2 commits into
masterfrom
generic-admin-import-16709899828126939314

Conversation

@CloCkWeRX

Copy link
Copy Markdown
Member

This change renames the administrative leads import feature to a more generic "Import" feature. It also adds support for importing other major entity types including Accounts, Campaigns, Opportunities, Contacts, and Tasks. The implementation uses a whitelisted dynamic class constantization in the controller to handle different models. Views and locale strings have been updated to be generic and user-friendly.


PR created automatically by Jules for task 16709899828126939314 started by @CloCkWeRX

…tiple entity types.

- Renamed Admin::LeadsController to Admin::ImportsController.
- Genericized import logic to support Lead, Account, Campaign, Opportunity, Contact, and Task.
- Updated routes and settings to reflect the rename.
- Renamed and updated views to include an entity type selector.
- Updated locales with generic import keys and added missing model pluralizations.
- Updated and renamed specs to cover multiple entity types.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

redirect_to admin_imports_path and return
end

klass = params[:klass].classify.constantize rescue nil
redirect_to admin_imports_path and return
end

klass = params[:klass].classify.constantize rescue nil
redirect_to admin_imports_path and return
end

klass = params[:klass].classify.constantize rescue nil
flash[:notice] = t(:msg_imported_records, count: @imported_count, records: klass.model_name.human(count: @imported_count).downcase)
else
flash[:warning] = t(:msg_imported_records_with_errors, count: @imported_count, records: klass.model_name.human(count: @imported_count).downcase, errors: @errors.size)
flash[:error] = @errors.join("<br/>").html_safe
…ties.

- Rename Admin::LeadsController to Admin::ImportsController.
- Add support for Account, Campaign, Opportunity, Contact, and Task imports.
- Update routes, settings, and navigation.
- Implement entity type selector in the import view.
- Fix i18n pluralization for imported record counts in flash messages.
- Update and rename controller specs.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
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.

2 participants