Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: feature/BQ-250 into [email protected] 🌊 added organizations activities table with add activity modal #40

Open
wants to merge 36 commits into
base: [email protected]
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5e779a5
feature/BQ-250 :ocean: added organization schedule table page with re…
danax7 Mar 23, 2024
7c9919c
feature/BQ-250 :ocean: added translations for columns
danax7 Mar 23, 2024
ba3fb0d
feature/BQ-250 :ocean: added getUserMe mock draft
danax7 Mar 23, 2024
39be73d
feature/BQ-250 :ocean: added organization schedule mock
danax7 Mar 24, 2024
08316e5
Merge branch '[email protected]' into feature/BQ-250
danax7 Mar 24, 2024
a9cec52
feature/BQ-250 :ocean: fixed token name
danax7 Mar 24, 2024
0b8fd4f
feature/BQ-250 :ocean: added DatePickerWithRange component with selec…
danax7 Mar 25, 2024
ca8085a
feature/BQ-250 :ocean: added AddScheduleForm draft
danax7 Mar 26, 2024
a2640f5
feature/BQ-250 :ocean: added new fields for form structure
danax7 Mar 27, 2024
5734446
feature/BQ-250 :ocean: added addScheduleSchema draft, request and mut…
danax7 Mar 29, 2024
624cddd
feature/BQ-250 :ocean: added dateSchema to form
danax7 Mar 29, 2024
ef603f5
feature/BQ-250 :ocean: added date range select for form with conditio…
danax7 Mar 30, 2024
c55c0d0
feature/BQ-250 :ocean: added date picker for non repeat event
danax7 Mar 30, 2024
7a90c92
feature/BQ-250 :ocean: added conditional form fields renering, added …
danax7 Mar 30, 2024
1e53554
feature/BQ-250 :ocean: added translation for datePicker label
danax7 Mar 30, 2024
80826b2
feature/BQ-250 :ocean: added DatePicker Component
danax7 Mar 30, 2024
b87e25a
feature/BQ-250 :ocean: added default date range from url for date range
danax7 Mar 31, 2024
b086708
feature/BQ-250 :ocean: added time form value
danax7 Apr 1, 2024
fa4e482
feature/BQ-250 :ocean: added activity combobox
danax7 Apr 1, 2024
1eb0997
feature/BQ-250 :ocean: added leads combobox
danax7 Apr 1, 2024
fc17b35
some review fixes
danax7 Apr 10, 2024
1215b33
feature/BQ-250 🧊 replace files
debabin Apr 13, 2024
43772c7
feature/BQ-250 🧊 merge release
debabin Apr 13, 2024
80895fb
feature/BQ-250 🧊 change address request and
debabin Apr 13, 2024
b6294f8
Merge branch '[email protected]' into feature/BQ-250
debabin May 16, 2024
a0a01f5
feature/BQ-250 🚀 rework schedule request
May 17, 2024
bfa9db1
feature/BQ-250 🚀 renaming
vitrivdolkom May 17, 2024
4bd91d0
feature/BQ-250 🚀 fix mock request
vitrivdolkom May 17, 2024
a534235
feature/BQ-250 🚀 fix post schedule type errors, bruh fixes
vitrivdolkom May 18, 2024
f6a55dd
feature/BQ-250 🚀 backend get schedules request update
vitrivdolkom May 19, 2024
63aa41f
feature/BQ-250 🚀 fix date filter
vitrivdolkom May 19, 2024
25063b4
feature/BQ-250 🚀 add get activities infinite query, fix types
vitrivdolkom May 20, 2024
79846f2
feature/BQ-250 🚀 add conditional schedule schema
May 21, 2024
0febf4e
feature/BQ-250 🚀 prepare employee request for leads combobox
Jun 20, 2024
dd2ec44
feature/BQ-250 🚀 add filters in get employee request
Jun 20, 2024
c49fbd3
feature/BQ-250 🚀 update schedules request
Jun 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged --no-stash
yarn build
yarn lint-staged --no-stash
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn build
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ export const ActivitiesSection = async ({ cityId }: ActivitiesSectionProps) => {
</div>
<div className='mt-16 flex flex-col items-center justify-center gap-8 md:grid md:grid-cols-2 md:justify-between lg:grid-cols-3'>
{getActivityResponse.rows.map((activity) => {
const activityCover = activity.media.find((item) => item.flag === 'AVATAR')!;
const activityCover = activity.media.find((item) => item.flag === 'AVATAR');

return (
<ActivityCard>
<ActivityCardImage src={activityCover.url} alt={activity.name} />
{activityCover && <ActivityCardImage src={activityCover.url} alt={activity.name} />}
<ActivityCardHeader>
<ActivityCardCategory>{activity.category.RU}</ActivityCardCategory>
<ActivityCardName>{activity.name}</ActivityCardName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ export const ActivityList = () => {
<>
<div className='mt-6 flex flex-col items-center justify-center gap-8 md:grid md:grid-cols-2 md:justify-between lg:grid-cols-3'>
{activities.map((activity) => {
const activityCover = activity.media.find((item) => item.flag === 'AVATAR')!;
const activityCover = activity.media.find((item) => item.flag === 'AVATAR');

return (
<ActivityCard key={activity.id}>
<ActivityCardImage src={activityCover.url} alt={activity.name} />
{activityCover && <ActivityCardImage src={activityCover.url} alt={activity.name} />}
<ActivityCardHeader>
<ActivityCardCategory>{activity.category.RU}</ActivityCardCategory>
<ActivityCardName>{activity.name}</ActivityCardName>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import React from 'react';
import { useParams, usePathname } from 'next/navigation';

import { I18nText } from '@/components/common';
Expand Down Expand Up @@ -63,13 +64,13 @@ export const OrgBreadcrumbs = ({ ids = {}, ...props }: OrgBreadcrumbsProps) => {
);

return (
<>
<BreadcrumbItem key={href} className='list-none text-base'>
<React.Fragment key={href}>
<BreadcrumbItem className='list-none text-base'>
{clickable && <BreadcrumbLink href={href}>{item}</BreadcrumbLink>}
{!clickable && <BreadcrumbPage>{item}</BreadcrumbPage>}
</BreadcrumbItem>
{index !== filteredPathnames.length - 1 && <BreadcrumbSeparator />}
</>
</React.Fragment>
);
})}
</BreadcrumbList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { getActivitiesDashboard } from '@/utils/api';

export const ActivitiesDashboard = async () => {
const dashboard = await getActivitiesDashboard();

return (
<div className='flex flex-wrap gap-2'>
<InfoCard>
Expand Down
4 changes: 2 additions & 2 deletions app/org/(panel)/activities/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export interface ActivitiesDashboardPageProps {
searchParams: SearchParams;
}

const DEFAULT_ACTIVITIES_LIMIT = '10';
const DEFAULT_ACTIVITIES_PAGE = '1';
const DEFAULT_ACTIVITIES_LIMIT = 10;
const DEFAULT_ACTIVITIES_PAGE = 1;

const ActivitiesDashboardPage = async ({ searchParams }: ActivitiesDashboardPageProps) => {
const activitiesTableResponse = await getActivities({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export const OrganizationHeader = ({ organization }: OrganizationHeaderProps) =>
priority={false}
className='h-[168px] w-full rounded-lg'
src={organization.background || background}
alt='org-background'
alt={`${organization.name ?? ''} background`}
fill
/>
<div className='absolute bottom-0 mx-4 mt-auto h-36 w-[96%] rounded-lg border-none bg-background/70 pb-4 pl-4 pr-4 pt-3 shadow-sm backdrop-blur-lg'>
<div className='flex gap-5'>
Expand All @@ -29,7 +30,7 @@ export const OrganizationHeader = ({ organization }: OrganizationHeaderProps) =>
width={80}
height={80}
src={organization.avatar || avatar}
alt='org-background'
alt={`${organization.name ?? ''} avatar`}
/>
<div className='flex flex-col justify-center'>
<Typography variant='h5' tag='h5'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { LucideIcon } from 'lucide-react';
import { ActivityIcon, MapPinIcon, UserIcon, UsersRoundIcon } from 'lucide-react';
import { ActivityIcon, CalendarIcon, MapPinIcon, UserIcon, UsersRoundIcon } from 'lucide-react';

import { ROUTES } from '@/utils/constants';

Expand Down Expand Up @@ -66,7 +66,7 @@ export const PARTNER_PROFILE_TABS: ProfileTab[] = [
route: ROUTES.ORG.ORGANIZATIONS.ACTIVITIES
},
{
icon: ActivityIcon,
icon: CalendarIcon,
title: 'organization.profile.header.schedule',
value: ORGANIZATION_PROFILE_TAB_VALUES.SCHEDULE,
route: ROUTES.ORG.ORGANIZATIONS.SCHEDULE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ const OrganizationActivitiesPage = async ({ params }: OrganizationActivitiesPage
}
});

console.log('@', getActivityResponse);

return (
<>
<div className='flex flex-wrap justify-between gap-3 lgx:p-4'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const ActionAddressForm = <ActionType extends AddressActionType>({
)}
/>
</div>
<I18nText path='dialog.addAddress.form.untill' />
<I18nText path='dialog.addAddress.form.until' />
<div>
<FormField
control={form.control}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const useActionAddressForm = ({

if (actionType === 'edit') {
const putOrganizationActionAddressParams = {
params: { ...requestParams, id: address!.id },
params: { ...requestParams, legalEntityId: params.organizationId },
action: actionType
} as const;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
'use client';

import { XIcon } from 'lucide-react';

import { I18nText } from '@/components/common';
import {
Dialog,
DialogClose,
DialogContent,
DialogHeader,
DialogTitle,
DialogTrigger,
Typography
} from '@/components/ui';

import { AddScheduleForm } from './components/AddScheduleForm/AddScheduleForm';
import { useAddScheduleDialog } from './hooks/useAddScheduleDialog';

interface AddScheduleDialogProps {
trigger: JSX.Element;
}

export const AddScheduleDialog = ({ trigger }: AddScheduleDialogProps) => {
const { functions } = useAddScheduleDialog();

return (
<Dialog>
<DialogTrigger asChild>{trigger}</DialogTrigger>
<DialogContent className='flex h-fit w-11/12 max-w-[713px] flex-col rounded-lg smx:max-h-[90%]'>
<DialogClose>
<XIcon className='h-6 w-6' />
</DialogClose>
<DialogHeader>
<DialogTitle>
<Typography variant='h4' tag='h4'>
<I18nText path='dialog.addSchedule.title' />
</Typography>
</DialogTitle>
</DialogHeader>
<div className='flex h-full flex-col items-end justify-between overflow-y-auto rounded-lg border p-5'>
<AddScheduleForm onAdded={functions.onAdded} />
</div>
</DialogContent>
</Dialog>
);
};
Loading