Merge pull request #933 from ONLYOFFICE/feature/shared-redesign-third-party

Feature/shared redesign third party
This commit is contained in:
Alexey Safronov 2022-10-20 14:32:47 +03:00 committed by GitHub
commit 5f2fbb74db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 643 additions and 104 deletions

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.8589 10.9925C16.0587 11.2839 16.0187 11.6586 15.779 11.8667C15.4994 12.0749 15.0999 12.0333 14.9002 11.7835L13.502 9.91022L12.1438 11.7419C11.9441 12.0333 11.5446 12.0333 11.265 11.8251C10.9854 11.617 10.9454 11.2423 11.1452 10.9509L12.743 8.78629L11.1452 6.62162C10.9454 6.33022 11.0254 5.91394 11.265 5.70581C11.5446 5.49767 11.9441 5.58093 12.1438 5.83069L13.502 7.70397L14.9002 5.91394C15.0999 5.62255 15.4595 5.58093 15.779 5.78906C16.0587 5.9972 16.0587 6.41348 15.8589 6.70488L14.301 8.8279L15.8589 10.9925ZM8.58857 10.7427C7.54996 10.7427 6.71105 9.91022 6.71105 8.8279C6.71105 7.78719 7.54996 6.91298 8.58857 6.91298C9.62719 6.91298 10.4661 7.78719 10.4661 8.8279C10.4262 9.91022 9.58726 10.7427 8.58857 10.7427ZM3.07591 10.7427C2.03729 10.7427 1.19841 9.91022 1.19841 8.8279C1.19841 7.78719 2.03729 6.91298 3.07591 6.91298C4.11453 6.91298 4.95341 7.78719 4.95341 8.8279C4.95341 9.91022 4.11453 10.7427 3.07591 10.7427ZM8.58857 5.66418C7.4301 5.66418 6.39151 6.33022 5.87219 7.32928C5.35288 6.33022 4.31426 5.66418 3.11586 5.66418C2.39681 5.66418 1.75766 5.91394 1.23836 6.2886V3.62442C1.23836 3.2914 0.958726 3 0.639148 3C0.279629 3 0 3.2914 0 3.62442V8.86951C0.0399491 10.6178 1.39814 11.9916 3.07591 11.9916C4.27432 11.9916 5.31294 11.2839 5.83225 10.2848C6.35156 11.2839 7.39017 11.9916 8.54865 11.9916C10.2663 11.9916 11.6645 10.5762 11.6645 8.78629C11.7044 7.07949 10.3063 5.66418 8.58857 5.66418Z" fill="#0061D5"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 1L0 3.62468L4 6.24936L0 8.87404L4 11.4987L8 8.87404L12 11.4987L16 8.87404L12 6.24936L16 3.62468L12 1L8 3.62468L4 1ZM8 3.62468L12 6.24936L8 8.87404L4 6.24936L8 3.62468Z" fill="#0061FE"/>
<path d="M8 9.75L4 12.3747L8 14.9994L12 12.3747L8 9.75Z" fill="#0061FE"/>
</svg>

After

Width:  |  Height:  |  Size: 415 B

View File

