Skip to content

Commit

Permalink
feat: Licensing information expanded
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Aug 1, 2024
1 parent d7ee70e commit 8255b9b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions public/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
"version": "Version",
"licensed": "Licensed",
"not_licensed": "Unlicensed",
"non_commercial": "No Need For License",
"license": "Licence",
"updated_at": "Updated Date",
"upload": {
Expand Down
3 changes: 2 additions & 1 deletion public/locales/tr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
"version": "Versiyon",
"licensed": "Lisanslanmış",
"not_licensed": "Lisanslanmamış",
"non_commercial": "Lisans Gerektirmeyen",
"license": "Lisans",
"updated_at": "Güncellenme Tarihi",
"upload": {
Expand Down Expand Up @@ -841,4 +842,4 @@
}
}
}
}
}
14 changes: 7 additions & 7 deletions src/pages/settings/extensions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ export default function ExtensionSettingsPage() {
{
accessorKey: "licensed",
accessorFn: (row) => {
return row.licensed
? 0 + t("extensions.licensed")
: t("extensions.not_licensed")
return row.licensed === "licensed" ? "1" : "0"
},
header: ({ column }) => (
<DataTableColumnHeader
Expand All @@ -55,32 +53,34 @@ export default function ExtensionSettingsPage() {
filterPresets={[
{
key: t("extensions.licensed"),
value: 0 + t("extensions.licensed"),
value: "1",
},
{
key: t("extensions.not_licensed"),
value: t("extensions.not_licensed"),
value: "0",
},
]}
/>
),
title: t("extensions.license"),
cell: ({ row }) => (
<>
{row.original.licensed ? (
{row.original.licensed === "licensed" ? (
<div className="flex items-center">
<Check className="size-5 text-green-500" />
<Badge className="ml-2" variant="success">
{t("extensions.licensed")}
</Badge>
</div>
) : (
) : row.original.licensed === "not_licensed" ? (
<div className="flex items-center">
<X className="size-5 text-red-500" />
<Badge className="ml-2" variant="outline">
{t("extensions.not_licensed")}
</Badge>
</div>
) : (
<Badge variant="outline">{t("extensions.non_commercial")}</Badge>
)}
</>
),
Expand Down
2 changes: 1 addition & 1 deletion src/types/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface IExtension {
display_name: string
menus: IMenu[]
updated: number
licensed: boolean
licensed: "licensed" | "not_licensed" | "non_commercial"
license_type: "golang_standard" | "php"
}

Expand Down

0 comments on commit 8255b9b

Please sign in to comment.