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

Update workflow files and Minor UX Improvements #323

Merged
merged 7 commits into from
Apr 22, 2024
Merged
2 changes: 1 addition & 1 deletion .github/workflows/deploy_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
echo "Starting redis service..."
sudo systemctl start redis
echo "Starting gunicorn..."
nohup sh -c 'gunicorn -w 4 marketplace.wsgi:application > gunicorn.out 2>&1' &
nohup sh -c 'gunicorn -w 4 --access-logfile - --error-logfile - --timeout 300 marketplace.wsgi:application > gunicorn.out 2>&1' &
echo "Gunicorn started."
echo "Starting celery worker..."
nohup sh -c 'celery -A marketplace worker -l info > celery_worker.out 2>&1' &
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_prod_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
echo "Starting redis service..."
sudo systemctl start redis
echo "Starting gunicorn..."
nohup sh -c 'gunicorn -w 4 marketplace.wsgi:application > gunicorn.out 2>&1' &
nohup sh -c 'gunicorn -w 4 --access-logfile - --error-logfile - --timeout 300 marketplace.wsgi:application > gunicorn.out 2>&1' &
echo "Gunicorn started."
echo "Starting celery worker..."
nohup sh -c 'celery -A marketplace worker -l info > celery_worker.out 2>&1' &
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
npm install
npm run build
sudo systemctl restart nginx
pm2 stop marketplace
pm2 delete marketplace
pm2 start npm --name marketplace -- start

- name: Remove Github Actions IP from security group
Expand Down
1 change: 1 addition & 0 deletions src/ui/app/influencer/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@ export default function BusinessDashboardPage() {
{params?.row?.approved &&
(params?.row?.status === ORDER_ITEM_STATUS.ACCEPTED ||
params?.row?.status === ORDER_ITEM_STATUS.CANCELLED) &&
params?.row?.order_id?.status === ORDER_STATUS.ACCEPTED &&
// Publish date is in the future
dayjs(params?.row?.publish_date) > dayjs() && (
<Tooltip title="Schedule Post" placement="top" arrow>
Expand Down
17 changes: 10 additions & 7 deletions src/ui/app/influencer/profile/[id]/_services/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Services = ({
const dispatch = useAppDispatch();
const cart = useAppSelector((state) => state.cart);
const loggedInUser = useAppSelector((state) => state.user?.user);
const [type, setType] = React.useState<string | null>(null);
const [type, setType] = React.useState<string | null>("published");
const [services, setServices] = React.useState<ServiceType[]>([]);
const [pagination, setPagination] = React.useState<PaginationType>({
total_data_count: 0,
Expand All @@ -58,16 +58,13 @@ const Services = ({
const getServices = async () => {
try {
setLoading(true);
const { message, data, isSuccess, errors } = await getService(
const { message, data, isSuccess } = await getService(
"packages/service",
{
page_number: pagination.current_page_number,
page_size:
id === loggedInUser?.id
? pagination.current_page_size
: pagination.current_page_size + 1,
page_size: pagination.current_page_size,
influencer: id,
status: id === loggedInUser?.id ? type : "published",
status: type,
}
);
if (isSuccess) {
Expand Down Expand Up @@ -120,6 +117,12 @@ const Services = ({
}
}, [refreshPage]);

useEffect(() => {
if (id && loggedInUser && loggedInUser?.id && loggedInUser?.id === id) {
setType(null);
}
}, [loggedInUser, id]);

useEffect(() => {
getServices();
}, [pagination.current_page_number, pagination.current_page_size, type]);
Expand Down