Skip to content

Change the type of custom field#319

Merged
pokhiii merged 3 commits intodevelopfrom
change-custom-field-to-entity-type
Oct 3, 2024
Merged

Change the type of custom field#319
pokhiii merged 3 commits intodevelopfrom
change-custom-field-to-entity-type

Conversation

@tarunnjoshi
Copy link
Copy Markdown
Member

@tarunnjoshi tarunnjoshi commented Oct 3, 2024

Change the type of custom field

Need to update things on staging and production

Add a new custom type on production which is an entity type for collection camp

  1. Update the Camp Vehicle Dispatch Form where we need to remove the intent id and add the collection camp is
    Here is the URL: https://goonj.test/camp-vehicle-dispatch-form/#?Camp_Vehicle_Dispatch.Collection_Camp=177&Camp_Vehicle_Dispatch.Filled_by=14920&Camp_Vehicle_Dispatch.To_which_PU_Center_material_is_being_sent=2700&Eck_Collection_Camp1=177

  2. Changes on the Acknowlegde formbuilder and change it on the searchKit too to show the collection camp code and address
    https://goonj.test/acknowledgement-form-for-logistics/#?Eck_Collection_Source_Vehicle_Dispatch1=33&Camp_Vehicle_Dispatch.Collection_Camp=177&id=33&Eck_Collection_Camp1=177

  3. Remove the collection camp code and title from ack formbuilder

  4. Remove the intent id from the Camp Vehicle Dispatch Data seatchKit

  5. Check the update form on backend as well:

  • Camp Vehicle Dispatch Form
  • Acknowlegde form
  • Backend searchKit's
  • Check the share link functionality too
  1. Update Camp Vehicle Dispatch Data for images searchkit link
    wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fvehicle-dispatch-images#?Eck_Collection_Source_Vehicle_Dispatch1=[id]&Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id=[Camp_Vehicle_Dispatch.Collection_Camp]&id=[id]

  2. Main Issue = fix the Camp Vehicle Dispatch Data formbuilder id from the filters
    https://goonj-crm.staging.coloredcow.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fafform#/edit/afsearchCampVehicleDispatchData

  3. Fix the Vehicle Dispatch Images formbuilder id intent id
    https://goonj-crm.staging.coloredcow.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fafform#/edit/afsearchVehicleDispatchImages

  4. Fix the Acknowledgement For Logistics Data
    https://goonj-crm.staging.coloredcow.com/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Fadmin%2Fafform#/edit/afsearchAcknowledgementForLogisticsData

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Updated URL construction for vehicle dispatch forms to enhance data accuracy.
    • Improved email notification logic for collection camps.
  • Bug Fixes

    • Corrected parameters in URLs to ensure proper data referencing in vehicle dispatch notifications.
  • Documentation

    • Enhanced error logging for better tracking of collection camp data.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 3, 2024

Walkthrough

The changes in this pull request modify the URL construction within the goonjcustom_collection_camp_email_html function in the CollectionCampCron.php file. The parameter name for the camp vehicle dispatch form URL has been updated from Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id to Camp_Vehicle_Dispatch.Collection_Camp. This adjustment affects the query string used for generating the URL in email notifications sent to participants of the collection camp, while the rest of the code remains unchanged.

Changes

File Path Change Summary
wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/CollectionCampCron.php Updated URL parameter for camp vehicle dispatch form in email notification.
wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php Modified generateLinks method to change URL parameter for Collection_Camp.
wp-content/civi-extensions/goonjcustom/Civi/CollectionCampService.php Updated methods to change collection camp ID references in email notifications.

Possibly related PRs

  • Updated Mail Id for Collection Camp #300: The changes in this PR involve modifications to the email sending logic in CollectionCampCron.php, which aligns with the URL construction changes made in the main PR regarding the camp vehicle dispatch form.
  • Remove the filled by option for ACK form #301: This PR also modifies the goonjcustom_material_management_email_html method in CollectionCampService.php, which is relevant to the changes in the main PR that affect email notifications related to collection camps.
  • Fix the sharable link #313: The updates to the generateLinks method in CollectionCampLinks.php include changes to URL parameters that are directly related to the modifications made in the main PR regarding URL construction for the camp vehicle dispatch form.

Suggested labels

in review

Suggested reviewers

  • pokhiii

🐇 In the fields where bunnies play,
A URL change brightens the day.
From intent to camp, we hop with glee,
Sending emails with joy, oh so free!
With each little change, we dance and cheer,
For collection camps, we hold so dear! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 2bfc326 and a629f3a.

📒 Files selected for processing (1)
  • wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/CollectionCampCron.php (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/CollectionCampCron.php

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6ecfc91 and 6ce23a1.

📒 Files selected for processing (1)
  • wp-content/civi-extensions/goonjcustom/api/v3/Goonjcustom/CollectionCampCron.php (1 hunks)

$homeUrl = \CRM_Utils_System::baseCMSURL();
// Construct the full URLs for the forms.
$campVehicleDispatchFormUrl = $homeUrl . 'camp-vehicle-dispatch-form/#?Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id=' . $collectionCampId . '&Camp_Vehicle_Dispatch.Filled_by=' . $campAttendedById . '&Camp_Vehicle_Dispatch.To_which_PU_Center_material_is_being_sent=' . $collectionCampGoonjOffice . '&Eck_Collection_Camp1=' . $collectionCampId;
$campVehicleDispatchFormUrl = $homeUrl . 'camp-vehicle-dispatch-form/#?Camp_Vehicle_Dispatch.Collection_Camp=' . $collectionCampId . '&Camp_Vehicle_Dispatch.Filled_by=' . $campAttendedById . '&Camp_Vehicle_Dispatch.To_which_PU_Center_material_is_being_sent=' . $collectionCampGoonjOffice . '&Eck_Collection_Camp1=' . $collectionCampId;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codebase verification

Issues Found: Old parameter name Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id is still in use.

Please address the following instances to ensure consistency across the codebase:

  • wp-content/civi-extensions/goonjcustom/Civi/CollectionCampService.php
  • wp-content/civi-extensions/goonjcustom/CRM/Goonjcustom/Form/CollectionCampLinks.php

Ensure that all references to Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id are updated to Camp_Vehicle_Dispatch.Collection_Camp.

🔗 Analysis chain

LGTM! Verify form compatibility and update documentation.

The change from Camp_Vehicle_Dispatch.Collection_Camp_Intent_Id to Camp_Vehicle_Dispatch.Collection_Camp aligns with the PR objective to update the custom field type. The new parameter name is more generic and appropriate.

Please ensure that:

  1. The Camp Vehicle Dispatch form can correctly process the new Collection_Camp parameter.
  2. Any related documentation or user guides referencing the old parameter name are updated.

To verify the change across the codebase, you can run:

This will help identify any other places where the old parameter name might still be in use.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining instances of the old parameter name
rg "Camp_Vehicle_Dispatch\.Collection_Camp_Intent_Id" --type php

Length of output: 1271

@tarunnjoshi tarunnjoshi requested a review from pokhiii October 3, 2024 06:33
@tarunnjoshi tarunnjoshi self-assigned this Oct 3, 2024
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