Skip to content

Commit

Permalink
Merge pull request #1412 from jitendra-webkul/lead-index-page
Browse files Browse the repository at this point in the history
Issue #1411 fixed
  • Loading branch information
jitendra-webkul authored Aug 22, 2024
2 parents 1c2fff9 + 2744594 commit b49df6e
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public function index($id)
*/
public function concatEmail($activities)
{
return $activities->sortByDesc('created_at')->sortByDesc('id');
return $activities->sortByDesc('id')->sortByDesc('created_at');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ public function concatEmailAsActivities($leadId, $activities)
'created_at' => $email->created_at,
'updated_at' => $email->updated_at,
];
}))->sortByDesc('created_at')->sortByDesc('id');
}))->sortByDesc('id')->sortByDesc('created_at');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ public function transformToActivity($data)
'user' => auth()->guard('user')->user(),
'participants' => [],
'location' => null,
'additional' => (object) [
'folders' => json_decode($data['folders']),
'from' => json_decode($data['from']),
'to' => json_decode($data['reply_to']),
'cc' => json_decode($data['cc']),
'bcc' => json_decode($data['bcc']),
],
'additional' => json_encode([
'folders' => $data['folders'],
'from' => $data['from'],
'to' => $data['reply_to'],
'cc' => $data['cc'],
'bcc' => $data['bcc'],
]),
'files' => array_map(function ($attachment) {
return (object) $attachment;
}, $data['attachments']),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public function index($id)
*/
public function concatEmail($activities)
{
return $activities->sortByDesc('created_at')->sortByDesc('id');
return $activities->sortByDesc('id')->sortByDesc('created_at');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public function index($id)
*/
public function concatEmail($activities)
{
return $activities->sortByDesc('created_at')->sortByDesc('id');
return $activities->sortByDesc('id')->sortByDesc('created_at');
}
}
1 change: 1 addition & 0 deletions packages/Webkul/Admin/src/Http/Resources/LeadResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function toArray($request)
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'person' => new PersonResource($this->person),
'user' => new UserResource($this->user),
'type' => new TypeResource($this->type),
'source' => new SourceResource($this->source),
'pipeline' => new PipelineResource($this->pipeline),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<template v-else>
<div class="w-full bg-white dark:bg-gray-900">
<div class="flex gap-4 border-b border-gray-200 dark:border-gray-800">
<div class="flex gap-2 border-b border-gray-200 dark:border-gray-800">
<div
v-for="type in types"
class="cursor-pointer px-3 py-2.5 text-sm font-medium dark:text-white"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="w-full bg-white dark:bg-gray-900">
<!-- Tabs -->
<div class="flex gap-4 border-b border-gray-200 dark:border-gray-800">
<div class="flex gap-2 border-b border-gray-200 dark:border-gray-800">
@for ($i = 0; $i < 5; $i++)
<div class="px-3 py-[11px]">
<div class="shimmer h-5 w-24"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="flex gap-4 overflow-x-auto">
<!-- Stages -->
@for ($i = 1; $i <= 6; $i++)
<div class="flex min-w-[275px] flex-col gap-1 rounded-lg bg-white dark:bg-gray-900">
<div class="flex min-w-[275px] max-w-[275px] flex-col gap-1 rounded-lg bg-white dark:bg-gray-900">
<!-- Stage Header -->
<div class="flex flex-col px-2 py-3">
<div class="flex items-center justify-between">
Expand All @@ -21,7 +21,35 @@
<div class="flex h-[calc(100vh-315px)] flex-col gap-2 overflow-y-auto p-2">
@for ($j = 1; $j <= 3; $j++)
<!-- Card -->
<div class="shimmer min-h-[163px] w-full rounded-md"></div>
<div class="flex w-full flex-col gap-5 rounded-md border border-gray-100 p-2 dark:border-gray-400">
<!-- Header -->
<div class="flex items-start justify-between">
<div class="flex items-center gap-1">
<!-- Avatar -->
<div class="shimmer h-9 w-9 rounded-full"></div>

<!-- Name and Organization -->
<div class="flex flex-col gap-0.5">
<div class="shimmer h-4 w-20"></div>
<div class="shimmer h-[15px] w-12"></div>
</div>
</div>
</div>

