- Introduced tests for drift operations UI and backend to ensure proper handling of ignore rules and UI elements. - Added tests for email identity API to validate email linking and identity retrieval without updates. - Implemented tests for email purchase link service to verify correct handling of purchase mail links and conflict scenarios. - Created tests for email reply automation to ensure proper routing and processing of replies based on classification. - Developed tests for email sender creation to validate suggestions and handling of existing contacts and companies. - Added tests for email sender identity to ensure correct matching of contacts and domains. - Implemented tests for work desk functionalities to validate task management, meeting registrations, and timer functionalities.
30 lines
1.6 KiB
Python
30 lines
1.6 KiB
Python
from fastapi import APIRouter, Depends, Request
|
|
from fastapi.responses import HTMLResponse, RedirectResponse
|
|
import os
|
|
from fastapi.templating import Jinja2Templates
|
|
from app.core.auth_dependencies import get_current_user
|
|
|
|
router = APIRouter()
|
|
templates = Jinja2Templates(directory="app")
|
|
|
|
@router.get("/planner", response_class=HTMLResponse)
|
|
async def planner(request: Request, current_user: dict = Depends(get_current_user)):
|
|
return templates.TemplateResponse("modules/planner/templates/index.html", {"request": request, "current_user": current_user})
|
|
|
|
|
|
@router.get("/planning", response_class=HTMLResponse)
|
|
async def planning(request: Request, current_user: dict = Depends(get_current_user)):
|
|
if os.environ.get('PLANNING_UI_ENABLED','true').lower() in {'0','false','no'}:
|
|
return RedirectResponse('/planner',status_code=307)
|
|
desk_enabled = os.environ.get('WORK_DESK_ENABLED', 'true').lower() not in {'0', 'false', 'no'}
|
|
template = 'desk.html' if request.query_params.get('view') == 'queue' and desk_enabled else 'work.html'
|
|
return templates.TemplateResponse("modules/planner/templates/" + template, {"request": request, "current_user": current_user})
|
|
|
|
|
|
@router.get('/planning/absence', response_class=HTMLResponse)
|
|
async def absence_status(request: Request, current_user: dict = Depends(get_current_user)):
|
|
from app.modules.planner.backend.calendar import require_absence_report
|
|
require_absence_report(current_user)
|
|
return templates.TemplateResponse('modules/planner/templates/absence.html',
|
|
{'request':request,'current_user':current_user})
|