Skip to content

Commit 8ba04ec

Browse files
committed
move currency and cancreateproject permission to props to decouple TimeEntryCreateModal from web
1 parent 8a2f35d commit 8ba04ec

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

resources/js/Components/TimeTracker.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ const { tags } = storeToRefs(useTagsStore());
168168
:create-client="createClient"
169169
:create-tag="createTag"
170170
:create-time-entry="createTimeEntry"
171+
:currency="getOrganizationCurrencyString()"
172+
:can-create-project="canCreateProjects()"
171173
:projects
172174
:tasks
173175
:tags

resources/js/Pages/Calendar.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import { useClientsStore } from '@/utils/useClients';
2121
import { storeToRefs } from 'pinia';
2222
import { useTasksStore } from '@/utils/useTasks';
2323
import { getUserTimezone } from '@/packages/ui/src/utils/settings';
24+
import { getOrganizationCurrencyString } from '@/utils/money';
25+
import { canCreateProjects } from '@/utils/permissions';
2426
2527
const calendarStart = ref<Date | undefined>(undefined);
2628
const calendarEnd = ref<Date | undefined>(undefined);
@@ -129,6 +131,8 @@ function onRefresh() {
129131
:tags="tags"
130132
:loading="timeEntriesLoading"
131133
:enable-estimated-time="isAllowedToPerformPremiumAction()"
134+
:currency="getOrganizationCurrencyString()"
135+
:can-create-project="canCreateProjects()"
132136
:create-time-entry="createTimeEntry"
133137
:update-time-entry="updateTimeEntry"
134138
:delete-time-entry="deleteTimeEntry"

resources/js/packages/ui/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@solidtime/ui",
3-
"version": "0.0.11",
3+
"version": "0.0.12",
44
"description": "Package containing the solidtime ui components",
55
"main": "./dist/solidtime-ui-lib.umd.cjs",
66
"module": "./dist/solidtime-ui-lib.js",

resources/js/packages/ui/src/FullCalendar/TimeEntryCalendar.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ const props = defineProps<{
4141
4242
// Permissions / feature flags
4343
enableEstimatedTime: boolean;
44+
currency: string;
45+
canCreateProject: boolean;
4446
4547
createTimeEntry: (
4648
entry: Omit<TimeEntry, 'id' | 'organization_id' | 'user_id'>
@@ -295,6 +297,8 @@ watch(showEditTimeEntryModal, (value) => {
295297
:create-client="createClient"
296298
:create-project="createProject"
297299
:create-tag="createTag"
300+
:currency="currency"
301+
:can-create-project="canCreateProject"
298302
:tags="tags as any"
299303
:projects="projects"
300304
:tasks="tasks"

resources/js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import type {
1515
Client,
1616
CreateTimeEntryBody,
1717
} from '@/packages/api/src';
18-
import { getOrganizationCurrencyString } from '@/utils/money';
19-
import { canCreateProjects } from '@/utils/permissions';
2018
import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue';
2119
import { Badge } from '@/packages/ui/src';
2220
import BillableIcon from '@/packages/ui/src/Icons/BillableIcon.vue';
@@ -43,6 +41,8 @@ const props = defineProps<{
4341
clients: Client[];
4442
start?: string;
4543
end?: string;
44+
currency: string;
45+
canCreateProject: boolean;
4646
}>();
4747
4848
const description = ref<HTMLInputElement | null>(null);
@@ -167,8 +167,8 @@ type BillableOption = {
167167
:clients
168168
:create-project
169169
:create-client
170-
:can-create-project="canCreateProjects()"
171-
:currency="getOrganizationCurrencyString()"
170+
:can-create-project
171+
:currency
172172
size="xlarge"
173173
class="bg-input-background"
174174
:projects="projects"

0 commit comments

Comments
 (0)