discourse/app/assets/javascripts/admin/addon/components/plugin-commit-hash.gjs
Jarek Radosz 3930064fd1
DEV: Convert various components to gjs (#26782)
Those were all low hanging fruits - all were already glimmer components, so this was mostly merging js and hbs files and adding imports.

(occasionally also adds/fixes class names)
2024-04-30 16:44:49 +02:00

20 lines
470 B
Plaintext

import Component from "@glimmer/component";
export default class PluginCommitHash extends Component {
get shortCommitHash() {
return this.args.plugin.commitHash?.slice(0, 7);
}
<template>
{{#if @plugin.commitHash}}
<a
href={{@plugin.commitUrl}}
target="_blank"
rel="noopener noreferrer"
class="current commit-hash"
title={{@plugin.commitHash}}
>{{this.shortCommitHash}}</a>
{{/if}}
</template>
}