Skip to content

Commit e2a43dd

Browse files
committed
review feedback
1 parent fffe586 commit e2a43dd

File tree

10 files changed

+26
-21
lines changed

10 files changed

+26
-21
lines changed

Modules/Project/Emails/EffortsheetSetupMail.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function build()
3636
->from(config('mail.from.address'))
3737
->to($this->emails['infrasupport_email'])
3838
->cc($this->emails['key_account_manager'])
39-
->view('project::mail.effortsheet-setup-email')
39+
->view('project::mail.initiate-project-email')
4040
->with([
4141
'project' => $this->project,
4242
]);

Modules/Project/Resources/views/mail/effortsheet-setup-email.blade.php Modules/Project/Resources/views/mail/initiate-project-email.blade.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
.line {
44
line-height: 1px;
55
}
6+
67
</style>
7-
88
<p>Hi Infrastructure Support Team,</p>
99

1010
<p>This is to put a request to set up a project folder and its effortsheet. Please find the necessary details below:</p>
1111

1212
<ul>
1313
<li><strong>Project Name:</strong> {{ $project->name }}</li>
14-
<li><strong>Client Name:</strong> {{ $project->client->name ?? 'N/A' }}</li>
14+
<li><strong>Client Name:</strong> {{ $project->client->name }}</li>
1515
<li><strong>Billing Type:</strong> {{ Str::of($project->type)->replace('-', ' ')->title() }}</li>
1616
<li><strong>Due Date:</strong> {{ now()->format('d M Y') }}</li>
1717
</ul>

Modules/Project/Resources/views/subviews/create-project-details.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="form-group col-md-5">
77
<label for="name" class="field-required">Name</label>
88
<input type="text" class="form-control" name="name" id="name" placeholder="Enter project name"
9-
required="required" value="{{ old('name', $projectData['project_name'] ?? '') }}">
9+
required="required" value="{{ old('name', $projectData['name'] ?? '') }}">
1010
</div>
1111
<div class="form-group offset-md-1 col-md-5">
1212
<label for="client_id" class="field-required">Client</label>

Modules/Project/Services/ProjectService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public function store($data)
110110
if (isset($data['send_mail_to_infra']) && $data['send_mail_to_infra']) {
111111
// ToDo: Make infra email fetched from ENV
112112
$emails = [
113-
'key_account_manager' => $project->keyAccountManager->email,
114-
'infrasupport_email' => '[email protected]',
113+
'key_account_manager' => $project->keyAccountManager->email,
114+
'infrasupport_email' => '[email protected]',
115115
];
116116

117117
Mail::send(new EffortsheetSetupMail($project, $emails));

Modules/Prospect/Http/Controllers/ProspectController.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ public function update(Request $request, Prospect $prospect)
109109
if ($request->input('action') === 'update_create_project') {
110110
$totalEstimatedHours = $this->getTotalEstimatedHoursForProject($prospect);
111111
$projectData = [
112-
'project_name' => $prospect->project_name,
113-
'client_id' => $prospect->client_id,
114-
'status' => 'active',
112+
'name' => $prospect->project_name,
113+
'client_id' => $prospect->client_id,
114+
'status' => 'active',
115115
'total_estimated_hours' => $totalEstimatedHours ?? null,
116116

117117
];
@@ -151,6 +151,6 @@ public function getTotalEstimatedHoursForProject($prospectData)
151151
$projectBudget = $prospectData->budget;
152152
$clientServiceRates = Client::find($prospectData->client_id)->billingDetails->service_rates;
153153

154-
return $projectBudget / $clientServiceRates;
154+
return $clientServiceRates ? $projectBudget / $clientServiceRates : '';
155155
}
156156
}

Modules/Prospect/Http/Requests/ProspectRequest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function rules()
2727
'proposal_link' => 'nullable|url',
2828
'currency' => 'nullable',
2929
'client_id' => 'nullable|exists:clients,id',
30-
'project_name' => 'required',
30+
'project_name' => 'nullable',
3131
];
3232
}
3333

