Fixing assessment UX for private preview (#14837)

* Fixing assessment UX for private preview

* localizing all the string

* Fixing comments

* Fixing dbname bug in assessment page.
This commit is contained in:
Aasim Khan
2021-03-24 20:49:03 -07:00
committed by GitHub
parent f12c8cd5d3
commit f61288d29e
6 changed files with 386 additions and 204 deletions

View File

@@ -0,0 +1,23 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.99984 5.13995C5.45984 5.13995 2.58984 4.13995 2.58984 2.81995V15.1799C2.58984 16.4499 5.40984 17.4799 8.90984 17.4999H8.99984C12.5398 17.4999 15.4098 16.4999 15.4098 15.1799V2.81995C15.4098 4.10995 12.5398 5.13995 8.99984 5.13995Z" fill="url(#paint0_linear)"/>
<path d="M15.4098 2.82C15.4098 4.11 12.5398 5.14 8.99984 5.14C5.45984 5.14 2.58984 4.14 2.58984 2.82C2.58984 1.5 5.45984 0.5 8.99984 0.5C12.5398 0.5 15.4098 1.5 15.4098 2.82Z" fill="#E8E8E8"/>
<path d="M13.9201 2.63003C13.9201 3.45003 11.7101 4.11003 9.00008 4.11003C6.29008 4.11003 4.08008 3.45003 4.08008 2.63003C4.08008 1.81003 6.29008 1.16003 9.00008 1.16003C11.7101 1.16003 13.9201 1.82003 13.9201 2.63003Z" fill="#50E6FF"/>
<path d="M8.99937 3.00001C7.67966 2.9663 6.36394 3.15909 5.10938 3.57001C6.36513 3.97329 7.68125 4.15599 8.99937 4.11001C10.3202 4.1487 11.6373 3.95231 12.8894 3.53001C11.6312 3.1381 10.3165 2.95897 8.99937 3.00001Z" fill="#198AB3"/>
<path d="M12.9 11.4V7.99995H12V12.13H14.46V11.4H12.9ZM5.76001 9.72995C5.57419 9.65522 5.4019 9.5505 5.25001 9.41995C5.20968 9.37731 5.17828 9.32704 5.15767 9.27208C5.13706 9.21712 5.12766 9.1586 5.13001 9.09995C5.12695 9.04125 5.13915 8.98275 5.16544 8.93017C5.19173 8.87759 5.23121 8.83272 5.28001 8.79995C5.403 8.71485 5.55062 8.67268 5.70001 8.67995C6.05617 8.66395 6.40767 8.76588 6.70001 8.96995V8.10995C6.38052 7.99108 6.04064 7.9367 5.70001 7.94995C5.30768 7.92906 4.92089 8.04972 4.61001 8.28995C4.47451 8.39443 4.36577 8.5296 4.29275 8.68433C4.21973 8.83907 4.18451 9.00894 4.19001 9.17995C4.19001 9.68995 4.51001 10.09 5.19001 10.39C5.41087 10.4837 5.61915 10.6046 5.81001 10.75C5.85676 10.7892 5.8944 10.8381 5.92031 10.8934C5.94621 10.9487 5.95976 11.0089 5.96001 11.07C5.96004 11.1306 5.94552 11.1905 5.91769 11.2444C5.88985 11.2983 5.8495 11.3448 5.80001 11.38C5.66392 11.4596 5.50752 11.4979 5.35001 11.49C4.94779 11.4866 4.56046 11.3374 4.26001 11.07V12C4.59025 12.1702 4.95868 12.2529 5.33001 12.24C5.74916 12.2648 6.16457 12.1486 6.51001 11.91C6.63202 11.7944 6.72538 11.652 6.78267 11.494C6.83996 11.336 6.85959 11.1669 6.84001 11C6.84482 10.7439 6.75591 10.495 6.59001 10.3C6.35637 10.0539 6.07358 9.85966 5.76001 9.72995ZM11 11.32C11.227 10.9396 11.3415 10.5027 11.33 10.06C11.3074 9.68512 11.1942 9.32137 11 8.99995C10.8439 8.68767 10.6008 8.42721 10.3 8.24995C9.99521 8.07719 9.65036 7.98753 9.30001 7.98995C8.92233 7.98165 8.54935 8.0749 8.22001 8.25995C7.9113 8.43223 7.65807 8.68892 7.49001 8.99995C7.31298 9.35353 7.2238 9.74458 7.23001 10.14C7.2321 10.4873 7.31423 10.8295 7.47001 11.14C7.62262 11.4488 7.86254 11.7061 8.16001 11.88C8.46205 12.0642 8.80645 12.1675 9.16001 12.18L10.02 13.18H11.23L10 12.08C10.4142 11.9557 10.7694 11.6858 11 11.32ZM10 11.07C9.90896 11.183 9.79296 11.2735 9.6611 11.3342C9.52924 11.3949 9.38511 11.4243 9.24001 11.42C9.09384 11.4247 8.94864 11.3945 8.81647 11.3319C8.6843 11.2693 8.56896 11.176 8.48001 11.06C8.26863 10.7712 8.16594 10.417 8.19001 10.06C8.1668 9.70297 8.26941 9.34913 8.48001 9.05995C8.57413 8.94393 8.69305 8.85047 8.82803 8.78645C8.96301 8.72242 9.11062 8.68944 9.26001 8.68995C9.40604 8.68366 9.5513 8.71426 9.68238 8.77892C9.81347 8.84359 9.92614 8.94024 10.01 9.05995C10.207 9.35476 10.3019 9.70605 10.28 10.06C10.3149 10.4197 10.2151 10.7795 10 11.07Z" fill="url(#paint1_radial)"/>
<defs>
<linearGradient id="paint0_linear" x1="2.58984" y1="10.1599" x2="15.4098" y2="10.1599" gradientUnits="userSpaceOnUse">
<stop stop-color="#005BA1"/>
<stop offset="0.07" stop-color="#0060A9"/>
<stop offset="0.36" stop-color="#0071C8"/>
<stop offset="0.52" stop-color="#0078D4"/>
<stop offset="0.64" stop-color="#0074CD"/>
<stop offset="0.82" stop-color="#006ABB"/>
<stop offset="1" stop-color="#005BA1"/>
</linearGradient>
<radialGradient id="paint1_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(9.36001 10.57) scale(7.07)">
<stop stop-color="#F2F2F2"/>
<stop offset="0.58" stop-color="#EEEEEE"/>
<stop offset="1" stop-color="#E6E6E6"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@@ -0,0 +1,26 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.99984 5.13995C5.45984 5.13995 2.58984 4.13995 2.58984 2.81995V15.1799C2.58984 16.4499 5.40984 17.4799 8.90984 17.4999H8.99984C12.5398 17.4999 15.4098 16.4999 15.4098 15.1799V2.81995C15.4098 4.10995 12.5398 5.13995 8.99984 5.13995Z" fill="url(#paint0_linear)"/>
<path d="M15.4098 2.82C15.4098 4.11 12.5398 5.14 8.99984 5.14C5.45984 5.14 2.58984 4.14 2.58984 2.82C2.58984 1.5 5.45984 0.5 8.99984 0.5C12.5398 0.5 15.4098 1.5 15.4098 2.82Z" fill="#E8E8E8"/>
<path d="M13.9201 2.63003C13.9201 3.45003 11.7101 4.11003 9.00008 4.11003C6.29008 4.11003 4.08008 3.45003 4.08008 2.63003C4.08008 1.81003 6.29008 1.16003 9.00008 1.16003C11.7101 1.16003 13.9201 1.82003 13.9201 2.63003Z" fill="#50E6FF"/>
<path d="M8.99937 3.00001C7.67966 2.9663 6.36394 3.15909 5.10938 3.57001C6.36513 3.97329 7.68125 4.15599 8.99937 4.11001C10.3202 4.1487 11.6373 3.95231 12.8894 3.53001C11.6312 3.1381 10.3165 2.95897 8.99937 3.00001Z" fill="#198AB3"/>
<path d="M12.9 11.4V7.99995H12V12.13H14.46V11.4H12.9ZM5.76001 9.72995C5.57419 9.65522 5.4019 9.5505 5.25001 9.41995C5.20968 9.37731 5.17828 9.32704 5.15767 9.27208C5.13706 9.21712 5.12766 9.1586 5.13001 9.09995C5.12695 9.04125 5.13915 8.98275 5.16544 8.93017C5.19173 8.87759 5.23121 8.83272 5.28001 8.79995C5.403 8.71485 5.55062 8.67268 5.70001 8.67995C6.05617 8.66395 6.40767 8.76588 6.70001 8.96995V8.10995C6.38052 7.99108 6.04064 7.9367 5.70001 7.94995C5.30768 7.92906 4.92089 8.04972 4.61001 8.28995C4.47451 8.39443 4.36577 8.5296 4.29275 8.68433C4.21973 8.83907 4.18451 9.00894 4.19001 9.17995C4.19001 9.68995 4.51001 10.09 5.19001 10.39C5.41087 10.4837 5.61915 10.6046 5.81001 10.75C5.85676 10.7892 5.8944 10.8381 5.92031 10.8934C5.94621 10.9487 5.95976 11.0089 5.96001 11.07C5.96004 11.1306 5.94552 11.1905 5.91769 11.2444C5.88985 11.2983 5.8495 11.3448 5.80001 11.38C5.66392 11.4596 5.50752 11.4979 5.35001 11.49C4.94779 11.4866 4.56046 11.3374 4.26001 11.07V12C4.59025 12.1702 4.95868 12.2529 5.33001 12.24C5.74916 12.2648 6.16457 12.1486 6.51001 11.91C6.63202 11.7944 6.72538 11.652 6.78267 11.494C6.83996 11.336 6.85959 11.1669 6.84001 11C6.84482 10.7439 6.75591 10.495 6.59001 10.3C6.35637 10.0539 6.07358 9.85966 5.76001 9.72995ZM11 11.32C11.227 10.9396 11.3415 10.5027 11.33 10.06C11.3074 9.68512 11.1942 9.32137 11 8.99995C10.8439 8.68767 10.6008 8.42721 10.3 8.24995C9.99521 8.07719 9.65036 7.98753 9.30001 7.98995C8.92233 7.98165 8.54935 8.0749 8.22001 8.25995C7.9113 8.43223 7.65807 8.68892 7.49001 8.99995C7.31298 9.35353 7.2238 9.74458 7.23001 10.14C7.2321 10.4873 7.31423 10.8295 7.47001 11.14C7.62262 11.4488 7.86254 11.7061 8.16001 11.88C8.46205 12.0642 8.80645 12.1675 9.16001 12.18L10.02 13.18H11.23L10 12.08C10.4142 11.9557 10.7694 11.6858 11 11.32ZM10 11.07C9.90896 11.183 9.79296 11.2735 9.6611 11.3342C9.52924 11.3949 9.38511 11.4243 9.24001 11.42C9.09384 11.4247 8.94864 11.3945 8.81647 11.3319C8.6843 11.2693 8.56896 11.176 8.48001 11.06C8.26863 10.7712 8.16594 10.417 8.19001 10.06C8.1668 9.70297 8.26941 9.34913 8.48001 9.05995C8.57413 8.94393 8.69305 8.85047 8.82803 8.78645C8.96301 8.72242 9.11062 8.68944 9.26001 8.68995C9.40604 8.68366 9.5513 8.71426 9.68238 8.77892C9.81347 8.84359 9.92614 8.94024 10.01 9.05995C10.207 9.35476 10.3019 9.70605 10.28 10.06C10.3149 10.4197 10.2151 10.7795 10 11.07Z" fill="url(#paint1_radial)"/>
<path d="M17.8698 16.7L13.7892 8.48188C13.4567 7.83938 12.5423 7.83938 12.2117 8.48188L8.13045 16.5725C7.79795 17.215 8.13045 17.9862 8.79483 17.9862H17.2055C17.8698 18.1137 18.2017 17.3438 17.8698 16.7Z" fill="#DB7500"/>
<path d="M12.9994 17.0306C13.4995 17.0306 13.905 16.6251 13.905 16.125C13.905 15.6248 13.4995 15.2194 12.9994 15.2194C12.4992 15.2194 12.0938 15.6248 12.0938 16.125C12.0938 16.6251 12.4992 17.0306 12.9994 17.0306Z" fill="white"/>
<path d="M12.125 10.5L12.4375 14.25H13.5625L13.875 10.5H12.125Z" fill="white"/>
<defs>
<linearGradient id="paint0_linear" x1="2.58984" y1="10.1599" x2="15.4098" y2="10.1599" gradientUnits="userSpaceOnUse">
<stop stop-color="#005BA1"/>
<stop offset="0.07" stop-color="#0060A9"/>
<stop offset="0.36" stop-color="#0071C8"/>
<stop offset="0.52" stop-color="#0078D4"/>
<stop offset="0.64" stop-color="#0074CD"/>
<stop offset="0.82" stop-color="#006ABB"/>
<stop offset="1" stop-color="#005BA1"/>
</linearGradient>
<radialGradient id="paint1_radial" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(9.36001 10.57) scale(7.07)">
<stop stop-color="#F2F2F2"/>
<stop offset="0.58" stop-color="#EEEEEE"/>
<stop offset="1" stop-color="#E6E6E6"/>
</radialGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@@ -0,0 +1,19 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.84 5.09004C3.34 5.09004 0.5 4.09004 0.5 2.79004V15C0.5 16.26 3.29 17.28 6.75 17.3H6.84C10.34 17.3 13.18 16.3 13.18 15V2.79004C13.18 4.06004 10.34 5.09004 6.84 5.09004Z" fill="url(#paint0_linear)"/>
<path d="M13.18 2.79024C13.18 4.06024 10.34 5.09024 6.84 5.09024C3.34 5.09024 0.5 4.06024 0.5 2.79024C0.5 1.52023 3.34 0.490234 6.84 0.490234C10.34 0.490234 13.18 1.49023 13.18 2.79024Z" fill="#E8E8E8"/>
<path d="M11.7 2.60014C11.7 3.41014 9.52 4.06014 6.84 4.06014C4.16 4.06014 2 3.41014 2 2.60014C2 1.79014 4.16 1.14014 6.84 1.14014C9.52 1.14014 11.7 1.80014 11.7 2.60014Z" fill="#50E6FF"/>
<path d="M6.84 2.93982C5.53864 2.91368 4.2417 3.09944 3 3.48982C4.24047 3.90205 5.5433 4.09494 6.85 4.05982C8.1567 4.09494 9.45953 3.90205 10.7 3.48982C9.45192 3.09729 8.14805 2.9115 6.84 2.93982Z" fill="#198AB3"/>
<path d="M10.7411 11.1V7.71997H9.81107V11.86H12.2711V11.1H10.7411ZM3.59107 9.42997C3.40595 9.35385 3.23387 9.24926 3.08107 9.11997C3.01392 9.02771 2.98523 8.91298 3.00107 8.79997C3.00104 8.73928 3.01556 8.67946 3.04339 8.62552C3.07123 8.57159 3.11158 8.52511 3.16107 8.48997C3.28642 8.41096 3.43309 8.37255 3.58107 8.37997C3.93679 8.3676 4.28716 8.46921 4.58107 8.66997V7.80997C4.261 7.69333 3.92156 7.63902 3.58107 7.64997C3.15153 7.61397 2.72391 7.73869 2.38107 7.99997C2.24897 8.10909 2.14341 8.24681 2.07238 8.40273C2.00135 8.55866 1.96671 8.72869 1.97107 8.89997C1.97107 9.40997 2.29107 9.80997 2.97107 10.11C3.18835 10.2046 3.39321 10.3255 3.58107 10.47C3.63075 10.5072 3.67107 10.5555 3.69884 10.6111C3.72661 10.6666 3.74107 10.7279 3.74107 10.79C3.7411 10.8507 3.72658 10.9105 3.69875 10.9644C3.67091 11.0184 3.63056 11.0648 3.58107 11.1C3.4476 11.1867 3.29 11.2287 3.13107 11.22C2.70985 11.2246 2.30381 11.0629 2.00107 10.77V11.7C2.3339 11.862 2.70106 11.9409 3.07107 11.93C3.48816 11.9491 3.90078 11.8372 4.25107 11.61C4.39139 11.5025 4.50374 11.3627 4.57859 11.2026C4.65344 11.0424 4.68859 10.8666 4.68107 10.69C4.69077 10.4332 4.60125 10.1825 4.43107 9.98997C4.19355 9.74633 3.90732 9.55551 3.59107 9.42997ZM8.79107 11C9.01691 10.6155 9.13118 10.1757 9.12107 9.72997C9.1295 9.34832 9.04363 8.97049 8.87107 8.62997C8.71495 8.31769 8.47185 8.05723 8.17107 7.87997C7.86626 7.70721 7.52142 7.61755 7.17107 7.61997C6.79039 7.61324 6.41459 7.70633 6.08107 7.88997C5.7685 8.07077 5.51496 8.33821 5.35107 8.65997C5.17053 9.01586 5.08119 9.41102 5.09107 9.80997C5.08528 10.1742 5.16762 10.5344 5.33107 10.86C5.4827 11.1689 5.71839 11.4289 6.01107 11.61C6.31295 11.7932 6.65798 11.8933 7.01107 11.9L7.86107 12.9H9.05107L7.85107 11.79C8.24688 11.6442 8.57936 11.3648 8.79107 11ZM7.86107 10.74C7.7672 10.8515 7.6501 10.9411 7.51795 11.0026C7.38581 11.0641 7.24182 11.0959 7.09607 11.0959C6.95032 11.0959 6.80633 11.0641 6.67419 11.0026C6.54204 10.9411 6.42494 10.8515 6.33107 10.74C6.12245 10.4502 6.02324 10.0959 6.05107 9.73997C6.02342 9.38252 6.12647 9.02718 6.34107 8.73997C6.4309 8.6192 6.54898 8.52231 6.68498 8.4578C6.82097 8.39329 6.97071 8.36313 7.12107 8.36997C7.26683 8.36548 7.41146 8.39687 7.54224 8.46139C7.67301 8.52591 7.78594 8.62157 7.87107 8.73997C8.06808 9.03477 8.16293 9.38607 8.14107 9.73997C8.18108 10.1063 8.08106 10.4743 7.86107 10.77V10.74Z" fill="#F2F2F2"/>
<path d="M14.8096 17.4899L15.0496 16.6999L15.5196 16.4299L16.3296 16.7899L16.8496 16.2599V16.1999L16.4796 15.4899L16.6996 14.9899L17.5096 14.6999H17.5996V13.9699H17.4996L16.6996 13.7299L16.4396 13.2699L16.7896 12.4499L16.2596 11.9399H16.1996L15.4896 12.2999L14.9996 11.9999L14.6796 11.1099H13.9396V11.2199L13.6996 12.0099L13.1896 12.2299L12.3196 11.8299L11.8096 12.3599L11.8596 12.4599L12.2396 13.1999L12.0396 13.7099L11.0996 13.9999V14.7399H11.2096L11.9996 14.9799L12.2196 15.4899L11.8296 16.3499L12.3596 16.8699L12.4496 16.8199L13.1896 16.4399L13.6996 16.6399L14.0396 17.5299H14.7696L14.8096 17.4899ZM13.6096 15.1299C13.408 14.9323 13.2932 14.6627 13.2904 14.3805C13.2876 14.0982 13.397 13.8264 13.5946 13.6249C13.7922 13.4233 14.0618 13.3085 14.344 13.3057C14.6262 13.3029 14.898 13.4123 15.0996 13.6099C15.1994 13.7077 15.279 13.8242 15.3337 13.9528C15.3885 14.0814 15.4174 14.2195 15.4188 14.3593C15.4202 14.499 15.3941 14.6377 15.3419 14.7673C15.2897 14.897 15.2124 15.0151 15.1146 15.1149C15.0168 15.2147 14.9002 15.2942 14.7717 15.349C14.6431 15.4038 14.505 15.4327 14.3652 15.4341C14.2255 15.4354 14.0868 15.4093 13.9572 15.3571C13.8275 15.3049 13.7094 15.2277 13.6096 15.1299Z" fill="#949494"/>
<defs>
<linearGradient id="paint0_linear" x1="0.5" y1="10.04" x2="13.18" y2="10.04" gradientUnits="userSpaceOnUse">
<stop stop-color="#005BA1"/>
<stop offset="0.07" stop-color="#0060A9"/>
<stop offset="0.36" stop-color="#0071C8"/>
<stop offset="0.52" stop-color="#0078D4"/>
<stop offset="0.64" stop-color="#0074CD"/>
<stop offset="0.82" stop-color="#006ABB"/>
<stop offset="1" stop-color="#005BA1"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -24,6 +24,9 @@ export class IconPathHelper {
public static notStartedMigration: IconPath;
public static sqlVmLogo: IconPath;
public static sqlMiLogo: IconPath;
public static sqlServerLogo: IconPath;
public static sqlDatabaseLogo: IconPath;
public static sqlDatabaseWarningLogo: IconPath;
public static setExtensionContext(context: vscode.ExtensionContext) {
IconPathHelper.copy = {
@@ -78,5 +81,17 @@ export class IconPathHelper {
light: context.asAbsolutePath('images/sqlVM.svg'),
dark: context.asAbsolutePath('images/sqlVM.svg')
};
IconPathHelper.sqlServerLogo = {
light: context.asAbsolutePath('images/sqlServer.svg'),
dark: context.asAbsolutePath('images/sqlServer.svg')
};
IconPathHelper.sqlDatabaseLogo = {
light: context.asAbsolutePath('images/sqlDatabase.svg'),
dark: context.asAbsolutePath('images/sqlDatabase.svg')
};
IconPathHelper.sqlDatabaseWarningLogo = {
light: context.asAbsolutePath('images/sqlDatabaseWarning.svg'),
dark: context.asAbsolutePath('images/sqlDatabaseWarning.svg')
};
}
}

View File

@@ -274,6 +274,28 @@ export function ENTER_YOUR_SQL_CREDS(sqlServerName: string) {
return localize('sql.migration.enter.your.sql.creds', "Enter the credentials for source SQL server instance {0}", sqlServerName);
}
export const USERNAME = localize('sql.migration.username', "Username");
//Assessment Dialog
export const DATABASES = localize('sql.migration.databases', "Databases");
export const ISSUES = localize('sql.migration.issues', "Issues");
export const SEARCH = localize('sql.migration.search', "Search");
export const INSTANCE = localize('sql.migration.instance', "Instance");
export const WARNINGS = localize('sql.migration.warnings', "Warnings");
export const IMPACTED_OBJECTS = localize('sql.migration.impacted.objects', "Impacted Objects");
export const OBJECT_DETAILS = localize('sql.migration.object.details', "Object details");
export const TYPES_LABEL = localize('sql.migration.type.label', "Type:");
export const NAMES_LABEL = localize('sql.migration.name.label', "Names:");
export const DESCRIPTION = localize('sql.migration.description', "Description");
export const RECOMMENDATION = localize('sql.migration.recommendation', "Recommendation");
export const MORE_INFO = localize('sql.migration.more.info', "More Info");
export const TARGET_PLATFORM = localize('sql.migration.target.platform', "Target Platform");
export const WARNINGS_DETAILS = localize('sql.migration.warnings.details', "Warnings Details");
export function IMPACT_OBJECT_TYPE(objectType: string): string {
return localize('sql.migration.impact.object.type', "Type: {0}", objectType);
}
export function IMPACT_OBJECT_NAME(objectName: string): string {
return localize('sql.migration.impact.object.name', "Name: {0}", objectName);
}
export const AUTHENTICATION_TYPE = localize('sql.migration.authentication.type', "Authentication Type");
export const SQL_LOGIN = localize('sql.migration.sql.login', "SQL Login");
export const WINDOWS_AUTHENTICATION = localize('sql.migration.windows.auth', "Windows Authentication");

View File

@@ -4,29 +4,47 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import { SqlMigrationAssessmentResultItem, SqlMigrationImpactedObjectInfo } from '../../../../mssql/src/mssql';
import { IconPath, IconPathHelper } from '../../constants/iconPathHelper';
import { MigrationStateModel, MigrationTargetType } from '../../models/stateMachine';
import * as constants from '../../constants/strings';
const styleLeft: azdata.CssStyles = {
'border': 'none',
'text-align': 'left',
'white-space': 'nowrap',
'text-overflow': 'ellipsis',
'overflow': 'hidden'
'overflow': 'hidden',
};
const styleRight: azdata.CssStyles = {
'border': 'none',
'text-align': 'right',
'white-space': 'nowrap',
'text-overflow': 'ellipsis',
'overflow': 'hidden'
'overflow': 'hidden',
};
const headerLeft: azdata.CssStyles = {
'border': 'none',
'text-align': 'left',
'white-space': 'nowrap',
'text-overflow': 'ellipsis',
'overflow': 'hidden',
'border-bottom': '1px solid'
};
const headerRight: azdata.CssStyles = {
'border': 'none',
'text-align': 'right',
'white-space': 'nowrap',
'text-overflow': 'ellipsis',
'overflow': 'hidden',
'border-bottom': '1px solid'
};
export class SqlDatabaseTree {
private _view!: azdata.ModelView;
private _instanceTable!: azdata.DeclarativeTableComponent;
private _databaseTable!: azdata.DeclarativeTableComponent;
private _assessmentResultsTable!: azdata.DeclarativeTableComponent;
private _impactedObjectsTable!: azdata.DeclarativeTableComponent;
private _recommendation!: azdata.TextComponent;
@@ -44,6 +62,9 @@ export class SqlDatabaseTree {
private _selectedIssue!: SqlMigrationAssessmentResultItem;
private _selectedObject!: SqlMigrationImpactedObjectInfo;
private _serverName!: string;
private _dbNames!: string[];
constructor(
private _model: MigrationStateModel,
private _targetType: MigrationTargetType
@@ -51,6 +72,7 @@ export class SqlDatabaseTree {
}
async createComponent(view: azdata.ModelView, dbs: string[]): Promise<azdata.Component> {
this._view = view;
const component = view.modelBuilder.flexContainer().withLayout({
height: '100%',
flexFlow: 'column'
@@ -60,14 +82,15 @@ export class SqlDatabaseTree {
},
}).component();
component.addItem(this.createSearchComponent(view), { flex: '0 0 auto' });
component.addItem(this.createInstanceComponent(view), { flex: '0 0 auto' });
component.addItem(this.createDatabaseComponent(view, dbs), { flex: '1 1 auto', CSSStyles: { 'overflow-y': 'auto' } });
component.addItem(this.createSearchComponent(), { flex: '0 0 auto' });
component.addItem(this.createInstanceComponent(), { flex: '0 0 auto' });
component.addItem(this.createDatabaseComponent(dbs), { flex: '1 1 auto', CSSStyles: { 'overflow-y': 'auto' } });
return component;
}
private createDatabaseComponent(view: azdata.ModelView, dbs: string[]): azdata.DivContainer {
this._databaseTable = view.modelBuilder.declarativeTable().withProps(
private createDatabaseComponent(dbs: string[]): azdata.DivContainer {
this._databaseTable = this._view.modelBuilder.declarativeTable().withProps(
{
enableRowSelection: true,
width: 200,
@@ -81,22 +104,21 @@ export class SqlDatabaseTree {
width: 20,
isReadOnly: false,
showCheckAll: true,
headerCssStyles: styleLeft,
ariaLabel: 'Database Migration Check' // TODO localize
headerCssStyles: headerLeft,
},
{
displayName: 'Databases', // TODO localize
valueType: azdata.DeclarativeDataType.string,
displayName: constants.DATABASES,
valueType: azdata.DeclarativeDataType.component,
width: 100,
isReadOnly: true,
headerCssStyles: styleLeft
headerCssStyles: headerLeft
},
{
displayName: 'Issues', // Incidents
displayName: constants.ISSUES,
valueType: azdata.DeclarativeDataType.string,
width: 30,
isReadOnly: true,
headerCssStyles: styleRight,
headerCssStyles: headerRight,
}
]
}
@@ -106,76 +128,69 @@ export class SqlDatabaseTree {
this._databaseTable.focus();
this._activeIssues = this._model._assessmentResults?.databaseAssessments[row].issues;
this._selectedIssue = this._model._assessmentResults?.databaseAssessments[row].issues[0];
this._dbName.value = <string>this._databaseTable.dataValues![row][1].value;
this._dbName.value = this._dbNames[row];
this.refreshResults();
});
const tableContainer = view.modelBuilder.divContainer().withItems([this._databaseTable]).withProps({
const tableContainer = this._view.modelBuilder.divContainer().withItems([this._databaseTable]).withProps({
CSSStyles: {
'width': '200px',
'margin-left': '15px',
'margin-right': '5px',
'margin-bottom': '10px'
'margin': '0px 8px 0px 34px'
}
}).component();
return tableContainer;
}
private createSearchComponent(view: azdata.ModelView): azdata.DivContainer {
let resourceSearchBox = view.modelBuilder.inputBox().withProperties({
placeHolder: 'Search',
private createSearchComponent(): azdata.DivContainer {
let resourceSearchBox = this._view.modelBuilder.inputBox().withProps({
placeHolder: constants.SEARCH,
width: 200
}).component();
const searchContainer = view.modelBuilder.divContainer().withItems([resourceSearchBox]).withProps({
const searchContainer = this._view.modelBuilder.divContainer().withItems([resourceSearchBox]).withProps({
CSSStyles: {
'width': '200px',
'margin-left': '15px',
'margin-right': '5px',
'margin-bottom': '10px'
'margin': '32px 8px 0px 34px'
}
}).component();
return searchContainer;
}
private createInstanceComponent(view: azdata.ModelView): azdata.DivContainer {
this._instanceTable = view.modelBuilder.declarativeTable().withProps(
private createInstanceComponent(): azdata.DivContainer {
this._instanceTable = this._view.modelBuilder.declarativeTable().withProps(
{
enableRowSelection: true,
width: 200,
columns: [
{
displayName: 'Instance',
valueType: azdata.DeclarativeDataType.string,
displayName: constants.INSTANCE,
valueType: azdata.DeclarativeDataType.component,
width: 150,
isReadOnly: true,
headerCssStyles: styleLeft,
ariaLabel: 'Database Migration Check' // TODO localize
headerCssStyles: headerLeft
},
{
displayName: 'Warnings', // TODO localize
displayName: constants.WARNINGS,
valueType: azdata.DeclarativeDataType.string,
width: 50,
isReadOnly: true,
headerCssStyles: styleRight
headerCssStyles: headerRight
}
],
}).component();
const instanceContainer = view.modelBuilder.divContainer().withItems([this._instanceTable]).withProps({
const instanceContainer = this._view.modelBuilder.divContainer().withItems([this._instanceTable]).withProps({
CSSStyles: {
'width': '200px',
'margin-left': '15px',
'margin-right': '5px',
'margin-bottom': '10px'
'margin': '19px 8px 0px 34px'
}
}).component();
this._instanceTable.onRowSelected((e) => {
this._activeIssues = this._model._assessmentResults?.issues;
this._selectedIssue = this._model._assessmentResults?.issues[0];
this._dbName.value = <string>this._instanceTable.dataValues![0][0].value;
this._dbName.value = this._serverName;
this.refreshResults();
});
@@ -183,17 +198,16 @@ export class SqlDatabaseTree {
}
async createComponentResult(view: azdata.ModelView): Promise<azdata.Component> {
this._view = view;
const topContainer = this.createTopContainer();
const bottomContainer = this.createBottomContainer();
const topContainer = this.createTopContainer(view);
const bottomContainer = this.createBottomContainer(view);
const container = view.modelBuilder.flexContainer().withLayout({
const container = this._view.modelBuilder.flexContainer().withLayout({
flexFlow: 'column',
height: '100%'
}).withProps({
CSSStyles: {
'margin-left': '10px',
'margin-right': '15px',
'margin': '32px 0px 0px 18px',
'overflow-y': 'hidden'
}
}).component();
@@ -205,25 +219,42 @@ export class SqlDatabaseTree {
}
private createTopContainer(view: azdata.ModelView): azdata.FlexContainer {
const title = this.createTitleComponent(view);
const impact = this.createPlatformComponent(view);
const recommendation = this.createRecommendationComponent(view);
const assessmentResults = this.createAssessmentResultsTitle(view);
private createTopContainer(): azdata.FlexContainer {
const title = this.createTitleComponent();
const impact = this.createPlatformComponent();
const recommendation = this.createRecommendationComponent();
const assessmentResultsTitle = this.createAssessmentResultsTitle();
const assessmentDetailsTitle = this.createAssessmentDetailsTitle();
const container = view.modelBuilder.flexContainer().withItems([title, impact, recommendation, assessmentResults]).withLayout({
const titleContainer = this._view.modelBuilder.flexContainer().withItems([
]).withProps({
CSSStyles: {
'border-bottom': 'solid 1px',
'width': '800px'
}
}).component();
titleContainer.addItem(assessmentResultsTitle, {
flex: '0 0 auto'
});
titleContainer.addItem(assessmentDetailsTitle, {
flex: '0 0 auto'
});
const container = this._view.modelBuilder.flexContainer().withItems([title, impact, recommendation, titleContainer]).withLayout({
flexFlow: 'column'
}).component();
return container;
}
private createBottomContainer(view: azdata.ModelView): azdata.FlexContainer {
private createBottomContainer(): azdata.FlexContainer {
const impactedObjects = this.createImpactedObjectsTable(view);
const rightContainer = this.createAssessmentContainer(view);
const impactedObjects = this.createImpactedObjectsTable();
const rightContainer = this.createAssessmentContainer();
const container = view.modelBuilder.flexContainer().withLayout({
const container = this._view.modelBuilder.flexContainer().withLayout({
flexFlow: 'row',
height: '100%'
}).withProps({
@@ -237,189 +268,196 @@ export class SqlDatabaseTree {
return container;
}
private createAssessmentContainer(view: azdata.ModelView): azdata.FlexContainer {
const title = this.createAssessmentTitle(view);
private createAssessmentContainer(): azdata.FlexContainer {
const title = this.createAssessmentTitle();
const bottomContainer = this.createDescriptionContainer(view);
const bottomContainer = this.createDescriptionContainer();
const container = view.modelBuilder.flexContainer().withItems([title, bottomContainer]).withLayout({
const container = this._view.modelBuilder.flexContainer().withItems([title, bottomContainer]).withLayout({
flexFlow: 'column'
}).withProps({
CSSStyles: {
'margin-left': '10px'
'margin-left': '24px'
}
}).component();
return container;
}
private createDescriptionContainer(view: azdata.ModelView): azdata.FlexContainer {
const description = this.createDescription(view);
const impactedObjects = this.createImpactedObjectsDescription(view);
private createDescriptionContainer(): azdata.FlexContainer {
const description = this.createDescription();
const impactedObjects = this.createImpactedObjectsDescription();
const container = view.modelBuilder.flexContainer().withLayout({
const container = this._view.modelBuilder.flexContainer().withLayout({
flexFlow: 'row'
}).withProps({
CSSStyles: {
'height': '100%'
}
}).component();
container.addItem(description, { flex: '1 1 auto', CSSStyles: { 'width': '50%', 'margin-right': '10px' } });
container.addItem(impactedObjects, { flex: '1 1 auto', CSSStyles: { 'width': '50%', 'margin-left': '10px' } });
container.addItem(description, { flex: '0 0 auto', CSSStyles: { 'width': '200px', 'margin-right': '35px' } });
container.addItem(impactedObjects, { flex: '0 0 auto', CSSStyles: { 'width': '280px' } });
return container;
}
private createImpactedObjectsDescription(view: azdata.ModelView): azdata.FlexContainer {
const impactedObjectsTitle = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'Impacted Objects',
private createImpactedObjectsDescription(): azdata.FlexContainer {
const impactedObjectsTitle = this._view.modelBuilder.text().withProps({
value: constants.IMPACTED_OBJECTS,
CSSStyles: {
'font-size': '14px'
'font-size': '14px',
'width': '280px',
'margin': '10px 0px 0px 0px'
}
}).component();
const headerStyle: azdata.CssStyles = {
'border': 'none',
'text-align': 'left'
};
const rowStyle: azdata.CssStyles = {
'border': 'none',
'text-align': 'left'
'text-align': 'left',
'border-bottom': '1px solid'
};
this._impactedObjectsTable = view.modelBuilder.declarativeTable().withProps(
this._impactedObjectsTable = this._view.modelBuilder.declarativeTable().withProps(
{
enableRowSelection: true,
width: '100%',
columns: [
{
displayName: 'Type', // TODO localize
displayName: constants.TYPE,
valueType: azdata.DeclarativeDataType.string,
width: '100%',
width: '120px',
isReadOnly: true,
headerCssStyles: headerStyle,
headerCssStyles: headerLeft,
rowCssStyles: rowStyle
},
{
displayName: 'Name', // TODO localize
displayName: constants.NAME,
valueType: azdata.DeclarativeDataType.string,
width: '100%',
width: '130px',
isReadOnly: true,
headerCssStyles: headerStyle,
headerCssStyles: headerLeft,
rowCssStyles: rowStyle
},
],
dataValues: [
[
{
value: 'Agent Job'
value: ''
},
{
value: 'Process Monthly Usage'
value: ''
}
]
]
],
CSSStyles: {
'margin-top': '12px'
}
}
).component();
this._impactedObjectsTable.onRowSelected(({ row }) => {
this._selectedObject = this._impactedObjects[row];
this.refreshImpactedObject();
});
const objectDetailsTitle = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'Object details',
const objectDetailsTitle = this._view.modelBuilder.text().withProps({
value: constants.OBJECT_DETAILS,
CSSStyles: {
'margin-top': '10px',
'font-size': '14px',
'margin-block-start': '0px',
'margin-block-end': '0px'
'font-size': '13px',
'line-size': '18px',
'margin': '12px 0px 0px 0px'
}
}).component();
this._objectDetailsType = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'Type:',
this._objectDetailsType = this._view.modelBuilder.text().withProps({
value: constants.TYPES_LABEL,
CSSStyles: {
'font-size': '14px',
'margin-block-start': '0px',
'margin-block-end': '0px'
'font-size': '13px',
'line-size': '18px',
'margin': '5px 0px 0px 0px'
}
}).component();
this._objectDetailsName = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'Name:',
this._objectDetailsName = this._view.modelBuilder.text().withProps({
value: constants.NAMES_LABEL,
CSSStyles: {
'font-size': '14px',
'margin-block-start': '0px',
'margin-block-end': '0px'
'font-size': '13px',
'line-size': '18px',
'margin': '5px 0px 0px 0px'
}
}).component();
this._objectDetailsSample = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'Sample',
this._objectDetailsSample = this._view.modelBuilder.text().withProps({
value: '',
CSSStyles: {
'font-size': '14px',
'margin-block-start': '0px',
'margin-block-end': '0px'
'font-size': '13px',
'line-size': '18px',
'margin': '5px 0px 0px 0px'
}
}).component();
const container = view.modelBuilder.flexContainer().withItems([impactedObjectsTitle, this._impactedObjectsTable, objectDetailsTitle, this._objectDetailsType, this._objectDetailsName, this._objectDetailsSample]).withLayout({
const container = this._view.modelBuilder.flexContainer().withItems([impactedObjectsTitle, this._impactedObjectsTable, objectDetailsTitle, this._objectDetailsType, this._objectDetailsName, this._objectDetailsSample]).withLayout({
flexFlow: 'column'
}).component();
return container;
}
private createDescription(view: azdata.ModelView): azdata.FlexContainer {
const descriptionTitle = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'Description',
private createDescription(): azdata.FlexContainer {
const descriptionTitle = this._view.modelBuilder.text().withProps({
value: constants.DESCRIPTION,
CSSStyles: {
'font-size': '14px',
'margin-block-start': '0px',
'margin-block-end': '0px'
'width': '200px',
'margin': '10px 35px 0px 0px'
}
}).component();
this._descriptionText = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'It is a job step that runs a PowerShell scripts.',
CSSStyles: {
'font-size': '12px'
}
}).component();
const recommendationTitle = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'Recommendation',
CSSStyles: {
'font-size': '14px',
'margin-block-start': '0px',
'margin-block-end': '0px'
}
}).component();
this._recommendationText = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: '',
this._descriptionText = this._view.modelBuilder.text().withProps({
CSSStyles: {
'font-size': '12px',
'width': '250px'
'width': '200px',
'margin': '3px 35px 0px 0px'
}
}).component();
const moreInfo = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'More Info',
const recommendationTitle = this._view.modelBuilder.text().withProps({
value: constants.RECOMMENDATION,
CSSStyles: {
'font-size': '14px',
'margin-block-start': '0px',
'margin-block-end': '0px'
'width': '200px',
'margin': '12px 35px 0px 0px'
}
}).component();
this._moreInfo = view.modelBuilder.hyperlink().component();
this._recommendationText = this._view.modelBuilder.text().withProps({
CSSStyles: {
'font-size': '12px',
'width': '200px',
'margin': '3px 35px 0px 0px'
}
}).component();
const moreInfo = this._view.modelBuilder.text().withProps({
value: constants.MORE_INFO,
CSSStyles: {
'font-size': '14px',
'width': '200px',
'margin': '15px 35px 0px 0px'
}
}).component();
this._moreInfo = this._view.modelBuilder.hyperlink().withProps({
label: '',
url: '',
CSSStyles: {
'font-size': '12px',
'width': '200px',
'margin': '3px 35px 0px 0px'
},
showLinkIcon: true
}).component();
const container = view.modelBuilder.flexContainer().withItems([descriptionTitle, this._descriptionText, recommendationTitle, this._recommendationText, moreInfo, this._moreInfo]).withLayout({
const container = this._view.modelBuilder.flexContainer().withItems([descriptionTitle, this._descriptionText, recommendationTitle, this._recommendationText, moreInfo, this._moreInfo]).withLayout({
flexFlow: 'column'
}).component();
@@ -427,13 +465,15 @@ export class SqlDatabaseTree {
}
private createAssessmentTitle(view: azdata.ModelView): azdata.TextComponent {
this._assessmentTitle = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
private createAssessmentTitle(): azdata.TextComponent {
this._assessmentTitle = this._view.modelBuilder.text().withProps({
value: '',
CSSStyles: {
'font-size': '15px',
'line-size': '19px',
'padding-bottom': '15px',
'font-size': '13px',
'line-size': '18px',
'height': '48px',
'width': '540px',
'font-weight': '600',
'border-bottom': 'solid 1px'
}
}).component();
@@ -441,57 +481,67 @@ export class SqlDatabaseTree {
return this._assessmentTitle;
}
private createTitleComponent(view: azdata.ModelView): azdata.TextComponent {
const title = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
value: 'Target Platform',
private createTitleComponent(): azdata.TextComponent {
const title = this._view.modelBuilder.text().withProps({
value: constants.TARGET_PLATFORM,
CSSStyles: {
'font-size': '13px',
'line-size': '19px',
'margin-block-start': '0px',
'margin-block-end': '2px'
'margin': '0px 0px 0px 0px'
}
});
return title.component();
}
private createPlatformComponent(view: azdata.ModelView): azdata.TextComponent {
const impact = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
title: 'Platform', // TODO localize
value: (this._targetType === MigrationTargetType.SQLVM) ? 'Azure SQL Virtual Machine' : 'Azure SQL Managed Instance',
private createPlatformComponent(): azdata.TextComponent {
const impact = this._view.modelBuilder.text().withProps({
value: (this._targetType === MigrationTargetType.SQLVM) ? constants.SUMMARY_VM_TYPE : constants.SUMMARY_MI_TYPE,
CSSStyles: {
'font-size': '18px',
'margin-block-start': '0px',
'margin-block-end': '0px'
'margin': '0px 0px 0px 0px'
}
});
return impact.component();
}
private createRecommendationComponent(view: azdata.ModelView): azdata.TextComponent {
this._dbName = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
title: 'Recommendation', // TODO localize
value: 'SQL Server 1',
private createRecommendationComponent(): azdata.TextComponent {
this._dbName = this._view.modelBuilder.text().withProps({
CSSStyles: {
'font-size': '14px',
'font-weight': 'bold'
'font-size': '13px',
'font-weight': 'bold',
'margin': '10px 0px 0px 0px'
}
}).component();
return this._dbName;
}
private createAssessmentResultsTitle(view: azdata.ModelView): azdata.TextComponent {
this._recommendation = view.modelBuilder.text().withProperties<azdata.TextComponentProperties>({
title: 'Recommendation', // TODO localize
value: 'Warnings',
private createAssessmentResultsTitle(): azdata.TextComponent {
this._recommendation = this._view.modelBuilder.text().withProps({
value: constants.WARNINGS,
CSSStyles: {
'font-size': '14px',
'font-weight': 'bold',
'border-bottom': 'solid 1px',
'margin-block-start': '0px',
'margin-block-end': '0px'
'font-size': '13px',
'line-height': '18px',
'width': '200px',
'font-weight': '600',
'margin': '8px 35px 5px 0px'
}
}).component();
return this._recommendation;
}
private createAssessmentDetailsTitle(): azdata.TextComponent {
this._recommendation = this._view.modelBuilder.text().withProps({
value: constants.WARNINGS_DETAILS,
CSSStyles: {
'font-size': '13px',
'line-height': '18px',
'width': '200px',
'font-weight': '600',
'margin': '8px 0px 5px 0px'
}
}).component();
@@ -499,7 +549,7 @@ export class SqlDatabaseTree {
}
private createImpactedObjectsTable(view: azdata.ModelView): azdata.DeclarativeTableComponent {
private createImpactedObjectsTable(): azdata.DeclarativeTableComponent {
const headerStyle: azdata.CssStyles = {
'border': 'none',
@@ -511,10 +561,11 @@ export class SqlDatabaseTree {
'white-space': 'nowrap',
'text-overflow': 'ellipsis',
'width': '200px',
'overflow': 'hidden'
'overflow': 'hidden',
'border-bottom': '1px solid'
};
this._assessmentResultsTable = view.modelBuilder.declarativeTable().withProps(
this._assessmentResultsTable = this._view.modelBuilder.declarativeTable().withProps(
{
enableRowSelection: true,
width: '200px',
@@ -523,25 +574,13 @@ export class SqlDatabaseTree {
},
columns: [
{
displayName: '', // TODO localize
displayName: '',
valueType: azdata.DeclarativeDataType.string,
width: '100%',
isReadOnly: true,
headerCssStyles: headerStyle,
rowCssStyles: rowStyle
}
],
dataValues: [
[
{
value: 'DB1 Assessment results'
}
],
[
{
value: 'DB2 Assessment results'
}
]
]
}
).component();
@@ -587,7 +626,7 @@ export class SqlDatabaseTree {
this._moreInfo.url = this._selectedIssue.helpLink;
this._moreInfo.label = this._selectedIssue.helpLink;
this._impactedObjects = this._selectedIssue.impactedObjects;
this._recommendationText.value = this._selectedIssue.message; // Expose correct property for recommendation.
this._recommendationText.value = this._selectedIssue.message; //TODO: Expose correct property for recommendation.
this._impactedObjectsTable.dataValues = this._selectedIssue.impactedObjects.map((object) => {
return [
{
@@ -613,8 +652,8 @@ export class SqlDatabaseTree {
public refreshImpactedObject(): void {
if (this._selectedObject) {
this._objectDetailsType.value = `Type: ${this._selectedObject.objectType!}`;
this._objectDetailsName.value = `Name: ${this._selectedObject.name}`;
this._objectDetailsType.value = constants.IMPACT_OBJECT_TYPE(this._selectedObject.objectType!);
this._objectDetailsName.value = constants.IMPACT_OBJECT_NAME(this._selectedObject.name);
this._objectDetailsSample.value = this._selectedObject.impactDetail;
} else {
this._objectDetailsType.value = ``;
@@ -628,15 +667,15 @@ export class SqlDatabaseTree {
let instanceTableValues: azdata.DeclarativeTableCellValue[][] = [];
let databaseTableValues: azdata.DeclarativeTableCellValue[][] = [];
const excludedDatabases = ['master', 'msdb', 'tempdb', 'model'];
const dbList = (await azdata.connection.listDatabases(this._model.sourceConnectionId)).filter(db => !excludedDatabases.includes(db));
this._dbNames = (await azdata.connection.listDatabases(this._model.sourceConnectionId)).filter(db => !excludedDatabases.includes(db));
const selectedDbs = (this._targetType === MigrationTargetType.SQLVM) ? this._model._vmDbs : this._model._miDbs;
const serverName = (await this._model.getSourceConnectionProfile()).serverName;
this._serverName = (await this._model.getSourceConnectionProfile()).serverName;
if (this._targetType === MigrationTargetType.SQLVM || !this._model._assessmentResults) {
instanceTableValues = [
[
{
value: serverName,
value: this.createIconTextCell(IconPathHelper.sqlServerLogo, this._serverName),
style: styleLeft
},
{
@@ -645,7 +684,7 @@ export class SqlDatabaseTree {
}
]
];
dbList.forEach((db) => {
this._dbNames.forEach((db) => {
databaseTableValues.push(
[
{
@@ -653,7 +692,7 @@ export class SqlDatabaseTree {
style: styleLeft
},
{
value: db,
value: this.createIconTextCell(IconPathHelper.sqlDatabaseLogo, db),
style: styleLeft
},
{
@@ -667,7 +706,7 @@ export class SqlDatabaseTree {
instanceTableValues = [
[
{
value: serverName,
value: this.createIconTextCell(IconPathHelper.sqlServerLogo, this._serverName),
style: styleLeft
},
{
@@ -684,7 +723,7 @@ export class SqlDatabaseTree {
style: styleLeft
},
{
value: db.name,
value: this.createIconTextCell((db.issues.length === 0) ? IconPathHelper.sqlDatabaseLogo : IconPathHelper.sqlDatabaseWarningLogo, db.name),
style: styleLeft
},
{
@@ -695,11 +734,49 @@ export class SqlDatabaseTree {
);
});
}
this._dbName.value = serverName;
this._dbName.value = this._serverName;
this._instanceTable.dataValues = instanceTableValues;
this._databaseTable.dataValues = databaseTableValues;
if (this._targetType === MigrationTargetType.SQLMI) {
this._activeIssues = this._model._assessmentResults.issues;
this._selectedIssue = this._model._assessmentResults?.issues[0];
this.refreshResults();
this._instanceTable.dataValues = instanceTableValues;
this._databaseTable.dataValues = databaseTableValues;
}
}
private createIconTextCell(icon: IconPath, text: string): azdata.FlexContainer {
const iconComponent = this._view.modelBuilder.image().withProps({
iconPath: icon,
iconWidth: '16px',
iconHeight: '16px',
width: '20px',
height: '20px'
}).component();
const textComponent = this._view.modelBuilder.text().withProps({
value: text,
CSSStyles: {
'margin': '0px'
}
}).component();
const cellContainer = this._view.modelBuilder.flexContainer().withProps({
CSSStyles: {
'justify-content': 'left'
}
}).component();
cellContainer.addItem(iconComponent, {
flex: '0',
CSSStyles: {
'width': '32px'
}
});
cellContainer.addItem(textComponent, {
CSSStyles: {
'width': 'auto'
}
});
return cellContainer;
}
}