Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOUR-19891:The tab Request needs to show only when the case has more than 1 request #7651

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ProcessMaker/Http/Controllers/CasesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public function show($case_number)
'canViewComments',
'canPrintScreens',
'isProcessManager',
'manager'
'manager',
'requestCount'
pmPaulis marked this conversation as resolved.
Show resolved Hide resolved
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import TabHistory from "./TabHistory.vue";
import CompletedForms from "./CompletedForms.vue";
import TabFiles from "./TabFiles.vue";
import Overview from "./Overview.vue";
import { getRequestCount } from "../variables/index";
const translate = ProcessMaker.i18n;
Expand All @@ -35,7 +36,7 @@ const tabs = [
name: translate.t("History"), href: "#history", current: "history", show: true, content: TabHistory,
},
{
name: translate.t("Requests"), href: "#requests", current: "requests", show: true, content: RequestTable,
name: translate.t("Requests"), href: "#requests", current: "requests", show: getRequestCount() !== 1, content: RequestTable,
},
];
Expand Down
8 changes: 5 additions & 3 deletions resources/jscomposition/cases/casesDetail/variables/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
export default {};

export const api = window.ProcessMaker?.apiClient;

export const useStore = () => Vue.globalStore;

export const getRequestId = () => requestId;

export const getCaseNumber = () => request.case_number;
Expand All @@ -12,6 +16,4 @@ export const getComentableType = () => comentable_type;

export const getProcessName = () => request.process.name;

export const api = window.ProcessMaker?.apiClient;

export const useStore = () => Vue.globalStore;
export const getRequestCount = () => requestCount;
1 change: 1 addition & 0 deletions resources/views/cases/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class="tw-grow tw-overflow-hidden"
const processId = @json($request->process->id);
const canViewComments = @json($canViewComments);
const comentable_type = @json(get_class($request));
const requestCount = @json($requestCount);
</script>
<script src="{{mix('js/composition/cases/casesDetail/edit.js')}}"></script>
@if (hasPackage('package-files'))
Expand Down
Loading