mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 20:22:15 +01:00
hide shared reports create for employees, fix export request for employees
This commit is contained in:
committed by
Constantin Graf
parent
a3dda8b03c
commit
b4edcaa2dc
@@ -5,6 +5,7 @@ import { h, ref } from 'vue';
|
|||||||
import type { CreateReportBodyProperties } from '@/packages/api/src';
|
import type { CreateReportBodyProperties } from '@/packages/api/src';
|
||||||
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
|
import { isAllowedToPerformPremiumAction } from '@/utils/billing';
|
||||||
import UpgradeModal from '@/Components/Common/UpgradeModal.vue';
|
import UpgradeModal from '@/Components/Common/UpgradeModal.vue';
|
||||||
|
import { canCreateReports } from '@/utils/permissions';
|
||||||
defineProps<{
|
defineProps<{
|
||||||
reportProperties: CreateReportBodyProperties;
|
reportProperties: CreateReportBodyProperties;
|
||||||
}>();
|
}>();
|
||||||
@@ -33,7 +34,10 @@ function onSaveReportClick() {
|
|||||||
<strong>Sharable Reports</strong> is only available in solidtime
|
<strong>Sharable Reports</strong> is only available in solidtime
|
||||||
Professional.
|
Professional.
|
||||||
</UpgradeModal>
|
</UpgradeModal>
|
||||||
<SecondaryButton :icon="SaveIcon" @click="onSaveReportClick"
|
<SecondaryButton
|
||||||
|
v-if="canCreateReports()"
|
||||||
|
:icon="SaveIcon"
|
||||||
|
@click="onSaveReportClick"
|
||||||
>Save Report</SecondaryButton
|
>Save Report</SecondaryButton
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -107,6 +107,10 @@ function getFilterAttributes(): AggregatedTimeEntriesQueryParams {
|
|||||||
: undefined,
|
: undefined,
|
||||||
tag_ids: selectedTags.value.length > 0 ? selectedTags.value : undefined,
|
tag_ids: selectedTags.value.length > 0 ? selectedTags.value : undefined,
|
||||||
billable: billable.value !== null ? billable.value : undefined,
|
billable: billable.value !== null ? billable.value : undefined,
|
||||||
|
member_id:
|
||||||
|
getCurrentRole() === 'employee'
|
||||||
|
? getCurrentMembershipId()
|
||||||
|
: undefined,
|
||||||
};
|
};
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,4 +125,6 @@ export function canViewAllTimeEntries() {
|
|||||||
export function canViewInvoices() {
|
export function canViewInvoices() {
|
||||||
return currentUserHasPermission('invoices:view');
|
return currentUserHasPermission('invoices:view');
|
||||||
}
|
}
|
||||||
|
export function canCreateReports() {
|
||||||
|
return currentUserHasPermission('reports:create');
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user