Skip to content

Commit

Permalink
issues resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar1862000 committed Dec 12, 2024
1 parent 7b9b2ee commit ca3f5fe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 30 deletions.
5 changes: 0 additions & 5 deletions Modules/CodeTrek/Entities/CodeTrekApplicant.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public static function factory()
return new CodeTrekApplicantFactory();
}

// public function center()
// {
// return $this->belongsTo(OfficeLocation::class, 'center_id');
// }

public function getDaysInCodetrekAttribute()
{
$internshipStartDate = Carbon::parse($this->internship_start_date);
Expand Down
4 changes: 0 additions & 4 deletions Modules/CodeTrek/Http/Controllers/CodeTrekController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function index(Request $request)
{
// $this->authorize('view', $applicant); There are some issues in the production, which is why these lines are commented out.

// $centres = OfficeLocation::all();
$mentors = User::all();
$applicantData = $this->service->getCodeTrekApplicants($request->all());
$applicants = $applicantData['applicants'];
Expand All @@ -40,7 +39,6 @@ public function index(Request $request)

return view('codetrek::index', [
'applicants' => $applicants,
// 'centres' => $centres,
'mentors' => $mentors,
'reportApplicationCounts' => $reportApplicationCounts,
'statusCounts' => $statusCounts,
Expand Down Expand Up @@ -77,8 +75,6 @@ public function edit(CodeTrekApplicant $applicant)
{
// $this->authorize('update', $applicant); There are some issues in the production, which is why these lines are commented out.

// $centres = OfficeLocation::all();

$mentors = User::all();
$this->service->edit($applicant);

Expand Down
1 change: 0 additions & 1 deletion Modules/CodeTrek/Resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<input type="text" name="name" class="form-control" id="name"
placeholder="Enter the Applicant name" value= "{{ request()->get('name') }}">
<input type="hidden" name="status" value="{{ $request['status'] ?? '' }}">
<input type="hidden" name="centre" value="{{ request()->get('centre') }}">
<input type="hidden" name="roundSlug" value="{{ request()->input('roundSlug') }}">
<button class="btn btn-info h-40 ml-2 text-white">Search</button>
</div>
Expand Down
7 changes: 3 additions & 4 deletions Modules/Prospect/Resources/views/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@
<div class="form-row">
<div class="form-group col-md-5">
<label for="client_id" class="field-required">ColoredCow POC</label>
<select name="poc_user_id" id="poc_user_id" class="form-control" required >
<select name="poc_user_id" id="poc_user_id" class="form-control" required="required">
<option value="">Select POC User</option>
<option value="1">User</option>
<!-- @foreach ($users as $user)
@foreach ($users as $user)
<option value="{{ $user->id }}"
{{ old('poc_user_id') == $user->id ? 'selected' : '' }}>
{{ $user->name }}</option>
@endforeach -->
@endforeach
</select>
</div>

Expand Down
22 changes: 6 additions & 16 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,16 @@ public function __construct()
* Show the application dashboard.
*/
public function index()
{
// Book suggestion logic remains unchanged
{
$unreadBook = session('disable_book_suggestion') ? null : Book::getRandomUnreadBook();

// Replace OfficeLocation dependency with a static list or alternative logic
$centres = collect([
['id' => 1, 'centre_name' => 'Center 1'],
['id' => 2, 'centre_name' => 'Center 2'],
['id' => 3, 'centre_name' => 'Center 3'],
])->sortBy('centre_name');

// Handle the selected location for the user
$selectedLocation = auth()->user()->office_location ?? 'Default Location';

return view('home')->with([
'book' => $unreadBook,
'centres' => $centres,
'selectedLocation' => $selectedLocation,
]);
}
}


/**
Expand Down Expand Up @@ -81,9 +71,9 @@ public function getUserGroups($email)

public function storeEmployeeLocation(Request $request)
{
// $request->validate([
// 'centre_name' => 'required|exists:office_locations,centre_name',
// ]);
$request->validate([
'centre_name' => 'required|string',
]);

UserMeta::updateOrCreate(
['user_id' => auth()->user()->id, 'meta_key' => 'office_location'],
Expand All @@ -92,4 +82,4 @@ public function storeEmployeeLocation(Request $request)

return redirect('home');
}
}
}

0 comments on commit ca3f5fe

Please sign in to comment.