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
+2
View File
@@ -168,6 +168,8 @@ const { tags } = storeToRefs(useTagsStore());
:create-client="createClient"
:create-tag="createTag"
:create-time-entry="createTimeEntry"
:currency="getOrganizationCurrencyString()"
:can-create-project="canCreateProjects()"
:projects
:tasks
:tags
+4
View File
@@ -21,6 +21,8 @@ import { useClientsStore } from '@/utils/useClients';
import { storeToRefs } from 'pinia';
import { useTasksStore } from '@/utils/useTasks';
import { getUserTimezone } from '@/packages/ui/src/utils/settings';
import { getOrganizationCurrencyString } from '@/utils/money';
import { canCreateProjects } from '@/utils/permissions';
const calendarStart = ref<Date | undefined>(undefined);
const calendarEnd = ref<Date | undefined>(undefined);
@@ -129,6 +131,8 @@ function onRefresh() {
:tags="tags"
:loading="timeEntriesLoading"
:enable-estimated-time="isAllowedToPerformPremiumAction()"
:currency="getOrganizationCurrencyString()"
:can-create-project="canCreateProjects()"
:create-time-entry="createTimeEntry"
:update-time-entry="updateTimeEntry"
:delete-time-entry="deleteTimeEntry"
+2 -2
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",
+1 -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",
@@ -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"
@@ -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"