Skip to content

Commit

Permalink
add project edit button to project show page and billing rate info, f…
Browse files Browse the repository at this point in the history
…ixes ST-236
  • Loading branch information
Onatcer committed Sep 30, 2024
1 parent 469f128 commit 084647c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
5 changes: 4 additions & 1 deletion e2e/project-members.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ test('test that updating project member billable rate works for existing time en
.first()
.getByRole('button')
.click();
await page.getByRole('button', { name: 'Edit' }).first().click();
await page
.getByRole('button', { name: 'Edit Project Member' })
.first()
.click();
await page.getByLabel('Billable Rate').fill(newBillableRate.toString());
await page.getByRole('button', { name: 'Update Project Member' }).click();

Expand Down
42 changes: 41 additions & 1 deletion resources/js/Pages/ProjectShow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
ChevronRightIcon,
CheckCircleIcon,
UserGroupIcon,
PencilSquareIcon,
} from '@heroicons/vue/20/solid';
import { Link } from '@inertiajs/vue3';
import TaskCreateModal from '@/Components/Common/Task/TaskCreateModal.vue';
import TaskTable from '@/Components/Common/Task/TaskTable.vue';
Expand All @@ -19,10 +21,18 @@ import Card from '@/Components/Common/Card.vue';
import ProjectMemberTable from '@/Components/Common/ProjectMember/ProjectMemberTable.vue';
import ProjectMemberCreateModal from '@/Components/Common/ProjectMember/ProjectMemberCreateModal.vue';
import { useProjectMembersStore } from '@/utils/useProjectMembers';
import { canCreateTasks, canViewProjectMembers } from '@/utils/permissions';
import {
canCreateProjects,
canCreateTasks,
canViewProjectMembers,
} from '@/utils/permissions';
import TabBarItem from '@/Components/Common/TabBar/TabBarItem.vue';
import TabBar from '@/Components/Common/TabBar/TabBar.vue';
import { useTasksStore } from '@/utils/useTasks';
import ProjectEditModal from '@/Components/Common/Project/ProjectEditModal.vue';
import { Badge } from '@/packages/ui/src';
import { formatCents } from '../packages/ui/src/utils/money';
import { getOrganizationCurrencyString } from '../utils/money';
const { projects } = storeToRefs(useProjectsStore());
Expand All @@ -45,6 +55,8 @@ onMounted(() => {
}
});
const showEditProjectModal = ref(false);
const activeTab = ref<'active' | 'done'>('active');
function isActiveTab(tab: string) {
Expand Down Expand Up @@ -98,7 +110,35 @@ const shownTasks = computed(() => {
</div>
</li>
</ol>
<div class="px-4">
<Badge v-if="project?.billable_rate">
{{
formatCents(
project?.billable_rate ?? 0,
getOrganizationCurrencyString()
)
}}
/ h
</Badge>
<Badge
v-if="project?.is_billable && !project?.billable_rate">
Default Rate
</Badge>
<Badge v-if="!project?.is_billable"> Non-Billable </Badge>
</div>
</nav>
<div>
<SecondaryButton
:icon="PencilSquareIcon"
@click="showEditProjectModal = true"
v-if="canCreateProjects()">
Edit Project
</SecondaryButton>
<ProjectEditModal
v-if="project"
:originalProject="project"
v-model:show="showEditProjectModal"></ProjectEditModal>
</div>
</MainContainer>
<MainContainer>
<div class="grid lg:grid-cols-2 gap-x-6 pt-6">
Expand Down

0 comments on commit 084647c

Please sign in to comment.