Added equal opps view, and other changes.

This commit is contained in:
naomi 2021-02-18 16:46:59 +00:00
parent 1a7757394e
commit 4647ef6e3e
7 changed files with 320 additions and 8 deletions

View File

@ -0,0 +1,308 @@
langcode: en
status: true
dependencies:
config:
- system.menu.opencase
module:
- opencase_entities
- user
- views_autosubmit
id: equal_opps_records
label: 'Equal Opps Records'
module: views
description: ''
tag: ''
base_table: oc_equal_opps
base_field: id
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: perm
options:
perm: 'view published equal opps entities'
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: autosubmit
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
autosubmit_hide: true
pager:
type: mini
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
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
tags:
previous:
next:
style:
type: table
row:
type: fields
fields:
name:
id: name
table: oc_equal_opps
field: name
relationship: none
group_type: group
admin_label: ''
label: Name
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
click_sort_column: value
type: string
settings:
link_to_entity: true
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: null
entity_field: name
plugin_id: field
filters:
status:
value: '1'
table: oc_equal_opps
field: status
plugin_id: boolean
entity_type: oc_equal_opps
entity_field: status
id: status
expose:
operator: ''
operator_limit_selection: false
operator_list: { }
group: 1
first_name:
id: first_name
table: oc_actor_field_data
field: first_name
relationship: oc_actor
group_type: group
admin_label: ''
operator: '='
value: ''
group: 1
exposed: true
expose:
operator_id: first_name_op
label: 'First Name'
description: ''
use_operator: false
operator: first_name_op
operator_limit_selection: false
operator_list: { }
identifier: first_name
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
anonymous: '0'
administrator: '0'
gno_standard_user: '0'
placeholder: ''
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: oc_actor
entity_field: first_name
plugin_id: string
last_name:
id: last_name
table: oc_actor_field_data
field: last_name
relationship: oc_actor
group_type: group
admin_label: ''
operator: '='
value: ''
group: 1
exposed: true
expose:
operator_id: last_name_op
label: 'Last Name'
description: ''
use_operator: false
operator: last_name_op
operator_limit_selection: false
operator_list: { }
identifier: last_name
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
anonymous: '0'
administrator: '0'
gno_standard_user: '0'
placeholder: ''
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: oc_actor
entity_field: last_name
plugin_id: string
sorts: { }
title: 'Equal Opps Records'
header: { }
footer: { }
empty:
area:
id: area
table: views
field: area
relationship: none
group_type: group
admin_label: ''
empty: true
tokenize: false
content:
value: 'There is no Equal Opps record by that name. Please check the spelling'
format: basic_html
plugin_id: text
relationships:
oc_actor:
id: oc_actor
table: oc_equal_opps
field: oc_actor
relationship: none
group_type: group
admin_label: Person
required: true
entity_type: oc_equal_opps
entity_field: oc_actor
plugin_id: standard
arguments: { }
display_extenders: { }
use_ajax: true
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- user.permissions
tags: { }
page_1:
display_plugin: page
id: page_1
display_title: Page
position: 1
display_options:
display_extenders: { }
path: equal-opps-records
exposed_block: true
menu:
type: normal
title: 'Equal Opps Records'
description: ''
expanded: false
parent: opencase.see_all
weight: 10
context: '0'
menu_name: opencase
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- user.permissions
tags: { }

View File

@ -268,8 +268,9 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
->setDefaultValue('')
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -9,
]);
'weight' => -100,
])
->setRequired(TRUE);
$fields['middle_names'] = BaseFieldDefinition::create('string')
->setLabel(t('Middle Names'))
@ -284,7 +285,7 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
->setDefaultValue('')
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -8,
'weight' => -99,
])
->setRequired(FALSE);
@ -301,8 +302,9 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
->setDefaultValue('')
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -7,
]);
'weight' => -98,
])
->setRequired(TRUE);
// Contact details.
$fields['email'] = BaseFieldDefinition::create('string')

View File

@ -8,5 +8,6 @@ dependencies:
- opencase_entities
- superfish
- admin_toolbar
- views_autosubmit
libraries:
- opencase/opencase-lib

View File

@ -89,6 +89,7 @@ function opencase_uninstall() {
'block.block.opencase',
'system.menu.opencase',
'views.view.contact_details_changes',
'views.view.equal_opps_records',
];
foreach($configs as $config) {
Drupal::configFactory()->getEditable($config)->delete();

View File

@ -45,7 +45,7 @@ class AddActorsMenuLink extends DeriverBase implements ContainerDeriverInterface
$actorTypes = $this->entityTypeManager->getStorage('oc_actor_type')->loadMultiple();
foreach ($actorTypes as $id => $actorType) {
$links[$id] = [
'title' => "Add ". $actorType->label(),
'title' => $actorType->label(),
'route_name' => "entity.oc_actor.add_form",
'route_parameters' => ['oc_actor_type' => $actorType->id()]
] + $base_plugin_definition;

View File

@ -45,7 +45,7 @@ class AddEventsMenuLink extends DeriverBase implements ContainerDeriverInterface
$eventTypes = $this->entityTypeManager->getStorage('oc_event_type')->loadMultiple();
foreach ($eventTypes as $id => $eventType) {
$links[$id] = [
'title' => "Add ". $eventType->label() . " Event",
'title' => $eventType->label() . " Event",
'route_name' => "entity.oc_event.add_form",
'route_parameters' => ['oc_event_type' => $eventType->id()]
] + $base_plugin_definition;

View File

@ -45,7 +45,7 @@ class AddOrganisationsMenuLink extends DeriverBase implements ContainerDeriverIn
$organisationTypes = $this->entityTypeManager->getStorage('oc_organisation_type')->loadMultiple();
foreach ($organisationTypes as $id => $organisationType) {
$links[$id] = [
'title' => "Add ". $organisationType->label(),
'title' => $organisationType->label(),
'route_name' => "entity.oc_organisation.add_form",
'route_parameters' => ['oc_organisation_type' => $organisationType->id()]
] + $base_plugin_definition;