mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 04:02:15 +01:00
move currency and cancreateproject permission to props to decouple TimeEntryCreateModal from web
This commit is contained in:
@@ -168,6 +168,8 @@ const { tags } = storeToRefs(useTagsStore());
|
|||||||
:create-client="createClient"
|
:create-client="createClient"
|
||||||
:create-tag="createTag"
|
:create-tag="createTag"
|
||||||
:create-time-entry="createTimeEntry"
|
:create-time-entry="createTimeEntry"
|
||||||
|
:currency="getOrganizationCurrencyString()"
|
||||||
|
:can-create-project="canCreateProjects()"
|
||||||
:projects
|
:projects
|
||||||
:tasks
|
:tasks
|
||||||
:tags
|
:tags
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import { useClientsStore } from '@/utils/useClients';
|
|||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { useTasksStore } from '@/utils/useTasks';
|
import { useTasksStore } from '@/utils/useTasks';
|
||||||
import { getUserTimezone } from '@/packages/ui/src/utils/settings';
|
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 calendarStart = ref<Date | undefined>(undefined);
|
||||||
const calendarEnd = ref<Date | undefined>(undefined);
|
const calendarEnd = ref<Date | undefined>(undefined);
|
||||||
@@ -129,6 +131,8 @@ function onRefresh() {
|
|||||||
:tags="tags"
|
:tags="tags"
|
||||||
:loading="timeEntriesLoading"
|
:loading="timeEntriesLoading"
|
||||||
:enable-estimated-time="isAllowedToPerformPremiumAction()"
|
:enable-estimated-time="isAllowedToPerformPremiumAction()"
|
||||||
|
:currency="getOrganizationCurrencyString()"
|
||||||
|
:can-create-project="canCreateProjects()"
|
||||||
:create-time-entry="createTimeEntry"
|
:create-time-entry="createTimeEntry"
|
||||||
:update-time-entry="updateTimeEntry"
|
:update-time-entry="updateTimeEntry"
|
||||||
:delete-time-entry="deleteTimeEntry"
|
:delete-time-entry="deleteTimeEntry"
|
||||||
|
|||||||
4
resources/js/packages/ui/package-lock.json
generated
4
resources/js/packages/ui/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@solidtime/ui",
|
"name": "@solidtime/ui",
|
||||||
"version": "0.0.11",
|
"version": "0.0.12",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@solidtime/ui",
|
"name": "@solidtime/ui",
|
||||||
"version": "0.0.11",
|
"version": "0.0.12",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^22.4.1",
|
"@types/node": "^22.4.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@solidtime/ui",
|
"name": "@solidtime/ui",
|
||||||
"version": "0.0.11",
|
"version": "0.0.12",
|
||||||
"description": "Package containing the solidtime ui components",
|
"description": "Package containing the solidtime ui components",
|
||||||
"main": "./dist/solidtime-ui-lib.umd.cjs",
|
"main": "./dist/solidtime-ui-lib.umd.cjs",
|
||||||
"module": "./dist/solidtime-ui-lib.js",
|
"module": "./dist/solidtime-ui-lib.js",
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ const props = defineProps<{
|
|||||||
|
|
||||||
// Permissions / feature flags
|
// Permissions / feature flags
|
||||||
enableEstimatedTime: boolean;
|
enableEstimatedTime: boolean;
|
||||||
|
currency: string;
|
||||||
|
canCreateProject: boolean;
|
||||||
|
|
||||||
createTimeEntry: (
|
createTimeEntry: (
|
||||||
entry: Omit<TimeEntry, 'id' | 'organization_id' | 'user_id'>
|
entry: Omit<TimeEntry, 'id' | 'organization_id' | 'user_id'>
|
||||||
@@ -295,6 +297,8 @@ watch(showEditTimeEntryModal, (value) => {
|
|||||||
:create-client="createClient"
|
:create-client="createClient"
|
||||||
:create-project="createProject"
|
:create-project="createProject"
|
||||||
:create-tag="createTag"
|
:create-tag="createTag"
|
||||||
|
:currency="currency"
|
||||||
|
:can-create-project="canCreateProject"
|
||||||
:tags="tags as any"
|
:tags="tags as any"
|
||||||
:projects="projects"
|
:projects="projects"
|
||||||
:tasks="tasks"
|
:tasks="tasks"
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ import type {
|
|||||||
Client,
|
Client,
|
||||||
CreateTimeEntryBody,
|
CreateTimeEntryBody,
|
||||||
} from '@/packages/api/src';
|
} from '@/packages/api/src';
|
||||||
import { getOrganizationCurrencyString } from '@/utils/money';
|
|
||||||
import { canCreateProjects } from '@/utils/permissions';
|
|
||||||
import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue';
|
import TagDropdown from '@/packages/ui/src/Tag/TagDropdown.vue';
|
||||||
import { Badge } from '@/packages/ui/src';
|
import { Badge } from '@/packages/ui/src';
|
||||||
import BillableIcon from '@/packages/ui/src/Icons/BillableIcon.vue';
|
import BillableIcon from '@/packages/ui/src/Icons/BillableIcon.vue';
|
||||||
@@ -43,6 +41,8 @@ const props = defineProps<{
|
|||||||
clients: Client[];
|
clients: Client[];
|
||||||
start?: string;
|
start?: string;
|
||||||
end?: string;
|
end?: string;
|
||||||
|
currency: string;
|
||||||
|
canCreateProject: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const description = ref<HTMLInputElement | null>(null);
|
const description = ref<HTMLInputElement | null>(null);
|
||||||
@@ -167,8 +167,8 @@ type BillableOption = {
|
|||||||
:clients
|
:clients
|
||||||
:create-project
|
:create-project
|
||||||
:create-client
|
:create-client
|
||||||
:can-create-project="canCreateProjects()"
|
:can-create-project
|
||||||
:currency="getOrganizationCurrencyString()"
|
:currency
|
||||||
size="xlarge"
|
size="xlarge"
|
||||||
class="bg-input-background"
|
class="bg-input-background"
|
||||||
:projects="projects"
|
:projects="projects"
|
||||||
|
|||||||
Reference in New Issue
Block a user