Skip to content

Commit

Permalink
Merge main to staging
Browse files Browse the repository at this point in the history
  • Loading branch information
mbappai committed Sep 25, 2023
2 parents 4ed8209 + 39db293 commit 9624eff
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { NewOrg } from "../../../../types/OrganisationTypes";
import useOrgs from "../../../../hooks/useOrgs";
const {Text,Title} = Typography
import { SearchOutlined, PlusOutlined, LikeOutlined, DislikeOutlined } from '@ant-design/icons';
import { SearchOutlined, PlusOutlined, LikeOutlined, DashOutlined, DislikeOutlined } from '@ant-design/icons';
import type { FilterConfirmProps } from 'antd/es/table/interface';
import React, { useRef, useState } from 'react'
import {Typography,Button,Avatar, Alert, Upload, Tag, Image, Descriptions, Table, InputRef, Input, Space, DatePicker, Radio, Dropdown, MenuProps, Drawer, Row, Col, Divider, Form, Modal, notification} from 'antd'
Expand Down Expand Up @@ -477,12 +477,20 @@ export default function ManagerOrgsView(){
key: 'address',
width:'370px',
ellipsis: true,
render:(_,record)=>(
<div style={{display:'flex',flexDirection:'column'}}>
<Text style={{textTransform:'capitalize'}}>{record.country}</Text>
<Text type="secondary">{record.street}</Text>
</div>
render:(_,record)=>{
return(
<>
{
record.street !== ''
? <div style={{display:'flex',flexDirection:'column'}}>
<Text style={{textTransform:'capitalize'}}>{record.country}</Text>
<Text type="secondary">{record.street}</Text>
</div>
: <DashOutlined rev={undefined}/>
}
</>
)
}
},

{
Expand All @@ -491,8 +499,12 @@ export default function ManagerOrgsView(){
key: 'contactNumber',
width:'150px',
render: (_,record)=>(
<>
{
//@ts-ignore
<Text>{convertToAmericanFormat(record.contactNumber)}</Text>
record.contactNumber !=='' ?<Text>{convertToAmericanFormat(record.contactNumber)}</Text>: <DashOutlined rev={undefined}/>
}
</>
)
},
{
Expand Down
46 changes: 27 additions & 19 deletions components/OrganizationsPage/OrganizationList/OrganizationView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {Typography,Button,Avatar, Upload, Tag, Image, Descriptions, Table, Input
import { useRouter } from 'next/router'
import Highlighter from 'react-highlight-words'
import axios from 'axios';
import {MoreOutlined,ReloadOutlined} from '@ant-design/icons'
import {MoreOutlined,ReloadOutlined,DashOutlined} from '@ant-design/icons'
import { FilterDropdownProps, FilterValue, SorterResult } from 'antd/lib/table/interface';

import { useAuthContext } from '../../../context/AuthContext';
Expand Down Expand Up @@ -61,7 +61,7 @@ export default function AdminOrgsView(){
async function fetchAllOrgs(){
const res = await axios({
method:'get',
url:`${process.env.NEXT_PUBLIC_NEW_API_URL}/${urlPrefix}/orgs?pageNumber=${pageNumber}&pageSize=10&key2=created_by`,
url:`${process.env.NEXT_PUBLIC_NEW_API_URL}/${urlPrefix}/orgs?pageNumber=${pageNumber}&pageSize=10&status=1`,
headers:{
"Authorization": paseto
}
Expand All @@ -74,7 +74,7 @@ export default function AdminOrgsView(){
async function fetchOrgs(){
const res = await axios({
method:'get',
url:`${process.env.NEXT_PUBLIC_NEW_API_URL}/${urlPrefix}/orgs?key=status&value=${currentStatus.id}&pageNumber=${pageNumber}&pageSize=${pageSize}&key2=created_by`,
url:`${process.env.NEXT_PUBLIC_NEW_API_URL}/${urlPrefix}/orgs?pageNumber=${pageNumber}&pageSize=${pageSize}&status=${currentStatus.id}`,
headers:{
"Authorization": paseto
}
Expand All @@ -84,8 +84,6 @@ export default function AdminOrgsView(){

}



async function changeOrgStatus({orgId, statusNumber}:{orgId:string, statusNumber: string}){
const res = await axios({
method:'patch',
Expand All @@ -102,8 +100,6 @@ export default function AdminOrgsView(){
return res;
}




const changeStatusMutation = useMutation(['orgs'],{
mutationFn: changeOrgStatus,
Expand Down Expand Up @@ -369,27 +365,39 @@ export default function AdminOrgsView(){
},
{
title: 'Address',
// dataIndex: 'address',
dataIndex: 'address',
key: 'address',
width:'370px',
ellipsis:true,
render:(_,record)=>(
<div style={{display:'flex',flexDirection:'column'}}>
<Text style={{textTransform:'capitalize'}}>{record.country}</Text>
<Text type="secondary">{record.street}</Text>
</div>
ellipsis: true,
render:(_,record)=>{
return(
<>
{
record.street !== ''
? <div style={{display:'flex',flexDirection:'column'}}>
<Text style={{textTransform:'capitalize'}}>{record.country}</Text>
<Text type="secondary">{record.street}</Text>
</div>
: <DashOutlined rev={undefined}/>
}
</>
)
}
},

{
{
title: 'Contact Number',
dataIndex: 'contactNumber',
key: 'contactNumber',
width:'150px',
render:(number)=>{
const formattedNumber = convertToAmericanFormat(number)
return <Text>{formattedNumber}</Text>
}
render: (_,record)=>(
<>
{
//@ts-ignore
record.contactNumber !=='' ?<Text>{convertToAmericanFormat(record.contactNumber)}</Text>: <DashOutlined rev={undefined}/>
}
</>
)
},
{
title: 'Created On',
Expand Down
12 changes: 12 additions & 0 deletions pages/404.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {Typography,Button} from 'antd'
import { useRouter } from 'next/router'

export default function Custom404() {
const router = useRouter()
return (
<div style={{display:'flex', flexDirection:'column', justifyContent:'center', alignItems:'center', background: '#fff', width:'100vw', height:'100vh'}}>
<Typography.Title level={2}>404 - Page Not Found</Typography.Title>
<Button style={{marginTop:'1rem'}} onClick={()=>router.replace('/')}>Go to Dashboard</Button>
</div>
)
}
11 changes: 0 additions & 11 deletions pages/404.tsx

This file was deleted.

13 changes: 11 additions & 2 deletions pages/500.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import {Typography} from 'antd'
import {Button, Typography} from 'antd'
import { useRouter } from 'next/router'

export default function Custom500() {
return <Typography.Title level={2}>500 - Server side error occured</Typography.Title>
const router = useRouter()
return(
<div style={{display:'flex', flexDirection:'column', justifyContent:'center', alignItems:'center', background: '#fff', width:'100vw', height:'100vh'}}>
<Typography.Title level={2}>
500 - Server side error occured
<Button style={{marginTop:'1rem'}} onClick={()=>router.replace('/')}>Go to Dashboard</Button>
</Typography.Title>
</div>
)
}
5 changes: 2 additions & 3 deletions pages/organizations/events/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ function gotoEventPage(event:Event){
},
{
title: 'Type',
dataIndex: 'eventType',
key: 'eventType',
dataIndex: 'type',
key: 'type',
width:'100px',
render: (type)=>(
<Tag style={{textTransform:'capitalize'}}>{type}</Tag>
Expand Down Expand Up @@ -454,7 +454,6 @@ function copyLink(selectedRecord:any){
const marketplaceLink = `https://marketplace.staging.flexabledats.com/events/${eventId}`
// Copy the text inside the text field
navigator.clipboard.writeText(marketplaceLink);
console.log(selectedRecord)
}


Expand Down
4 changes: 2 additions & 2 deletions pages/organizations/venues/exclusive-access/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default function Services(){ // ServiceItems
// minHeight:'70vh',
}}
>
<ServiceItemErrorBoundary name='Service page'>
<ServiceItemPageView/>
<ServiceItemErrorBoundary name='Exlclusive Access page'>
<ServiceItemPageView/>
</ServiceItemErrorBoundary>
</Content>
</Col>
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"jsx": "preserve",
"incremental": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "components/shared/ErrorBoundary/ServiceItemErrorBoundary.js"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "components/shared/ErrorBoundary/ServiceItemErrorBoundary.js", "pages/404.js"],
"exclude": ["node_modules"]
}

0 comments on commit 9624eff

Please sign in to comment.