Skip to content

Commit 097b89d

Browse files
authored
Adding ability to increase script pane height and properties pane (#18056)
* Adding ability to increase script pane height and properties pane * Adding loc files * Also adding confirmation checkbox * Fixing compile error * remove console statement
1 parent d3ad78b commit 097b89d

File tree

6 files changed

+52
-35
lines changed

6 files changed

+52
-35
lines changed

localization/l10n/bundle.l10n.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@
9191
"Script As Create": "Script As Create",
9292
"Properties": "Properties",
9393
"No data": "No data",
94-
"Severity": "Severity",
95-
"Script as CREATE": "Script as CREATE",
9694
"1 issue": "1 issue",
9795
"{0} issues": "{0} issues",
9896
"Issues": "Issues",
@@ -101,9 +99,6 @@
10199
"Move Up": "Move Up",
102100
"Move Down": "Move Down",
103101
"Delete": "Delete",
104-
"Error loading designer": "Error loading designer",
105-
"Retry": "Retry",
106-
"Loading table designer": "Loading table designer",
107102
"Results": "Results",
108103
"Messages": "Messages",
109104
"Timestamp": "Timestamp",
@@ -166,9 +161,13 @@
166161
"Continue Editing": "Continue Editing",
167162
"Loading Table Designer": "Loading Table Designer",
168163
"Error loading preview": "Error loading preview",
164+
"Retry": "Retry",
169165
"Update Database": "Update Database",
170166
"Publish": "Publish",
171167
"Preview Database Updates": "Preview Database Updates",
168+
"Error loading designer": "Error loading designer",
169+
"Severity": "Severity",
170+
"I have read the summary and understand the potential risks.": "I have read the summary and understand the potential risks.",
172171
"Connect": "Connect",
173172
"Advanced Connection Settings": "Advanced Connection Settings",
174173
"Advanced": "Advanced",

localization/xliff/vscode-mssql.xlf

+3-6
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,9 @@
548548
<trans-unit id="++CODE++881cda150f08bbb74d0fa62b161f8a953cf0e98bf734b60d0e059b408b75522b">
549549
<source xml:lang="en">Highlight Expensive Operation</source>
550550
</trans-unit>
551+
<trans-unit id="++CODE++9638b09db2ce74e3d600f9a512a6116df9ba9b3a147569930a5d5b4682ac5a20">
552+
<source xml:lang="en">I have read the summary and understand the potential risks.</source>
553+
</trans-unit>
551554
<trans-unit id="++CODE++1d59e3e131d04ce9ba04c0f297dbd4eddb83c0bfe977b2a6bf19bdeb73f2d5c3">
552555
<source xml:lang="en">Ignore Tenant</source>
553556
</trans-unit>
@@ -603,9 +606,6 @@
603606
<trans-unit id="++CODE++10a371b8dc47cdf83c4cd7f926daf76305a6b52311a69b3087d744151dc53501">
604607
<source xml:lang="en">Loading Table Designer</source>
605608
</trans-unit>
606-
<trans-unit id="++CODE++c47aaf844e09d0c6bd516bf7b71a31e66eac808241c7ec609c6c74c54908daa4">
607-
<source xml:lang="en">Loading table designer</source>
608-
</trans-unit>
609609
<trans-unit id="++CODE++aaaeb8d7872b0c49ed19d951314516d2dcd84ca23411320f05fac3d87bac8a32">
610610
<source xml:lang="en">MSSQL</source>
611611
</trans-unit>
@@ -913,9 +913,6 @@
913913
<trans-unit id="++CODE++cce7c24ebb0a14bc98b7d6a3f18ddfe9c893e65adb1a599321b3e0eca3515490">
914914
<source xml:lang="en">Script As Create</source>
915915
</trans-unit>
916-
<trans-unit id="++CODE++3a4a2e94c1227e991b2d55800b114ce9ef01970894efa5dade81ab8f14adda8b">
917-
<source xml:lang="en">Script as CREATE</source>
918-
</trans-unit>
919916
<trans-unit id="++CODE++ebe0dbee443b4562c7925a01e3bc69a3d5d0a3b0e8b3e11041c69fa067b65ef7">
920917
<source xml:lang="en">Select a tenant</source>
921918
</trans-unit>

src/reactviews/common/locConstants.ts

+7
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ export class LocConstants {
102102
publish: l10n.t("Publish"),
103103
previewDatabaseUpdates: l10n.t("Preview Database Updates"),
104104
close: l10n.t("Close"),
105+
errorLoadingDesigner: l10n.t("Error loading designer"),
106+
severity: l10n.t("Severity"),
107+
description: l10n.t("Description"),
108+
scriptAsCreate: l10n.t("Script As Create"),
109+
designerPreviewConfirmation: l10n.t(
110+
"I have read the summary and understand the potential risks.",
111+
),
105112
};
106113
}
107114

