move currency and cancreateproject permission to props to decouple TimeEntryCreateModal from web

This commit is contained in:
Gregor Vostrak
2025-11-04 16:08:24 +01:00
parent 2f807e4808
commit 522f7d2bd2
6 changed files with 17 additions and 7 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@solidtime/ui",
"version": "0.0.11",
"version": "0.0.12",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@solidtime/ui",
"version": "0.0.11",
"version": "0.0.12",
"license": "AGPL-3.0",
"devDependencies": {
"@types/node": "^22.4.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@solidtime/ui",
"version": "0.0.11",
"version": "0.0.12",
"description": "Package containing the solidtime ui components",
"main": "./dist/solidtime-ui-lib.umd.cjs",
"module": "./dist/solidtime-ui-lib.js",

View File

@@ -41,6 +41,8 @@ const props = defineProps<{
// Permissions / feature flags
enableEstimatedTime: boolean;
currency: string;
canCreateProject: boolean;
createTimeEntry: (
entry: Omit<TimeEntry, 'id' | 'organization_id' | 'user_id'>
@@ -295,6 +297,8 @@ watch(showEditTimeEntryModal, (value) => {
:create-client="createClient"
:create-project="createProject"
:create-tag="createTag"
:currency="currency"
:can-create-project="canCreateProject"
:tags="tags as any"
:projects="projects"
:tasks="tasks"

View File

@@ -15,8 +15,6 @@ import type {
Client,
CreateTimeEntryBody,
} from '@/packages/api/src';
import { getOrganizationCurrencyString } from '@/utils/money';
import { canCreateProjects } from '@/utils/permissions';
import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue';
import { Badge } from '@/packages/ui/src';
import BillableIcon from '@/packages/ui/src/Icons/BillableIcon.vue';
@@ -43,6 +41,8 @@ const props = defineProps<{
clients: Client[];
start?: string;
end?: string;
currency: string;
canCreateProject: boolean;
}>();
const description = ref<HTMLInputElement | null>(null);
@@ -167,8 +167,8 @@ type BillableOption = {
:clients
:create-project
:create-client
:can-create-project="canCreateProjects()"
:currency="getOrganizationCurrencyString()"
:can-create-project
:currency
size="xlarge"
class="bg-input-background"
:projects="projects"