Skip to content

Commit

Permalink
fix extension version display
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Jul 25, 2024
1 parent 7511bff commit 68f496a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addon/components/modals/extension-details.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<div class="space-y-2">
<div>
<div class="text-sm font-semibold dark:text-gray-100">Version</div>
<div class="text-sm dark:text-gray-200">{{this.extension.version}}</div>
<div class="text-sm dark:text-gray-200">{{this.extension.current_bundle_version}}</div>
</div>
<div>
<div class="text-sm font-semibold dark:text-gray-100">Updated</div>
Expand Down
1 change: 1 addition & 0 deletions addon/models/registry-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default class RegistryExtensionModel extends Model {
@attr('string') icon_uuid;
@attr('string') public_id;
@attr('string') current_bundle_public_id;
@attr('string') current_bundle_version;
@attr('string') next_bundle_public_id;
@attr('string') current_bundle_id;
@attr('string') next_bundle_id;
Expand Down
13 changes: 13 additions & 0 deletions server/src/Models/RegistryExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class RegistryExtension extends Model
'current_bundle_filename',
'current_bundle_id',
'current_bundle_public_id',
'current_bundle_version',
'next_bundle_filename',
'next_bundle_id',
'next_bundle_public_id',
Expand Down Expand Up @@ -340,6 +341,18 @@ public function getCurrentBundleFilenameAttribute(): ?string
return data_get($this, 'currentBundle.bundle_filename');
}

/**
* Get the current bundle version.
*/
public function getCurrentBundleVersionAttribute(): ?string
{
if ($this->currentBundle instanceof RegistryExtensionBundle) {
return $this->currentBundle->version;
}

return data_get($this, 'currentBundle.version');
}

/**
* Get the next bundle public ID.
*/
Expand Down

0 comments on commit 68f496a

Please sign in to comment.