66 Link ,
77 palette ,
88 spacing ,
9+ Toggle ,
910 Tooltip ,
1011} from '@mongodb-js/compass-components' ;
1112import React from 'react' ;
@@ -14,14 +15,24 @@ const headerStyles = css({
1415 marginBottom : spacing [ 200 ] ,
1516} ) ;
1617
18+ const indexFieldsHeaderContainterStyles = css ( {
19+ display : 'flex' ,
20+ alignItems : 'center' ,
21+ justifyContent : 'space-between' ,
22+ } ) ;
23+
1724const indexFieldsCalloutStyles = css ( {
1825 border : `1px solid ${ palette . gray . light2 } ` ,
1926 borderRadius : '12px' ,
2027 padding : spacing [ 600 ] ,
21- minHeight : '132px' ,
2228 marginBottom : spacing [ 600 ] ,
2329} ) ;
2430
31+ const coveredQueriesHeaderContainterStyles = css ( {
32+ display : 'flex' ,
33+ alignItems : 'center' ,
34+ } ) ;
35+
2536const coveredQueriesCalloutStyles = css ( {
2637 border : `1px solid ${ palette . gray . light2 } ` ,
2738 background : palette . gray . light3 ,
@@ -30,6 +41,11 @@ const coveredQueriesCalloutStyles = css({
3041 marginBottom : spacing [ 600 ] ,
3142} ) ;
3243
44+ const buttonContainerStyles = css ( {
45+ display : 'flex' ,
46+ justifyContent : 'right' ,
47+ } ) ;
48+
3349const coveredQueriesButtonStyles = css ( {
3450 height : spacing [ 600 ] + 4 ,
3551 float : 'right' ,
@@ -52,25 +68,43 @@ const IndexFlowSection = ({
5268} ) => {
5369 return (
5470 < div >
55- < Body baseFontSize = { 16 } weight = "medium" className = { headerStyles } >
56- Input Index
57- </ Body >
71+ < div className = { indexFieldsHeaderContainterStyles } >
72+ < Body baseFontSize = { 16 } weight = "medium" className = { headerStyles } >
73+ Input Index
74+ </ Body >
75+ < Toggle
76+ size = "xsmall"
77+ aria-label = "Toggle Auto Preview"
78+ onChange = { ( ) => {
79+ ( ) => {
80+ // TODO in CLOUDP-311784
81+ } ;
82+ } }
83+ checked = { false }
84+ >
85+ Code Equivalent
86+ </ Toggle >
87+ </ div >
5888 < div className = { indexFieldsCalloutStyles } >
5989 { createIndexFieldsComponent }
6090
61- < Button
62- className = { coveredQueriesButtonStyles }
63- onClick = { ( ) => {
64- // TODO in CLOUDP-311782 generate covered queries
65- // TODO in CLOUDP-311783 generate optimal queries
66- } }
67- >
68- Show me covered queries
69- </ Button >
91+ < div className = { buttonContainerStyles } >
92+ < Button
93+ className = { coveredQueriesButtonStyles }
94+ onClick = { ( ) => {
95+ // TODO in CLOUDP-311782 generate covered queries
96+ // TODO in CLOUDP-311783 generate optimal queries
97+ } }
98+ >
99+ Show me covered queries
100+ </ Button >
101+ </ div >
70102 </ div >
71103
72- < Body baseFontSize = { 16 } weight = "medium" className = { headerStyles } >
73- Covered Queries{ ' ' }
104+ < div className = { coveredQueriesHeaderContainterStyles } >
105+ < Body baseFontSize = { 16 } weight = "medium" className = { headerStyles } >
106+ Covered Queries
107+ </ Body >
74108 < Tooltip
75109 enabled = { true }
76110 trigger = {
@@ -89,7 +123,7 @@ const IndexFlowSection = ({
89123 index and does not have to examine any documents. If a query is
90124 covered, it is highly performant.
91125 </ Tooltip >
92- </ Body >
126+ </ div >
93127
94128 < div className = { coveredQueriesCalloutStyles } >
95129 { /* Covered Queries, clean up with actual covered queries examples in CLOUDP-311782 */ }
@@ -105,7 +139,7 @@ const IndexFlowSection = ({
105139 </ u >
106140 { /* Optimal queries, clean up with actual optimal queries in CLOUDP-311783 */ }
107141 < Body baseFontSize = { 13 } className = { codeStyles } >
108- { `{awards.wins : 5, imdb.rating: {$gt : 5} }.sort({ awards.nominations : 1 }` }
142+ { `{ awards.wins : 5, imdb.rating: {$gt : 5} }.sort({ awards.nominations : 1 }` }
109143 </ Body >
110144 </ p >
111145
0 commit comments