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

Next #2094

Draft
wants to merge 39 commits into
base: master
Choose a base branch
from
Draft

Next #2094

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1b405c1
Integrate Web Components (#2032)
cairocoder01 Apr 13, 2023
6a6728e
implements dt-single-select and dt-date (#2044)
micahmills Apr 25, 2023
144e825
Merge 1.40.0 into next (#2060)
cairocoder01 May 5, 2023
623a6ad
implement dt-tags (#2059)
cairocoder01 May 5, 2023
77b3320
Implement dt-connection (#2061)
cairocoder01 May 8, 2023
ff7fc79
implements dt_multi_select (#2065)
micahmills May 15, 2023
f87febc
Merge branch 'master' into next
corsacca Aug 29, 2023
b940bdf
Update components to 0.5.1
corsacca Aug 30, 2023
fd0b612
Missing files.
corsacca Aug 30, 2023
480420a
Merge branch 'master' into next
corsacca Nov 15, 2023
21e14b0
Merge branch 'master' into next
corsacca Dec 13, 2023
1a0b3e6
Merge branch 'master' into next
corsacca Jan 12, 2024
ab21565
Merge branch 'develop' into next
corsacca Mar 25, 2024
dcfa4a9
Merge branch 'refs/heads/develop' into next
corsacca May 22, 2024
d0bbd48
Run prettier and ignore components
corsacca May 22, 2024
868e24d
Web components integration into new contact form (#2450)
Ashima-Arora May 23, 2024
d15d41a
Make private contacts an opt-in feature for new instances. Connection…
corsacca May 23, 2024
6ab0384
Update README.md
squigglybob May 23, 2024
d4e59f1
Update README.md
squigglybob May 23, 2024
f796bc0
Update README.md
squigglybob May 23, 2024
1c375cf
fix migration
corsacca May 23, 2024
e3beb1a
Handle undefined warning
corsacca May 25, 2024
af0d9b4
moves component services to header
micahmills May 28, 2024
f3b4c1f
Update email template button hover color to green
corsacca May 29, 2024
65b87a3
Metrics > Personal > Add Gen-Mapper (#2483)
kodinkat May 29, 2024
ec8f406
Customizations > enable creation of location fields (grid only) (#2499)
kodinkat May 29, 2024
bc79c0e
Create dt_site_id function (#2489)
corsacca May 29, 2024
faa87eb
Move location fields to the custom post type base (#2501)
kodinkat May 29, 2024
8f834e2
Login SSO: Try to match firebase languages
corsacca May 30, 2024
add696e
change CI to use php8.3 (#2511)
corsacca May 31, 2024
8dd0be8
phpcs
corsacca May 31, 2024
38d0ed1
Refactor Settings D.T > Custom Lists > Languages (#2509)
CptHappyHands May 31, 2024
da44754
Metrics> Maps > fix getting user locations (#2503)
kodinkat Jun 3, 2024
06d3fe2
phpcbf fixes
micahmills Jun 5, 2024
f590336
Merge branch 'upstream-develop' into next
micahmills Jun 5, 2024
949d0b8
Edit page components integration fixing (#2510)
Ashima-Arora Jun 21, 2024
f6f3325
Dt-Modal Integration in Dt-Theme on Edit Contact Page (#2528)
Vijenderrr Jul 17, 2024
812231f
Duplicates detected button integration (#2543)
Vijenderrr Jul 26, 2024
22699c0
Integrations of Dt-multiselect-button-group into DT Theme (#2524)
Ashima-Arora Jul 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
implements dt-single-select and dt-date (#2044)
* implements dt-single-select

* implements dt-date
  • Loading branch information
micahmills committed Apr 25, 2023
commit 6a6728e0fd58a7569de9e4305f560f5bbf997396
40 changes: 21 additions & 19 deletions dt-contacts/access-module.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,28 +435,30 @@ public function dt_render_field_for_display_template( $post, $field_type, $field
return;
}
?>
<div class="section-subheader">
<img src="<?php echo esc_url( $contact_fields[$field_key]['icon'] ) ?>">
<?php echo esc_html( $contact_fields[$field_key]['name'] ) ?>
</div>
<?php
$active_color = '#366184';
$current_key = $contact['overall_status']['key'] ?? '';
if ( isset( $contact_fields['overall_status']['default'][ $current_key ]['color'] ) ){
$active_color = $contact_fields['overall_status']['default'][ $current_key ]['color'];
$options_array = $contact_fields[$field_key]['default'];
$options_array = array_map( function( $key, $value ) {
return [
'id' => $key,
'label' => $value['label'],
'color' => $value['color'] ?? null,
];
}, array_keys( $options_array ), $options_array );

if ( isset( $contact_fields[$field_key]['icon'] ) && !empty( $contact_fields[$field_key]['icon'] ) ) {
$icon = 'icon=' . esc_attr( $contact_fields[$field_key]['icon'] );
}
?>
<select id="overall_status" class="select-field color-select" style="margin-bottom:0; background-color: <?php echo esc_html( $active_color ) ?>" <?php echo esc_html( $disabled ); ?>>
<?php foreach ( $contact_fields['overall_status']['default'] as $key => $option ){
$value = $option['label'] ?? '';
if ( $current_key === $key ) {
?>
<option value="<?php echo esc_html( $key ) ?>" selected><?php echo esc_html( $value ); ?></option>
<?php } else { ?>
<option value="<?php echo esc_html( $key ) ?>"><?php echo esc_html( $value ); ?></option>
<?php } ?>
<?php } ?>
</select>
<dt-single-select
id="overall_status"
name="overall_status"
label="<?php echo esc_attr( $contact_fields[$field_key]['name'] )?>"
<?php echo esc_html( $icon ) ?>
options="<?php echo esc_attr( json_encode( $options_array ) ) ?>"
value="<?php echo esc_attr( $post[$field_key] ? $post[$field_key]['key'] : '' ) ?>">
<?php dt_render_icon_slot( $fields[$field_key] ) ?>
</dt-single-select>

<p>
<span id="reason">
<?php
Expand Down
46 changes: 23 additions & 23 deletions dt-core/global-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ function render_field_for_display( $field_key, $fields, $post, $show_extra_contr
' . esc_html( $disabled ) . '
' . ( $is_private ? 'private privateLabel=' . esc_attr( _x( "Private Field: Only I can see it\'s content", 'disciple_tools' ) ) : null ) . '
';
$supported_web_components = [ 'text' ];
$supported_web_components = [ 'text', 'key_select', 'date' ];

?>
<?php if ( !in_array( $field_type, $supported_web_components ) ): ?>
Expand Down Expand Up @@ -633,23 +633,26 @@ class="add-link__option"
}
}
?>
<select class="select-field <?php echo esc_html( $color_select ? 'color-select' : '' ); ?>" id="<?php echo esc_html( $display_field_id ); ?>" style="<?php echo esc_html( $color_select ? ( 'background-color: ' . $active_color ) : '' ); ?>" <?php echo esc_html( $required_tag ) ?> <?php echo esc_html( $disabled ); ?>>
<?php if ( !isset( $fields[$field_key]['default']['none'] ) && empty( $fields[$field_key]['select_cannot_be_empty'] ) ) : ?>
<option value="" <?php echo esc_html( !isset( $post[$field_key] ) ?: 'selected' ) ?>></option>
<?php endif; ?>
<?php foreach ( $fields[$field_key]['default'] as $option_key => $option_value ):
if ( !$show_hidden && isset( $option_value['hidden'] ) && $option_value['hidden'] === true ){
continue;
}
$selected = isset( $post[$field_key]['key'] ) && $post[$field_key]['key'] === strval( $option_key ); ?>
<option value="<?php echo esc_html( $option_key )?>" <?php echo esc_html( $selected ? 'selected' : '' )?>>
<?php echo esc_html( $option_value['label'] ) ?>
</option>
<?php endforeach; ?>
</select>

<?php
$options_array = $fields[$field_key]['default'];
$options_array = array_map( function( $key, $value ) {
return [
'id' => $key,
'label' => $value['label'],
'color' => $value['color'] ?? null,
];
}, array_keys( $options_array ), $options_array );
?>
<dt-single-select
<?php echo wp_kses_post( $shared_attributes ) ?>
options="<?php echo esc_attr( json_encode( $options_array ) ) ?>"
value="<?php echo esc_attr( $post[$field_key] ? $post[$field_key]['key'] : '' ) ?>">
<?php dt_render_icon_slot( $fields[$field_key] ) ?>
</dt-single-select>
<?php elseif ( $field_type === 'tags' ) : ?>
<div id="<?php echo esc_html( $display_field_id ); ?>" class="tags">
<var id="<?php echo esc_html( $display_field_id ); ?>-result-container" class="result-container"></var>
<var id="<?php echo json_encode( $display_field_id ); ?>-result-container" class="result-container"></var>
<div id="<?php echo esc_html( $display_field_id ); ?>_t" name="form-tags" class="scrollable-typeahead typeahead-margin-when-active">
<div class="typeahead__container">
<div class="typeahead__field">
Expand Down Expand Up @@ -787,13 +790,10 @@ class="text-input"
</div>

<?php elseif ( $field_type === 'date' ) :?>
<div class="<?php echo esc_html( $display_field_id ); ?> input-group">
<input id="<?php echo esc_html( $display_field_id ); ?>" class="input-group-field dt_date_picker" type="text" autocomplete="off" <?php echo esc_html( $required_tag ) ?>
value="<?php echo esc_html( $post[$field_key]['timestamp'] ?? '' ) ?>" <?php echo esc_html( $disabled ); ?> >
<div class="input-group-button">
<button id="<?php echo esc_html( $display_field_id ); ?>-clear-button" class="button alert clear-date-button" data-inputid="<?php echo esc_html( $display_field_id ); ?>" title="Delete Date" type="button" <?php echo esc_html( $disabled ); ?>>x</button>
</div>
</div>
<dt-date
<?php echo wp_kses_post( $shared_attributes ) ?> timestamp="<?php echo esc_html( $post[$field_key]['timestamp'] ?? '' ) ?>">
<?php dt_render_icon_slot( $fields[$field_key] ) ?>
</dt-date>
<?php elseif ( $field_type === 'connection' ) :?>
<div id="<?php echo esc_attr( $display_field_id . '_connection' ) ?>" class="dt_typeahead <?php echo esc_html( $disabled ) ?>">
<span id="<?php echo esc_html( $display_field_id ); ?>-result-container" class="result-container"></span>
Expand Down