<!-- Body -->
<div class="flex flex-col gap-0.5">
<div class="shimmer h-4 w-full"></div>
<div class="shimmer h-4 w-1/2"></div>
</div>

<!-- Footer -->
<div class="flex flex-wrap gap-1">
<div class="shimmer h-6 w-16 rounded-xl"></div>
<div class="shimmer h-6 w-16 rounded-xl"></div>
<div class="shimmer h-6 w-16 rounded-xl"></div>
<div class="shimmer h-6 w-16 rounded-xl"></div>
</div>
</div>
@endfor
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class="flex h-[calc(100vh-315px)] flex-col gap-2 overflow-y-auto p-2"
<!-- Lead Card -->
<template #item="{ element, index }">
<a
class="lead-item flex cursor-grab flex-col gap-5 rounded-md border border-gray-50 bg-gray-50 p-2 dark:border-gray-400 dark:bg-gray-400"
class="lead-item flex cursor-pointer flex-col gap-5 rounded-md border border-gray-100 bg-gray-50 p-2 dark:border-gray-400 dark:bg-gray-400"
:href="'{{ route('admin.leads.view', 'replaceId') }}'.replace('replaceId', element.id)"
>
<!-- Header -->
Expand All @@ -91,12 +91,12 @@ class="flex h-9 w-9 items-center justify-center rounded-full text-xs font-medium
@{{ element.person.name.split(' ').map(word => word[0].toUpperCase()).join('') }}
</div>

<div class="flex flex-col gap-1">
<div class="flex flex-col gap-0.5">
<span class="text-xs font-medium">
@{{ element.person.name }}
</span>

<span class="text-[10px]">
<span class="text-[10px] leading-normal">
@{{ element.person.organization?.name }}
</span>
</div>
Expand All @@ -114,10 +114,31 @@ class="icon-rotten cursor-default text-xl text-rose-600"
</p>

<div class="flex flex-wrap gap-1">
<div
class="flex items-center gap-1 rounded-xl bg-gray-200 px-2 py-1 text-xs font-medium dark:bg-gray-800 dark:text-white"
v-if="element.user"
>
<span class="icon-settings-user text-sm"></span>

@{{ element.user.name }}
</div>

<div class="rounded-xl bg-gray-200 px-2 py-1 text-xs font-medium dark:bg-gray-800 dark:text-white">
@{{ element.formatted_lead_value }}
</div>

<div class="rounded-xl bg-gray-200 px-2 py-1 text-xs font-medium dark:bg-gray-800 dark:text-white">
@{{ element.source.name }}
</div>

<div class="rounded-xl bg-gray-200 px-2 py-1 text-xs font-medium dark:bg-gray-800 dark:text-white">
@{{ element.type.name }}
</div>

<!-- Tags -->
<template v-for="tag in element.tags">
<div
class="rounded-xl bg-gray-200 px-3 py-1 text-xs font-medium dark:bg-gray-800"
class="rounded-xl bg-gray-200 px-2 py-1 text-xs font-medium dark:bg-gray-800"
:style="{
backgroundColor: tag.color,
color: tagTextColor[tag.color]
Expand All @@ -126,18 +147,6 @@ class="rounded-xl bg-gray-200 px-3 py-1 text-xs font-medium dark:bg-gray-800"
@{{ tag.name }}
</div>
</template>

<div class="rounded-xl bg-gray-200 px-3 py-1 text-xs font-medium dark:bg-gray-800 dark:text-white">
@{{ element.formatted_lead_value }}
</div>

<div class="rounded-xl bg-gray-200 px-3 py-1 text-xs font-medium dark:bg-gray-800 dark:text-white">
@{{ element.source.name }}
</div>

<div class="rounded-xl bg-gray-200 px-3 py-1 text-xs font-medium dark:bg-gray-800 dark:text-white">
@{{ element.type.name }}
</div>
</div>
</a>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ class="primary-button"
methods: {
openModal(stage) {
if (this.currentStage.code == stage.code) {
return;
}
this.nextStage = stage;
this.$refs.stageUpdateModal.open();
Expand Down
1 change: 0 additions & 1 deletion public/admin/build/assets/app-69f0739b.css

This file was deleted.

1 change: 1 addition & 0 deletions public/admin/build/assets/app-b7e5e622.css

Large diffs are not rendered by default.

Loading

0 comments on commit b49df6e

Please sign in to comment.