Skip to content

Commit

Permalink
Update table attributes for element types
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Jul 8, 2024
1 parent fa9f5fd commit 246ce58
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 27 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

## 3.4.1 - Unreleased

### Changed

- Updated the table attributes for all element types.

### Fixed

- Fixed missing draft status icons in sendouts.
- Fixed the missing draft status icons in sendouts.

## 3.4.0 - 2024-07-04

Expand Down
11 changes: 2 additions & 9 deletions src/elements/CampaignElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@ protected static function defineSortOptions(): array
*/
protected static function defineTableAttributes(): array
{
return [
'title' => ['label' => Craft::t('app', 'Title')],
return array_merge(parent::defineTableAttributes(), [
'campaignType' => ['label' => Craft::t('campaign', 'Campaign Type')],
'recipients' => ['label' => Craft::t('campaign', 'Recipients')],
'opened' => ['label' => Craft::t('campaign', 'Opened')],
Expand All @@ -322,13 +321,7 @@ protected static function defineTableAttributes(): array
'openRate' => ['label' => Craft::t('campaign', 'Open Rate')],
'clickRate' => ['label' => Craft::t('campaign', 'Click Rate')],
'lastSent' => ['label' => Craft::t('campaign', 'Last Sent')],
'slug' => ['label' => Craft::t('app', 'Slug')],
'uri' => ['label' => Craft::t('app', 'URI')],
'link' => ['label' => Craft::t('app', 'Link'), 'icon' => 'world'],
'id' => ['label' => Craft::t('app', 'ID')],
'dateCreated' => ['label' => Craft::t('app', 'Date Created')],
'dateUpdated' => ['label' => Craft::t('app', 'Date Updated')],
];
]);
}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/elements/ContactElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,12 @@ protected static function defineSortOptions(): array
*/
protected static function defineTableAttributes(): array
{
return [
return array_merge(parent::defineTableAttributes(), [
'subscriptionStatus' => ['label' => Craft::t('campaign', 'Subscription Status')],
'country' => ['label' => Craft::t('campaign', 'Country')],
'lastActivity' => ['label' => Craft::t('campaign', 'Last Activity')],
'verified' => ['label' => Craft::t('campaign', 'Verified')],
'dateCreated' => ['label' => Craft::t('app', 'Date Created')],
'dateUpdated' => ['label' => Craft::t('app', 'Date Updated')],
];
]);
}

/**
Expand Down
7 changes: 2 additions & 5 deletions src/elements/MailingListElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,14 @@ protected static function defineSortOptions(): array
*/
protected static function defineTableAttributes(): array
{
return [
return array_merge(parent::defineTableAttributes(), [
'mailingListType' => ['label' => Craft::t('campaign', 'Mailing List Type')],
'subscribed' => ['label' => Craft::t('campaign', 'Subscribed')],
'unsubscribed' => ['label' => Craft::t('campaign', 'Unsubscribed')],
'complained' => ['label' => Craft::t('campaign', 'Complained')],
'bounced' => ['label' => Craft::t('campaign', 'Bounced')],
'slug' => ['label' => Craft::t('app', 'Slug')],
'id' => ['label' => Craft::t('app', 'ID')],
'dateCreated' => ['label' => Craft::t('app', 'Date Created')],
'dateUpdated' => ['label' => Craft::t('app', 'Date Updated')],
];
]);
}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/elements/SegmentElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,10 @@ protected static function defineSortOptions(): array
*/
protected static function defineTableAttributes(): array
{
return [
return array_merge(parent::defineTableAttributes(), [
'contacts' => ['label' => Craft::t('campaign', 'Contacts')],
'slug' => ['label' => Craft::t('app', 'Slug')],
'dateCreated' => ['label' => Craft::t('app', 'Date Created')],
'dateUpdated' => ['label' => Craft::t('app', 'Date Updated')],
];
]);
}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/elements/SendoutElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ protected static function defineSortOptions(): array
*/
protected static function defineTableAttributes(): array
{
$attributes = [
$attributes = array_merge(parent::defineTableAttributes(), [
'sendoutType' => ['label' => Craft::t('campaign', 'Sendout Type')],
'subject' => ['label' => Craft::t('campaign', 'Subject')],
'campaignId' => ['label' => Craft::t('campaign', 'Campaign')],
Expand All @@ -322,9 +322,7 @@ protected static function defineTableAttributes(): array
'mailingListIds' => ['label' => Craft::t('campaign', 'Mailing Lists')],
'sendDate' => ['label' => Craft::t('campaign', 'Send Date')],
'lastSent' => ['label' => Craft::t('campaign', 'Last Sent')],
'dateCreated' => ['label' => Craft::t('app', 'Date Created')],
'dateUpdated' => ['label' => Craft::t('app', 'Date Updated')],
];
]);

// Hide sender if not Craft Pro edition
if (Craft::$app->edition !== CmsEdition::Pro) {
Expand Down

0 comments on commit 246ce58

Please sign in to comment.