Skip to content

Commit

Permalink
Merge pull request #1140 from ColoredCow/master
Browse files Browse the repository at this point in the history
Production build v0.2.3
  • Loading branch information
rathorevaibhav authored Oct 26, 2021
2 parents 5d52dce + 477e8ad commit e707d04
Show file tree
Hide file tree
Showing 35 changed files with 489 additions and 44 deletions.
14 changes: 14 additions & 0 deletions Modules/Client/Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,19 @@
'id' => 5,
'name' => 'Based on project terms',
],
],

'currency-symbols' =>[
[
'rupee' => ''
],

[
'dollar' => '$'
],

[
'pound' => ''
],
]
];
12 changes: 12 additions & 0 deletions Modules/Client/Entities/Country.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Modules\Client\Entities;

use Illuminate\Database\Eloquent\Model;

class Country extends Model
{
protected $table = 'countries';

protected $fillable = ['name', 'initials', 'currency', 'currency_symbol'];
}
17 changes: 17 additions & 0 deletions Modules/Client/Http/Controllers/CountryController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Modules\Client\Http\Controllers;

use Modules\Client\Entities\Country;
use Modules\Client\Http\Requests\CountryRequest;

class CountryController extends ModuleBaseController
{
public function store(CountryRequest $request)
{
$validated = $request->validated();
$country = Country::create($request->all());

return redirect()->back()->with('status', 'Country saved successfully!');
}
}
15 changes: 14 additions & 1 deletion Modules/Client/Http/Requests/ClientFormsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function contactPersonsValidation()
return [
'client_contact_persons.*.name' => 'nullable|max:120',
'client_contact_persons.*.email' => 'required|email',
'client_contact_persons.*.phone' => 'nullable',
'client_contact_persons.*.phone' => 'required|digits_between:4,10|integer',
];
}

Expand Down Expand Up @@ -90,4 +90,17 @@ public function authorize()
{
return true;
}

/**
* Get the error messages for the defined validation rules.
*
* @return array
*/
public function messages()
{
return [
'client_contact_persons.*.phone.*' => 'Please enter a valid phone number.',
'client_contact_persons.*.email.*' => 'Please enter a valid mailing-address.',
];
}
}
30 changes: 30 additions & 0 deletions Modules/Client/Http/Requests/CountryRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Modules\Client\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CountryRequest extends FormRequest
{
public function rules()
{
$rules = [
'name' => 'required|string',
'initials' => 'required|string',
'currency' => 'required|string',
'currency_symbol' => 'nullable|string',
];

return $rules;
}

/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
}
3 changes: 2 additions & 1 deletion Modules/Client/Resources/views/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
@includeWhen( $section == 'billing-details' ,'client::subviews.edit-client-billing-details')
@includeWhen( $section == 'client-type' ,'client::subviews.edit-client-type-info')
</form>
@include('client::subviews.client-address-modal')
</div>
</div>
</div>

@endsection
@endsection
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<div class="modal" id="myModalClientCountry">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Country Details</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<form action="{{route("country.store")}}" method ="POST">
@csrf
<div class="modal-body">
<div class="form-group row">
<label class="col-sm-2 col-form-label">Country<strong class="text-danger">*</strong></label>
<div class="col-sm-4">
<input type="text" id="name" name="name" class="form-control" placeholder="Country" required>
</div>
<label class="col-sm-2 col-form-label">Initials<strong class="text-danger">*</strong></label>
<div class="col-sm-4">
<input type="text" id ="initials" name="initials" class="form-control" placeholder="Initials" required>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Currency<strong class="text-danger">*</strong></label>
<div class="col-sm-4">
<input type="text" id ="currency" name="currency" class="form-control" placeholder="Currency" required>
</div>
<label class="col-sm-2 col-form-label">Symbols</label>
<div class="col-sm-4">
<select id="currency_symbol" name="currency_symbol" class="form-control">
@foreach(config('client.currency-symbols') as $key => $value)
<option value="{{ $key }}">{{implode($value)}}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="modal-footer">
<input type="submit" class='btn btn-outline-primary' value="Save">
<button type="button" class="btn btn-outline-danger" data-dismiss="modal">Close</button>
</div>
</form>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</select>
</div>
<div class="mt-2">
<button type="button" style="text-decoration: underline;" class="btn btn-sm">Add new country</button>
<button type="button" style="text-decoration: underline;" data-toggle="modal" data-target="#myModalClientCountry" class="btn btn-sm">Add new country</button>
</div>
</div>
<div class="form-group">
Expand Down Expand Up @@ -76,9 +76,6 @@
</div>
</div>
</div>



