diff --git a/modules/social_features/social_profile/config/install/views.view.newest_users.yml b/modules/social_features/social_profile/config/install/views.view.newest_users.yml index 5632d1c8c03..344aa024f33 100644 --- a/modules/social_features/social_profile/config/install/views.view.newest_users.yml +++ b/modules/social_features/social_profile/config/install/views.view.newest_users.yml @@ -80,6 +80,7 @@ display: type: mini options: offset: 0 + pagination_heading_level: h4 items_per_page: 4 total_pages: null id: 0 @@ -382,6 +383,7 @@ display: type: full options: offset: 0 + pagination_heading_level: h4 items_per_page: 10 total_pages: null id: 0 @@ -399,6 +401,147 @@ display: offset: false offset_label: Offset quantity: 9 + filters: + type: + id: type + table: profile + field: type + entity_type: profile + entity_field: type + plugin_id: bundle + value: + profile: profile + expose: + operator_limit_selection: false + operator_list: { } + status: + id: status + table: users_field_data + field: status + relationship: uid + group_type: group + admin_label: '' + entity_type: user + entity_field: status + plugin_id: boolean + operator: '=' + value: '1' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + uid_raw: + id: uid_raw + table: users_field_data + field: uid_raw + relationship: uid + group_type: group + admin_label: filter_no_admin + entity_type: user + plugin_id: numeric + operator: '>' + value: + min: '' + max: '' + value: '1' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + roles_target_id: + id: roles_target_id + table: user__roles + field: roles_target_id + relationship: uid + group_type: group + admin_label: '' + entity_type: user + entity_field: roles + plugin_id: user_roles + operator: 'not empty' + value: { } + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + filter_groups: + operator: AND + groups: + 1: AND defaults: title: false pager: false @@ -406,12 +549,14 @@ display: filter_groups: true display_description: '' exposed_block: true - display_extenders: { } + display_extenders: + views_ef_fieldset: { } path: all-members cache_metadata: max-age: -1 contexts: - 'languages:language_interface' + - url - url.query_args - user.permissions tags: diff --git a/modules/social_features/social_profile/config/update/social_profile_update_130004.yml b/modules/social_features/social_profile/config/update/social_profile_update_130004.yml new file mode 100644 index 00000000000..5632d1c8c03 --- /dev/null +++ b/modules/social_features/social_profile/config/update/social_profile_update_130004.yml @@ -0,0 +1,431 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.profile.small_teaser + - core.entity_view_mode.profile.teaser + - profile.type.profile + module: + - profile + - user +id: newest_users +label: 'Newest users' +module: views +description: 'Displays a block and page for the newest users on the platform based on Profile' +tag: '' +base_table: profile +base_field: profile_id +display: + default: + id: default + display_title: Master + display_plugin: default + position: 0 + display_options: + title: 'Newest members' + fields: + rendered_entity: + id: rendered_entity + table: profile + field: rendered_entity + relationship: none + group_type: group + admin_label: '' + entity_type: null + entity_field: null + plugin_id: rendered_entity + label: '' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + view_mode: default + pager: + type: mini + options: + offset: 0 + items_per_page: 4 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + exposed_form: + type: basic + options: + submit_button: Filter + reset_button: false + reset_button_label: Reset + exposed_sorts_label: 'Sort by' + expose_sort_order: true + sort_asc_label: Asc + sort_desc_label: Desc + access: + type: perm + options: + perm: 'view any profile profile' + cache: + type: tag + options: { } + empty: { } + sorts: + created: + id: created + table: profile + field: created + relationship: none + group_type: group + admin_label: '' + entity_type: profile + entity_field: created + plugin_id: date + order: DESC + expose: + label: '' + exposed: false + granularity: minute + arguments: { } + filters: + type: + id: type + table: profile + field: type + entity_type: profile + entity_field: type + plugin_id: bundle + value: + profile: profile + expose: + operator_limit_selection: false + operator_list: { } + status: + id: status + table: users_field_data + field: status + relationship: uid + group_type: group + admin_label: '' + entity_type: user + entity_field: status + plugin_id: boolean + operator: '=' + value: '1' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + uid_raw: + id: uid_raw + table: users_field_data + field: uid_raw + relationship: uid + group_type: group + admin_label: filter_no_admin + entity_type: user + plugin_id: numeric + operator: '>' + value: + min: '' + max: '' + value: '1' + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + roles_target_id: + id: roles_target_id + table: user__roles + field: roles_target_id + relationship: uid + group_type: group + admin_label: '' + entity_type: user + entity_field: roles + plugin_id: user_roles + operator: 'not empty' + value: { } + group: 1 + exposed: false + expose: + operator_id: '' + label: '' + description: '' + use_operator: false + operator: '' + operator_limit_selection: false + operator_list: { } + identifier: '' + required: false + remember: false + multiple: false + remember_roles: + authenticated: authenticated + reduce: false + is_grouped: false + group_info: + label: '' + description: '' + identifier: '' + optional: true + widget: select + multiple: false + remember: false + default_group: All + default_group_multiple: { } + group_items: { } + reduce_duplicates: false + style: + type: default + row: + type: 'entity:profile' + options: + relationship: none + view_mode: teaser + query: + type: views_query + options: + query_comment: '' + disable_sql_rewrite: false + distinct: true + replica: false + query_tags: { } + relationships: + uid: + id: uid + table: profile + field: uid + relationship: none + group_type: group + admin_label: User + entity_type: profile + entity_field: uid + plugin_id: standard + required: true + header: { } + footer: { } + display_extenders: { } + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_interface' + - url.query_args + - user.permissions + tags: + - 'config:core.entity_view_display.profile.profile.autocomplete_item' + - 'config:core.entity_view_display.profile.profile.compact' + - 'config:core.entity_view_display.profile.profile.compact_notification' + - 'config:core.entity_view_display.profile.profile.compact_teaser' + - 'config:core.entity_view_display.profile.profile.default' + - 'config:core.entity_view_display.profile.profile.hero' + - 'config:core.entity_view_display.profile.profile.medium_teaser' + - 'config:core.entity_view_display.profile.profile.name' + - 'config:core.entity_view_display.profile.profile.search_index' + - 'config:core.entity_view_display.profile.profile.small' + - 'config:core.entity_view_display.profile.profile.small_teaser' + - 'config:core.entity_view_display.profile.profile.statistic' + - 'config:core.entity_view_display.profile.profile.table' + - 'config:core.entity_view_display.profile.profile.teaser' + block_newest_users: + id: block_newest_users + display_title: 'Newest users block' + display_plugin: block + position: 2 + display_options: + title: 'Newest members' + pager: + type: some + options: + offset: 0 + items_per_page: 2 + style: + type: default + options: { } + row: + type: 'entity:profile' + options: + relationship: none + view_mode: small_teaser + defaults: + title: false + pager: false + use_more: false + use_more_always: false + use_more_text: false + style: false + row: false + display_description: '' + use_more: true + use_more_always: true + use_more_text: 'All members' + display_extenders: { } + block_description: 'Newest users block' + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_interface' + - user.permissions + tags: + - 'config:core.entity_view_display.profile.profile.autocomplete_item' + - 'config:core.entity_view_display.profile.profile.compact' + - 'config:core.entity_view_display.profile.profile.compact_notification' + - 'config:core.entity_view_display.profile.profile.compact_teaser' + - 'config:core.entity_view_display.profile.profile.default' + - 'config:core.entity_view_display.profile.profile.hero' + - 'config:core.entity_view_display.profile.profile.medium_teaser' + - 'config:core.entity_view_display.profile.profile.name' + - 'config:core.entity_view_display.profile.profile.search_index' + - 'config:core.entity_view_display.profile.profile.small' + - 'config:core.entity_view_display.profile.profile.small_teaser' + - 'config:core.entity_view_display.profile.profile.statistic' + - 'config:core.entity_view_display.profile.profile.table' + - 'config:core.entity_view_display.profile.profile.teaser' + page_newest_users: + id: page_newest_users + display_title: 'Newest users page' + display_plugin: page + position: 1 + display_options: + title: 'All members' + pager: + type: full + options: + offset: 0 + items_per_page: 10 + total_pages: null + id: 0 + tags: + next: ›› + previous: ‹‹ + first: '« First' + last: 'Last »' + expose: + items_per_page: false + items_per_page_label: 'Items per page' + items_per_page_options: '5, 10, 25, 50' + items_per_page_options_all: false + items_per_page_options_all_label: '- All -' + offset: false + offset_label: Offset + quantity: 9 + defaults: + title: false + pager: false + filters: true + filter_groups: true + display_description: '' + exposed_block: true + display_extenders: { } + path: all-members + cache_metadata: + max-age: -1 + contexts: + - 'languages:language_interface' + - url.query_args + - user.permissions + tags: + - 'config:core.entity_view_display.profile.profile.autocomplete_item' + - 'config:core.entity_view_display.profile.profile.compact' + - 'config:core.entity_view_display.profile.profile.compact_notification' + - 'config:core.entity_view_display.profile.profile.compact_teaser' + - 'config:core.entity_view_display.profile.profile.default' + - 'config:core.entity_view_display.profile.profile.hero' + - 'config:core.entity_view_display.profile.profile.medium_teaser' + - 'config:core.entity_view_display.profile.profile.name' + - 'config:core.entity_view_display.profile.profile.search_index' + - 'config:core.entity_view_display.profile.profile.small' + - 'config:core.entity_view_display.profile.profile.small_teaser' + - 'config:core.entity_view_display.profile.profile.statistic' + - 'config:core.entity_view_display.profile.profile.table' + - 'config:core.entity_view_display.profile.profile.teaser' diff --git a/modules/social_features/social_profile/social_profile.install b/modules/social_features/social_profile/social_profile.install index e2076be14ec..0976adac753 100644 --- a/modules/social_features/social_profile/social_profile.install +++ b/modules/social_features/social_profile/social_profile.install @@ -296,3 +296,30 @@ function _social_profile_hide_path_field_from_entity_form_display(string $taxono ->save(); } } + +/** + * Re-update views /all-members. + * + * Hide blocked members and display organization filter. + */ +function social_profile_update_130004(): void { + $moduleHandler = \Drupal::moduleHandler(); + if ($moduleHandler->moduleExists('views') === FALSE || + $moduleHandler->moduleExists('user') === FALSE || + $moduleHandler->moduleExists('profile') === FALSE + ) { + return; + } + + $config_file = \Drupal::service('extension.list.module')->getPath('social_profile') . '/config/install/views.view.newest_users.yml'; + if (file_exists($config_file) === FALSE) { + \Drupal::logger('social_profile')->info('Configuration file for view "newest_users" not found.'); + return; + } + + $view_config = Yaml::parseFile($config_file); + \Drupal::configFactory()->getEditable('views.view.newest_users') + ->setData($view_config) + ->save(); + \Drupal::logger('social_profile')->info('The view "newest_users" has been updated with new configuration.'); +}