Skip to content

Commit

Permalink
add description, update routes
Browse files Browse the repository at this point in the history
  • Loading branch information
janette committed Nov 21, 2020
1 parent 85602d5 commit b19cfc6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Metastore Entity
type: module
description: .
description: Entity for storing metadata.
package: DKAN
core_version_requirement: ^8 || ^9
# These modules are required by the tests, must be available at bootstrap time
dependencies:
- options

- drupal:options
- drupal:user
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ entity.metastore_entity_metadata.canonical:
entity.metastore_entity_metadata.collection:
path: 'admin/structure/metadata/list'
defaults:
# Calls the list controller, defined in the annotation of the contact entity.
# Calls the list controller, defined in the annotation of the metadata entity.
_entity_list: 'metastore_entity_metadata'
_title: 'Metadata List'
requirements:
# Checks for permission directly.
_permission: 'view metadata entity'
_permission: 'admininister metadata entity'

metastore_entity.metadata_add:
path: '/metadata/add'
Expand All @@ -36,7 +36,7 @@ entity.metastore_entity_metadata.edit_form:
_entity_form: metastore_entity_metadata.default
_title: 'Edit Metadata'
requirements:
_entity_access: 'metastore_entity_metadata.default'
_entity_access: 'metastore_entity_metadata.edit'

entity.metastore_entity_metadata.delete_form:
path: '/metadata/{metastore_entity_metadata}/delete'
Expand All @@ -48,7 +48,7 @@ entity.metastore_entity_metadata.delete_form:
_entity_access: 'metastore_entity_metadata.delete'

metastore_entity.metadata_settings:
path: 'admin/structure/metastore_entity_metadata_settings'
path: 'admin/structure/metadata/settings'
defaults:
_form: '\Drupal\metastore_entity\Form\MetadataSettingsForm'
_title: 'Metadata Settings'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function buildHeader() {
* {@inheritdoc}
*/
public function buildRow(EntityInterface $entity) {
/* @var $entity \Drupal\metastore_entity\Entity\Contact */
/* @var $entity \Drupal\metastore_entity\Entity\Metadata */
$row['id'] = $entity->id();
$row['title'] = $entity->toLink()->toString();
$row['data'] = $entity->data->value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
* "data" = "data"
* },
* links = {
* "canonical" = "/metastore_entity_metadata/{metastore_entity_metadata}",
* "edit-form" = "/metastore_entity_metadata/{metastore_entity_metadata}/edit",
* "canonical" = "/metadata/{metastore_entity_metadata}",
* "edit-form" = "/metadata/{metastore_entity_metadata}/edit",
* "delete-form" = "/metadata/{metastore_entity_metadata}/delete",
* "collection" = "/metastore_entity_metadata/list"
* "collection" = "/admin/structure/metadata/list"
* },
* field_ui_base_route = "metastore_entity.metadata_settings",
* )
Expand Down Expand Up @@ -193,7 +193,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {

$fields['langcode'] = BaseFieldDefinition::create('language')
->setLabel(t('Language code'))
->setDescription(t('The language code of ContentEntityExample entity.'));
->setDescription(t('The language code of the Metadata entity.'));
$fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created'))
->setDescription(t('The time that the entity was created.'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function checkCreateAccess(AccountInterface $account, array $context,
if ($account->hasPermission($admin_permission)) {
return AccessResult::allowed();
}
return AccessResult::allowedIfHasPermission($account, 'add contact entity');
return AccessResult::allowedIfHasPermission($account, 'add metadata entity');
}

}

0 comments on commit b19cfc6

Please sign in to comment.