-
+
+
+
+
+
Laserfiche
+
+
+
+
+
+
{!(missingFields?.length > 0) && }
{missingFields?.length > 0 && (
)}
+
+
+
+
);
}
@@ -456,7 +487,7 @@ function MissingFieldsDialog(props: { missingFields: JSX.Element[] }) {
return (
-
{textInside}
+
{textInside}
);
}
diff --git a/src/extensions/savetoLaserfiche/SaveDocumentToLaserfiche.ts b/src/extensions/savetoLaserfiche/SaveDocumentToLaserfiche.ts
index c62040a..8d45b38 100644
--- a/src/extensions/savetoLaserfiche/SaveDocumentToLaserfiche.ts
+++ b/src/extensions/savetoLaserfiche/SaveDocumentToLaserfiche.ts
@@ -6,6 +6,7 @@ import {
FieldToUpdate,
ValueToUpdate,
PutFieldValsRequest,
+ Entry,
} from '@laserfiche/lf-repository-api-client';
import { RepositoryClientExInternal } from '../../repository-client/repository-client';
import { IRepositoryApiClientExInternal } from '../../repository-client/repository-client-types';
@@ -21,6 +22,7 @@ export interface SavedToLaserficheDocumentData {
fileLink: string;
pathBack: string;
metadataSaved: boolean;
+ fileName: string;
}
export class SaveDocumentToLaserfiche {
@@ -68,7 +70,10 @@ export class SaveDocumentToLaserfiche {
const spFileUrl = this.spFileMetadata.fileUrl;
const fileNameWithExt = this.spFileMetadata.fileName;
const encodedFileName = encodeURIComponent(fileNameWithExt);
- const encodedSpFileUrl = spFileUrl?.replace(fileNameWithExt, encodedFileName);
+ const encodedSpFileUrl = spFileUrl?.replace(
+ fileNameWithExt,
+ encodedFileName
+ );
const fullSPDataUrl = window.location.origin + encodedSpFileUrl;
try {
const res = await fetch(fullSPDataUrl, {
@@ -153,7 +158,8 @@ export class SaveDocumentToLaserfiche {
filenameWithoutExt
);
fileName = docNameReplacedWithFileName;
- fileNameInEdoc = docNameReplacedWithFileName + `.${fileExtensionWithPeriod}`;
+ fileNameInEdoc =
+ docNameReplacedWithFileName + `.${fileExtensionWithPeriod}`;
extension = fileExtensionWithPeriod;
}
const electronicDocument: FileParameter = {
@@ -176,9 +182,9 @@ export class SaveDocumentToLaserfiche {
const entryId = entryCreateResult.operations.entryCreate.entryId ?? 1;
const fileLink = getEntryWebAccessUrl(
entryId.toString(),
- repoId,
webClientUrl,
- false
+ false,
+ repoId
);
const fileUrl = this.spFileMetadata.fileUrl;
const fileUrlWithoutDocName = fileUrl.slice(0, fileUrl.lastIndexOf('/'));
@@ -193,8 +199,20 @@ export class SaveDocumentToLaserfiche {
} else {
// TODO what should happen?
}
+ const fileInfo: SavedToLaserficheDocumentData = {
+ fileLink,
+ pathBack: path,
+ metadataSaved: true,
+ fileName,
+ };
- return { fileLink, pathBack: path, metadataSaved: true };
+ await this.tryUpdateFileNameAsync(
+ repoClient,
+ repoId,
+ entryCreateResult,
+ fileInfo
+ );
+ return fileInfo;
} catch (error) {
const conflict409 =
error.operations.setFields.exceptions[0].statusCode === 409;
@@ -203,9 +221,9 @@ export class SaveDocumentToLaserfiche {
const fileLink = getEntryWebAccessUrl(
entryId.toString(),
- repoId,
webClientUrl,
- false
+ false,
+ repoId
);
const fileUrl = this.spFileMetadata.fileUrl;
const fileUrlWithoutDocName = fileUrl.slice(
@@ -214,7 +232,15 @@ export class SaveDocumentToLaserfiche {
);
const path = window.location.origin + fileUrlWithoutDocName;
window.localStorage.removeItem(SP_LOCAL_STORAGE_KEY);
- return { fileLink, pathBack: path, metadataSaved: false };
+ const fileInfo: SavedToLaserficheDocumentData = {
+ fileLink,
+ pathBack: path,
+ metadataSaved: false,
+ fileName,
+ };
+
+ await this.tryUpdateFileNameAsync(repoClient, repoId, error, fileInfo);
+ return fileInfo;
} else {
window.alert(`Error uploading file: ${JSON.stringify(error)}`);
window.localStorage.removeItem(SP_LOCAL_STORAGE_KEY);
@@ -283,16 +309,28 @@ export class SaveDocumentToLaserfiche {
const entryId = entryCreateResult.operations.entryCreate.entryId;
const fileLink = getEntryWebAccessUrl(
entryId.toString(),
- repoId,
webClientUrl,
- false
+ false,
+ repoId
);
const fileUrl = this.spFileMetadata.fileUrl;
const fileUrlWithoutDocName = fileUrl.slice(0, fileUrl.lastIndexOf('/'));
const path = window.location.origin + fileUrlWithoutDocName;
window.localStorage.removeItem(SP_LOCAL_STORAGE_KEY);
- return { fileLink, pathBack: path, metadataSaved: true };
+ const fileInfo: SavedToLaserficheDocumentData = {
+ fileLink,
+ pathBack: path,
+ metadataSaved: true,
+ fileName: fileNameWithExt,
+ };
+ await this.tryUpdateFileNameAsync(
+ repoClient,
+ repoId,
+ entryCreateResult,
+ fileInfo
+ );
+ return fileInfo;
} catch (error) {
window.alert(`Error uploading file: ${JSON.stringify(error)}`);
window.localStorage.removeItem(SP_LOCAL_STORAGE_KEY);
@@ -300,6 +338,24 @@ export class SaveDocumentToLaserfiche {
}
}
+ private async tryUpdateFileNameAsync(
+ repoClient: IRepositoryApiClientExInternal,
+ repoId: string,
+ entryCreateResult: CreateEntryResult,
+ fileInfo: SavedToLaserficheDocumentData
+ ) {
+ try {
+ const entryInfo: Entry = await repoClient.entriesClient.getEntry({
+ repoId,
+ entryId: entryCreateResult.operations.entryCreate.entryId,
+ });
+
+ fileInfo.fileName = entryInfo.name;
+ } catch {
+ // do nothing, keep default file name
+ }
+ }
+
async deleteSPFileAsync() {
const encodedFileName = encodeURIComponent(this.spFileMetadata.fileName);
const spUrlWithEncodedFileName = this.spFileMetadata.fileUrl.replace(
@@ -349,7 +405,10 @@ export class SaveDocumentToLaserfiche {
}
}
- async replaceFileWithLinkAsync(filenameWithoutExt: string, docFileLink: string) {
+ async replaceFileWithLinkAsync(
+ filenameWithoutExt: string,
+ docFileLink: string
+ ) {
const resp = await fetch(
this.spFileMetadata.contextPageAbsoluteUrl + '/_api/contextinfo',
{
diff --git a/src/extensions/savetoLaserfiche/SaveToLaserficheDialog.tsx b/src/extensions/savetoLaserfiche/SaveToLaserficheDialog.tsx
index 4c8d04c..57417ba 100644
--- a/src/extensions/savetoLaserfiche/SaveToLaserficheDialog.tsx
+++ b/src/extensions/savetoLaserfiche/SaveToLaserficheDialog.tsx
@@ -3,8 +3,14 @@ import { LfLoginComponent } from '@laserfiche/types-lf-ui-components';
import * as React from 'react';
import { ISPDocumentData } from '../../Utils/Types';
import { clientId } from '../../webparts/constants';
-import LoadingDialog, { SavedToLaserficheSuccessDialog } from './CommonDialogs';
-import { SaveDocumentToLaserfiche } from './SaveDocumentToLaserfiche';
+import LoadingDialog, {
+ SavedToLaserficheSuccessDialogButtons,
+ SavedToLaserficheSuccessDialogText,
+} from './CommonDialogs';
+import {
+ SaveDocumentToLaserfiche,
+ SavedToLaserficheDocumentData,
+} from './SaveDocumentToLaserfiche';
import styles from './SendToLaserFiche.module.scss';
import { SPComponentLoader } from '@microsoft/sp-loader';
import * as ReactDOM from 'react-dom';
@@ -18,16 +24,18 @@ export default class SaveToLaserficheCustomDialog extends BaseDialog {
this.successful = successful;
};
- closeClick = async () => {
+ closeClick = async (success?: SavedToLaserficheDocumentData) => {
await this.close();
if (this.closeParent) {
- await this.closeParent();
+ await this.closeParent(success);
}
};
constructor(
private spFileData: ISPDocumentData,
- private closeParent?: () => Promise
+ private closeParent?: (
+ success?: SavedToLaserficheDocumentData
+ ) => Promise
) {
super();
}
@@ -56,7 +64,7 @@ export default class SaveToLaserficheCustomDialog extends BaseDialog {
function SaveToLaserficheDialog(props: {
successSave: (success: boolean) => void;
- closeClick: () => Promise;
+ closeClick: (success?: SavedToLaserficheDocumentData) => Promise;
spFileMetadata: ISPDocumentData;
}) {
const loginComponent = React.createRef<
@@ -65,11 +73,11 @@ function SaveToLaserficheDialog(props: {
const region = getRegion();
const [success, setSuccess] = React.useState<
- { fileLink: string; pathBack: string; metadataSaved: boolean } | undefined
+ SavedToLaserficheDocumentData | undefined
>();
const saveToDialogCloseClick = async () => {
- await props.closeClick();
+ await props.closeClick(success);
};
React.useEffect(() => {
@@ -100,31 +108,47 @@ function SaveToLaserficheDialog(props: {
}, []);
return (
-
-
-
-
-
+
+
+
+
+
+
Laserfiche
+
+
+
+
+
+
+ {!success && }
+ {success && (
+
+ )}
- {!success &&
}
- {success && (
-
+
- )}
- {/* TODO error dialog */}
+
);
}
diff --git a/src/extensions/savetoLaserfiche/SendToLaserFiche.module.scss b/src/extensions/savetoLaserfiche/SendToLaserFiche.module.scss
index 403af45..1f331c6 100644
--- a/src/extensions/savetoLaserfiche/SendToLaserFiche.module.scss
+++ b/src/extensions/savetoLaserfiche/SendToLaserFiche.module.scss
@@ -1,50 +1,100 @@
@import '~@fluentui/react/dist/sass/References.scss';
-.overlay {
- position: relative;
- display: block;
- opacity: 0;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- width: 50%;
- height: 100%;
- z-index: 1;
- background-color: rgb(46, 44, 44);
-}
-.maindialog {
- background-color: white;
- padding: 20px;
- transition: all 5s ease-in-out;
- max-height: fit-content;
-}
-.text {
- position: relative;
- font-size: 16px;
- color: black;
- //z-index: 4;
- //text-align: center;
-}
-.button {
- color: #178080;
- margin-left: 200px;
- font-weight: bold;
+.actionButton {
+ margin-right: 10px;
+}
+
+.wrapper {
+ display: flex;
+ flex-direction: column;
+ max-height: calc(100vh - 50px);
+ min-width: 400px;
+}
+
+.header {
display: flex;
- flex-direction: row-reverse;
-}
-.button1 {
- //font-weight: bold;
- color: black;
- font-size: 15px;
-}
-.button2 {
- //font-weight: bold;
- color: rgb(8, 8, 8);
- font-size: 15px;
- margin-right: 16px;
-}
-.href {
- font-weight: bold;
- color: rgb(9, 34, 172);
+ justify-content: space-between;
+ border-bottom: 1px solid #e0e0e0;
+ min-height: var(--header-min-height, 50px);
+ color: #606060;
+ background-color: #fafafa;
+ /* default is the standard padding, but expose variables
+ in case contents have additional padding */
+ padding-top: var(--header-padding-top, 13px);
+ padding-bottom: var(--header-padding-bottom, 13px);
+ padding-left: var(--header-padding-left, 20px);
+ padding-right: var(--header-padding-right, 20px);
+
+ /* automatically accommodates for padding */
+ box-sizing: border-box;
+ height: 55px;
+ /* 50px - padding */
+ line-height: 24px;
+ align-items: center;
+}
+
+.contentBox {
+ width: 100%;
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ font-weight: 400;
+ box-sizing: border-box;
+ overflow: auto;
+ background-color: #fafafa;
+ min-height: 80px;
+ /* default is the standard padding, but expose variables
+ in case contents have additional padding */
+ padding-top: var(--content-padding-top, 20px);
+ padding-bottom: var(--content-padding-bottom, 20px);
+ padding-left: var(--content-padding-left, 20px);
+ padding-right: var(--content-padding-right, 20px);
+ max-height: calc(100vh - var(--header-min-height) - var(--footer-min-height));
+}
+
+.footer {
+ width: 100%;
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+ min-height: var(--footer-min-height, 50px);
+ border-top: 1px solid #e0e0e0;
+ background-color: #fafafa;
+ /* default is the standard padding, but expose variables
+ in case contents have additional padding */
+ padding-top: var(--footer-padding-top, 10px);
+ padding-bottom: var(--footer-padding-bottom, 10px);
+ padding-left: var(--footer-padding-left, 20px);
+ padding-right: var(--footer-padding-right, 20px);
+
+ /* automatically accommodates for padding */
+ box-sizing: border-box;
+ height: 55px;
+ /* 50px - padding */
+ line-height: 30px;
+}
+
+.lfCloseButton {
+ cursor: pointer;
+ display: flex;
+ height: 24px;
+ width: 24px;
+ align-items: center;
+ border: none;
+ background: inherit;
+ justify-content: center;
+ color: #646464;
+}
+
+.logoHeader {
+ display: flex;
+ height: 100%;
+ align-items: center;
+ justify-content: center;
+}
+
+.dialogTitle {
+ padding-left: 10px;
}
diff --git a/src/webparts/LaserficheRepositoryAccessWebPart/components/RepositoryViewWebPart.tsx b/src/webparts/LaserficheRepositoryAccessWebPart/components/RepositoryViewWebPart.tsx
index 2661ede..7838693 100644
--- a/src/webparts/LaserficheRepositoryAccessWebPart/components/RepositoryViewWebPart.tsx
+++ b/src/webparts/LaserficheRepositoryAccessWebPart/components/RepositoryViewWebPart.tsx
@@ -217,9 +217,9 @@ function RepositoryBrowserToolbar(props: {
if (props.selectedItem?.id) {
const webClientNodeUrl = getEntryWebAccessUrl(
props.selectedItem.id,
- repoId,
props.webClientUrl,
- props.selectedItem.isContainer
+ props.selectedItem.isContainer,
+ repoId
);
window.open(webClientNodeUrl);
} else {
diff --git a/src/webparts/laserficheAdminConfiguration/components/ProfileConfigurationComponents.tsx b/src/webparts/laserficheAdminConfiguration/components/ProfileConfigurationComponents.tsx
index 46352e5..f800d85 100644
--- a/src/webparts/laserficheAdminConfiguration/components/ProfileConfigurationComponents.tsx
+++ b/src/webparts/laserficheAdminConfiguration/components/ProfileConfigurationComponents.tsx
@@ -228,6 +228,7 @@ export function RepositoryBrowserModal(props: {
NgElement & WithProperties
> = React.useRef();
let lfRepoTreeService: LfRepoTreeNodeService;
+
React.useEffect(() => {
if (props.repoClient) {
lfRepoTreeService = new LfRepoTreeNodeService(props.repoClient);
@@ -238,6 +239,7 @@ export function RepositoryBrowserModal(props: {
initializeTreeAsync();
}
}, [props.repoClient]);
+
const isNodeSelectable = (node: LfRepoTreeNode) => {
if (node?.entryType == EntryType.Folder) {
return true;
diff --git a/src/webparts/sendToLaserficheLoginComponent/components/SendToLaserficheLoginComponent.module.scss b/src/webparts/sendToLaserficheLoginComponent/components/SendToLaserficheLoginComponent.module.scss
index 34fb903..9c814d7 100644
--- a/src/webparts/sendToLaserficheLoginComponent/components/SendToLaserficheLoginComponent.module.scss
+++ b/src/webparts/sendToLaserficheLoginComponent/components/SendToLaserficheLoginComponent.module.scss
@@ -1,49 +1,31 @@
-.overlay {
- position: relative;
- display: block;
- opacity: 0;
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- width: 50%;
- height: 100%;
- z-index: 1;
- background-color: rgb(46, 44, 44);
-}
-.maindialog {
- background-color: white;
- padding: 30px;
- transition: all 5s ease-in-out;
- max-height: fit-content;
-}
-.text {
- position: relative;
- font-size: 16px;
- color: black;
- //z-index: 4;
- text-align: center;
-}
-.button {
- color: #178080;
- margin-left: 200px;
+.signInHeaderText {
+ margin-left: 10px;
+ font-size: 22px;
font-weight: bold;
- writing-mode: tb;
+}
+
+.signInHeader {
+ border-bottom: 3px solid #ce7a14;
+ margin-block-end: 32px;
display: flex;
- flex-direction: column;
+ align-items: center;
}
-.button1 {
- //font-weight: bold;
- color: black;
- font-size: 15px;
+
+.laserficheLogo {
+ height: 30px;
+ width: 30px;
}
-.button2 {
- //font-weight: bold;
- color: rgb(8, 8, 8);
- font-size: 15px;
- margin-right: 16px;
+
+.signInLabel {
+ text-align: center;
+ font-size: 16px;
}
-.href {
- font-weight: bold;
- color: rgb(9, 34, 172);
+
+.loginButton {
+ text-align: center;
+}
+
+.signInFooter {
+ margin-top: 35px;
+ text-align: center;
}
diff --git a/src/webparts/sendToLaserficheLoginComponent/components/SendToLaserficheLoginComponent.tsx b/src/webparts/sendToLaserficheLoginComponent/components/SendToLaserficheLoginComponent.tsx
index 3eaf85c..210c929 100644
--- a/src/webparts/sendToLaserficheLoginComponent/components/SendToLaserficheLoginComponent.tsx
+++ b/src/webparts/sendToLaserficheLoginComponent/components/SendToLaserficheLoginComponent.tsx
@@ -10,7 +10,8 @@ import { NgElement, WithProperties } from '@angular/elements';
import { ISendToLaserficheLoginComponentProps } from './ISendToLaserficheLoginComponentProps';
import { ISPDocumentData } from '../../../Utils/Types';
import SaveToLaserficheCustomDialog from '../../../extensions/savetoLaserfiche/SaveToLaserficheDialog';
-import { getRegion } from '../../../Utils/Funcs';
+import { getEntryWebAccessUrl, getRegion } from '../../../Utils/Funcs';
+import styles from './SendToLaserficheLoginComponent.module.scss';
declare global {
// eslint-disable-next-line
@@ -22,6 +23,12 @@ declare global {
}
}
+const SIGN_IN = 'Sign In';
+const SIGN_OUT = 'Sign Out';
+const CANCEL = 'Cancel';
+const NOTE_THIS_PAGE_ONLY_NEEDED_WHEN_SAVING_TO_LASERFICHE =
+ '*Note: This page should only be needed if you are attempting to save a document to Laserfiche.';
+
export default function SendToLaserficheLoginComponent(
props: ISendToLaserficheLoginComponentProps
) {
@@ -37,52 +44,76 @@ export default function SendToLaserficheLoginComponent(
window.localStorage.getItem(SP_LOCAL_STORAGE_KEY)
) as ISPDocumentData;
+ let webClientUrl: string | undefined;
+ if (loggedIn) {
+ webClientUrl = getEntryWebAccessUrl(
+ '1',
+ loginComponent.current?.account_endpoints.webClientUrl,
+ true
+ );
+ }
+ const loginText: JSX.Element | undefined = getLoginText();
+
React.useEffect(() => {
- SPComponentLoader.loadScript(
- 'https://cdn.jsdelivr.net/npm/zone.js@0.11.4/bundles/zone.umd.min.js'
- ).then(() => {
- SPComponentLoader.loadScript(
+ const setUpLoginComponent = async () => {
+ SPComponentLoader.loadCss(
+ 'https://cdn.jsdelivr.net/npm/@laserfiche/lf-ui-components@14/cdn/indigo-pink.css'
+ );
+ SPComponentLoader.loadCss(
+ 'https://cdn.jsdelivr.net/npm/@laserfiche/lf-ui-components@14/cdn/lf-ms-office-lite.css'
+ );
+ await SPComponentLoader.loadScript(
+ 'https://cdn.jsdelivr.net/npm/zone.js@0.11.4/bundles/zone.umd.min.js'
+ );
+ await SPComponentLoader.loadScript(
'https://cdn.jsdelivr.net/npm/@laserfiche/lf-ui-components@14/cdn/lf-ui-components.js'
- ).then(() => {
- SPComponentLoader.loadCss(
- 'https://cdn.jsdelivr.net/npm/@laserfiche/lf-ui-components@14/cdn/indigo-pink.css'
- );
- SPComponentLoader.loadCss(
- 'https://cdn.jsdelivr.net/npm/@laserfiche/lf-ui-components@14/cdn/lf-ms-office-lite.css'
- );
- loginComponent.current.addEventListener(
- 'loginCompleted',
- loginCompleted
- );
- loginComponent.current.addEventListener(
- 'logoutCompleted',
- logoutCompleted
- );
+ );
+ loginComponent.current.addEventListener('loginCompleted', loginCompleted);
+ loginComponent.current.addEventListener(
+ 'logoutCompleted',
+ logoutCompleted
+ );
+
+ const isLoggedIn: boolean =
+ loginComponent.current.state === LoginState.LoggedIn;
- const loggedIn: boolean =
- loginComponent.current.state === LoginState.LoggedIn;
+ setLoggedIn(isLoggedIn);
- if (loggedIn && spFileMetadata) {
- const dialog = new SaveToLaserficheCustomDialog(spFileMetadata);
-
- dialog.show().then(() => {
- if (!dialog.successful) {
- console.warn('Could not login successfully');
+ if (isLoggedIn && spFileMetadata) {
+ const dialog = new SaveToLaserficheCustomDialog(
+ spFileMetadata,
+ async (success) => {
+ if (success) {
+ Navigation.navigate(success.pathBack, true);
}
- });
+ }
+ );
+
+ await dialog.show();
+ if (!dialog.successful) {
+ console.warn('Could not login successfully');
}
- });
- });
+ }
+ };
+
+ setUpLoginComponent();
}, []);
- const loginCompleted = () => {
+ const loginCompleted = async () => {
+ setLoggedIn(true);
if (spFileMetadata) {
- const dialog = new SaveToLaserficheCustomDialog(spFileMetadata);
- dialog.show().then(() => {
- if (!dialog.successful) {
- console.warn('Could not login successfully');
+ const dialog = new SaveToLaserficheCustomDialog(
+ spFileMetadata,
+ async (success) => {
+ if (success) {
+ Navigation.navigate(success.pathBack, true);
+ }
}
- });
+ );
+ await dialog.show();
+ if (!dialog.successful) {
+ console.warn('Could not login successfully');
+ }
}
};
@@ -92,39 +123,79 @@ export default function SendToLaserficheLoginComponent(
props.context.pageContext.web.absoluteUrl + props.laserficheRedirectUrl;
};
- function Redirect() {
+ function getLoginText() {
+ let loginText: JSX.Element | undefined;
+ if (!spFileMetadata) {
+ loginText = (
+ <>
+ {NOTE_THIS_PAGE_ONLY_NEEDED_WHEN_SAVING_TO_LASERFICHE}
+ {loggedIn ? (
+
+ {'Welcome to Laserfiche.'}
+ {webClientUrl && (
+ <>
+ {' Go to '}
+
+ your Laserfiche repository
+
+ >
+ )}
+
+ ) : (
+
+ You are not signed in. You can sign in using the button below.
+
+ )}
+ >
+ );
+ } else if (spFileMetadata?.fileUrl && !loggedIn) {
+ loginText = (
+ <>
+
+ {`You are not signed in. Please sign in to continue saving ${spFileMetadata?.fileName}.`}
+
+
+ >
+ );
+ } else if (spFileMetadata?.fileUrl && loggedIn) {
+ loginText = (
+ <>
+
+ {`You are now signed in. Attempting to save ${spFileMetadata?.fileName}.`}
+
+
+ >
+ );
+ } else {
+ {NOTE_THIS_PAGE_ONLY_NEEDED_WHEN_SAVING_TO_LASERFICHE}
;
+ }
+ return loginText;
+ }
+
+ function redirect() {
const spFileUrl = spFileMetadata.fileUrl;
const fileNameWithExtension = spFileMetadata.fileName;
- const spFileUrlWithoutFileName = spFileUrl.replace(fileNameWithExtension, '');
+ const spFileUrlWithoutFileName = spFileUrl.replace(
+ fileNameWithExtension,
+ ''
+ );
const path = window.location.origin + spFileUrlWithoutFileName;
+ window.localStorage.removeItem(SP_LOCAL_STORAGE_KEY);
Navigation.navigate(path, true);
}
return (
-
+
-
- {loggedIn ? 'Sign Out' : 'Sign In'}
-
+
Laserfiche
-
- {loggedIn ? 'You are signed in to Laserfiche' : 'Welcome to Laserfiche'}
-
-
+
+
{loginText}
+
-
-
-
-
+ )}
);