Modules/Prospect/Resources/assets/js/app.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ document.addEventListener("DOMContentLoaded", function () {
2323
const updateAndCreateProjectButton = document.getElementById("update_create_project_button");
2424

2525
function toggleOrgNameField() {
26+
console.log("toggle-prospect");
2627
if (customerTypeField.value === CUSTOMER_TYPES.NEW) {
2728
orgNameTextField.classList.remove("d-none");
2829
orgNameSelectField.classList.add("d-none");
2930
orgNameTextInput.required = true;
3031
orgNameSelectInput.value = "";
3132
orgNameSelectInput.required = false;
3233
} else if (customerTypeField.value === CUSTOMER_TYPES.EXISTING) {
34+
console.log("elseif");
3335
orgNameTextField.classList.add("d-none");
3436
orgNameSelectField.classList.remove("d-none");
3537
orgNameSelectInput.required = true;
@@ -45,11 +47,14 @@ document.addEventListener("DOMContentLoaded", function () {
4547
}
4648

4749
function toggleUpdateAndCreateProjectButton() {
48-
if(proposalStatus.value === PROPOSAL_STATUS.CONVERTED) {
49-
updateAndCreateProjectButton.classList.remove("d-none");
50-
} else {
51-
updateAndCreateProjectButton.classList.add("d-none");
50+
if(updateAndCreateProjectButton) {
51+
if(proposalStatus.value === PROPOSAL_STATUS.CONVERTED) {
52+
updateAndCreateProjectButton.classList.remove("d-none");
53+
} else {
54+
updateAndCreateProjectButton.classList.add("d-none");
55+
}
5256
}
57+
5358
}
5459

5560
toggleOrgNameField();

Modules/Prospect/Resources/views/create.blade.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
</div>
5757

5858
<div class="form-group offset-md-1 col-md-5" id="org_name_text_field">
59-
<label class="field-required" for="project_name">Project Name</label>
60-
<input type="text" required="required" class="form-control" name="project_name" id="project_name"
59+
<label for="project_name">Project Name</label>
60+
<input type="text" class="form-control" name="project_name" id="project_name"
6161
placeholder="Enter Project Name" value="{{ old('project_name') }}">
6262
</div>
6363
</div>

Modules/Prospect/Resources/views/index.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<td class="w-30p">
4545
<div>
4646
<a href="{{ route('prospect.show', $prospect->id) }}" class="text-decoration-none">
47-
{{ $prospect->project_name ?? $prospect->organization_name }}
47+
{{ $prospect->project_name ?? ($prospect->organization_name ?? $prospect->client->name) }}
4848
</a>
4949
<div>
5050
@if($prospect->customer_type == 'new')

Modules/Prospect/Resources/views/subviews/edit-prospect-details.blade.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
</select>
5050
</div>
5151
<div class="form-group offset-md-1 col-md-5" id="org_name_text_field">
52-
<label class="field-required" for="project_name">Project Name</label>
53-
<input type="text" class="form-control" required="required" name="project_name" id="project_name"
52+
<label for="project_name">Project Name</label>
53+
<input type="text" class="form-control" name="project_name" id="project_name"
5454
placeholder="Enter Project Name" value="{{ $prospect->project_name }}">
5555
</div>
5656
</div>
@@ -123,7 +123,7 @@
123123
</div>
124124
<div class="card-footer">
125125
<button type="submit" name="action" value="update" class="btn btn-primary">Update</button>
126-
@if($prospect->customer_type === "exsiting")
126+
@if($prospect->customer_type === "existing")
127127
<button type="submit" name="action" id="update_create_project_button" value="update_create_project" class="btn ml-3 d-none btn-primary">Update and Create Project</button>
128128
@endif
129129
</div>

0 commit comments

Comments
 (0)