Skip to content

Commit 17f4cbf

Browse files
committed
feat: Remove license button/dialog
1 parent 48c0c7d commit 17f4cbf

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

config/areas/system/dialogs.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,26 @@
5757
// @codeCoverageIgnoreEnd
5858
}
5959
],
60+
'license/remove' => [
61+
'load' => function () {
62+
return [
63+
'component' => 'k-remove-dialog',
64+
'props' => [
65+
'text' => I18n::translate('license.remove.text'),
66+
'size' => 'medium',
67+
'submitButton' => [
68+
'icon' => 'trash',
69+
'text' => I18n::translate('remove'),
70+
'theme' => 'negative',
71+
],
72+
]
73+
];
74+
},
75+
'submit' => function () {
76+
App::instance()->system()->license()->delete();
77+
return true;
78+
}
79+
],
6080
// license registration
6181
'registration' => [
6282
'load' => function () {

i18n/translations/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@
474474
"license.code": "Code",
475475
"license.code.help": "You received your license code after the purchase via email. Please copy and paste it here.",
476476
"license.code.label": "Please enter your license code",
477+
"license.remove.text": "<p>Removing the license will irreversibly delete the license file from this site. You can activate this site with another license key afterwards.</p><p>The license will remain registered to the domain on the license hub. To change this, contact the Kirby team. <a href='https://getkirby.com/license'>Read more &rarr;</a></p>",
477478
"license.status.active.info": "Includes new major versions until {date}",
478479
"license.status.active.label": "Valid license",
479480
"license.status.demo.info": "This is a demo installation",

panel/src/components/Dialogs/LicenseDialog.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
<h2 class="k-headline">
1111
{{ $t("license") }}
1212
</h2>
13+
14+
<k-button
15+
:text="$t('remove')"
16+
icon="trash"
17+
size="xs"
18+
variant="filled"
19+
dialog="license/remove"
20+
/>
1321
</k-bar>
1422

1523
<div class="k-table">
@@ -69,7 +77,7 @@ export default {
6977
gap: var(--spacing-2);
7078
}
7179
72-
.k-license-dialog .k-icon {
73-
color: var(--theme-color-700);
80+
.k-license-dialog .k-license-dialog-status {
81+
--icon-color: var(--theme-color-700);
7482
}
7583
</style>

0 commit comments

Comments
 (0)