[#562] added DAV_BASE_URL to env (#570)

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2026-02-23 11:29:02 +01:00
committed by GitHub
parent 5e9e52c8dd
commit 5989b3661e
4 changed files with 31 additions and 25 deletions
@@ -307,7 +307,7 @@ describe("CalendarPopover - Tabs Scenarios", () => {
}); });
it("copies CalDAV link from Access tab", async () => { it("copies CalDAV link from Access tab", async () => {
window.CALENDAR_BASE_URL = "https://cal.example.org"; window.DAV_BASE_URL = "https://cal.example.org";
Object.assign(navigator, { Object.assign(navigator, {
clipboard: { writeText: jest.fn() }, clipboard: { writeText: jest.fn() },
}); });
@@ -441,7 +441,7 @@ describe("CalendarPopover - Tabs Scenarios", () => {
}); });
it("fetches and resets the secret link", async () => { it("fetches and resets the secret link", async () => {
window.CALENDAR_BASE_URL = "https://cal.example.org"; window.DAV_BASE_URL = "https://cal.example.org";
(getSecretLink as jest.Mock) (getSecretLink as jest.Mock)
.mockResolvedValueOnce({ .mockResolvedValueOnce({
+1
View File
@@ -6,6 +6,7 @@ var SSO_RESPONSE_TYPE = "code";
var SSO_CODE_CHALLENGE_METHOD = "S256"; var SSO_CODE_CHALLENGE_METHOD = "S256";
var SSO_POST_LOGOUT_REDIRECT = "http://example.com?logout=1"; var SSO_POST_LOGOUT_REDIRECT = "http://example.com?logout=1";
var CALENDAR_BASE_URL = "https://calendar.example.com"; var CALENDAR_BASE_URL = "https://calendar.example.com";
var DAV_BASE_URL = "https://dav.example.com";
var MAIL_SPA_URL = "https://mail.example.com"; var MAIL_SPA_URL = "https://mail.example.com";
var VIDEO_CONFERENCE_BASE_URL = "https://meet.linagora.com"; var VIDEO_CONFERENCE_BASE_URL = "https://meet.linagora.com";
var DEBUG = false; var DEBUG = false;
+7 -3
View File
@@ -22,7 +22,7 @@ import { SnackbarAlert } from "../Loading/SnackBarAlert";
export function AccessTab({ calendar }: { calendar: Calendar }) { export function AccessTab({ calendar }: { calendar: Calendar }) {
const { t } = useI18n(); const { t } = useI18n();
const calDAVLink = `${window.CALENDAR_BASE_URL}${calendar.link.replace(".json", "")}`; const calDAVLink = `${window.DAV_BASE_URL}${calendar.link.replace(".json", "")}`;
const [secretLink, setSecretLink] = useState(""); const [secretLink, setSecretLink] = useState("");
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
@@ -82,6 +82,7 @@ export function AccessTab({ calendar }: { calendar: Calendar }) {
return ( return (
<> <>
{!!window.DAV_BASE_URL && (
<FieldWithLabel label={t("calendar.caldav_access")} isExpanded={false}> <FieldWithLabel label={t("calendar.caldav_access")} isExpanded={false}>
<Box mt={2}> <Box mt={2}>
<TextField <TextField
@@ -94,7 +95,10 @@ export function AccessTab({ calendar }: { calendar: Calendar }) {
InputProps={{ InputProps={{
endAdornment: ( endAdornment: (
<InputAdornment position="end"> <InputAdornment position="end">
<IconButton onClick={() => handleCopy(calDAVLink)} edge="end"> <IconButton
onClick={() => handleCopy(calDAVLink)}
edge="end"
>
<ContentCopyIcon fontSize="small" /> <ContentCopyIcon fontSize="small" />
</IconButton> </IconButton>
</InputAdornment> </InputAdornment>
@@ -103,7 +107,7 @@ export function AccessTab({ calendar }: { calendar: Calendar }) {
/> />
</Box> </Box>
</FieldWithLabel> </FieldWithLabel>
)}
<FieldWithLabel label={t("calendar.secretUrl")} isExpanded={false}> <FieldWithLabel label={t("calendar.secretUrl")} isExpanded={false}>
<Box mt={3} display="flex" alignItems="center" gap={1}> <Box mt={3} display="flex" alignItems="center" gap={1}>
<TextField <TextField
+1
View File
@@ -15,6 +15,7 @@ declare global {
SSO_POST_LOGOUT_REDIRECT: string; SSO_POST_LOGOUT_REDIRECT: string;
CALENDAR_BASE_URL: string; CALENDAR_BASE_URL: string;
DAV_BASE_URL: string;
MAIL_SPA_URL: string; MAIL_SPA_URL: string;
VIDEO_CONFERENCE_BASE_URL: string; VIDEO_CONFERENCE_BASE_URL: string;