Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -307,7 +307,7 @@ describe("CalendarPopover - Tabs Scenarios", () => {
|
||||
});
|
||||
|
||||
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, {
|
||||
clipboard: { writeText: jest.fn() },
|
||||
});
|
||||
@@ -441,7 +441,7 @@ describe("CalendarPopover - Tabs Scenarios", () => {
|
||||
});
|
||||
|
||||
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)
|
||||
.mockResolvedValueOnce({
|
||||
|
||||
@@ -6,6 +6,7 @@ var SSO_RESPONSE_TYPE = "code";
|
||||
var SSO_CODE_CHALLENGE_METHOD = "S256";
|
||||
var SSO_POST_LOGOUT_REDIRECT = "http://example.com?logout=1";
|
||||
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 VIDEO_CONFERENCE_BASE_URL = "https://meet.linagora.com";
|
||||
var DEBUG = false;
|
||||
|
||||
@@ -22,7 +22,7 @@ import { SnackbarAlert } from "../Loading/SnackBarAlert";
|
||||
|
||||
export function AccessTab({ calendar }: { calendar: Calendar }) {
|
||||
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 [open, setOpen] = useState(false);
|
||||
@@ -82,28 +82,32 @@ export function AccessTab({ calendar }: { calendar: Calendar }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<FieldWithLabel label={t("calendar.caldav_access")} isExpanded={false}>
|
||||
<Box mt={2}>
|
||||
<TextField
|
||||
disabled
|
||||
fullWidth
|
||||
label=""
|
||||
inputProps={{ "aria-label": t("calendar.caldav_access") }}
|
||||
value={calDAVLink}
|
||||
size="small"
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconButton onClick={() => handleCopy(calDAVLink)} edge="end">
|
||||
<ContentCopyIcon fontSize="small" />
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
</FieldWithLabel>
|
||||
|
||||
{!!window.DAV_BASE_URL && (
|
||||
<FieldWithLabel label={t("calendar.caldav_access")} isExpanded={false}>
|
||||
<Box mt={2}>
|
||||
<TextField
|
||||
disabled
|
||||
fullWidth
|
||||
label=""
|
||||
inputProps={{ "aria-label": t("calendar.caldav_access") }}
|
||||
value={calDAVLink}
|
||||
size="small"
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<IconButton
|
||||
onClick={() => handleCopy(calDAVLink)}
|
||||
edge="end"
|
||||
>
|
||||
<ContentCopyIcon fontSize="small" />
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
</FieldWithLabel>
|
||||
)}
|
||||
<FieldWithLabel label={t("calendar.secretUrl")} isExpanded={false}>
|
||||
<Box mt={3} display="flex" alignItems="center" gap={1}>
|
||||
<TextField
|
||||
|
||||
Vendored
+1
@@ -15,6 +15,7 @@ declare global {
|
||||
SSO_POST_LOGOUT_REDIRECT: string;
|
||||
|
||||
CALENDAR_BASE_URL: string;
|
||||
DAV_BASE_URL: string;
|
||||
MAIL_SPA_URL: string;
|
||||
VIDEO_CONFERENCE_BASE_URL: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user