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 () => {
|
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({
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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,28 +82,32 @@ export function AccessTab({ calendar }: { calendar: Calendar }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<FieldWithLabel label={t("calendar.caldav_access")} isExpanded={false}>
|
{!!window.DAV_BASE_URL && (
|
||||||
<Box mt={2}>
|
<FieldWithLabel label={t("calendar.caldav_access")} isExpanded={false}>
|
||||||
<TextField
|
<Box mt={2}>
|
||||||
disabled
|
<TextField
|
||||||
fullWidth
|
disabled
|
||||||
label=""
|
fullWidth
|
||||||
inputProps={{ "aria-label": t("calendar.caldav_access") }}
|
label=""
|
||||||
value={calDAVLink}
|
inputProps={{ "aria-label": t("calendar.caldav_access") }}
|
||||||
size="small"
|
value={calDAVLink}
|
||||||
InputProps={{
|
size="small"
|
||||||
endAdornment: (
|
InputProps={{
|
||||||
<InputAdornment position="end">
|
endAdornment: (
|
||||||
<IconButton onClick={() => handleCopy(calDAVLink)} edge="end">
|
<InputAdornment position="end">
|
||||||
<ContentCopyIcon fontSize="small" />
|
<IconButton
|
||||||
</IconButton>
|
onClick={() => handleCopy(calDAVLink)}
|
||||||
</InputAdornment>
|
edge="end"
|
||||||
),
|
>
|
||||||
}}
|
<ContentCopyIcon fontSize="small" />
|
||||||
/>
|
</IconButton>
|
||||||
</Box>
|
</InputAdornment>
|
||||||
</FieldWithLabel>
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
</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
|
||||||
|
|||||||
Vendored
+1
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user