@ -0,0 +1,30 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_743_33362)">
<path d="M0 10.4629L2.54685 14.998H13.4526L15.9994 10.4629H0Z" fill="#4788F4"/>
<path d="M15.888 10.5286L13.415 14.9323H2.58546L2.58535 14.9321L2.54736 14.998H13.453L15.9999 10.4629L15.888 10.5286Z" fill="black" fill-opacity="0.1"/>
<path d="M5.15994 10.4629L5.12207 10.5286H15.8879L15.9999 10.4629H5.15994Z" fill="white" fill-opacity="0.2"/>
<path d="M5.15951 10.4629L7.77161 14.998H2.54736L5.15951 10.4629Z" fill="url(#paint0_linear_743_33362)"/>
<path d="M0 10.4645L2.54684 14.9996L10.6119 1H5.38755L0 10.4645Z" fill="#1EA362"/>
<path d="M7.9997 5.53426L2.54685 14.9996L0 10.4645L0.0751417 10.4648L2.54756 14.8673L7.96198 5.46875L7.9997 5.53426Z" fill="black" fill-opacity="0.1"/>
<path d="M0 10.4645L5.38755 1L5.4254 1.06573L0.0751417 10.4648L0 10.4645Z" fill="white" fill-opacity="0.2"/>
<path d="M7.61492 6.20364L8.00053 5.53427L5.38821 1L5.00488 1.67339L7.61492 6.20364Z" fill="url(#paint1_linear_743_33362)"/>
<path d="M5.3877 1H10.612L15.9995 10.4645H10.8401L5.3877 1Z" fill="#FFCF49"/>
<path d="M10.8401 10.4645L5.3877 1L5.50104 1.06573L10.9156 10.4645H10.8401Z" fill="black" fill-opacity="0.1"/>
<path d="M5.3877 1H10.612L15.9995 10.4645H15.9243L10.5741 1.06573H5.50104L5.3877 1Z" fill="white" fill-opacity="0.2"/>
</g>
<defs>
<linearGradient id="paint0_linear_743_33362" x1="3.86976" y1="12.6647" x2="7.78469" y2="14.9758" gradientUnits="userSpaceOnUse">
<stop stop-opacity="0.2"/>
<stop offset="0.116022" stop-opacity="0.13"/>
<stop offset="1" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint1_linear_743_33362" x1="6.82489" y1="3.25111" x2="5.85871" y2="3.78805" gradientUnits="userSpaceOnUse">
<stop stop-opacity="0.1"/>
<stop offset="0.19337" stop-opacity="0.04"/>
<stop offset="0.681779" stop-opacity="0"/>
</linearGradient>
<clipPath id="clip0_743_33362">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,14 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_743_33365)">
<path opacity="0.504232" fill-rule="evenodd" clip-rule="evenodd" d="M6.89884 0.0620607L8.2498 0.640118C8.45658 0.728587 8.61647 0.903445 8.68898 1.12048L9.22621 2.72751C9.31262 2.98621 9.52192 3.182 9.78141 3.24696L15.4025 4.65406C15.7532 4.74186 15.9999 5.06358 15.9999 5.43312V12.146C15.9999 12.5889 15.649 12.948 15.2163 12.948C15.1382 12.948 15.0605 12.9361 14.9859 12.9126L6.36612 10.1981C6.03735 10.0945 5.81299 9.78359 5.81299 9.43142V0.802025C5.81299 0.359076 6.16386 0 6.59661 0C6.70039 0 6.80313 0.0210928 6.89884 0.0620607Z" fill="#D0DFFF"/>
<path opacity="0.8" fill-rule="evenodd" clip-rule="evenodd" d="M4.93986 1.66558L6.29088 2.24363C6.49766 2.3321 6.65754 2.50696 6.73006 2.724L7.2672 4.33102C7.35369 4.58973 7.56299 4.78552 7.82249 4.85048L13.4435 6.25762C13.7942 6.34535 14.041 6.66712 14.041 7.03662V13.7495C14.041 14.1925 13.6901 14.5516 13.2574 14.5516C13.1792 14.5516 13.1016 14.5396 13.0269 14.5161L4.40717 11.8016C4.07837 11.698 3.854 11.3871 3.854 11.035V2.40554C3.854 1.9626 4.20484 1.60352 4.63762 1.60352C4.74138 1.60352 4.84412 1.62461 4.93986 1.66558Z" fill="#B3CAFF"/>
<path opacity="0.8" fill-rule="evenodd" clip-rule="evenodd" d="M12.0819 11.9974L14.0409 12.6144V7.03653C14.0409 6.66694 13.7942 6.34526 13.4434 6.25744L7.82244 4.85036C7.56294 4.7854 7.35365 4.58961 7.26715 4.3309L6.73001 2.72387C6.65749 2.50684 6.49761 2.33198 6.29083 2.24351L5.81299 2.03906V6.19939C5.82955 6.20476 5.84635 6.20958 5.86338 6.21384L11.4845 7.62097C11.8351 7.7087 12.0819 8.03047 12.0819 8.39997V11.9974Z" fill="#AAC4FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.98087 3.03081L4.33187 3.60887C4.53864 3.69734 4.6985 3.8722 4.77106 4.08923L5.3082 5.69626C5.39468 5.95496 5.60397 6.15075 5.86346 6.21571L11.4845 7.62284C11.8352 7.71066 12.0819 8.03234 12.0819 8.40184V15.1147C12.0819 15.5578 11.7311 15.9168 11.2983 15.9168C11.2203 15.9168 11.1425 15.9049 11.0678 15.8813L2.44817 13.1668C2.11938 13.0632 1.89502 12.7523 1.89502 12.4002V3.77078C1.89502 3.32783 2.24585 2.96875 2.67863 2.96875C2.78239 2.96875 2.88513 2.98984 2.98087 3.03081Z" fill="#1A47FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.993555 6.58589L9.69995 9.06121C9.96274 9.13587 10.1687 9.34511 10.2437 9.61364L11.8836 15.4883C11.9431 15.7013 11.8225 15.9233 11.6145 15.9841C11.5416 16.0054 11.4641 16.0046 11.3916 15.9818L2.27226 13.1099C2.03501 13.0352 1.84639 12.8498 1.76377 12.6103L0.0448891 7.6256C-0.0991528 7.20792 0.114921 6.74979 0.523017 6.60233C0.67451 6.54767 0.83877 6.54189 0.993555 6.58589Z" fill="#5287FF"/>
</g>
<defs>
<clipPath id="clip0_743_33365">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -0,0 +1,10 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_743_33368)">
<path d="M8.0122 4C6.35375 4 4.94807 5.12419 4.51241 6.64735C4.13377 5.83944 3.31325 5.27343 2.36815 5.27343C1.06841 5.27343 0 6.34173 0 7.64133C0 8.94093 1.06841 10.0097 2.36815 10.0097C3.31325 10.0097 4.13377 9.44333 4.51241 8.63527C4.94807 10.1585 6.35375 11.2831 8.0122 11.2831C9.6584 11.2831 11.0569 10.1755 11.5037 8.6694C11.8893 9.45913 12.6997 10.0097 13.6313 10.0097C14.9311 10.0097 16 8.94093 16 7.64133C16 6.34173 14.9311 5.27343 13.6313 5.27343C12.6997 5.27343 11.8893 5.82364 11.5037 6.6132C11.0569 5.10723 9.6584 4 8.0122 4ZM8.0122 5.39C9.26413 5.39 10.2643 6.38952 10.2643 7.64133C10.2643 8.89313 9.26413 9.89313 8.0122 9.89313C6.76027 9.89313 5.76063 8.89313 5.76063 7.64133C5.76063 6.38952 6.76027 5.39 8.0122 5.39ZM2.36815 6.66344C2.91665 6.66344 3.34663 7.09287 3.34663 7.64133C3.34663 8.18973 2.91665 8.61967 2.36815 8.61967C1.81965 8.61967 1.39016 8.18973 1.39016 7.64133C1.39016 7.09287 1.81965 6.66344 2.36815 6.66344ZM13.6313 6.66344C14.1799 6.66344 14.6099 7.09287 14.6099 7.64133C14.6099 8.18973 14.1799 8.61967 13.6313 8.61967C13.0829 8.61967 12.6534 8.18973 12.6534 7.64133C12.6534 7.09287 13.0829 6.66344 13.6313 6.66344Z" fill="#0082C9"/>
</g>
<defs>
<clipPath id="clip0_743_33368">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0.167772 10.1745C0.448625 10.7175 1.04755 11.1922 1.61279 11.32C1.81728 11.3662 3.29631 11.381 3.34229 11.3372C3.36027 11.3201 3.32873 11.2199 3.2722 11.1146C3.12227 10.8351 3.01425 10.3471 3.0141 9.94821C3.01362 8.8525 3.70758 7.99615 4.89652 7.62536C5.28055 7.50557 5.37046 7.45283 5.37046 7.34722C5.37046 7.19839 5.6541 6.59879 5.87654 6.2774C6.18858 5.82659 6.6017 5.48066 7.11573 5.2397C8.40254 4.63657 9.91619 4.82721 10.8437 5.70922L11.1726 6.02204L11.5331 5.93268C11.7314 5.88354 11.9585 5.84204 12.0377 5.84046C12.2193 5.83684 12.227 5.71402 12.073 5.27547C11.5911 3.90289 10.2881 3.00354 8.77613 3.00001C8.23513 2.99875 7.78277 3.09446 7.3478 3.30221C6.94482 3.49471 6.45244 3.87259 6.20878 4.17644C5.92534 4.52988 5.84727 4.63265 5.7627 4.63825C5.72434 4.64078 5.68465 4.62332 5.62383 4.60019C5.00942 4.36644 4.29975 4.32562 3.73486 4.49154C2.68928 4.79866 1.94047 5.75495 1.89573 6.84028C1.88853 7.01498 1.86616 7.18324 1.84602 7.21414C1.82588 7.24505 1.69842 7.29688 1.56277 7.32936C0.920034 7.48329 0.407782 7.87523 0.140419 8.41765C0.0135997 8.67502 0 8.75813 0 9.2764C0 9.82121 0.00845803 9.86652 0.167772 10.1745Z" fill="#094AB1"/>
<path d="M3.67823 9.89768C3.67994 10.9836 4.21935 11.7155 5.18757 11.9456C5.38888 11.9935 6.55353 12.0058 10.2175 11.9991L14.9854 11.9904L15.1999 11.8812C15.6563 11.649 15.9443 11.1812 15.9918 10.5952C16.0644 9.69927 15.664 9.0898 14.8121 8.79957L14.5138 8.69793L14.4805 8.30996C14.3588 6.89177 12.8488 6.04314 11.334 6.54166L11.021 6.64467L10.6716 6.29575C10.0364 5.66133 9.5822 5.47352 8.67182 5.46888C8.03081 5.4656 7.76326 5.52254 7.23337 5.77501C6.72706 6.01623 6.25323 6.60591 5.99732 7.31327C5.94099 7.46899 5.8949 7.64467 5.8949 7.70363C5.8949 7.89162 5.77559 7.97278 5.38833 8.04847C4.61006 8.20044 4.01862 8.61346 3.79523 9.16083C3.7041 9.38415 3.67769 9.55052 3.67823 9.89768Z" fill="#094AB1"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.44095 15V1L0.5 2.43066V13.5694L8.44095 15ZM5.29189 10.4728C5.55622 10.1971 5.6884 9.80023 5.6884 9.28196C5.6884 8.95839 5.61596 8.67016 5.47108 8.41738C5.32875 8.1645 5.07585 7.91679 4.71239 7.67406C4.44297 7.49714 4.25362 7.33911 4.14433 7.20008C4.03758 7.06104 3.98421 6.89794 3.98421 6.71086C3.98421 6.52125 4.02868 6.37206 4.11764 6.26339C4.20915 6.15213 4.33877 6.09652 4.50652 6.09652C4.65902 6.09652 4.80135 6.12432 4.93352 6.17995C5.06823 6.23556 5.19658 6.29874 5.31858 6.36952L5.6617 5.54285C5.26775 5.30521 4.85727 5.18639 4.43027 5.18639C3.98293 5.18639 3.62583 5.32543 3.35895 5.60353C3.09463 5.88162 2.96245 6.25831 2.96245 6.73361C2.96245 6.98133 2.9955 7.19876 3.06158 7.38584C3.13021 7.57291 3.22552 7.74231 3.34752 7.89404C3.47206 8.04314 3.65379 8.19994 3.89271 8.36426C4.16721 8.55134 4.36418 8.72196 4.48364 8.87622C4.6031 9.02786 4.66283 9.19604 4.66283 9.38057C4.66283 9.56765 4.612 9.71552 4.51033 9.82429C4.41121 9.93296 4.26252 9.9873 4.06427 9.9873C3.71606 9.9873 3.33354 9.85202 2.9167 9.58156V10.6016C3.25729 10.7912 3.67031 10.8861 4.15577 10.8861C4.6514 10.8861 5.0301 10.7483 5.29189 10.4728Z" fill="#0072C6"/>
<path d="M9.32373 12.8355C9.58349 13.0917 9.94083 13.25 10.3354 13.25C11.1293 13.25 11.773 12.609 11.773 11.8181C11.773 11.7161 11.7622 11.6165 11.7418 11.5205C12.7264 11.1504 13.5179 10.3883 13.9243 9.42529C13.9697 9.42957 14.0159 9.43185 14.0624 9.43185C14.8564 9.43185 15.5 8.79074 15.5 8C15.5 7.20926 14.8564 6.56815 14.0624 6.56815C14.03 6.56815 13.9978 6.56929 13.9658 6.57139C13.5758 5.5657 12.7705 4.76576 11.7593 4.38008C11.7683 4.31528 11.773 4.24909 11.773 4.18182C11.773 3.39105 11.1293 2.75 10.3354 2.75C9.94083 2.75 9.58349 2.90826 9.32373 3.16452V5.19912C9.58349 5.45537 9.94083 5.61364 10.3354 5.61364C10.7543 5.61364 11.1314 5.43516 11.3941 5.15038C12.2089 5.441 12.8596 6.07475 13.1708 6.87676C12.8382 7.139 12.6249 7.54474 12.6249 8C12.6249 8.44039 12.8245 8.83431 13.1385 9.09699C12.8052 9.8865 12.1391 10.5024 11.3152 10.7705C11.0585 10.5322 10.714 10.3864 10.3354 10.3864C9.94083 10.3864 9.58349 10.5446 9.32373 10.8009V12.8355Z" fill="#0072C6"/>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.9 6.69268C12.4467 4.39268 10.4267 2.66602 8 2.66602C6.07333 2.66602 4.4 3.75935 3.56667 5.35935C1.56 5.57268 0 7.27268 0 9.33268C0 11.5393 1.79333 13.3327 4 13.3327H12.6667C14.5067 13.3327 16 11.8393 16 9.99935C16 8.23935 14.6333 6.81268 12.9 6.69268Z" fill="#96D1DE"/>
</svg>

