Updated landing page with stats data (#110)

* Updated landing page

* Minor change
This commit is contained in:
darth-coder00 2021-08-12 21:13:59 +05:30 committed by GitHub
parent 1c388f0b86
commit b269e7a6aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 264 additions and 27 deletions

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="M15.4037 6.57214C15.3988 6.57104 15.3938 6.56995 15.3889 6.56897L13.7388 6.24487C13.6267 5.87805 13.4795 5.52283 13.2988 5.18359L14.2366 3.78711C14.2395 3.78284 14.2422 3.77869 14.2449 3.77441C14.4358 3.46887 14.3912 3.07751 14.1365 2.82275L13.1772 1.86353C12.9225 1.60876 12.5312 1.56421 12.2256 1.75513C12.2213 1.75781 12.2172 1.7605 12.2129 1.76343L10.8164 2.70117C10.4772 2.52051 10.1219 2.37329 9.75513 2.26123L9.43103 0.611084C9.43005 0.606201 9.42896 0.601196 9.42786 0.596313C9.3468 0.245239 9.0387 0 8.67834 0H7.32166C6.9613 0 6.6532 0.245239 6.57214 0.596313C6.57104 0.601196 6.56995 0.606201 6.56897 0.611084L6.24487 2.26123C5.87805 2.37329 5.52283 2.52051 5.18359 2.70117L3.78711 1.76343C3.78284 1.7605 3.77869 1.75781 3.77441 1.75513C3.46887 1.56421 3.07751 1.60876 2.82275 1.86353L1.86353 2.82275C1.60876 3.07751 1.56421 3.46887 1.75513 3.77441C1.75781 3.77869 1.7605 3.78284 1.76343 3.78711L2.70117 5.18359C2.52051 5.52283 2.37329 5.87805 2.26123 6.24487L0.611084 6.56897C0.606201 6.56995 0.601196 6.57104 0.596313 6.57214C0.245239 6.6532 0 6.9613 0 7.32166V8.67834C0 9.0387 0.245239 9.3468 0.596313 9.42786C0.601196 9.42896 0.606201 9.43005 0.611084 9.43103L2.26123 9.75513C2.37329 10.1219 2.52051 10.4772 2.70117 10.8164L1.76343 12.2129C1.7605 12.2172 1.75781 12.2213 1.75513 12.2256C1.56421 12.5311 1.60876 12.9225 1.86353 13.1772L2.82275 14.1365C3.07751 14.3914 3.46887 14.4358 3.77441 14.2449C3.77869 14.2422 3.78284 14.2395 3.78711 14.2366L5.18359 13.2988C5.52283 13.4795 5.87805 13.6267 6.24487 13.7388L6.56897 15.3889C6.56995 15.3938 6.57104 15.3988 6.57214 15.4037C6.6532 15.7548 6.9613 16 7.32166 16H8.67834C9.0387 16 9.3468 15.7548 9.42786 15.4037C9.42896 15.3988 9.43005 15.3938 9.43103 15.3889L9.75513 13.7388C10.1219 13.6267 10.4772 13.4795 10.8164 13.2988L12.2129 14.2366C12.2172 14.2395 12.2213 14.2422 12.2256 14.2449C12.5311 14.4358 12.9224 14.3912 13.1772 14.1365L14.1365 13.1772C14.3912 12.9225 14.4358 12.5311 14.2449 12.2256C14.2422 12.2213 14.2395 12.2172 14.2366 12.2129L13.2988 10.8164C13.4795 10.4772 13.6267 10.1219 13.7388 9.75513L15.3889 9.43103C15.3938 9.43005 15.3988 9.42896 15.4037 9.42786C15.7548 9.3468 16 9.0387 16 8.67834V7.32166C16 6.9613 15.7548 6.6532 15.4037 6.57214ZM15.0769 8.55151L13.2817 8.9043C13.1064 8.93872 12.9668 9.07117 12.9231 9.24438C12.8031 9.72095 12.6139 10.1774 12.3608 10.6007C12.2692 10.7542 12.2743 10.9465 12.3739 11.0948L13.3942 12.6141L12.6141 13.3942L11.0948 12.3739C10.9465 12.2743 10.7542 12.2692 10.6007 12.3608C10.1772 12.6139 9.72095 12.8031 9.24438 12.9231C9.07117 12.9668 8.9386 13.1064 8.90417 13.2817L8.55151 15.0769H7.44849L7.0957 13.2817C7.06128 13.1064 6.92883 12.9668 6.75562 12.9231C6.27905 12.8031 5.82263 12.6139 5.39929 12.3608C5.24585 12.2692 5.05347 12.2743 4.90515 12.3739L3.38586 13.3942L2.60583 12.6141L3.6261 11.0948C3.72571 10.9465 3.73083 10.7542 3.63916 10.6007C3.38611 10.1772 3.1969 9.72095 3.0769 9.24438C3.0332 9.07117 2.89355 8.9386 2.71826 8.90417L0.923096 8.55151V7.44849L2.71826 7.0957C2.89355 7.06128 3.0332 6.92883 3.0769 6.75562C3.1969 6.27905 3.38611 5.82263 3.63916 5.39929C3.73083 5.24585 3.72571 5.05347 3.6261 4.90515L2.60583 3.38586L3.38586 2.60583L4.90515 3.6261C5.05347 3.72571 5.24585 3.73083 5.39929 3.63916C5.82275 3.38611 6.27905 3.1969 6.75562 3.0769C6.92883 3.0332 7.0614 2.89355 7.09583 2.71826L7.44849 0.923096H8.55151L8.9043 2.71826C8.93872 2.89355 9.07117 3.0332 9.24438 3.0769C9.72095 3.1969 10.1774 3.38611 10.6007 3.63916C10.7542 3.73083 10.9465 3.72571 11.0948 3.6261L12.6141 2.60583L13.3942 3.38586L12.3739 4.90515C12.2743 5.05347 12.2692 5.24585 12.3608 5.39929C12.6139 5.82275 12.8031 6.27905 12.9231 6.75562C12.9668 6.92883 13.1064 7.0614 13.2817 7.09583L15.0769 7.44849V8.55151Z" fill="#37352F"/>
<path d="M7.53845 6.9231H9.23071C9.48572 6.9231 9.69226 6.71643 9.69226 6.46155C9.69226 6.20667 9.48572 6 9.23071 6H8.46155V5.23071C8.46155 4.97583 8.25488 4.76929 8 4.76929C7.74512 4.76929 7.53845 4.97583 7.53845 5.23071V6C6.85986 6 6.30774 6.55212 6.30774 7.23071C6.30774 7.90942 6.85986 8.46155 7.53845 8.46155H8.46155C8.63123 8.46155 8.76929 8.59961 8.76929 8.76929C8.76929 8.93884 8.63123 9.0769 8.46155 9.0769H6.76929C6.51428 9.0769 6.30774 9.28357 6.30774 9.53845C6.30774 9.79333 6.51428 10 6.76929 10H7.53845V10.7693C7.53845 11.0242 7.74512 11.2307 8 11.2307C8.25488 11.2307 8.46155 11.0242 8.46155 10.7693V10C9.14014 10 9.69226 9.44788 9.69226 8.76929C9.69226 8.09058 9.14014 7.53845 8.46155 7.53845H7.53845C7.36877 7.53845 7.23071 7.40039 7.23071 7.23071C7.23071 7.06116 7.36877 6.9231 7.53845 6.9231Z" fill="#37352F"/>
</svg>

After

Width:  |  Height:  |  Size: 4.6 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="M2.69385 13.7744C2.95273 13.7744 3.1626 13.5646 3.1626 13.3057C3.1626 13.0468 2.95273 12.8369 2.69385 12.8369C2.43496 12.8369 2.2251 13.0468 2.2251 13.3057C2.2251 13.5646 2.43496 13.7744 2.69385 13.7744Z" fill="#37352F"/>
<path d="M12.6932 7.7035C13.521 7.58172 14.2721 7.20381 14.8653 6.61062C15.43 6.04594 15.8017 5.33306 15.9402 4.54909C16.0754 3.78335 15.9803 3.0045 15.6651 2.29675C15.5315 1.99657 15.1376 1.92375 14.9055 2.15597L12.9852 4.07616C12.906 4.15541 12.777 4.15541 12.6977 4.07616L11.9235 3.30194C11.8444 3.22281 11.8444 3.09406 11.9235 3.01494L13.844 1.0945C14.0764 0.862128 14.0031 0.468441 13.7032 0.334878C12.9954 0.019691 12.2165 -0.0754339 11.4508 0.059816C10.6668 0.198253 9.95386 0.569941 9.38914 1.13466C8.79595 1.72782 8.41802 2.47888 8.29624 3.30663C8.1957 3.98975 8.27592 4.67322 8.52802 5.30466L7.12186 6.45969L3.98177 3.31972L4.5342 2.76731C4.73217 2.56938 4.71349 2.24244 4.4938 2.06844L2.36842 0.385066C2.18189 0.237347 1.91421 0.252785 1.74592 0.421066L0.420113 1.74682C0.251832 1.91507 0.236332 2.18272 0.384113 2.36928L2.06755 4.49456C2.24155 4.71422 2.56827 4.73316 2.76646 4.53497L3.31886 3.98256L6.39399 7.05756L0.621769 11.799C-0.146699 12.4068 -0.213012 13.5503 0.479644 14.2429L1.75652 15.5198C2.44908 16.2123 3.59258 16.1462 4.20058 15.3777L8.94217 9.60566L9.41848 10.082L8.73336 10.7671C8.55727 10.9431 8.54961 11.2261 8.71586 11.4115L12.2879 15.3938C12.9904 16.1735 14.2022 16.2059 14.9451 15.463L15.4625 14.9456C16.2069 14.2012 16.1717 12.9806 15.3849 12.2806C15.3845 12.2803 15.3842 12.28 15.3839 12.2797L11.3832 8.73975C11.1977 8.57559 10.9164 8.58413 10.7411 8.75934L10.0814 9.41909L9.54005 8.87781L10.6951 7.47172C11.3266 7.72381 12.0101 7.804 12.6932 7.7035ZM2.47567 3.49997L1.37821 2.11447L2.11358 1.37913L3.49914 2.47653L2.47567 3.49997ZM11.0922 9.73403L14.7621 12.9812C14.9479 13.1467 15.0543 13.3748 15.0615 13.6236C15.0688 13.8725 14.9758 14.1066 14.7997 14.2827L14.2822 14.8002C14.1069 14.9755 13.8738 15.0687 13.6262 15.062C13.3784 15.0556 13.1505 14.9506 12.9851 14.7671L9.7102 11.116L11.0922 9.73403ZM10.1995 6.59822L8.54483 8.61244C8.54461 8.61269 8.54439 8.61297 8.54417 8.61322L3.47321 14.7862C3.47105 14.7888 3.46889 14.7915 3.46677 14.7942C3.20692 15.1251 2.71761 15.1551 2.41942 14.8569L1.14255 13.5801C0.84505 13.2826 0.873613 12.7932 1.20527 12.5328C1.20796 12.5307 1.21061 12.5285 1.21327 12.5263L7.38655 7.45547C7.38673 7.45531 7.38689 7.45519 7.38708 7.45503L9.40152 5.80031C9.57255 5.65984 9.62198 5.41888 9.52014 5.22241C8.92936 4.08278 9.14311 2.70644 10.052 1.79753C10.6118 1.23782 11.3695 0.940378 12.1358 0.940378C12.3009 0.940378 12.4665 0.954191 12.6305 0.982159L11.2605 2.35203C10.8159 2.79666 10.8159 3.52013 11.2605 3.96478L12.0348 4.739C12.4795 5.18375 13.2033 5.18381 13.6481 4.739L15.0178 3.36941C15.1755 4.29447 14.8827 5.26744 14.2024 5.94775C13.2934 6.85663 11.917 7.07034 10.7774 6.47963C10.581 6.37775 10.34 6.42719 10.1995 6.59822Z" fill="#37352F"/>
</svg>

After

Width:  |  Height:  |  Size: 3.0 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="M13.625 5.65625C13.3031 5.65625 12.985 5.72341 12.6923 5.85019C12.1895 4.75716 11.2862 3.83206 10.1479 3.31113C10.2757 3.01744 10.3438 2.69825 10.3438 2.375C10.3438 1.07944 9.29581 0 8 0C6.70441 0 5.65625 1.07922 5.65625 2.375C5.65625 2.69812 5.72391 3.01734 5.85156 3.31094C4.72703 3.82569 3.81638 4.74444 3.30772 5.85016C3.01497 5.72341 2.69688 5.65625 2.375 5.65625C1.07941 5.65625 0 6.70422 0 8C0 9.29559 1.07922 10.3438 2.375 10.3438C2.69475 10.3438 3.01097 10.2774 3.30222 10.1522C3.78431 11.2074 4.66828 12.1597 5.84491 12.7003C5.72056 12.9892 5.65625 13.3015 5.65625 13.625C5.65625 14.9206 6.70422 16 8 16C9.2955 16 10.3438 14.9208 10.3438 13.625C10.3438 13.3015 10.2794 12.9892 10.1551 12.7003C11.2564 12.1943 12.18 11.2855 12.6978 10.1522C12.989 10.2774 13.3053 10.3438 13.625 10.3438C14.9206 10.3438 16 9.29578 16 8C16 6.70447 14.9208 5.65625 13.625 5.65625ZM8 10.3581C6.71459 10.3581 5.64909 9.30781 5.64909 8.00716C5.64909 6.72809 6.69325 5.65625 8 5.65625C9.27347 5.65625 10.3509 6.68322 10.3509 8.00716C10.3509 9.30013 9.29241 10.3581 8 10.3581ZM6.68175 3.99116C6.99213 3.88913 7.10556 3.50803 6.90134 3.25288C6.70013 3.0015 6.59375 2.69794 6.59375 2.375C6.59375 1.59578 7.23772 0.9375 8 0.9375C8.76228 0.9375 9.40625 1.59578 9.40625 2.375C9.40625 2.69791 9.29991 3.0015 9.09863 3.25291C8.89234 3.51094 9.01294 3.89128 9.31822 3.99116C9.57575 4.07578 9.82197 4.18416 10.0558 4.31484C9.88816 4.41956 9.74222 4.55953 9.62869 4.72984C9.55784 4.83609 9.50381 4.94916 9.46575 5.06594C9.01372 4.83975 8.51253 4.71875 8 4.71875C7.21031 4.71875 6.44675 5.00434 5.84997 5.52287C5.70566 5.64828 5.46 5.74328 5.24269 5.59841C4.99003 5.42997 4.95563 5.06406 5.1795 4.86266C5.61853 4.46766 6.12397 4.17447 6.68175 3.99116ZM3.98366 9.32438C3.88206 9.015 3.50278 8.90084 3.24725 9.10316C2.99691 9.30144 2.69531 9.40625 2.375 9.40625C1.59578 9.40625 0.9375 8.76228 0.9375 8C0.9375 7.23772 1.59578 6.59375 2.375 6.59375C2.69662 6.59375 2.99919 6.69931 3.25003 6.89909C3.50478 7.10191 3.88453 6.98919 3.987 6.67975C4.07119 6.42553 4.17853 6.18237 4.30766 5.95134C4.41234 6.119 4.55234 6.26494 4.72266 6.37847C4.82894 6.44931 4.94191 6.50344 5.05872 6.54147C4.83253 6.9935 4.71156 7.49466 4.71156 8.00712C4.71156 8.79681 4.99713 9.56038 5.51569 10.1572C5.64109 10.3015 5.73612 10.5471 5.59122 10.7644C5.4225 11.0175 5.05647 11.0511 4.85547 10.8276C4.46028 10.3883 4.16694 9.88256 3.98366 9.32438ZM9.32634 12.0205C9.01822 12.1224 8.90425 12.5003 9.10541 12.7556C9.30222 13.0054 9.40625 13.306 9.40625 13.625C9.40625 14.4042 8.76228 15.0625 8 15.0625C7.23772 15.0625 6.59375 14.4042 6.59375 13.625C6.59375 13.306 6.69778 13.0054 6.89459 12.7556C7.0955 12.5007 6.98222 12.1226 6.67366 12.0205C6.41906 11.9362 6.17556 11.8288 5.94419 11.6995C6.11184 11.5947 6.25778 11.4548 6.37134 11.2845C6.44219 11.1782 6.49622 11.0652 6.53428 10.9483C6.98634 11.1746 7.48753 11.2955 8.00003 11.2955C8.78975 11.2955 9.55328 11.0099 10.1501 10.4914C10.2943 10.366 10.5401 10.271 10.7573 10.4159C11.01 10.5843 11.0444 10.9502 10.8205 11.1517C10.3837 11.5447 9.88097 11.837 9.32634 12.0205ZM13.625 9.40625C13.3047 9.40625 13.0031 9.30144 12.7528 9.10316C12.4976 8.90097 12.118 9.01472 12.0164 9.32438C11.9317 9.58228 11.8232 9.82887 11.6923 10.063C11.5876 9.89534 11.4477 9.74941 11.2773 9.63587C11.1711 9.56503 11.058 9.51097 10.9412 9.47294C11.1674 9.02087 11.2884 8.51969 11.2884 8.00719C11.2884 7.21753 11.0028 6.45397 10.4843 5.85719C10.3589 5.71287 10.2639 5.46722 10.4088 5.24988C10.5755 4.99966 10.9411 4.96056 11.1445 5.18669C11.5372 5.62319 11.8294 6.12553 12.013 6.67978C12.0612 6.82525 12.1774 6.93797 12.3243 6.98169C12.471 7.02537 12.6301 6.99456 12.75 6.89909C13.0008 6.69931 13.3034 6.59375 13.625 6.59375C14.4042 6.59375 15.0625 7.23772 15.0625 8C15.0625 8.76228 14.4042 9.40625 13.625 9.40625Z" fill="#37352F"/>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,4 @@
<svg width="14" height="16" viewBox="0 0 14 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.57349 7.70728C7.63232 7.70728 8.54907 7.32751 9.29834 6.57825C10.0474 5.8291 10.4272 4.91248 10.4272 3.85352C10.4272 2.79492 10.0475 1.87817 9.29822 1.12878C8.54895 0.379761 7.6322 0 6.57349 0C5.51453 0 4.5979 0.379761 3.84875 1.12891C3.09961 1.87805 2.71973 2.7948 2.71973 3.85352C2.71973 4.91248 3.09961 5.82922 3.84875 6.57837C4.59814 7.32739 5.51489 7.70728 6.57349 7.70728ZM4.51184 1.79187C5.08667 1.21704 5.76099 0.937622 6.57349 0.937622C7.38586 0.937622 8.0603 1.21704 8.63525 1.79187C9.21008 2.36682 9.48962 3.04126 9.48962 3.85352C9.48962 4.66602 9.21008 5.34033 8.63525 5.91528C8.0603 6.49023 7.38586 6.76965 6.57349 6.76965C5.76123 6.76965 5.08691 6.49011 4.51184 5.91528C3.93689 5.34045 3.65735 4.66602 3.65735 3.85352C3.65735 3.04126 3.93689 2.36682 4.51184 1.79187Z" fill="#37352F"/>
<path d="M13.3165 12.3032C13.2949 11.9915 13.2512 11.6514 13.1869 11.2922C13.1219 10.9304 13.0383 10.5884 12.9382 10.2758C12.8347 9.95264 12.6942 9.63354 12.5203 9.32776C12.34 9.01038 12.1281 8.73401 11.8903 8.50659C11.6416 8.26868 11.3372 8.07739 10.9851 7.93787C10.6343 7.79907 10.2455 7.72876 9.82959 7.72876C9.66626 7.72876 9.5083 7.79578 9.20325 7.99438C9.0155 8.11682 8.7959 8.25842 8.55078 8.41504C8.34119 8.54858 8.05725 8.67371 7.70654 8.78699C7.36438 8.89771 7.01697 8.95386 6.67395 8.95386C6.33118 8.95386 5.98376 8.89771 5.64136 8.78699C5.29102 8.67383 5.00696 8.54871 4.79773 8.41516C4.55493 8.26001 4.33521 8.11841 4.14465 7.99426C3.83984 7.79565 3.68188 7.72864 3.51855 7.72864C3.10254 7.72864 2.71387 7.79907 2.36316 7.93799C2.01135 8.07727 1.70679 8.26855 1.45789 8.50671C1.22009 8.73425 1.00818 9.0105 0.828003 9.32776C0.654297 9.63354 0.513672 9.95251 0.410156 10.2759C0.310181 10.5885 0.226562 10.9304 0.161621 11.2922C0.097168 11.6509 0.0535889 11.9911 0.0319824 12.3036C0.0107422 12.6091 0 12.9271 0 13.2484C0 14.0836 0.265503 14.7598 0.789062 15.2584C1.30615 15.7505 1.99023 16 2.82239 16H10.5265C11.3584 16 12.0425 15.7505 12.5597 15.2584C13.0834 14.7601 13.3489 14.0837 13.3489 13.2483C13.3488 12.9259 13.3379 12.6079 13.3165 12.3032ZM11.9132 14.5791C11.5715 14.9043 11.1179 15.0624 10.5264 15.0624H2.82239C2.23071 15.0624 1.7771 14.9043 1.43555 14.5792C1.10046 14.2603 0.937622 13.8248 0.937622 13.2484C0.937622 12.9486 0.94751 12.6526 0.967285 12.3684C0.986572 12.0896 1.026 11.7833 1.08447 11.4579C1.14221 11.1365 1.2157 10.8348 1.3031 10.5618C1.38696 10.2999 1.50134 10.0406 1.64319 9.79089C1.77856 9.55286 1.93433 9.34863 2.1062 9.18408C2.26697 9.03015 2.4696 8.90417 2.70837 8.80969C2.9292 8.72229 3.17737 8.67444 3.44678 8.66724C3.47961 8.68469 3.53809 8.71802 3.63281 8.77979C3.82556 8.9054 4.04773 9.04871 4.29333 9.20557C4.57019 9.38208 4.92688 9.5415 5.35303 9.67908C5.7887 9.81995 6.23303 9.89148 6.67407 9.89148C7.11511 9.89148 7.55957 9.81995 7.995 9.6792C8.42151 9.54138 8.77808 9.38208 9.0553 9.20532C9.30664 9.04468 9.52258 8.90552 9.71533 8.77979C9.81006 8.71814 9.86853 8.68469 9.90137 8.66724C10.1709 8.67444 10.4191 8.72229 10.64 8.80969C10.8787 8.90417 11.0813 9.03027 11.2421 9.18408C11.4139 9.34851 11.5697 9.55273 11.7051 9.79102C11.847 10.0406 11.9615 10.3 12.0453 10.5616C12.1328 10.8351 12.2064 11.1366 12.264 11.4578C12.3224 11.7838 12.3619 12.0902 12.3812 12.3685V12.3688C12.4011 12.6519 12.4111 12.9478 12.4113 13.2484C12.4111 13.825 12.2483 14.2603 11.9132 14.5791Z" fill="#37352F"/>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -38,7 +38,12 @@ import {
getUserByName,
getUsers,
} from '../axiosAPIs/userAPI';
import { oidcTokenKey, ROUTES, TIMEOUT } from '../constants/constants';
import {
API_RES_MAX_SIZE,
oidcTokenKey,
ROUTES,
TIMEOUT,
} from '../constants/constants';
import { ClientErrors } from '../enums/axios.enum';
import { useAuth } from '../hooks/authHooks';
import useToastContext from '../hooks/useToastContext';
@ -94,7 +99,7 @@ const AuthProvider: FunctionComponent<AuthProviderProps> = ({
// Moving this code here from App.tsx
const getAllUsersList = (): void => {
getUsers().then((res) => {
getUsers('', API_RES_MAX_SIZE).then((res) => {
appState.users = res.data.data;
});
};

View File

@ -20,8 +20,13 @@ import { UserProfile } from 'Models';
import { getURLWithQueryFields } from '../utils/APIUtils';
import APIClient from './index';
export const getUsers = (arrQueryFields?: string): Promise<AxiosResponse> => {
const url = getURLWithQueryFields('/users', arrQueryFields);
export const getUsers = (
arrQueryFields?: string,
limit?: number
): Promise<AxiosResponse> => {
const url =
`${getURLWithQueryFields('/users', arrQueryFields)}` +
(limit ? `${arrQueryFields?.length ? '&' : '?'}limit=${limit}` : '');
return APIClient.get(url);
};

View File

@ -36,7 +36,7 @@ export type DatabaseObj = {
serviceType: string;
};
export type DataObj = {
export type ServiceDataObj = {
connectionUrl: string;
description: string;
driverClass: string;
@ -56,8 +56,8 @@ export type EditObj = {
type Props = {
header: string;
serviceName: string;
serviceList: Array<DataObj>;
data?: DataObj;
serviceList: Array<ServiceDataObj>;
data?: ServiceDataObj;
onSave: (obj: DatabaseObj, text: string, editData: EditObj) => void;
onCancel: () => void;
};
@ -88,7 +88,7 @@ const generateOptions = (count: number, initialValue = 0) => {
));
};
const generateName = (data: Array<DataObj>) => {
const generateName = (data: Array<ServiceDataObj>) => {
const newArr: string[] = [];
data.forEach((d) => {
newArr.push(d.name);

View File

@ -0,0 +1,105 @@
import { observer } from 'mobx-react';
import React, { FunctionComponent, useEffect, useState } from 'react';
import AppState from '../../AppState';
import SVGIcons, { Icons } from '../../utils/SvgUtils';
type Props = {
countServices: number;
countAssets: number;
};
const LANDING_STATES = [
{
title: 'Explore Assets',
description:
'OpenMetadata has {countAssets} Assets. Click Explore on top menu to search, claim or follow your Data Assets',
},
{
title: 'Register Services',
description:
'Create a service to bring in metadata. Click Settings -> Services to explore available services.',
},
{
title: 'Knowledgebase',
description:
'Donec tempus eu dolor non vehicula. Etiam malesuada, sapien ac euismod condimentum.',
},
];
const MyDataHeader: FunctionComponent<Props> = ({
countAssets,
countServices,
}: Props) => {
const { users, userTeams } = AppState;
const [dataSummary, setdataSummary] = useState({
asstes: {
icon: Icons.ASSETS,
data: `${countAssets} of Assets`,
},
service: {
icon: Icons.SERVICE,
data: `${countServices} of Services`,
},
user: {
icon: Icons.USERS,
data: `${users.length} of Users`,
},
terms: {
icon: Icons.TERMS,
data: `${userTeams.length} of Teams`,
},
});
const getFormattedDescription = (description: string) => {
return description.replaceAll('{countAssets}', countAssets.toString());
};
useEffect(() => {
setdataSummary({
asstes: {
icon: Icons.ASSETS,
data: `${countAssets} of Assets`,
},
service: {
icon: Icons.SERVICE,
data: `${countServices} of Services`,
},
user: {
icon: Icons.USERS,
data: `${users.length} of Users`,
},
terms: {
icon: Icons.TERMS,
data: `${userTeams.length} of Teams`,
},
});
}, [userTeams, users, countAssets, countServices]);
return (
<section className="tw-flex tw-flex-col tw-items-center tw-py-7">
<h3 className="tw-mb-3 tw-font-semibold">
<span style={{ color: '#8D6AF1' }}>Open</span>
<span style={{ color: '#7147E8' }}>Metadata</span>
</h3>
<div className="tw-flex tw-gap-5 tw-mb-7">
{Object.values(dataSummary).map((data, index) => (
<div className="tw-flex tw-items-center tw-gap-2" key={index}>
<SVGIcons alt="icon" className="tw-h-4 tw-w-4" icon={data.icon} />
<p className="tw-font-medium">{data.data}</p>
</div>
))}
</div>
<div className="tw-flex tw-gap-10">
{LANDING_STATES.map((d, i) => (
<div className="tw-card tw-p-3 tw-w-72" key={i}>
<p className="tw-font-medium tw-mb-1">{d.title}</p>
<p>{getFormattedDescription(d.description)}</p>
</div>
))}
</div>
</section>
);
};
export default observer(MyDataHeader);

View File

@ -16,6 +16,7 @@
*/
export const PAGE_SIZE = 10;
export const API_RES_MAX_SIZE = 100000;
export const LIST_SIZE = 5;
export const SIDEBAR_WIDTH_COLLAPSED = 290;
export const SIDEBAR_WIDTH_EXPANDED = 290;

View File

@ -281,4 +281,17 @@ declare module 'Models' {
aggregations: Record<string, Sterm>;
};
};
export type ServiceCollection = {
name: string;
value: string;
};
export type ServiceData = {
collection: {
documentation: string;
href: string;
name: string;
};
};
}

View File

@ -21,12 +21,14 @@ import React, { useEffect, useState } from 'react';
import { searchData } from '../../axiosAPIs/miscAPI';
import Error from '../../components/common/error/Error';
import Loader from '../../components/Loader/Loader';
import MyDataHeader from '../../components/my-data/MyDataHeader';
import SearchedData from '../../components/searched-data/SearchedData';
import { ERROR404, ERROR500, PAGE_SIZE } from '../../constants/constants';
import { Ownership } from '../../enums/mydata.enum';
import useToastContext from '../../hooks/useToastContext';
import { formatDataResponse } from '../../utils/APIUtils';
import { getCurrentUserId } from '../../utils/CommonUtils';
import { getAllServices } from '../../utils/ServiceUtils';
const MyDataPage: React.FC = (): React.ReactElement => {
const showToast = useToastContext();
@ -37,6 +39,8 @@ const MyDataPage: React.FC = (): React.ReactElement => {
const [currentTab, setCurrentTab] = useState<number>(1);
const [error, setError] = useState<string>('');
const [filter, setFilter] = useState<string>('');
const [countServices, setCountServices] = useState<number>(0);
const [countAssets, setCountAssets] = useState<number>(0);
const getActiveTabClass = (tab: number) => {
return tab === currentTab ? 'active' : '';
@ -52,9 +56,11 @@ const MyDataPage: React.FC = (): React.ReactElement => {
)
.then((res: SearchResponse) => {
const hits = res.data.hits.hits;
const total = res.data.hits.total.value;
if (hits.length > 0) {
setTotalNumberOfValues(res.data.hits.total.value);
setData(formatDataResponse(hits));
setCountAssets(total);
setIsLoading(false);
} else {
setData([]);
@ -93,7 +99,7 @@ const MyDataPage: React.FC = (): React.ReactElement => {
setFilter(Ownership.OWNER);
setCurrentPage(1);
}}>
Owned
My Data
</button>
<button
className={`tw-pb-2 tw-px-4 tw-gh-tabs ${getActiveTabClass(3)}`}
@ -117,6 +123,12 @@ const MyDataPage: React.FC = (): React.ReactElement => {
fetchTableData();
}, [currentPage, filter]);
useEffect(() => {
getAllServices()
.then((res) => setCountServices(res.length))
.catch(() => setCountServices(0));
}, []);
return (
<>
{isLoading ? (
@ -134,6 +146,10 @@ const MyDataPage: React.FC = (): React.ReactElement => {
searchText="*"
showResultCount={filter && data.length > 0 ? true : false}
totalValue={totalNumberOfValue}>
<MyDataHeader
countAssets={countAssets}
countServices={countServices}
/>
{getTabs()}
</SearchedData>
)}

View File

@ -16,6 +16,7 @@
*/
import { AxiosResponse } from 'axios';
import { ServiceCollection, ServiceData } from 'Models';
import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import {
@ -30,21 +31,14 @@ import Loader from '../../components/Loader/Loader';
import {
AddServiceModal,
DatabaseObj,
DataObj,
EditObj,
ServiceDataObj,
} from '../../components/Modals/AddServiceModal/AddServiceModal';
import { getServiceDetailsPath } from '../../constants/constants';
import { NOSERVICE, PLUS } from '../../constants/services.const';
import { serviceTypeLogo } from '../../utils/ServiceUtils';
import { stringToHTML } from '../../utils/StringsUtils';
import SVGIcons from '../../utils/SvgUtils';
type ServiceData = {
collection: {
documentation: string;
href: string;
name: string;
};
};
export type ApiData = {
description: string;
@ -56,13 +50,11 @@ export type ApiData = {
ingestionSchedule?: { repeatFrequency: string; startDate: string };
};
type ServiceCollection = { name: string; value: string };
const ServicesPage = () => {
const [isModalOpen, setIsModalOpen] = useState(false);
const [serviceName] = useState('databaseServices');
const [serviceList, setServiceList] = useState<Array<DataObj>>([]);
const [editData, setEditData] = useState<DataObj>();
const [serviceList, setServiceList] = useState<Array<ServiceDataObj>>([]);
const [editData, setEditData] = useState<ServiceDataObj>();
const [isLoading, setIsLoading] = useState<boolean>(false);
const updateServiceList = (
@ -102,7 +94,7 @@ const ServicesPage = () => {
setEditData(undefined);
};
const handleEdit = (value: DataObj) => {
const handleEdit = (value: ServiceDataObj) => {
setEditData(value);
setIsModalOpen(true);
};

View File

@ -164,12 +164,12 @@ const TagsPage = () => {
<div className="tw-flex tw-justify-between tw-items-baseline tw-mb-3">
<h6 className="tw-heading">Tag Categories</h6>
<Button
className="tw-h-8 tw-px-3"
className="tw-h-7 tw-px-2"
size="small"
theme="primary"
variant="contained"
onClick={() => setIsAddingCategory((prevState) => !prevState)}>
+
<i aria-hidden="true" className="fa fa-plus" />
</Button>
</div>
{categories &&

View File

@ -1,13 +1,18 @@
import { AxiosResponse } from 'axios';
import { ServiceCollection, ServiceData } from 'Models';
import { getServiceDetails, getServices } from '../axiosAPIs/serviceAPI';
import { ServiceDataObj } from '../components/Modals/AddServiceModal/AddServiceModal';
import {
MYSQL,
REDSHIFT,
BIGQUERY,
HIVE,
POSTGRES,
MYSQL,
ORACLE,
POSTGRES,
REDSHIFT,
SNOWFLAKE,
} from '../constants/services.const';
import { ServiceType } from '../enums/service.enum';
import { ApiData } from '../pages/services';
export const serviceTypeLogo = (type: string) => {
switch (type) {
@ -36,3 +41,59 @@ export const serviceTypeLogo = (type: string) => {
return MYSQL;
}
};
const getAllServiceList = (
allServiceCollectionArr: Array<ServiceCollection>
): Promise<Array<ServiceDataObj>> => {
let listArr = [];
// fetch services of all individual collection
return new Promise<Array<ServiceDataObj>>((resolve, reject) => {
if (allServiceCollectionArr.length) {
let promiseArr = [];
promiseArr = allServiceCollectionArr.map((obj) => {
return getServices(obj.value);
});
Promise.all(promiseArr)
.then((result: AxiosResponse[]) => {
if (result.length) {
let serviceArr = [];
serviceArr = result.map((service) => service?.data?.data || []);
// converted array of arrays to array
const allServices = serviceArr.reduce(
(acc, el) => acc.concat(el),
[]
);
listArr = allServices.map((s: ApiData) => {
return { ...s, ...s.jdbc };
});
resolve(listArr);
} else {
resolve([]);
}
})
.catch((err) => reject(err));
} else {
resolve([]);
}
});
};
export const getAllServices = (): Promise<Array<ServiceDataObj>> => {
return new Promise<Array<ServiceDataObj>>((resolve, reject) => {
getServiceDetails().then((res: AxiosResponse) => {
let allServiceCollectionArr: Array<ServiceCollection> = [];
if (res.data.data?.length) {
allServiceCollectionArr = res.data.data.map((service: ServiceData) => {
return {
name: service.collection.name,
value: service.collection.name,
};
});
}
getAllServiceList(allServiceCollectionArr)
.then((res) => resolve(res))
.catch((err) => reject(err));
});
});
};

View File

@ -1,5 +1,6 @@
import React, { FunctionComponent } from 'react';
import IconSuccess from '../assets/svg/check.svg';
import IconAsstest from '../assets/svg/data-assets.svg';
import IconError from '../assets/svg/error.svg';
import IconCheckCircle from '../assets/svg/ic-check-circle.svg';
import IconDelete from '../assets/svg/ic-delete.svg';
@ -39,6 +40,9 @@ import IconUnique from '../assets/svg/icon-unique.svg';
import IconInfo from '../assets/svg/info.svg';
import LogoMonogram from '../assets/svg/logo-monogram.svg';
import Logo from '../assets/svg/logo.svg';
import IconSetting from '../assets/svg/service.svg';
import IconTerns from '../assets/svg/terms.svg';
import IconUser from '../assets/svg/user.svg';
import IconWarning from '../assets/svg/warning.svg';
type Props = {
@ -90,6 +94,10 @@ export const Icons = {
KEY: 'key',
NOT_NULL: 'not-null',
UNIQUE: 'unique',
ASSETS: 'assets',
SERVICE: 'service',
USERS: 'users',
TERMS: 'terms',
};
const SVGIcons: FunctionComponent<Props> = ({
@ -263,10 +271,26 @@ const SVGIcons: FunctionComponent<Props> = ({
case Icons.UNIQUE:
IconComponent = IconUnique;
break;
case Icons.ASSETS:
IconComponent = IconAsstest;
break;
case Icons.TOAST_INFO:
IconComponent = IconInfo;
break;
case Icons.SERVICE:
IconComponent = IconSetting;
break;
case Icons.USERS:
IconComponent = IconUser;
break;
case Icons.TERMS:
IconComponent = IconTerns;
break;
default: