Skip to content
Snippets Groups Projects
Commit a01f8af3 authored by xiaohua guan's avatar xiaohua guan Committed by Yas Naoi
Browse files

Issue #3065538 by Xiaohua Guan, yas: Fix a name field in image listing page

parent 9c924c74
No related branches found
No related tags found
No related merge requests found
...@@ -1054,6 +1054,16 @@ function aws_cloud_update_8161() { ...@@ -1054,6 +1054,16 @@ function aws_cloud_update_8161() {
cloud_update_yml_definitions($files, 'aws_cloud'); cloud_update_yml_definitions($files, 'aws_cloud');
} }
/**
* Update view aws_cloud_image.
*/
function aws_cloud_update_8162() {
$files = [
'views.view.aws_cloud_image.yml',
];
cloud_update_yml_definitions($files, 'aws_cloud');
}
/** /**
* Helper function to add fields to the entity type. * Helper function to add fields to the entity type.
* *
......
...@@ -59,7 +59,7 @@ display: ...@@ -59,7 +59,7 @@ display:
expose: expose:
items_per_page: true items_per_page: true
items_per_page_label: 'Items per page' items_per_page_label: 'Items per page'
items_per_page_options: '10, 15, 20, 25, 50, 100' items_per_page_options: '10,15,20,25,50,100'
items_per_page_options_all: true items_per_page_options_all: true
items_per_page_options_all_label: '- All -' items_per_page_options_all_label: '- All -'
offset: false offset: false
...@@ -78,6 +78,7 @@ display: ...@@ -78,6 +78,7 @@ display:
description: '' description: ''
columns: columns:
image_bulk_form: image_bulk_form image_bulk_form: image_bulk_form
name: name
ami_name: ami_name ami_name: ami_name
image_id: image_id image_id: image_id
source: source source: source
...@@ -90,6 +91,13 @@ display: ...@@ -90,6 +91,13 @@ display:
separator: '' separator: ''
empty_column: false empty_column: false
responsive: '' responsive: ''
name:
sortable: true
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
ami_name: ami_name:
sortable: true sortable: true
default_sort_order: asc default_sort_order: asc
...@@ -151,6 +159,71 @@ display: ...@@ -151,6 +159,71 @@ display:
hide_alter_empty: true hide_alter_empty: true
plugin_id: image_bulk_form plugin_id: image_bulk_form
entity_type: aws_cloud_image entity_type: aws_cloud_image
name:
id: name
table: aws_cloud_image
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: aws_cloud_image
entity_field: name
plugin_id: field
ami_name: ami_name:
id: ami_name id: ami_name
table: aws_cloud_image table: aws_cloud_image
...@@ -202,7 +275,7 @@ display: ...@@ -202,7 +275,7 @@ display:
click_sort_column: value click_sort_column: value
type: string type: string
settings: settings:
link_to_entity: true link_to_entity: false
group_column: value group_column: value
group_columns: { } group_columns: { }
group_rows: true group_rows: true
...@@ -642,7 +715,7 @@ display: ...@@ -642,7 +715,7 @@ display:
groups: groups:
1: AND 1: AND
cache_metadata: cache_metadata:
max-age: -1 max-age: 0
contexts: contexts:
- 'languages:language_content' - 'languages:language_content'
- 'languages:language_interface' - 'languages:language_interface'
...@@ -812,7 +885,7 @@ display: ...@@ -812,7 +885,7 @@ display:
defaults: defaults:
access: false access: false
cache_metadata: cache_metadata:
max-age: -1 max-age: 0
contexts: contexts:
- 'languages:language_content' - 'languages:language_content'
- 'languages:language_interface' - 'languages:language_interface'
......
...@@ -100,11 +100,10 @@ class ImageCreateForm extends AwsCloudContentForm { ...@@ -100,11 +100,10 @@ class ImageCreateForm extends AwsCloudContentForm {
&& ($entity->set('account_id', $account_id)) && ($entity->set('account_id', $account_id))
&& ($entity->save())) { && ($entity->save())) {
$this->setUidInAws( $this->setTagsInAws($entity->getImageId(), [
$this->entity->getImageId(), 'image_created_by_uid' => $entity->getOwner()->id(),
'image_created_by_uid', 'Name' => $entity->getName(),
$this->entity->getOwner()->id() ]);
);
$message = $this->t('The @label "%label (@image_id)" has been created.', [ $message = $this->t('The @label "%label (@image_id)" has been created.', [
'@label' => $entity->getEntityType()->getLabel(), '@label' => $entity->getEntityType()->getLabel(),
......
...@@ -190,11 +190,11 @@ class ImageEditForm extends AwsCloudContentForm { ...@@ -190,11 +190,11 @@ class ImageEditForm extends AwsCloudContentForm {
*/ */
public function save(array $form, FormStateInterface $form_state) { public function save(array $form, FormStateInterface $form_state) {
parent::save($form, $form_state); parent::save($form, $form_state);
$this->setUidInAws(
$this->entity->getImageId(), $this->setTagsInAws($this->entity->getImageId(), [
'image_created_by_uid', 'image_created_by_uid' => $this->entity->getOwner()->id(),
$this->entity->getOwner()->id() 'Name' => $this->entity->getName(),
); ]);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment