diff --git a/products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js b/products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js index f08af31289..96ffc760dd 100644 --- a/products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js +++ b/products/ASC.Files/Client/src/components/Article/Body/ThirdPartyList.js @@ -91,12 +91,10 @@ const ServiceItem = (props) => { const { capability, src, ...rest } = props; const capabilityName = capability[0]; - //const capabilityAuthKey = capability[1]; - const capabilityLink = capability[2] ? capability[2] : ""; + const capabilityLink = capability[1] ? capability[1] : ""; const dataProps = { "data-link": capabilityLink, - //"data-token": capabilityAuthKey, "data-title": capabilityName, }; diff --git a/products/ASC.Files/Client/src/components/dialogs/ConnectDialog/index.js b/products/ASC.Files/Client/src/components/dialogs/ConnectDialog/index.js index 47feeca24f..991d86c4d5 100644 --- a/products/ASC.Files/Client/src/components/dialogs/ConnectDialog/index.js +++ b/products/ASC.Files/Client/src/components/dialogs/ConnectDialog/index.js @@ -86,7 +86,7 @@ const PureConnectDialogContainer = (props) => { setSelectedNode, providers, } = props; - const { corporate, title, link, token, provider_id, provider_key } = item; + const { corporate, title, link, provider_id, provider_key } = item; const provider = providers.find( (el) => el.provider_key === item.provider_key @@ -98,7 +98,6 @@ const PureConnectDialogContainer = (props) => { const [passwordValue, setPasswordValue] = useState(""); const [customerTitle, setCustomerTitleValue] = useState(folderTitle); const [isCorporate, setMakeShared] = useState(!!corporate); - const [oAuthToken, setToken] = useState(token); const onChangeUrl = (e) => setUrlValue(e.target.value); const onChangeLogin = (e) => setLoginValue(e.target.value); @@ -110,10 +109,10 @@ const PureConnectDialogContainer = (props) => { onClose(); setIsLoading(true); saveThirdParty( - urlValue, - loginValue, - passwordValue, - oAuthToken, + null, + null, + null, + null, isCorporate, customerTitle, provider_key, @@ -127,9 +126,15 @@ const PureConnectDialogContainer = (props) => { const { pathParts, folders, foldersCount } = treeFolder; const newTreeFolders = treeFolders; - loopTreeFolders(pathParts, newTreeFolders, folders, foldersCount); - setUpdateTree(true); + loopTreeFolders( + pathParts, + newTreeFolders, + folders, + foldersCount, + folderData + ); setTreeFolders(newTreeFolders); + setUpdateTree(true); fetchThirdPartyProviders(); setSelectedNode([`${folderData.id}`]); fetchFiles(folderData.id); @@ -141,8 +146,8 @@ const PureConnectDialogContainer = (props) => { const onReconnect = () => { let authModal = window.open("", "Authorization", "height=600, width=1020"); - openConnectWindow(title, authModal).then((modal) => - getOAuthToken(modal).then((token) => setToken(token)) + openConnectWindow(title, authModal).then( + (modal) => getOAuthToken(modal) //.then((token) => setToken(token)) ); }; diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js index ec9293fa35..764bf043d3 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js @@ -390,8 +390,7 @@ class SectionBodyContent extends React.Component { ); const capability = { title: capabilityItem[0], - token: capabilityItem[1], - link: capabilityItem[2], + link: capabilityItem[1], }; const connectItem = { ...provider, ...capability }; diff --git a/products/ASC.Files/Client/src/components/pages/Settings/Section/Body/ConnectedClouds.js b/products/ASC.Files/Client/src/components/pages/Settings/Section/Body/ConnectedClouds.js index b1fac6cdec..9ec435ca2b 100644 --- a/products/ASC.Files/Client/src/components/pages/Settings/Section/Body/ConnectedClouds.js +++ b/products/ASC.Files/Client/src/components/pages/Settings/Section/Body/ConnectedClouds.js @@ -91,12 +91,10 @@ const ServiceItem = (props) => { const { capability, t, ...rest } = props; const capabilityName = capability[0]; - const capabilityAuthKey = capability[1]; - const capabilityLink = capability[2] ? capability[2] : ""; + const capabilityLink = capability[1] ? capability[1] : ""; const dataProps = { "data-link": capabilityLink, - "data-token": capabilityAuthKey, "data-title": capabilityName, }; @@ -152,6 +150,7 @@ class ConnectClouds extends React.Component { }; onShowService = (e) => { + console.log("onShowService", e.currentTarget.dataset); const selectedServiceData = e.currentTarget.dataset; const showAccountSettingDialog = !e.currentTarget.dataset.link; if (!showAccountSettingDialog) { @@ -216,8 +215,7 @@ class ConnectClouds extends React.Component { const selectedServiceData = { title: capabilitiesItem[0], - token: capabilitiesItem[1], - link: capabilitiesItem[2], + link: capabilitiesItem[1], corporate: providerItem.corporate, provider_id: providerItem.provider_id, provider_key: key, @@ -339,16 +337,15 @@ class ConnectClouds extends React.Component { element={element} contextOptions={[ { - key: index, + key: `${index}_change`, "data-key": item.provider_key, label: t("ThirdPartyInfo"), onClick: this.onChangeThirdPartyInfo, }, { - key: index, + key: `${index}_delete`, "data-id": item.provider_id, "data-title": item.customer_title, - //"data-provider-key": item.provider_key, label: t("DeleteThirdParty"), onClick: this.onDeleteThirdParty, }, diff --git a/products/ASC.Files/Client/src/store/files/actions.js b/products/ASC.Files/Client/src/store/files/actions.js index d3e60ebbef..4bb1cdf308 100644 --- a/products/ASC.Files/Client/src/store/files/actions.js +++ b/products/ASC.Files/Client/src/store/files/actions.js @@ -1689,9 +1689,13 @@ export function itemOperationToFolder( } export function fetchThirdPartyCapabilities(dispatch) { - return files - .getThirdPartyCapabilities() - .then((data) => dispatch(setThirdPartyCapabilities(data))); + return files.getThirdPartyCapabilities().then((data) => { + for (let item of data) { + item.splice(1, 1); + } + + dispatch(setThirdPartyCapabilities(data)); + }); } export function fetchThirdPartyProviders() { diff --git a/products/ASC.Files/Client/src/store/files/selectors.js b/products/ASC.Files/Client/src/store/files/selectors.js index a56dcc0efb..c6b448d76d 100644 --- a/products/ASC.Files/Client/src/store/files/selectors.js +++ b/products/ASC.Files/Client/src/store/files/selectors.js @@ -275,7 +275,7 @@ export const createTreeFolders = (pathParts, filterData) => { }; const renameTreeFolder = (folders, newItems, currentFolder) => { - const newItem = folders.find((x) => x.id === currentFolder.id); + const newItem = folders.find((x) => x.id + "" === currentFolder.id); const oldItemIndex = newItems.folders.findIndex( (x) => x.id === currentFolder.id );