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

#1660 - Revert Record Back In Time Shape #1776

Merged

Conversation

kodinkat
Copy link
Contributor

fixes #1660

@kodinkat kodinkat changed the title #1660 - Revert Record Back In Time Shape WIP: #1660 - Revert Record Back In Time Shape [DO_NOT_MERGE] Aug 30, 2022
@kodinkat kodinkat changed the title WIP: #1660 - Revert Record Back In Time Shape [DO_NOT_MERGE] #1660 - Revert Record Back In Time Shape Sep 6, 2022
@kodinkat kodinkat force-pushed the 1660-revert-record-back-in-time branch from 471e7bf to 14ef2b3 Compare September 6, 2022 10:42
@corsacca
Copy link
Member

corsacca commented Sep 8, 2022

  • Display name without the &
    image
  • Order History in the same order as the comments section
  • Show all History in modal, calendar scrolls to the relevant section. Confused as to how much history is shown when.
  • Should comment be deleted? (revert history and comments?)
  • Revert activity done by "Revert Bot" instead of by the user.
  • Milestone (multi select) don't want to revert.
  • delete history since selected revision ?
  • get activity message formatted.

@kodinkat kodinkat force-pushed the 1660-revert-record-back-in-time branch from 1d70edc to 02bcedd Compare September 14, 2022 10:37
@kodinkat kodinkat force-pushed the 1660-revert-record-back-in-time branch from 02bcedd to 7684c5c Compare September 14, 2022 10:40
@@ -348,6 +348,24 @@ function dt_site_scripts() {
'template_dir_uri' => esc_html( get_template_directory_uri() ),
'fetch_more_text' => __( 'Load More', 'disciple_tools' ) // Support translations
) );

wp_register_script( 'litepicker', 'https://cdn.jsdelivr.net/npm/litepicker/dist/litepicker.js', false );
Copy link
Member

Choose a reason for hiding this comment

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

@kodinkat lets us the existing date range picker.

Copy link
Member

Choose a reason for hiding this comment

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

See metrics, and tasks

field_label = 'contact_other';

} else {
field_label = 'communication_channel';
Copy link
Member

Choose a reason for hiding this comment

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

This section can modularized.

$field_key = 'contact_twitter';

} elseif ( substr( $field_key, 0, strlen( 'contact_other_' ) ) == 'contact_other_' ) {
$field_key = 'contact_other';
Copy link
Member

Choose a reason for hiding this comment

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

This section can be modularized to accommodate for custom channels.

dt-posts/dt-posts.php Show resolved Hide resolved
@corsacca
Copy link
Member

Address: Name in modal
image

@kodinkat
Copy link
Contributor Author

Address: Name in modal
image

Including:

  • Correct timestamp formats.
  • Activated Links.

@kodinkat kodinkat marked this pull request as draft December 7, 2022 09:01
@kodinkat kodinkat marked this pull request as ready for review December 9, 2022 17:03
…h select widget + Additional permissions + Formatted links + Revert to specific activity record + Resolved groups connection field revert issue
@corsacca
Copy link
Member

corsacca commented Mar 3, 2023

Duplicate dates, comes from opening the modal multiple times.
image

@corsacca
Copy link
Member

corsacca commented Mar 3, 2023

Filter not always working?
No error logs
image

@corsacca
Copy link
Member

corsacca commented Mar 3, 2023

A bunch of fields did not revert:
image

</tr>
<tr style="border: none;">
<td style="vertical-align: top;">
<span><?php echo esc_html( _x( 'Show All', 'Show All', 'disciple_tools' ) ) ?></span>
Copy link
Member

Choose a reason for hiding this comment

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

No need to add context if the string is the same as the context.
Adding the context can result in an extra string to translate

@@ -386,7 +386,7 @@ public function dt_custom_fields_settings_after_combine( $fields, $post_type ){
public static function dt_record_admin_actions( $post_type, $post_id ){
if ( $post_type === 'contacts' ){
$post = DT_Posts::get_post( $post_type, $post_id );
if ( empty( $post['archive'] ) && isset( $post['type'] ) && ( $post['type']['key'] === 'personal' || $post['type']['key'] === 'placeholder' ) ) :?>
if ( empty( $post['archive'] ) && isset( $post['type'] ) && isset( $post['type'] ) && ( $post['type']['key'] === 'personal' || $post['type']['key'] === 'placeholder' ) ) :?>
Copy link
Member

Choose a reason for hiding this comment

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

@kodinkat this is duplicate?

register_rest_route(
$this->namespace, '/(?P<post_type>\w+)/(?P<id>\d+)/revert_activity_history', [
[
'methods' => 'GET',
Copy link
Member

Choose a reason for hiding this comment

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

Would be a post request more naturally

@kodinkat
Copy link
Contributor Author

kodinkat commented Mar 6, 2023

Filter not always working?
No error logs
image

@corsacca

Typically, this filters from most recent date to selected filtered date. So, you should be able to scroll down in time to selected date?

@kodinkat
Copy link
Contributor Author

kodinkat commented Mar 6, 2023

A bunch of fields did not revert:
image

@corsacca

Suitable user capabilities added and the following A Beautiful Tile fields sanity-checked:

  • Number field [number]
  • Text [text]
  • Communication Channel [communication_channel]
  • User Select [user_select]
  • location field [location]
  • Date Field [date]
  • Random Options [multi_select]
  • Random Options [key_select]
  • Random Tags [tags]
  • Link Field [link]

Let me know if you are still encountering any troublesome fields/values?

@kodinkat
Copy link
Contributor Author

kodinkat commented Mar 6, 2023

Duplicate dates, comes from opening the modal multiple times.
image

@corsacca

Good spot! 😄 A fix has now been worked in...!

@corsacca
Copy link
Member

corsacca commented Mar 7, 2023

Filter not always working?
No error logs
image

@corsacca

Typically, this filters from most recent date to selected filtered date. So, you should be able to scroll down in time to selected date?

@kodinkat Let's filter this to just show the day selected. There might be 100s of activity between today and the date selected.

dt-posts/dt-posts.php Outdated Show resolved Hide resolved
@corsacca
Copy link
Member

corsacca commented Mar 9, 2023

No history or revert ability on Name
image
Number field did not revert?
image
image

@corsacca
Copy link
Member

Number not changing is prob related to: #1969

@kodinkat
Copy link
Contributor Author

Number not changing is prob related to: #1969

@corsacca

Yup, that's most likely the cause; as no update action whenever there is a min/max constraint on the field.

I'll look into the reverting of record Names, issue...

AND `action` IN ( $supported_actions_sql )
AND `field_type` IN ( $supported_field_types_sql )
AND `hist_time` BETWEEN %d AND %d
ORDER BY hist_time $result_order",
Copy link
Member

Choose a reason for hiding this comment

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

@kodinkat $result_order is NOT escaped

@corsacca
Copy link
Member

@kodinkat !!!!!

@corsacca corsacca merged commit ba9408d into DiscipleTools:master Mar 16, 2023
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.

Ability to revert a record back in history
2 participants