src/reactviews/pages/TableDesigner/designerChangesPreviewButton.tsx

+21-5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import {
1818
ErrorCircleRegular,
1919
} from "@fluentui/react-icons";
2020
import { Button } from "@fluentui/react-button";
21-
import { Spinner, makeStyles } from "@fluentui/react-components";
21+
import { Checkbox, Spinner, makeStyles } from "@fluentui/react-components";
2222
import ReactMarkdown from "react-markdown";
23-
import { useContext } from "react";
23+
import { useContext, useState } from "react";
2424
import { TableDesignerContext } from "./tableDesignerStateProvider";
2525
import { LoadState } from "../../../sharedInterfaces/tableDesigner";
2626
import { locConstants } from "../../common/locConstants";
@@ -57,6 +57,8 @@ export const DesignerChangesPreviewButton = () => {
5757
return null;
5858
}
5959

60+
const [isConfirmationChecked, setIsConfirmationChecked] = useState(false);
61+
6062
const metadata = designerContext.state;
6163

6264
const generateScriptIcon = () => {
@@ -158,7 +160,7 @@ export const DesignerChangesPreviewButton = () => {
158160
<div
159161
style={{
160162
width: "98%",
161-
height: "100%",
163+
height: "calc(100% - 40px)",
162164
alignItems: "center",
163165
justifyContent: "center",
164166
borderTop: "1px solid #e0e0e0",
@@ -170,13 +172,27 @@ export const DesignerChangesPreviewButton = () => {
170172
{metadata?.generatePreviewReportResult?.report}
171173
</ReactMarkdown>
172174
</div>
175+
<Checkbox
176+
label={
177+
locConstants.tableDesigner
178+
.designerPreviewConfirmation
179+
}
180+
onChange={(_event, data) => {
181+
setIsConfirmationChecked(
182+
data.checked as boolean,
183+
);
184+
}}
185+
/>
173186
</DialogContent>
174187
<DialogActions>
175188
<Button
176189
className={classes.updateDatabase}
177190
disabled={
178-
metadata.apiState?.previewState !==
179-
LoadState.Loaded
191+
!(
192+
isConfirmationChecked &&
193+
metadata.apiState?.previewState ===
194+
LoadState.Loaded
195+
)
180196
}
181197
appearance="primary"
182198
onClick={() => {

src/reactviews/pages/TableDesigner/designerResultPane.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import {
4242
InputBoxProperties,
4343
} from "../../../sharedInterfaces/tableDesigner";
4444
import * as l10n from "@vscode/l10n";
45+
import { locConstants } from "../../common/locConstants";
4546

4647
const useStyles = makeStyles({
4748
root: {
@@ -100,9 +101,6 @@ export const DesignerResultPane = () => {
100101
const state = useContext(TableDesignerContext);
101102
const metadata = state?.state;
102103

103-
const SEVERITY = l10n.t("Severity");
104-
const DESCRIPTION = l10n.t("Description");
105-
const SCRIPT_AS_CREATE = l10n.t("Script as CREATE");
106104
const getIssuesTabAriaLabel = (count: number) => {
107105
return count === 1 ? l10n.t("1 issue") : l10n.t("{0} issues", count);
108106
};
@@ -124,11 +122,13 @@ export const DesignerResultPane = () => {
124122
const columnsDef: TableColumnDefinition<DesignerIssue>[] = [
125123
createTableColumn({
126124
columnId: "severity",
127-
renderHeaderCell: () => <>{SEVERITY}</>,
125+
renderHeaderCell: () => <>{locConstants.tableDesigner.severity}</>,
128126
}),
129127
createTableColumn({
130128
columnId: "description",
131-
renderHeaderCell: () => <>{DESCRIPTION}</>,
129+
renderHeaderCell: () => (
130+
<>{locConstants.tableDesigner.description}</>
131+
),
132132
}),
133133
createTableColumn({
134134
columnId: "propertyPath",
@@ -192,7 +192,7 @@ export const DesignerResultPane = () => {
192192
value={DesignerResultPaneTabs.Script}
193193
key={DesignerResultPaneTabs.Script}
194194
>
195-
{SCRIPT_AS_CREATE}
195+
{locConstants.tableDesigner.scriptAsCreate}
196196
</Tab>
197197
<Tab
198198
value={DesignerResultPaneTabs.Issues}

src/reactviews/pages/TableDesigner/tableDesignerPage.tsx

+11-13
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { DesignerPageRibbon } from "./designerPageRibbon";
1919
import { DesignerMainPane } from "./designerMainPane";
2020
import { DesignerPropertiesPane } from "./designerPropertiesPane";
2121
import { DesignerResultPane } from "./designerResultPane";
22-
import * as l10n from "@vscode/l10n";
22+
import { locConstants } from "../../common/locConstants";
2323

2424
const useStyles = makeStyles({
2525
root: {
@@ -109,17 +109,13 @@ export const TableDesigner = () => {
109109
return null;
110110
}
111111

112-
const ERROR_LOADING_DESIGNER = l10n.t("Error loading designer");
113-
const RETRY = l10n.t("Retry");
114-
const LOADING_TABLE_DESIGNER = l10n.t("Loading table designer");
115-
116112
return (
117113
<div className={classes.root}>
118114
{tableDesignerState.apiState?.initializeState ===
119115
designer.LoadState.Loading && (
120116
<div className={classes.pageContext}>
121117
<Spinner
122-
label={LOADING_TABLE_DESIGNER}
118+
label={locConstants.tableDesigner.loadingTableDesigner}
123119
labelPosition="below"
124120
/>
125121
</div>
@@ -128,8 +124,10 @@ export const TableDesigner = () => {
128124
designer.LoadState.Error && (
129125
<div className={classes.pageContext}>
130126
<ErrorCircleRegular className={classes.errorIcon} />
131-
<div>{ERROR_LOADING_DESIGNER}</div>
132-
<Button className={classes.retryButton}>{RETRY}</Button>
127+
<div>{locConstants.tableDesigner.errorLoadingDesigner}</div>
128+
<Button className={classes.retryButton}>
129+
{locConstants.tableDesigner.retry}
130+
</Button>
133131
</div>
134132
)}
135133
{tableDesignerState.apiState?.initializeState ===
@@ -150,10 +148,10 @@ export const TableDesigner = () => {
150148
/>
151149
{state.state.propertiesPaneData && (
152150
<ResizableBox
153-
width={350}
151+
width={500}
154152
height={Infinity}
155-
maxConstraints={[800, Infinity]}
156-
minConstraints={[300, Infinity]}
153+
maxConstraints={[Infinity, Infinity]}
154+
minConstraints={[10, Infinity]}
157155
resizeHandles={["w"]}
158156
handle={
159157
<div
@@ -169,8 +167,8 @@ export const TableDesigner = () => {
169167
<ResizableBox
170168
width={Infinity}
171169
height={250}
172-
maxConstraints={[Infinity, 400]}
173-
minConstraints={[Infinity, 200]}
170+
maxConstraints={[Infinity, Infinity]}
171+
minConstraints={[Infinity, 10]}
174172
resizeHandles={["n"]}
175173
handle={<div className={classes.resultPaneHandle} />}
176174
className={classes.resultPaneContainer}

0 commit comments

Comments
 (0)