@section('js_scripts')
<script>
new Vue({
Expand Down Expand Up @@ -116,4 +113,4 @@
}
})
</script>
@endsection
@endsection
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<input v-model="contactPerson.email" autocomplete="nope" class="form-control" type="email" :name="`client_contact_persons[${index}][email]`">
</div>
<div class="col-2">
<input v-model="contactPerson.phone" class="form-control" type="tel" :name="`client_contact_persons[${index}][phone]`">
<input v-model="contactPerson.phone" class="form-control" type="tel" :name="`client_contact_persons[${index}][phone]`" pattern="[1-9]{1}[0-9]{9}" title="The phone must be valid phone number.">
</div>
<div class="col-4 d-flex justify-content-between">
<div class="mr-3 w-full">
Expand Down Expand Up @@ -95,4 +95,4 @@
}
})
</script>
@endsection
@endsection
1 change: 1 addition & 0 deletions Modules/Client/Routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
Route::get('/{client}/edit/{section?}', 'ClientController@edit')->name('client.edit');
Route::post('/', 'ClientController@store')->name('client.store');
Route::post('/{client}/update', 'ClientController@update')->name('client.update');
Route::post('/create/country', 'CountryController@store')->name('country.store');
});
17 changes: 10 additions & 7 deletions Modules/EffortTracking/Resources/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,25 @@ function effortTrackingChart() {
}

for (let i = users.length - 1; i >= 0; i--) {
const userId = users[i].id,
userData = effortDetails[userId],
userDataKeys = Object.keys(userData),
userDates = userDataKeys.map((key) => ({
const userId = users[i].id;
const userData = effortDetails[userId];
let data=[];
if(userData){
const userDataKeys = Object.keys(userData);
const userDates = userDataKeys.map((key) => ({
effort: userData[key].actual_effort,
addedOn: userData[key].added_on
})),
}));
data = workingDays.map((workingDay) => {
for (let i = 0; i <= userDates.length - 1; i++) {
if (userDates[i].addedOn === workingDay) {
return userDates[i].effort;
}
}
return 0;
}),
userColor = `rgb(${255-i*35},0,0)`;
});
}
const userColor = `rgb(${255-i*35},0,0)`;
datasetValue[i] = {
type: "bar",
label: users[i].name,
Expand Down
2 changes: 1 addition & 1 deletion Modules/EffortTracking/Services/EffortTrackingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function getTeamMembersDetails($teamMembers)
}
}
}
$total_effort_in_effortsheet = empty($teamMembersEffort) ? 0 : end($teamMembersEffort[$userDetails->id])['total_effort_in_effortsheet'];
$total_effort_in_effortsheet = $efforts->isNotEmpty() ? end($teamMembersEffort[$userDetails->id])['total_effort_in_effortsheet'] : 0;
$users[] = [
'id' => $userDetails->id,
'name' => $userDetails->name,
Expand Down
9 changes: 9 additions & 0 deletions Modules/HR/Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@

],

'tags' => [
'in-progress' => 'In progress',
'need-follow-up' => 'Need follow up',
'awaiting-confirmation' => 'Awaiting confirmation',
'new-application' => 'New application',
'no-show' => 'No show',
'no-show-reminded' => 'No show reminded'
],

'opportunities-status' => [
'draft' => 'Draft',
'published' => 'Published',
Expand Down
34 changes: 34 additions & 0 deletions Modules/HR/Database/Factories/HrApplicantsFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Modules\HR\Database\Factories;

use Modules\HR\Entities\Applicant;
use Illuminate\Database\Eloquent\Factories\Factory;

class HrApplicantsFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Applicant::class;

/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->name,
'email' => $this->faker->email,
'phone' => $this->faker->phoneNumber,
'course' => array_rand(config('hr.opportunities.domains')),
'college' => $this->faker->word,
'graduation_year' => $this->faker->year,
'linkedin' => $this->faker->url
];
}
}
33 changes: 33 additions & 0 deletions Modules/HR/Database/Factories/HrApplicationRoundFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Modules\HR\Database\Factories;

use Modules\HR\Entities\ApplicationRound;
use Modules\HR\Entities\Application;
use Modules\HR\Entities\Round;
use Modules\User\Entities\User;
use Illuminate\Database\Eloquent\Factories\Factory;

class HrApplicationRoundFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = ApplicationRound::class;

/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'hr_application_id' => Application::factory()->create()->id,
'hr_round_id' => Round::first()->id,
'scheduled_person_id' => User::first()->id,
];
}
}
32 changes: 32 additions & 0 deletions Modules/HR/Database/Factories/HrApplicationsFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Modules\HR\Database\Factories;

use Modules\HR\Entities\Application;
use Modules\HR\Entities\Applicant;
use Modules\HR\Entities\Job;
use Illuminate\Database\Eloquent\Factories\Factory;

class HrApplicationsFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Application::class;

/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'hr_applicant_id' => Applicant::factory()->create()->id,
'hr_job_id' => Job::factory()->create()->id,
'status' => array_rand(config('hr.status'))
];
}
}
Loading

0 comments on commit e707d04

Please sign in to comment.