Skip to content

Commit

Permalink
chore: update ui import user
Browse files Browse the repository at this point in the history
  • Loading branch information
mahatmamahardhikach committed Nov 11, 2024
1 parent e557b85 commit a891072
Show file tree
Hide file tree
Showing 28 changed files with 86 additions and 76 deletions.
13 changes: 12 additions & 1 deletion app/Livewire/ImportUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ class ImportUser extends Component

public $positionCode;

/**
* Handles the event when the import field is updated.
*
* This function will validate the uploaded file and store it in the
* 'photos' directory.
* The path of the uploaded file will be stored in
public function updatedImport(): void
{
$this->importUser();
}
/**
* Handles the event when the import field is updated.
*
Expand Down Expand Up @@ -163,4 +174,4 @@ public function render(): View
{
return view('livewire.import-user');
}
}
}
Binary file modified public/employee_data.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion resources/views/livewire/approval-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/asset-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/attendance-leave-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/attendance-time-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-branch.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-brand.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-category.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-company.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-department.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-division.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-inventory.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-level.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-position.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-sub-category.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-sub-division.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
25 changes: 10 additions & 15 deletions resources/views/livewire/import-user.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="flex gap-2 h-10 w-full">
<div class="flex gap-2 h-10 justify-end">
<a
href="{{ asset('employee_data.xlsx') }}"
class="
Expand All @@ -18,27 +18,22 @@ class="
</svg>
Employee Template
</a>
<label for="import" class="inline">
<div class="relative">
<input
wire:model="import"
type="file"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"
class="hidden"
>
</label>
@error('import')
<div class="text-red-500 inline">{{ $message }}</div>
@enderror
<button
wire:click="importUser"
type="button"
class="btn bg-green-500 text-white"
>
<i class="mgc_upload_line"></i>
</button>

<label for="import" class="inline-flex items-center px-4 py-3 bg-green-500 text-white rounded-md">
<i class="mgc_upload_line"></i>
</label>
@error('import')
<div class="text-red-500 inline">{{ $message }}</div>
@enderror
</div>
<div wire:loading.class.remove="hidden" class="hidden">
<div class="fixed top-0 left-0 right-0 bottom-0 w-full h-screen z-50 overflow-hidden bg-gray-700 opacity-75 flex flex-col items-center justify-center">
<div class="animate-spin h-12 w-12 border-b-4 border-gray-900 mb-4"></div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-working-calendar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/import-working-shift.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/leave-type-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
4 changes: 2 additions & 2 deletions resources/views/livewire/login-page.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

<div class="mb-4">
<label class="block text-sm font-medium text-gray-600 dark:text-gray-200 mb-2" for="email">Email Address or Username</label>
<input wire:model="loginAccount" id="loginAccount" class="form-input" type="text" placeholder="Enter your Email or username" name="loginAccount">
<input wire:model="loginAccount" id="loginAccount" type="text" placeholder="Enter your Email or username" name="loginAccount">
@error('loginAccount') <span class="text-red-300">{{ $message }}</span> @enderror
</div>

<div class="mb-4">
<label class="block text-sm font-medium text-gray-600 dark:text-gray-200 mb-2" for="password">Password</label>
<input wire:model="password" id="password" class="form-input" type="password" placeholder="Enter your password" name="password">
<input wire:model="password" id="password" type="password" placeholder="Enter your password" name="password">
@error('password') <span class="text-red-300">{{ $message }}</span> @enderror
</div>

Expand Down
8 changes: 4 additions & 4 deletions resources/views/livewire/register-company-page.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class="text-gray-800 text-sm font-medium inline-block mb-2"
wire:model.live="companyName"
type="text"
id="company_name"
class="form-input"

>
@error('companyName') {{ $message }} @enderror
</div>
Expand All @@ -28,7 +28,7 @@ class="text-gray-800 text-sm font-medium inline-block mb-2"
<textarea
wire:model.live="companyAddress"
id="company_address"
class="form-input"

rows="4"
></textarea>
@error('companyAddress') {{ $message }} @enderror
Expand All @@ -44,7 +44,7 @@ class="text-gray-800 text-sm font-medium inline-block mb-2"
wire:model.live="companyPhone"
type="text"
id="company_phone"
class="form-input"

>
@error('companyPhone') {{ $message }} @enderror
</div>
Expand All @@ -54,7 +54,7 @@ class="form-input"
wire:model.live="companyEmail"
type="text"
id="company_email"
class="form-input"

>
@error('companyEmail') {{ $message }} @enderror
</div>
Expand Down
66 changes: 35 additions & 31 deletions resources/views/livewire/user-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,44 +21,48 @@ class="ml-auto"
</div>
</div>
@enderror
<div class="flex justify-between pt-2" x-show="!open" >
<div>
<div class="grid grid-cols-2 gap-4 pt-2" x-show="!open" >
<div class="col-span-1">
<button
type="button"
class="btn bg-primary text-white"
@click="open = true; $wire.dispatch('disableFilter')"
>+</button>
</div>
<div
class="flex items-center gap-2
justify-between w-2/4 relative"
>
<livewire:import-user />
<input
wire:model.live="search"
type="text"
id="search"
class="form-input pr-10 w-2/3"
placeholder="Search..."
>
@if($search)
<button
wire:click="$set('search',null)"
type="button"
class="absolute inset-y-0 right-0 flex items-center pr-3"
>
<svg
class="h-3 w-3 text-gray-500"
fill="none" viewBox="0 0 24 24" stroke="currentColor"
<div class="col-span-1">
<div class="grid grid-cols-4 gap-2">
<div class="col-span-2">
<livewire:import-user />
</div>
<div class="col-span-2">
<input
wire:model.live="search"
type="text"
id="search"
class="form-input pr-10"
placeholder="Search..."
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2" d="M6 18L18 6M6 6l12 12"
></path>
</svg>
</button>
@endif
@if($search)
<button
wire:click="$set('search',null)"
type="button"
class="absolute inset-y-0 right-0 flex items-center pr-3"
>
<svg
class="h-3 w-3 text-gray-500"
fill="none" viewBox="0 0 24 24" stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2" d="M6 18L18 6M6 6l12 12"
></path>
</svg>
</button>
@endif
</div>
</div>

</div>
</div>
<div x-show="open">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/vacancy-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class="w-6 h-6"
id="import"
name="import"
accept=".csv,.xlsx"
class="form-input"

>
</label>
@error('import')
Expand Down
Loading

0 comments on commit a891072

Please sign in to comment.