Merge pull request #122 from chamikaJ/imp/task-list-loading-improvement
Imp/task list loading improvement
This commit is contained in:
@@ -15,7 +15,9 @@ services:
|
|||||||
- worklenz
|
- worklenz
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
image: docker.io/chamikajaycey/worklenz-backend:latest
|
build:
|
||||||
|
context: ./worklenz-backend
|
||||||
|
dockerfile: Dockerfile
|
||||||
container_name: worklenz_backend
|
container_name: worklenz_backend
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
@@ -51,28 +53,25 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- minio
|
- minio
|
||||||
entrypoint: >
|
entrypoint: >
|
||||||
/bin/sh -c "
|
/bin/sh -c '
|
||||||
# Wait for MinIO to be available
|
echo "Waiting for MinIO to start...";
|
||||||
echo 'Waiting for MinIO to start...'
|
sleep 15;
|
||||||
sleep 15;
|
for i in 1 2 3 4 5; do
|
||||||
# Retry up to 5 times
|
echo "Attempt $i to connect to MinIO...";
|
||||||
for i in 1 2 3 4 5; do
|
if /usr/bin/mc config host add myminio http://minio:9000 minioadmin minioadmin; then
|
||||||
echo \"Attempt $$i to connect to MinIO...\"
|
echo "Successfully connected to MinIO!";
|
||||||
if /usr/bin/mc config host add myminio http://minio:9000 minioadmin minioadmin; then
|
/usr/bin/mc mb --ignore-existing myminio/worklenz-bucket;
|
||||||
echo \"Successfully connected to MinIO!\"
|
/usr/bin/mc policy set public myminio/worklenz-bucket;
|
||||||
/usr/bin/mc mb --ignore-existing myminio/worklenz-bucket;
|
exit 0;
|
||||||
/usr/bin/mc policy set public myminio/worklenz-bucket;
|
fi
|
||||||
exit 0;
|
echo "Connection failed, retrying in 5 seconds...";
|
||||||
fi
|
sleep 5;
|
||||||
echo \"Connection failed, retrying in 5 seconds...\"
|
done;
|
||||||
sleep 5;
|
echo "Failed to connect to MinIO after 5 attempts";
|
||||||
done
|
exit 1;
|
||||||
echo \"Failed to connect to MinIO after 5 attempts\"
|
'
|
||||||
exit 1;
|
|
||||||
"
|
|
||||||
networks:
|
networks:
|
||||||
- worklenz
|
- worklenz
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
container_name: worklenz_db
|
container_name: worklenz_db
|
||||||
@@ -94,22 +93,19 @@ services:
|
|||||||
target: /docker-entrypoint-initdb.d
|
target: /docker-entrypoint-initdb.d
|
||||||
consistency: cached
|
consistency: cached
|
||||||
command: >
|
command: >
|
||||||
bash -c '
|
bash -c ' if command -v apt-get >/dev/null 2>&1; then
|
||||||
if command -v apt-get >/dev/null 2>&1; then
|
|
||||||
apt-get update && apt-get install -y dos2unix
|
apt-get update && apt-get install -y dos2unix
|
||||||
elif command -v apk >/dev/null 2>&1; then
|
elif command -v apk >/dev/null 2>&1; then
|
||||||
apk add --no-cache dos2unix
|
apk add --no-cache dos2unix
|
||||||
fi &&
|
fi && find /docker-entrypoint-initdb.d -type f -name "*.sh" -exec sh -c '\''
|
||||||
find /docker-entrypoint-initdb.d -type f -name "*.sh" -exec sh -c '\''
|
|
||||||
dos2unix "{}" 2>/dev/null || true
|
dos2unix "{}" 2>/dev/null || true
|
||||||
chmod +x "{}"
|
chmod +x "{}"
|
||||||
'\'' \; &&
|
'\'' \; && exec docker-entrypoint.sh postgres '
|
||||||
exec docker-entrypoint.sh postgres
|
|
||||||
'
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
worklenz_postgres_data:
|
worklenz_postgres_data:
|
||||||
worklenz_minio_data:
|
worklenz_minio_data:
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
worklenz:
|
worklenz:
|
||||||
|
|||||||
@@ -80,6 +80,14 @@ COOKIE_SECRET=change_me_in_production
|
|||||||
SOCKET_IO_CORS=${FRONTEND_URL}
|
SOCKET_IO_CORS=${FRONTEND_URL}
|
||||||
SERVER_CORS=${FRONTEND_URL}
|
SERVER_CORS=${FRONTEND_URL}
|
||||||
|
|
||||||
|
|
||||||
|
# Google Login
|
||||||
|
GOOGLE_CLIENT_ID="your_google_client_id"
|
||||||
|
GOOGLE_CLIENT_SECRET="your_google_client_secret"
|
||||||
|
GOOGLE_CALLBACK_URL="${FRONTEND_URL}/secure/google/verify"
|
||||||
|
LOGIN_FAILURE_REDIRECT="${FRONTEND_URL}/auth/authenticating"
|
||||||
|
LOGIN_SUCCESS_REDIRECT="${FRONTEND_URL}/auth/authenticating"
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
DB_HOST=db
|
DB_HOST=db
|
||||||
DB_PORT=5432
|
DB_PORT=5432
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
/>
|
/>
|
||||||
<title>Worklenz</title>
|
<title>Worklenz</title>
|
||||||
<!-- Environment configuration -->
|
<!-- Environment configuration -->
|
||||||
<script src="/env-config.js"></script>
|
<script type="module" src="/env-config.js"></script>
|
||||||
<!-- Unregister service worker -->
|
<!-- Unregister service worker -->
|
||||||
<script src="/unregister-sw.js"></script>
|
<script src="/unregister-sw.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -2,13 +2,18 @@ if ('serviceWorker' in navigator) {
|
|||||||
// Check if we've already attempted to unregister in this session
|
// Check if we've already attempted to unregister in this session
|
||||||
if (!sessionStorage.getItem('swUnregisterAttempted')) {
|
if (!sessionStorage.getItem('swUnregisterAttempted')) {
|
||||||
navigator.serviceWorker.getRegistrations().then(function(registrations) {
|
navigator.serviceWorker.getRegistrations().then(function(registrations) {
|
||||||
if (registrations.length > 0) {
|
const ngswWorker = registrations.find(reg => reg.active?.scriptURL.includes('ngsw-worker'));
|
||||||
|
|
||||||
|
if (ngswWorker) {
|
||||||
// Mark that we've attempted to unregister
|
// Mark that we've attempted to unregister
|
||||||
sessionStorage.setItem('swUnregisterAttempted', 'true');
|
sessionStorage.setItem('swUnregisterAttempted', 'true');
|
||||||
// If there are registered service workers, do a hard reload first
|
// Unregister the ngsw-worker
|
||||||
window.location.reload(true);
|
ngswWorker.unregister().then(() => {
|
||||||
|
// Reload the page after unregistering
|
||||||
|
window.location.reload(true);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// If no service workers are registered, unregister any that might be pending
|
// If no ngsw-worker is found, unregister any other service workers
|
||||||
for(let registration of registrations) {
|
for(let registration of registrations) {
|
||||||
registration.unregister();
|
registration.unregister();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,6 +77,18 @@ const LoginPage: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// Check and unregister ngsw-worker if present
|
||||||
|
if ('serviceWorker' in navigator) {
|
||||||
|
navigator.serviceWorker.getRegistrations().then(function(registrations) {
|
||||||
|
const ngswWorker = registrations.find(reg => reg.active?.scriptURL.includes('ngsw-worker'));
|
||||||
|
if (ngswWorker) {
|
||||||
|
ngswWorker.unregister().then(() => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
trackMixpanelEvent(evt_login_page_visit);
|
trackMixpanelEvent(evt_login_page_visit);
|
||||||
if (currentSession && !currentSession?.setup_completed) {
|
if (currentSession && !currentSession?.setup_completed) {
|
||||||
navigate('/worklenz/setup');
|
navigate('/worklenz/setup');
|
||||||
|
|||||||
Reference in New Issue
Block a user