After

Width:  |  Height:  |  Size: 386 B

View File

@ -0,0 +1,12 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_743_33370)">
<path d="M1.83296 7.27906L1.83635 7.2753C1.86069 7.24858 1.88526 7.22186 1.91003 7.19514C2.24212 6.81463 2.4961 6.25895 2.75067 5.70189C2.84377 5.4982 2.93693 5.29433 3.03403 5.0988C3.59247 3.98298 4.48516 3.08838 5.57602 2.55134C6.92566 1.88797 8.39933 1.86536 9.58973 2.25953C9.68285 2.29033 9.77325 2.32181 9.86253 2.35288C10.2935 2.50292 10.6978 2.64367 11.2515 2.65303C13.5884 2.48871 15.4184 3.05674 15.8443 3.98443C15.8503 3.99735 15.8557 4.01042 15.8607 4.02366C8.79997 4.92246 5.59998 6.17495 0.180055 11.7283C0.173247 11.7159 0.166863 11.7033 0.160919 11.6903C-0.333903 10.6123 0.337263 8.92307 1.83296 7.27906Z" fill="black"/>
<path d="M3.26751 11.4705C3.72741 12.4128 6.39806 12.115 9.23249 10.805C12.067 9.49453 13.9917 7.66866 13.5318 6.72588C13.0722 5.78347 10.4016 6.08177 7.56721 7.3922C4.73273 8.70221 2.80801 10.5284 3.26751 11.4705Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.67257 11.4754C5.34184 13.6037 0.904556 13.3109 0.20195 11.7804C-0.500663 10.2501 2.38561 7.1643 6.71658 5.03634C11.0476 2.90842 15.1828 2.5442 15.8854 4.07474C16.588 5.6053 14.0033 9.34779 9.67257 11.4754ZM9.21969 10.4891C7.16274 11.4996 5.22474 11.7294 4.89101 11.0024C4.55756 10.2758 5.95429 8.86717 8.01122 7.85667C10.0681 6.84592 12.0061 6.61579 12.3395 7.34273C12.6733 8.06993 11.2766 9.4783 9.21969 10.4891Z" fill="#0077FF"/>
</g>
<defs>
<clipPath id="clip0_743_33370">
<rect width="16" height="11" fill="white" transform="translate(0 2)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.75736 3.75736C4.84424 2.67048 6.34287 2 8 2C11.3137 2 14 4.68629 14 8H16C16 3.58172 12.4183 0 8 0C5.79413 0 3.79519 0.894098 2.34903 2.33727L2.34682 2.33941L2.3235 2.36228C2.30404 2.38149 2.27684 2.40861 2.24255 2.44351C2.18243 2.50467 2.10045 2.58976 2 2.69795V1H0V5C0 5.55228 0.447715 6 1 6H5V4H3.52058C3.58201 3.93468 3.632 3.88303 3.66896 3.84542C3.696 3.81791 3.71606 3.79793 3.72851 3.78563L3.7414 3.77298L3.74296 3.77147L3.74328 3.77116L3.74331 3.77114L3.74343 3.77102L3.74997 3.76475L3.75736 3.75736ZM8 14C4.68629 14 2 11.3137 2 8H0C0 12.4183 3.58172 16 8 16C10.3903 16 12.535 14.9513 14 13.2915V15H16V11C16 10.4477 15.5523 10 15 10H11V12H12.4724C11.3728 13.2286 9.77618 14 8 14Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 861 B

View File

@ -4,5 +4,6 @@
"ConnectMakeShared": "Share and put into 'Common' folder",
"ConnectionUrl": "Connection url",
"Login": "Login",
"Reconnect": "Reconnect"
"Reconnect": "Reconnect",
"SuccessfulConnectionOfAThirdParty": "Connection of a third-party resource was successful."
}

View File

@ -181,8 +181,8 @@ export default function withFileActions(WrappedFileItem) {
this.props.selectTag(tag);
};
onSelectType = (type) => {
this.props.selectType(type);
onSelectOption = (selectedOption) => {
this.props.selectOption(selectedOption);
};
getContextModel = () => {
@ -246,7 +246,7 @@ export default function withFileActions(WrappedFileItem) {
onMouseClick={this.onMouseClick}
onHideContextMenu={this.onHideContextMenu}
onSelectTag={this.onSelectTag}
onSelectType={this.onSelectType}
onSelectOption={this.onSelectOption}
getClassName={this.getClassName}
className={className}
isDragging={isDragging}
@ -281,7 +281,7 @@ export default function withFileActions(WrappedFileItem) {
const {
selectRowAction,
selectTag,
selectType,
selectOption,
onSelectItem,
setNewBadgeCount,
openFileAction,
@ -350,7 +350,7 @@ export default function withFileActions(WrappedFileItem) {
selectRowAction,
onSelectItem,
selectTag,
selectType,
selectOption,
setSharingPanelVisible,
isPrivacy: isPrivacyFolder,
isRoomsFolder,

View File

@ -13,6 +13,7 @@ const CreateRoomEvent = ({
createTag,
addTagsToRoom,
deleteThirdParty,
fetchThirdPartyProviders,
calculateRoomLogoParams,
uploadRoomLogo,
addLogoToRoom,
@ -105,6 +106,7 @@ const CreateRoomEvent = ({
isLoading={isLoading}
setIsLoading={setIsLoading}
deleteThirdParty={deleteThirdParty}
fetchThirdPartyProviders={fetchThirdPartyProviders}
/>
);
};
@ -133,7 +135,10 @@ export default inject(
const { connectDialogVisible } = dialogsStore;
const { deleteThirdParty } = settingsStore.thirdPartyStore;
const {
deleteThirdParty,
fetchThirdPartyProviders,
} = settingsStore.thirdPartyStore;
return {
createRoom,
@ -142,6 +147,7 @@ export default inject(
fetchTags,
addTagsToRoom,
deleteThirdParty,
fetchThirdPartyProviders,
calculateRoomLogoParams,
uploadRoomLogo,
addLogoToRoom,

View File

@ -29,6 +29,10 @@ const PureConnectDialogContainer = (props) => {
isConnectionViaBackupModule,
roomCreation,
setSaveThirdpartyResponse,
isConnectDialogReconnect,
setIsConnectDialogReconnect,
saveAfterReconnectOAuth,
setSaveAfterReconnectOAuth,
setSelectedThirdPartyAccount,
} = props;
const {
@ -65,6 +69,10 @@ const PureConnectDialogContainer = (props) => {
key === "WebDav" ||
key === "SharePoint";
const header = isConnectDialogReconnect
? t("Common:ReconnectStorage")
: t("Translations:ConnectingAccount");
const onChangeUrl = (e) => {
setIsUrlValid(true);
setUrlValue(e.target.value);
@ -93,7 +101,16 @@ const PureConnectDialogContainer = (props) => {
const onClose = useCallback(() => {
!isLoading && setConnectDialogVisible(false);
}, [isLoading, setConnectDialogVisible]);
if (isConnectDialogReconnect) {
setIsConnectDialogReconnect(false);
}
}, [
isLoading,
setConnectDialogVisible,
isConnectDialogReconnect,
setIsConnectDialogReconnect,
]);
const onSave = useCallback(() => {
const isTitleValid = !!customerTitle.trim();
@ -162,6 +179,7 @@ const PureConnectDialogContainer = (props) => {
)
.then(async (res) => {
setSaveThirdpartyResponse(res);
toastr.success(t("SuccessfulConnectionOfAThirdParty"));
await fetchThirdPartyProviders();
})
.catch((err) => {
@ -172,6 +190,7 @@ const PureConnectDialogContainer = (props) => {
.finally(() => {
onClose();
setIsLoading(false);
setSaveAfterReconnectOAuth(false);
});
}, [
customerTitle,
@ -215,6 +234,12 @@ const PureConnectDialogContainer = (props) => {
return setToken(token);
}, [setToken, token]);
useEffect(() => {
if (saveAfterReconnectOAuth) {
onSave();
}
}, [saveAfterReconnectOAuth]);
return (
<ModalDialog
isLoading={!tReady}
@ -224,9 +249,7 @@ const PureConnectDialogContainer = (props) => {
autoMaxHeight
onClose={onClose}
>
<ModalDialog.Header>
{t("Translations:ConnectingAccount")}
</ModalDialog.Header>
<ModalDialog.Header>{header}</ModalDialog.Header>
<ModalDialog.Body>
{isAccount ? (
<FieldContainer
@ -383,6 +406,10 @@ export default inject(
connectItem,
roomCreation,
setSaveThirdpartyResponse,
isConnectDialogReconnect,
setIsConnectDialogReconnect,
saveAfterReconnectOAuth,
setSaveAfterReconnectOAuth,
} = dialogsStore;
const item = backupConnectionItem ?? connectItem;
@ -404,6 +431,10 @@ export default inject(
setConnectDialogVisible,
setSelectedThirdPartyAccount,
personal,
isConnectDialogReconnect,
saveAfterReconnectOAuth,
setSaveAfterReconnectOAuth,
setIsConnectDialogReconnect,
};
}
)(observer(ConnectDialog));

View File

@ -38,6 +38,7 @@ const CreateRoomDialog = ({
setIsLoading,
deleteThirdParty,
fetchThirdPartyProviders,
}) => {
const [isScrollLocked, setIsScrollLocked] = useState(false);
const [isOauthWindowOpen, setIsOauthWindowOpen] = useState(false);
@ -92,6 +93,8 @@ const CreateRoomDialog = ({
await deleteThirdParty(
roomParams.storageLocation.thirdpartyAccount.providerId
).finally(() => setIsLoading(false));
await fetchThirdPartyProviders();
}
onClose();
};

View File

@ -16,6 +16,7 @@ export const FilterGroups = Object.freeze({
filterAuthor: "filter-author",
filterFolders: "filter-folders",
filterContent: "filter-withContent",
roomFilterProviderType: "filter-provider-type",
roomFilterType: "filter-type",
roomFilterOwner: "filter-owner",
roomFilterTags: "filter-tags",

View File

@ -306,7 +306,6 @@ const FilesTableRow = (props) => {
id,
isRooms,
onSelectType,
} = props;
const { acceptBackground, background } = theme.dragAndDrop;

View File

@ -5,9 +5,28 @@ import Tags from "@docspace/common/components/Tags";
import Tag from "@docspace/components/tag";
import { RoomsTypeTranslations } from "@docspace/common/constants";
const TagsCell = ({ t, item, tagCount, onSelectTag, onSelectType }) => {
const TagsCell = ({ t, item, tagCount, onSelectTag, onSelectOption }) => {
const styleTagsCell = {
width: "100%",
overflow: "hidden",
display: item.thirdPartyIcon ? "flex" : "",
};
return (
<div style={{ width: "100%", overflow: "hidden" }}>
<div style={styleTagsCell}>
{item.providerType && (
<Tag
icon={item.thirdPartyIcon}
label={item.providerKey}
onClick={() =>
onSelectOption({
option: "typeProvider",
value: item.providerType,
})
}
/>
)}
{item.tags.length > 0 ? (
<Tags
tags={item.tags}
@ -18,7 +37,12 @@ const TagsCell = ({ t, item, tagCount, onSelectTag, onSelectType }) => {
<Tag
isDefault
label={t(RoomsTypeTranslations[item.roomType])}
onClick={() => onSelectType(item.roomType)}
onClick={() =>
onSelectOption({
option: "defaultTypeRoom",
value: item.roomType,
})
}
/>
)}
</div>

View File

@ -48,7 +48,7 @@ const FileTile = (props) => {
setSelection,
id,
onSelectTag,
onSelectType,
onSelectOption,
columnCount,
} = props;
@ -116,7 +116,7 @@ const FileTile = (props) => {
showHotkeyBorder={showHotkeyBorder}
setSelection={setSelection}
selectTag={onSelectTag}
selectType={onSelectType}
selectOption={onSelectOption}
columnCount={columnCount}
>
<FilesTileContent

View File

@ -53,6 +53,7 @@ const roomsStyles = css`
}
.room-tile_bottom-content {
display: ${(props) => props.isThirdParty && "flex"};
width: 100%;
height: 56px;
@ -447,7 +448,7 @@ class Tile extends React.PureComponent {
t,
columnCount,
selectTag,
selectType,
selectOption,
} = this.props;
const { isFolder, isRoom, id, fileExst } = item;
@ -507,6 +508,7 @@ class Tile extends React.PureComponent {
inProgress={inProgress}
showHotkeyBorder={showHotkeyBorder}
onClick={this.onFileClick}
isThirdParty={item.providerType}
>
{isFolder || (!fileExst && id === -1) ? (
isRoom ? (
@ -570,6 +572,19 @@ class Tile extends React.PureComponent {
</StyledOptionButton>
</div>
<div className="room-tile_bottom-content">
{item.providerType && (
<Tag
icon={item.thirdPartyIcon}
label={item.providerKey}
onClick={() =>
selectOption({
option: "typeProvider",
value: item.providerType,
})
}
/>
)}
{item.tags.length > 0 ? (
<Tags
columnCount={columnCount}
@ -580,7 +595,12 @@ class Tile extends React.PureComponent {
<Tag
isDefault
label={t(RoomsTypeTranslations[item.roomType])}
onClick={() => selectType(item.roomType)}
onClick={() =>
selectOption({
option: "defaultTypeRoom",
value: item.roomType,
})
}
/>
)}
</div>

View File

@ -12,7 +12,12 @@ import {
} from "@docspace/client/src/helpers/filesConstants";
import { getUser } from "@docspace/common/api/people";
import { FilterType, RoomsType } from "@docspace/common/constants";
import {
FilterType,
RoomsType,
RoomsProviderType,
RoomsProviderTypeName,
} from "@docspace/common/constants";
import Loaders from "@docspace/common/components/Loaders";
import FilterInput from "@docspace/common/components/FilterInput";
import { withLayoutSize } from "@docspace/common/utils";
@ -64,6 +69,16 @@ const getType = (filterValues) => {
return type;
};
const getProviderType = (filterValues) => {
const filterType = filterValues.find(
(value) => value.group === FilterGroups.roomFilterProviderType
)?.key;
const type = filterType;
return type;
};
const getOwner = (filterValues) => {
const filterOwner = result(
find(filterValues, (value) => {
@ -138,6 +153,7 @@ const SectionFilterContent = ({
userId,
isPersonalRoom,
setCurrentRoomsFilter,
providers,
}) => {
const onFilter = React.useCallback(
(data) => {
@ -153,6 +169,7 @@ const SectionFilterContent = ({
const withoutMe = owner === FilterKeys.other;
const providerType = getProviderType(data) || null;
const tags = getTags(data) || null;
// const withSubfolders =
@ -165,6 +182,7 @@ const SectionFilterContent = ({
const newFilter = roomsFilter.clone();
newFilter.page = 0;
newFilter.provider = providerType ? providerType : null;
newFilter.type = type ? type : null;
newFilter.subjectId = subjectId ? subjectId : null;
if (tags) {
@ -360,6 +378,18 @@ const SectionFilterContent = ({
// });
// }
if (roomsFilter.provider) {
const provider = +roomsFilter.provider;
const label = RoomsProviderTypeName[provider];
filterValues.push({
key: provider,
label: label,
group: FilterGroups.roomFilterProviderType,
});
}
if (roomsFilter.type) {
const key = +roomsFilter.type;
@ -502,6 +532,7 @@ const SectionFilterContent = ({
filter.filterType,
filter.searchInContent,
filter.excludeSubject,
roomsFilter.provider,
roomsFilter.type,
roomsFilter.subjectId,
roomsFilter.tags,
@ -515,6 +546,16 @@ const SectionFilterContent = ({
]);
const getFilterData = React.useCallback(async () => {
const tags = await fetchTags();
const connectedThirdParty = [];
providers.forEach((item) => {
if (connectedThirdParty.includes(item.provider_key)) return;
connectedThirdParty.push(item.provider_key);
});
const isLastTypeOptionsRooms = !connectedThirdParty.length && !tags.length;
const folders =
!isFavoritesFolder && !isRecentFolder
? [
@ -563,6 +604,7 @@ const SectionFilterContent = ({
group: FilterGroups.roomFilterType,
label: t("Common:Type"),
isHeader: true,
isLast: isLastTypeOptionsRooms,
},
{
key: RoomsType.CustomRoom,
@ -701,9 +743,7 @@ const SectionFilterContent = ({
filterOptions.push(...typeOptions);
const tags = await fetchTags();
if (tags) {
if (tags.length > 0) {
const tagsOptions = tags.map((tag) => ({
key: tag,
group: FilterGroups.roomFilterTags,
@ -718,16 +758,44 @@ const SectionFilterContent = ({
// isMultiSelect: true,
// });
const isLast = connectedThirdParty.length === 0;
filterOptions.push({
key: FilterGroups.roomFilterTags,
group: FilterGroups.roomFilterTags,
label: t("Tags"),
isHeader: true,
isLast: true,
isLast,
});
filterOptions.push(...tagsOptions);
}
if (connectedThirdParty.length > 0) {
const thirdPartyOptions = connectedThirdParty.map((thirdParty) => {
const key = Object.entries(RoomsProviderType).find(
(item) => item[0] === thirdParty
)[1];
const label = RoomsProviderTypeName[key];
return {
key,
group: FilterGroups.roomFilterProviderType,
label,
};
});
filterOptions.push({
key: FilterGroups.roomFilterProviderType,
group: FilterGroups.roomFilterProviderType,
label: t("Settings:ThirdPartyResource"),
isHeader: true,
isLast: true,
});
filterOptions.push(...thirdPartyOptions);
}
} else {
if (!isRecentFolder && !isFavoritesFolder) {
const foldersOptions = [
@ -805,7 +873,15 @@ const SectionFilterContent = ({
}
return filterOptions;
}, [isFavoritesFolder, isRecentFolder, isRooms, t, personal, isPersonalRoom]);
}, [
isFavoritesFolder,
isRecentFolder,
isRooms,
t,
personal,
isPersonalRoom,
providers,
]);
const getViewSettingsData = React.useCallback(() => {
const viewSettings = [
@ -987,6 +1063,10 @@ const SectionFilterContent = ({
const newFilter = roomsFilter.clone();
if (group === FilterGroups.roomFilterProviderType) {
newFilter.provider = null;
}
if (group === FilterGroups.roomFilterType) {
newFilter.type = null;
}
@ -1117,8 +1197,11 @@ export default inject(
viewAs,
createThumbnails,
setCurrentRoomsFilter,
thirdPartyStore,
} = filesStore;
const { providers } = thirdPartyStore;
const { fetchTags } = tagsStore;
const { user } = auth.userStore;
@ -1160,12 +1243,13 @@ export default inject(
isPersonalRoom,
infoPanelVisible,
setCurrentRoomsFilter,
providers,
};
}
)(
withRouter(
withLayoutSize(
withTranslation(["Files", "Common", "Translations"])(
withTranslation(["Files", "Settings", "Common", "Translations"])(
withLoader(observer(SectionFilterContent))(<Loaders.Filter />)
)
)

View File

@ -12,6 +12,8 @@ import {
} from "@docspace/components/utils/device";
import { Events } from "@docspace/common/constants";
import { getContextMenuItems } from "SRC_DIR/helpers/plugins";
import { connectedCloudsTypeTitleTranslation } from "@docspace/client/src/helpers/filesUtils";
import { getOAuthToken } from "@docspace/common/utils";
class ContextOptionsStore {
authStore;
@ -58,6 +60,61 @@ class ContextOptionsStore {
return this.gotoDocEditor(false, item);
};
onClickReconnectStorage = async (item, t) => {
const { thirdPartyStore } = this.settingsStore;
const { openConnectWindow, connectItems } = thirdPartyStore;
const {
setRoomCreation,
setConnectItem,
setConnectDialogVisible,
setIsConnectDialogReconnect,
setSaveAfterReconnectOAuth,
} = this.dialogsStore;
setIsConnectDialogReconnect(true);
setRoomCreation(true);
const provider = connectItems.find(
(connectItem) => connectItem.providerName === item.providerKey
);
const itemThirdParty = {
title: connectedCloudsTypeTitleTranslation(provider.providerName, t),
customer_title: "NOTITLE",
provider_key: provider.providerName,
link: provider.oauthHref,
};
if (provider.isOauth) {
let authModal = window.open(
"",
"Authorization",
"height=600, width=1020"
);
await openConnectWindow(provider.providerName, authModal)
.then(getOAuthToken)
.then((token) => {
authModal.close();
setConnectItem({
...itemThirdParty,
token,
});
setSaveAfterReconnectOAuth(true);
})
.catch((err) => {
if (!err) return;
toastr.error(err);
});
} else {
setConnectItem(itemThirdParty);
setConnectDialogVisible(true);
}
};
onClickMakeForm = (item, t) => {
const {
setConvertPasswordDialogVisible,
@ -547,6 +604,13 @@ class ContextOptionsStore {
onClick: () => this.onClickMakeForm(item, t),
disabled: false,
},
{
key: "reconnect-storage",
label: t("Common:ReconnectStorage"),
icon: "images/reconnect.svg",
onClick: () => this.onClickReconnectStorage(item, t),
disabled: false,
},
{
key: "edit-room",
label: t("EditRoom"),

View File

@ -50,6 +50,9 @@ class DialogsStore {
saveThirdpartyResponse = null;
inviteItems = [];
isConnectDialogReconnect = false;
saveAfterReconnectOAuth = false;
constructor(
authStore,
treeFoldersStore,
@ -140,6 +143,14 @@ class DialogsStore {
this.connectItem = connectItem;
};
setIsConnectDialogReconnect = (isConnectDialogReconnect) => {
this.isConnectDialogReconnect = isConnectDialogReconnect;
};
setSaveAfterReconnectOAuth = (saveAfterReconnectOAuth) => {
this.saveAfterReconnectOAuth = saveAfterReconnectOAuth;
};
setThirdPartyDialogVisible = (thirdPartyDialogVisible) => {
this.thirdPartyDialogVisible = thirdPartyDialogVisible;
};

View File

@ -932,14 +932,21 @@ class FilesActionStore {
fetchRooms(id, newFilter).finally(() => setIsLoading(false));
};
selectType = (type) => {
selectOption = ({ option, value }) => {
const { roomsFilter, fetchRooms, setIsLoading } = this.filesStore;
const { id } = this.selectedFolderStore;
const newFilter = roomsFilter.clone();
const tags = newFilter.tags ? [...newFilter.tags] : [];
newFilter.tags = [...tags];
newFilter.type = type;
if (option === "defaultTypeRoom") {
newFilter.type = value;
}
if (option === "typeProvider") {
newFilter.provider = value;
}
setIsLoading(true);
fetchRooms(id, newFilter).finally(() => setIsLoading(false));

View File

@ -8,6 +8,7 @@ import {
FileStatus,
RoomSearchArea,
RoomsType,
RoomsProviderType,
} from "@docspace/common/constants";
import history from "@docspace/common/history";
import { combineUrl } from "@docspace/common/utils";
@ -35,6 +36,7 @@ class FilesStore {
selectedFolderStore;
treeFoldersStore;
filesSettingsStore;
thirdPartyStore;
isLoaded = false;
isLoading = false;
@ -94,7 +96,8 @@ class FilesStore {
authStore,
selectedFolderStore,
treeFoldersStore,
filesSettingsStore
filesSettingsStore,
thirdPartyStore
) {
const pathname = window.location.pathname.toLowerCase();
this.isEditor = pathname.indexOf("doceditor") !== -1;
@ -105,6 +108,7 @@ class FilesStore {
this.selectedFolderStore = selectedFolderStore;
this.treeFoldersStore = treeFoldersStore;
this.filesSettingsStore = filesSettingsStore;
this.thirdPartyStore = thirdPartyStore;
const { socketHelper, withPaging } = authStore.settingsStore;
@ -1341,6 +1345,7 @@ class FilesStore {
return fileOptions;
} else if (isRoom) {
let roomOptions = [
"reconnect-storage",
"edit-room",
"invite-users-to-room",
"show-info",
@ -1352,6 +1357,10 @@ class FilesStore {
"delete",
];
if (!item.providerKey) {
roomOptions = this.removeOptions(roomOptions, ["reconnect-storage"]);
}
if (item.pinned) {
roomOptions = this.removeOptions(roomOptions, ["pin-room"]);
} else {
@ -1977,6 +1986,16 @@ class FilesStore {
pinned,
} = item;
const thirdPartyIcon = this.thirdPartyStore.getThirdPartyIcon(
item.providerKey,
"small"
);
const providerType =
RoomsProviderType[
Object.keys(RoomsProviderType).find((key) => key === item.providerKey)
];
const { canConvert, isMediaOrImage } = this.filesSettingsStore;
const canOpenPlayer = isMediaOrImage(item.fileExst);
@ -2089,6 +2108,8 @@ class FilesStore {
isArchive,
tags,
pinned,
thirdPartyIcon,
providerType,
};
});

View File

@ -89,29 +89,40 @@ class ThirdPartyStore {
});
};
getThirdPartyIcon = (iconName) => {
getThirdPartyIcon = (iconName, size = "big") => {
switch (iconName) {
case "Box":
if (size === "small") return "images/icon_box_small.react.svg";
return "images/icon_box.react.svg";
case "DropboxV2":
if (size === "small") return "images/icon_dropbox_small.react.svg";
return "images/icon_dropbox.react.svg";
case "GoogleDrive":
if (size === "small") return "images/icon_google_drive_small.react.svg";
return "images/icon_google_drive.react.svg";
case "OneDrive":
if (size === "small") return "images/icon_onedrive_small.react.svg";
return "images/icon_onedrive.react.svg";
case "SharePoint":
if (size === "small") return "images/icon_sharepoint_small.react.svg";
return "images/icon_sharepoint.react.svg";
case "kDrive":
if (size === "small") return "images/icon_kdrive_small.react.svg";
return "images/icon_kdrive.react.svg";
case "Yandex":
if (size === "small") return "images/icon_yandex_disk_small.react.svg";
return "images/icon_yandex_disk.react.svg";
case "OwnCloud":
if (size === "small") return "images/icon_owncloud_small.react.svg";
return "images/icon_owncloud.react.svg";
case "NextCloud":
if (size === "small") return "images/icon_nextcloud_small.react.svg";
return "images/icon_nextcloud.react.svg";
case "OneDriveForBusiness":
if (size === "small") return "images/icon_onedrive_small.react.svg";
return "images/icon_onedrive.react.svg";
case "WebDav":
if (size === "small") return "images/icon_webdav_small.react.svg";
return "images/icon_webdav.react.svg";
default:
@ -176,6 +187,48 @@ class ThirdPartyStore {
this.capabilities && this.capabilities.find((x) => x[0] === "WebDav")
);
}
get connectItems() {
let nextCloudConnectItem = [],
ownCloudConnectItem = [];
if (this.nextCloudConnectItem) {
nextCloudConnectItem.push(...this.nextCloudConnectItem, "Nextcloud");
}
if (this.ownCloudConnectItem) {
ownCloudConnectItem.push(...this.ownCloudConnectItem, "ownCloud");
}
const connectItems = [
this.googleConnectItem,
this.boxConnectItem,
this.dropboxConnectItem,
this.oneDriveConnectItem,
nextCloudConnectItem,
this.kDriveConnectItem,
this.yandexConnectItem,
ownCloudConnectItem,
this.webDavConnectItem,
this.sharePointConnectItem,
]
.map(
(item) =>
item && {
isAvialable: !!item,
id: item[0],
providerName: item[0],
isOauth: item.length > 1 && item[0] !== "WebDav",
oauthHref: item.length > 1 && item[0] !== "WebDav" ? item[1] : "",
...(item[0] === "WebDav" && {
category: item[item.length - 1],
}),
}
)
.filter((item) => !!item);
return connectItems;
}
}
export default new ThirdPartyStore();

View File

@ -61,8 +61,7 @@ const filesStore = new FilesStore(
selectedFolderStore,
treeFoldersStore,
settingsStore,
selectFolderDialogStore,
selectFileDialogStore
thirdPartyStore
);
const mediaViewerDataStore = new MediaViewerDataStore(

View File

@ -10,6 +10,9 @@ const DEFAULT_TOTAL = 0;
const FILTER_VALUE = "filterValue";
const DEFAULT_FILTER_VALUE = null;
const PROVIDER = "provider";
const DEFAULT_PROVIDER = null;
const TYPE = "type";
const DEFAULT_TYPE = null;
@ -65,6 +68,9 @@ class RoomsFilter {
(urlFilter[FILTER_VALUE] && urlFilter[FILTER_VALUE]) ||
defaultFilter.filterValue;
const provider =
(urlFilter[PROVIDER] && urlFilter[PROVIDER]) || defaultFilter.filterType;
const type = (urlFilter[TYPE] && urlFilter[TYPE]) || defaultFilter.type;
const subjectId =
@ -104,6 +110,7 @@ class RoomsFilter {
pageCount,
defaultFilter.total,
filterValue,
provider,
type,
subjectId,
searchInContent,
@ -124,6 +131,7 @@ class RoomsFilter {
pageCount = DEFAULT_PAGE_COUNT,
total = DEFAULT_TOTAL,
filterValue = DEFAULT_FILTER_VALUE,
provider = DEFAULT_PROVIDER,
type = DEFAULT_TYPE,
subjectId = DEFAULT_SUBJECT_ID,
searchInContent = DEFAULT_SEARCH_IN_CONTENT,
@ -139,6 +147,7 @@ class RoomsFilter {
this.pageCount = pageCount;
this.total = total;
this.filterValue = filterValue;
this.provider = provider;
this.type = type;
this.subjectId = subjectId;
this.searchInContent = searchInContent;
@ -168,6 +177,7 @@ class RoomsFilter {
page,
pageCount,
filterValue,
provider,
type,
subjectId,
searchInContent,
@ -185,6 +195,7 @@ class RoomsFilter {
page: page,
startIndex: this.getStartIndex(),
filterValue: (filterValue ?? "").trim(),
provider: provider,
type: type,
subjectId: subjectId,
searchInContent: searchInContent,
@ -206,6 +217,7 @@ class RoomsFilter {
page,
pageCount,
filterValue,
provider,
type,
subjectId,
searchInContent,
@ -224,6 +236,10 @@ class RoomsFilter {
dtoFilter[FILTER_VALUE] = filterValue;
}
if (provider) {
dtoFilter[PROVIDER] = provider;
}
if (type) {
dtoFilter[TYPE] = type;
}
@ -275,6 +291,7 @@ class RoomsFilter {
this.pageCount,
this.total,
this.filterValue,
this.provider,
this.type,
this.subjectId,
this.searchInContent,
@ -300,6 +317,7 @@ class RoomsFilter {
const equals =
this.page === filter.page &&
this.pageCount === filter.pageCount &&
this.provider === filter.provider &&
this.filterValue === filter.filterValue &&
typeEqual &&
this.subjectId === filter.subjectId &&

View File

@ -164,7 +164,8 @@ const FilterInput = React.memo(
<SelectedItem
key={`${item.key}_${item.group}`}
propKey={item.key}
{...item}
label={item.label}
group={item.group}
removeSelectedItem={removeSelectedItemAction}
/>
))}

View File

@ -87,6 +87,31 @@ export const RoomsTypeTranslations = Object.freeze({
4: "Files:ViewOnlyRooms",
5: "Files:CustomRooms",
});
/**
* Enum for room provider type.
* @readonly
*/
export const RoomsProviderType = Object.freeze({
Box: 1,
DropBox: 2,
GoogleDrive: 3,
kDrive: 4,
OneDrive: 5,
SharePoint: 6,
WebDav: 7,
Yandex: 8,
});
export const RoomsProviderTypeName = Object.freeze({
1: "Box",
2: "DropBox",
3: "Google Drive",
4: "kDrive",
5: "OneDrive",
6: "SharePoint",
7: "WebDav",
8: "Yandex",
});
/**
* Enum for room search area.

View File

@ -25,6 +25,7 @@ const Tag = ({
id,
className,
style,
icon,
}) => {
const [openDropdown, setOpenDropdown] = React.useState(false);
@ -113,22 +114,28 @@ const Tag = ({
className={`tag${className ? ` ${className}` : ""}`}
style={style}
>
<Text
className={"tag-text"}
title={label}
font-size={"13px"}
noSelect
truncate
>
{label}
</Text>
{isNewTag && (
<IconButton
className={"tag-icon"}
iconName={"/static/images/cross.react.svg"}
size={"10px"}
onClick={onDeleteAction}
/>
{icon ? (
<ReactSVG className="third-party-tag" src={icon} />
) : (
<>
<Text
className={"tag-text"}
title={label}
font-size={"13px"}
noSelect
truncate
>
{label}
</Text>
{isNewTag && (
<IconButton
className={"tag-icon"}
iconName={"/static/images/cross.react.svg"}
size={"10px"}
onClick={onDeleteAction}
/>
)}
</>
)}
</StyledTag>
)}

View File

@ -40,6 +40,11 @@ const StyledTag = styled.div`
cursor: pointer;
}
.third-party-tag {
width: 16px;
height: 16px;
}
${(props) =>
!props.isDisabled &&
css`

View File

@ -58,10 +58,10 @@ public interface IFolderDao<T>
Task<Folder<T>> GetRootFolderByFileAsync(T fileId);
IAsyncEnumerable<Folder<T>> GetRoomsAsync(T parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders,
bool withoutTags, bool excludeSubject);
bool withoutTags, bool excludeSubject, ProviderFilter provider);
IAsyncEnumerable<Folder<T>> GetRoomsAsync(IEnumerable<T> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders,
bool withoutTags, bool excludeSubject);
bool withoutTags, bool excludeSubject, ProviderFilter provider);
/// <summary>
/// Get a list of folders in current folder.

View File

@ -9,7 +9,7 @@
//
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.htm
//
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
//

View File

@ -164,9 +164,9 @@ internal class FolderDao : AbstractDao, IFolderDao<int>
return GetFoldersAsync(parentId, default, FilterType.None, false, default, string.Empty);
}
public async IAsyncEnumerable<Folder<int>> GetRoomsAsync(int parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public async IAsyncEnumerable<Folder<int>> GetRoomsAsync(int parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || provider != ProviderFilter.None)
{
yield break;
}
@ -194,9 +194,9 @@ internal class FolderDao : AbstractDao, IFolderDao<int>
}
}
public async IAsyncEnumerable<Folder<int>> GetRoomsAsync(IEnumerable<int> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public async IAsyncEnumerable<Folder<int>> GetRoomsAsync(IEnumerable<int> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || provider != ProviderFilter.None)
{
yield break;
}

View File

@ -273,7 +273,8 @@ public class FileStorageService<T> //: IFileStorageService
SearchArea searchArea = SearchArea.Active,
bool withoutTags = false,
IEnumerable<string> tagNames = null,
bool excludeSubject = false)
bool excludeSubject = false,
ProviderFilter provider = ProviderFilter.None)
{
var subjectId = string.IsNullOrEmpty(subject) ? Guid.Empty : new Guid(subject);
@ -323,7 +324,7 @@ public class FileStorageService<T> //: IFileStorageService
try
{
(entries, total) = await _entryManager.GetEntriesAsync(parent, from, count, filterType, subjectGroup, subjectId, searchText, searchInContent, withSubfolders, orderBy, searchArea,
withoutTags, tagNames, excludeSubject);
withoutTags, tagNames, excludeSubject, provider);
}
catch (Exception e)
{

View File

@ -0,0 +1,41 @@
// (c) Copyright Ascensio System SIA 2010-2022
//
// This program is a free software product.
// You can redistribute it and/or modify it under the terms
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
// any third-party rights.
//
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
//
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
//
// The interactive user interfaces in modified source and object code versions of the Program must
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
//
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
// trademark law for use of our trademarks.
//
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
namespace ASC.Files.Core;
[EnumExtensions]
public enum ProviderFilter
{
None,
Box,
DropBox,
GoogleDrive,
kDrive,
OneDrive,
SharePoint,
WebDav,
Yandex
}

View File

@ -934,11 +934,11 @@ public class FileSecurity : IFileSecurity
}
public async Task<List<FileEntry>> GetVirtualRoomsAsync(FilterType filterType, Guid subjectId, string searchText, bool searchInContent, bool withSubfolders,
SearchArea searchArea, bool withoutTags, IEnumerable<string> tagNames, bool excludeSubject)
SearchArea searchArea, bool withoutTags, IEnumerable<string> tagNames, bool excludeSubject, ProviderFilter provider)
{
if (_fileSecurityCommon.IsAdministrator(_authContext.CurrentAccount.ID))
{
return await GetVirtualRoomsForAdminAsync(filterType, subjectId, searchText, searchInContent, withSubfolders, searchArea, withoutTags, tagNames, excludeSubject);
return await GetVirtualRoomsForAdminAsync(filterType, subjectId, searchText, searchInContent, withSubfolders, searchArea, withoutTags, tagNames, excludeSubject, provider);
}
var securityDao = _daoFactory.GetSecurityDao<int>();
@ -947,9 +947,9 @@ public class FileSecurity : IFileSecurity
var entries = new List<FileEntry>();
var rooms = await GetVirtualRoomsForUserAsync<int>(records.Where(r => r.EntryId is int), subjects, filterType, subjectId, searchText, searchInContent,
withSubfolders, searchArea, withoutTags, tagNames, excludeSubject);
withSubfolders, searchArea, withoutTags, tagNames, excludeSubject, provider);
var thirdPartyRooms = await GetVirtualRoomsForUserAsync<string>(records.Where(r => r.EntryId is string), subjects, filterType, subjectId, searchText,
searchInContent, withSubfolders, searchArea, withoutTags, tagNames, excludeSubject);
searchInContent, withSubfolders, searchArea, withoutTags, tagNames, excludeSubject, provider);
entries.AddRange(rooms);
entries.AddRange(thirdPartyRooms);
@ -958,7 +958,7 @@ public class FileSecurity : IFileSecurity
}
private async Task<List<FileEntry>> GetVirtualRoomsForAdminAsync(FilterType filterType, Guid subjectId, string search, bool searchInContent, bool withSubfolders,
SearchArea searchArea, bool withoutTags, IEnumerable<string> tagNames, bool excludeSubject)
SearchArea searchArea, bool withoutTags, IEnumerable<string> tagNames, bool excludeSubject, ProviderFilter provider)
{
var folderDao = _daoFactory.GetFolderDao<int>();
var folderThirdPartyDao = _daoFactory.GetFolderDao<string>();
@ -975,8 +975,8 @@ public class FileSecurity : IFileSecurity
var roomsFolderId = await _globalFolder.GetFolderVirtualRoomsAsync<int>(_daoFactory);
var thirdPartyRoomsIds = await providerDao.GetProvidersInfoAsync(FolderType.VirtualRooms).Select(p => p.FolderId).ToListAsync();
var roomsEntries = await folderDao.GetRoomsAsync(roomsFolderId, filterType, tagNames, subjectId, search, withSubfolders, withoutTags, excludeSubject).ToListAsync();
var thirdPartyRoomsEntries = await folderThirdPartyDao.GetRoomsAsync(thirdPartyRoomsIds, filterType, tagNames, subjectId, search, withSubfolders, withoutTags, excludeSubject)
var roomsEntries = await folderDao.GetRoomsAsync(roomsFolderId, filterType, tagNames, subjectId, search, withSubfolders, withoutTags, excludeSubject, provider).ToListAsync();
var thirdPartyRoomsEntries = await folderThirdPartyDao.GetRoomsAsync(thirdPartyRoomsIds, filterType, tagNames, subjectId, search, withSubfolders, withoutTags, excludeSubject, provider)
.ToListAsync();
foldersInt.AddRange(roomsEntries);
@ -1007,8 +1007,8 @@ public class FileSecurity : IFileSecurity
var archiveFolderId = await _globalFolder.GetFolderArchive<int>(_daoFactory);
var thirdPartyRoomsIds = await providerDao.GetProvidersInfoAsync(FolderType.Archive).Select(p => p.FolderId).ToListAsync();
var roomsEntries = await folderDao.GetRoomsAsync(archiveFolderId, filterType, tagNames, subjectId, search, withSubfolders, withoutTags, excludeSubject).ToListAsync();
var thirdPartyRoomsEntries = await folderThirdPartyDao.GetRoomsAsync(thirdPartyRoomsIds, filterType, tagNames, subjectId, search, withSubfolders, withoutTags, excludeSubject)
var roomsEntries = await folderDao.GetRoomsAsync(archiveFolderId, filterType, tagNames, subjectId, search, withSubfolders, withoutTags, excludeSubject, provider).ToListAsync();
var thirdPartyRoomsEntries = await folderThirdPartyDao.GetRoomsAsync(thirdPartyRoomsIds, filterType, tagNames, subjectId, search, withSubfolders, withoutTags, excludeSubject, provider)
.ToListAsync();
foldersInt.AddRange(roomsEntries);
@ -1047,7 +1047,7 @@ public class FileSecurity : IFileSecurity
}
private async Task<List<FileEntry>> GetVirtualRoomsForUserAsync<T>(IEnumerable<FileShareRecord> records, List<Guid> subjects, FilterType filterType, Guid subjectId, string search,
bool searchInContent, bool withSubfolders, SearchArea searchArea, bool withoutTags, IEnumerable<string> tagNames, bool excludeSubject)
bool searchInContent, bool withSubfolders, SearchArea searchArea, bool withoutTags, IEnumerable<string> tagNames, bool excludeSubject, ProviderFilter provider)
{
var folderDao = _daoFactory.GetFolderDao<T>();
var fileDao = _daoFactory.GetFileDao<T>();
@ -1089,7 +1089,7 @@ public class FileSecurity : IFileSecurity
return false;
};
var fileEntries = await folderDao.GetRoomsAsync(roomsIds.Keys, filterType, tagNames, subjectId, search, withSubfolders, withoutTags, excludeSubject)
var fileEntries = await folderDao.GetRoomsAsync(roomsIds.Keys, filterType, tagNames, subjectId, search, withSubfolders, withoutTags, excludeSubject, provider)
.Where(filter).ToListAsync();
await SetTagsAsync(fileEntries);

View File

@ -75,9 +75,9 @@ internal class BoxFolderDao : BoxDaoBase, IFolderDao<string>
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders,
bool withoutTags, bool excludeSubject)
bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.Box))
{
return AsyncEnumerable.Empty<Folder<string>>();
}
@ -98,9 +98,9 @@ internal class BoxFolderDao : BoxDaoBase, IFolderDao<string>
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText,
bool withSubfolders, bool withoutTags, bool excludeSubject)
bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.Box))
{
return AsyncEnumerable.Empty<Folder<string>>();
}

View File

@ -77,9 +77,9 @@ internal class DropboxFolderDao : DropboxDaoBase, IFolderDao<string>
return GetRootFolderAsync(fileId);
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.DropBox))
{
return AsyncEnumerable.Empty<Folder<string>>();
}
@ -99,9 +99,9 @@ internal class DropboxFolderDao : DropboxDaoBase, IFolderDao<string>
return rooms;
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.DropBox))
{
return AsyncEnumerable.Empty<Folder<string>>();
}

View File

@ -74,9 +74,9 @@ internal class GoogleDriveFolderDao : GoogleDriveDaoBase, IFolderDao<string>
return GetRootFolderAsync("");
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.GoogleDrive))
{
return AsyncEnumerable.Empty<Folder<string>>();
}
@ -96,9 +96,9 @@ internal class GoogleDriveFolderDao : GoogleDriveDaoBase, IFolderDao<string>
return rooms;
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.GoogleDrive))
{
return AsyncEnumerable.Empty<Folder<string>>();
}

View File

@ -453,14 +453,14 @@ internal abstract class ThirdPartyProviderDao<T> : ThirdPartyProviderDao, IDispo
_ => FolderType.DEFAULT,
};
return rooms.Where(f => f.FolderType == filter || filter == FolderType.DEFAULT);
return rooms.Where(f => f != null && (f.FolderType == filter || filter == FolderType.DEFAULT));
}
protected IAsyncEnumerable<Folder<string>> FilterBySubject(IAsyncEnumerable<Folder<string>> rooms, Guid subjectId, bool excludeSubject)
{
if (subjectId != Guid.Empty)
{
rooms = excludeSubject ? rooms.Where(f => f.CreateBy != subjectId) : rooms.Where(f => f.CreateBy == subjectId);
rooms = excludeSubject ? rooms.Where(f => f != null && f.CreateBy != subjectId) : rooms.Where(f => f != null && f.CreateBy == subjectId);
}
return rooms;

View File

@ -74,9 +74,9 @@ internal class OneDriveFolderDao : OneDriveDaoBase, IFolderDao<string>
return GetRootFolderAsync(fileId);
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.OneDrive))
{
return AsyncEnumerable.Empty<Folder<string>>();
}
@ -96,9 +96,9 @@ internal class OneDriveFolderDao : OneDriveDaoBase, IFolderDao<string>
return rooms;
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.OneDrive))
{
return AsyncEnumerable.Empty<Folder<string>>();
}

View File

@ -90,12 +90,13 @@ internal class ProviderFolderDao : ProviderDaoBase, IFolderDao<string>
return folderDao.GetRootFolderByFileAsync(selector.ConvertId(fileId));
}
public async IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public async IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
var selector = GetSelector(parentId);
var folderDao = selector.GetFolderDao(parentId);
var rooms = folderDao.GetRoomsAsync(selector.ConvertId(parentId), filterType, tags, subjectId, searchText, withSubfolders, withoutTags, excludeSubject);
var result = await rooms.Where(r => r != null).ToListAsync();
var rooms = folderDao.GetRoomsAsync(selector.ConvertId(parentId), filterType, tags, subjectId, searchText, withSubfolders, withoutTags, excludeSubject, provider);
var result = await FilterByProvider(rooms.Where(r => r != null), provider).ToListAsync();
await SetSharedPropertyAsync(result);
@ -105,7 +106,8 @@ internal class ProviderFolderDao : ProviderDaoBase, IFolderDao<string>
}
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject,
ProviderFilter provider)
{
var result = AsyncEnumerable.Empty<Folder<string>>();
@ -125,11 +127,13 @@ internal class ProviderFolderDao : ProviderDaoBase, IFolderDao<string>
{
var folderDao = selectorLocal.GetFolderDao(matchedId.FirstOrDefault());
return folderDao.GetRoomsAsync(matchedId.Select(selectorLocal.ConvertId).ToList(), filterType, tags, subjectId, searchText, withSubfolders, withoutTags, excludeSubject);
return folderDao.GetRoomsAsync(matchedId.Select(selectorLocal.ConvertId).ToList(), filterType, tags, subjectId, searchText, withSubfolders, withoutTags, excludeSubject, provider);
})
.Where(r => r != null));
}
result = FilterByProvider(result, provider);
return result.Distinct();
}
@ -435,4 +439,22 @@ internal class ProviderFolderDao : ProviderDaoBase, IFolderDao<string>
return storageMaxUploadSize;
}
private IAsyncEnumerable<Folder<string>> FilterByProvider(IAsyncEnumerable<Folder<string>> folders, ProviderFilter provider)
{
if (provider != ProviderFilter.kDrive && provider != ProviderFilter.WebDav && provider != ProviderFilter.Yandex)
{
return folders;
}
var providerKey = provider switch
{
ProviderFilter.Yandex => ProviderTypes.Yandex.ToStringFast(),
ProviderFilter.WebDav => ProviderTypes.WebDav.ToStringFast(),
ProviderFilter.kDrive => ProviderTypes.kDrive.ToStringFast(),
_ => throw new NotImplementedException(),
};
return folders.Where(x => providerKey == x.ProviderKey);
}
}

View File

@ -80,9 +80,9 @@ internal class SharePointFolderDao : SharePointDaoBase, IFolderDao<string>
return Task.FromResult(ProviderInfo.ToFolder(ProviderInfo.RootFolder));
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.SharePoint))
{
return AsyncEnumerable.Empty<Folder<string>>();
}
@ -102,9 +102,9 @@ internal class SharePointFolderDao : SharePointDaoBase, IFolderDao<string>
return rooms;
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.SharePoint))
{
return AsyncEnumerable.Empty<Folder<string>>();
}

View File

@ -79,9 +79,9 @@ internal class SharpBoxFolderDao : SharpBoxDaoBase, IFolderDao<string>
return Task.FromResult(ToFolder(RootFolder()));
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(string parentId, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.kDrive && provider != ProviderFilter.WebDav && provider != ProviderFilter.Yandex))
{
return AsyncEnumerable.Empty<Folder<string>>();
}
@ -101,9 +101,9 @@ internal class SharpBoxFolderDao : SharpBoxDaoBase, IFolderDao<string>
return rooms;
}
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject)
public IAsyncEnumerable<Folder<string>> GetRoomsAsync(IEnumerable<string> roomsIds, FilterType filterType, IEnumerable<string> tags, Guid subjectId, string searchText, bool withSubfolders, bool withoutTags, bool excludeSubject, ProviderFilter provider)
{
if (CheckInvalidFilter(filterType))
if (CheckInvalidFilter(filterType) || (provider != ProviderFilter.None && provider != ProviderFilter.kDrive && provider != ProviderFilter.WebDav && provider != ProviderFilter.Yandex))
{
return AsyncEnumerable.Empty<Folder<string>>();
}

View File

@ -374,7 +374,7 @@ public class EntryManager
public async Task<(IEnumerable<FileEntry> Entries, int Total)> GetEntriesAsync<T>(Folder<T> parent, int from, int count, FilterType filterType, bool subjectGroup, Guid subjectId,
string searchText, bool searchInContent, bool withSubfolders, OrderBy orderBy, SearchArea searchArea = SearchArea.Active, bool withoutTags = false, IEnumerable<string> tagNames = null,
bool excludeSubject = false)
bool excludeSubject = false, ProviderFilter provider = ProviderFilter.None)
{
var total = 0;
@ -457,7 +457,7 @@ public class EntryManager
}
else if ((parent.FolderType == FolderType.VirtualRooms || parent.FolderType == FolderType.Archive) && !parent.ProviderEntry)
{
entries = await _fileSecurity.GetVirtualRoomsAsync(filterType, subjectId, searchText, searchInContent, withSubfolders, searchArea, withoutTags, tagNames, excludeSubject);
entries = await _fileSecurity.GetVirtualRoomsAsync(filterType, subjectId, searchText, searchInContent, withSubfolders, searchArea, withoutTags, tagNames, excludeSubject, provider);
CalculateTotal();
}

View File

@ -24,6 +24,8 @@
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
using ASC.Files.Thirdparty;
namespace ASC.Files.Api;
[ConstraintRoute("int")]
@ -652,7 +654,8 @@ public class VirtualRoomsCommonController : ApiControllerBase
/// Virtual Rooms content
/// </returns>
[HttpGet("rooms")]
public async Task<FolderContentDto<int>> GetRoomsFolderAsync(RoomFilterType? type, string subjectId, bool? searchInContent, bool? withSubfolders, SearchArea? searchArea, bool? withoutTags, string tags, bool? excludeSubject)
public async Task<FolderContentDto<int>> GetRoomsFolderAsync(RoomFilterType? type, string subjectId, bool? searchInContent, bool? withSubfolders, SearchArea? searchArea, bool? withoutTags, string tags, bool? excludeSubject,
ProviderFilter? provider)
{
ErrorIfNotDocSpace();
@ -683,7 +686,8 @@ public class VirtualRoomsCommonController : ApiControllerBase
var filterValue = _apiContext.FilterValue;
var content = await _fileStorageServiceInt.GetFolderItemsAsync(parentId, startIndex, count, filter, false, subjectId, filterValue,
searchInContent ?? false, withSubfolders ?? false, orderBy, searchArea ?? SearchArea.Active, withoutTags ?? false, tagNames, excludeSubject ?? false);
searchInContent ?? false, withSubfolders ?? false, orderBy, searchArea ?? SearchArea.Active, withoutTags ?? false, tagNames, excludeSubject ?? false,
provider ?? ProviderFilter.None);
var dto = await _folderContentDtoHelper.GetAsync(content, startIndex);

View File

@ -151,6 +151,7 @@
"PunycodeDomain": "Punycode domains are not supported",
"PunycodeLocalPart": "Punycode local part is not supported",
"Plugin": "Plugin",
"ReconnectStorage": "Reconnect storage",
"RequiredField": "Required field",
"RecoverTitle": "Access recovery",
"RecoverDescribeYourProblemPlaceholder": "Describe your problem",