Compare commits

...

18 Commits

Author SHA1 Message Date
Sampath
6defcfb7e5 update snapshot 2022-12-23 18:16:16 +05:30
Sampath
ad953ffa1d InfoTooltip changes 2022-12-23 17:51:17 +05:30
Sampath
511b0bd8c0 Revert "commit for tooltip in defect 1704149"
This reverts commit 44766e8213.
2022-12-23 17:17:04 +05:30
Sampath
44766e8213 commit for tooltip in defect 1704149 2022-12-23 17:14:03 +05:30
Sampath
60d666df1e Revert "changes in infotooltip for defct"
This reverts commit ca9833e208.
2022-12-22 20:52:26 +05:30
Sampath
ca9833e208 changes in infotooltip for defct 2022-12-22 19:44:51 +05:30
Sampath
042ad24cc6 changes to addcollectionpanel.test.tsx snp file 2022-12-20 02:56:51 +05:30
Sampath
445427ecec format fixes 2022-12-20 02:00:52 +05:30
Sampath
6d19aaab43 committing changes for the keyboard navigation 2022-12-20 00:41:17 +05:30
Sampath
7fbecfff1a Revert "html,css changes corected after reversion"
This reverts commit 712e0e0c1e.
2022-12-20 00:36:31 +05:30
Sampath
712e0e0c1e html,css changes corected after reversion 2022-12-19 18:52:12 +05:30
Sampath
6aa229462b Revert "keyboard navigation for defects 1722611,1722618"
This reverts commit 9383609a22.
2022-12-19 18:45:53 +05:30
Sampath
990d86ffc6 Fixes for keyboard navigation of add new clause,edit,remove property,insert filter line, remove filter line 2022-12-19 18:27:52 +05:30
MokireddySampath
9383609a22 keyboard navigation for defects 1722611,1722618 2022-12-19 12:41:08 +05:30
vchske
2f32a676d0 Fixes issue when CRUD with no parition key for all APIs (#1362)
* Fixes issue where empty partition key is treated like nonexistent key for Tables API

* Updated format

* Refactor fix

* Prettier

* Fixes issue when CRUD with no parition key for all APIs

* Format fix

* Refactor to explicitly check for Tables
2022-12-13 11:36:39 -08:00
victor-meng
950c8ee470 Fix "Change network settings" button send the wrong message type (#1360) 2022-12-09 15:48:23 -08:00
vchske
b0eaac5b84 Fixes issue where empty partition key is treated like nonexistent key… (#1359) 2022-12-09 15:14:46 -08:00
victor-meng
952491a3ad Empty commit to trigger new build (#1351) 2022-11-14 13:46:27 -08:00
14 changed files with 340 additions and 292 deletions

View File

@@ -6,7 +6,7 @@
display: table;
display: none;
width: 100%;
border-top: 1px solid #DDDDDD;
border-top: 1px solid #dddddd;
/*[{environment-commandbar-toolbar-separator}]*/
background-color: #ffffff;
/*[{plugin-background-color}]*/
@@ -34,7 +34,7 @@
}
.query-builder {
width:100%;
width: 100%;
padding-right: @DefaultSpace;
border-bottom: 1px solid @BaseMedium;
margin-bottom: @DefaultSpace;
@@ -45,7 +45,7 @@
/*[{plugin-background-color}]*/
min-width: 600px;
height: 30px;
border-bottom: 1px solid #DDDDDD;
border-bottom: 1px solid #dddddd;
/*[1px solid {environment-commandbar-toolbar-separator}]*/
}
@@ -70,14 +70,14 @@
}
.query-builder-toolbar .query-toolbar-group .query-toolbar-button:hover {
background-color: #CCCEDB;
background-color: #cccedb;
/*[{common-controls-button-hover-background}]*/
}
.query-builder-toolbar .query-toolbar-group .query-toolbar-button.active {
background-color: #E6E7ED;
background-color: #e6e7ed;
/*[{common-controls-inner-tab-active-background}]*/
outline: none
outline: none;
}
.query-builder-toolbar .query-toolbar-group .query-toolbar-button:disabled,
@@ -96,10 +96,10 @@
.flex-direction();
}
.tablesQueryTab{
.tablesQueryTab {
padding-left: @MediumSpace;
width: 100%;
margin-bottom:@LargeSpace;
margin-bottom: @LargeSpace;
}
.entity-error-Img {
@@ -120,7 +120,7 @@
.query-editor-text {
width: 100%;
margin: 2px;
border: solid 1px #A9ACB3;
border: solid 1px #a9acb3;
/*[{plugin-textbox-disabled-color}]*/
resize: none;
margin-top: -39px;
@@ -169,7 +169,7 @@
margin-left: 2px;
}
.advanced-options-panel{
.advanced-options-panel {
margin-bottom: @DefaultSpace;
}
@@ -201,9 +201,9 @@ input::-webkit-inner-spin-button {
.advanced-options-panel .advanced-options .top .top-input {
width: 100px;
word-spacing: normal;
color: #1E1E1E;
color: #1e1e1e;
/*[{common-controls-button-foreground}]*/
border: 1px solid #CCCEDB;
border: 1px solid #cccedb;
/*[1px solid {plugin-textbox-border-color}]*/
height: 20px;
margin-left: 8px;
@@ -257,9 +257,9 @@ input::-webkit-inner-spin-button {
vertical-align: middle;
}
.action-column>button,
.group-control-header>button,
.group-indicator-column>button {
.action-column > button,
.group-control-header > button,
.group-indicator-column > button {
min-width: 20px;
width: 20px;
padding: 0px;
@@ -268,7 +268,7 @@ input::-webkit-inner-spin-button {
cursor: pointer;
}
.group-control-header>button:disabled {
.group-control-header > button:disabled {
min-width: 20px;
width: 20px;
padding: 0px;
@@ -299,9 +299,9 @@ input::-webkit-inner-spin-button {
}
.scroll-box {
border-bottom: 1px transparent #DDD;
border-bottom: 1px transparent #ddd;
/*[1px solid {plugin-table-border-color}]*/
border-top: 1px transparent #DDD;
border-top: 1px transparent #ddd;
/*[1px solid {plugin-table-border-color}]*/
max-height: 20vh;
width: 100%;
@@ -366,7 +366,7 @@ input::-webkit-inner-spin-button {
.group-indicator-table {
border-spacing: 0px;
min-height: 24px
min-height: 24px;
}
.group-indicator-column {
@@ -396,7 +396,6 @@ input::-webkit-inner-spin-button {
background-color: #ffffff;
}
/*.type-header {
padding-right: 4px;
}
@@ -410,9 +409,9 @@ input::-webkit-inner-spin-button {
}*/
.clause-table-field[readonly] {
background-color: #EEEEF2;
background-color: #eeeef2;
/*[{plugin-table-header-background-color}]*/
border: 1px solid #CCCEDB;
border: 1px solid #cccedb;
/*[{plugin-table-border-color}]*/
}
@@ -462,11 +461,11 @@ input::-webkit-inner-spin-button {
.query-panel .divider.horizontal {
height: 10px;
width: 100%
width: 100%;
}
.inline-div {
display: inline
display: inline;
}
.querybuilder-addpropertyImg,
@@ -485,7 +484,7 @@ input::-webkit-inner-spin-button {
}
.entity-Add-Cancel {
padding: @DefaultSpace @SmallSpace @SmallSpace;
// padding: @DefaultSpace @SmallSpace @SmallSpace;
cursor: pointer;
}
@@ -498,7 +497,7 @@ input::-webkit-inner-spin-button {
}
.query-builder-isDisabled {
border: 1px solid #CCCEDB;
border: 1px solid #cccedb;
color: #ccc;
}
@@ -515,7 +514,6 @@ input::-webkit-inner-spin-button {
margin-bottom: 5px;
}
/*
@media only screen and (max-width: 1200px) {
.clause-table {

View File

@@ -73,6 +73,17 @@ export const TableEntity: FunctionComponent<TableEntityProps> = ({
const sectionStackTokens: IStackTokens = { childrenGap: 12 };
const handleKeyPress = (event: React.KeyboardEvent<HTMLElement>) => {
if (event.key === "Enter" || event.key === "Space") {
onEditEntity();
}
};
const handleKeyPressdelete = (event: React.KeyboardEvent<HTMLElement>) => {
if (event.key === "Enter" || event.key === "Space") {
onDeleteEntity();
}
};
const getEntityValueType = (): string => {
const { Int, Smallint, Tinyint } = CassandraType;
const { Double, Int32, Int64 } = TableType;
@@ -126,12 +137,28 @@ export const TableEntity: FunctionComponent<TableEntityProps> = ({
/>
{!isEntityValueDisable && (
<TooltipHost content="Edit property" id="editTooltip">
<Image {...imageProps} src={EditIcon} alt="editEntity" id="editEntity" onClick={onEditEntity} />
<Image
{...imageProps}
src={EditIcon}
alt="editEntity"
id="editEntity"
onClick={onEditEntity}
tabIndex={0}
onKeyPress={handleKeyPress}
/>
</TooltipHost>
)}
{isDeleteOptionVisible && userContext.apiType !== "Cassandra" && (
<TooltipHost content="Delete property" id="deleteTooltip">
<Image {...imageProps} src={DeleteIcon} alt="delete entity" id="deleteEntity" onClick={onDeleteEntity} />
<Image
{...imageProps}
src={DeleteIcon}
alt="delete entity"
id="deleteEntity"
onClick={onDeleteEntity}
tabIndex={0}
onKeyPress={handleKeyPressdelete}
/>
</TooltipHost>
)}
</Stack>

View File

@@ -9,7 +9,7 @@ export const InfoTooltip: React.FunctionComponent<TooltipProps> = ({ children }:
return (
<span>
<TooltipHost content={children}>
<Icon iconName="Info" ariaLabel="Info" className="panelInfoIcon" tabIndex={0} />
<Icon iconName="Info" ariaLabel={children} className="panelInfoIcon" tabIndex={0} />
</TooltipHost>
</span>
);

View File

@@ -4,6 +4,7 @@ import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationCons
import { client } from "../CosmosClient";
import { getEntityName } from "../DocumentUtility";
import { handleError } from "../ErrorHandlingUtils";
import { getPartitionKeyValue } from "./getPartitionKeyValue";
export const deleteDocument = async (collection: CollectionBase, documentId: DocumentId): Promise<void> => {
const entityName: string = getEntityName();
@@ -13,7 +14,7 @@ export const deleteDocument = async (collection: CollectionBase, documentId: Doc
await client()
.database(collection.databaseId)
.container(collection.id())
.item(documentId.id(), documentId.partitionKeyValue?.length === 0 ? undefined : documentId.partitionKeyValue)
.item(documentId.id(), getPartitionKeyValue(documentId))
.delete();
logConsoleInfo(`Successfully deleted ${entityName} ${documentId.id()}`);
} catch (error) {

View File

@@ -0,0 +1,12 @@
import { userContext } from "UserContext";
import DocumentId from "../../Explorer/Tree/DocumentId";
export const getPartitionKeyValue = (documentId: DocumentId) => {
if (userContext.apiType === "Tables" && documentId.partitionKeyValue?.length === 0) {
return "";
}
if (documentId.partitionKeyValue?.length === 0) {
return undefined;
}
return documentId.partitionKeyValue;
};

View File

@@ -6,6 +6,7 @@ import { HttpHeaders } from "../Constants";
import { client } from "../CosmosClient";
import { getEntityName } from "../DocumentUtility";
import { handleError } from "../ErrorHandlingUtils";
import { getPartitionKeyValue } from "./getPartitionKeyValue";
export const readDocument = async (collection: CollectionBase, documentId: DocumentId): Promise<Item> => {
const entityName = getEntityName();
@@ -21,8 +22,7 @@ export const readDocument = async (collection: CollectionBase, documentId: Docum
const response = await client()
.database(collection.databaseId)
.container(collection.id())
// use undefined if the partitionKeyValue is empty
.item(documentId.id(), documentId.partitionKeyValue?.length === 0 ? undefined : documentId.partitionKeyValue)
.item(documentId.id(), getPartitionKeyValue(documentId))
.read(options);
return response?.resource;

View File

@@ -6,6 +6,7 @@ import { logConsoleInfo, logConsoleProgress } from "../../Utils/NotificationCons
import { client } from "../CosmosClient";
import { getEntityName } from "../DocumentUtility";
import { handleError } from "../ErrorHandlingUtils";
import { getPartitionKeyValue } from "./getPartitionKeyValue";
export const updateDocument = async (
collection: CollectionBase,
@@ -25,7 +26,7 @@ export const updateDocument = async (
const response = await client()
.database(collection.databaseId)
.container(collection.id())
.item(documentId.id(), documentId.partitionKeyValue?.length === 0 ? undefined : documentId.partitionKeyValue)
.item(documentId.id(), getPartitionKeyValue(documentId))
.replace(newDocument, options);
logConsoleInfo(`Successfully updated ${entityName} ${documentId.id()}`);

View File

@@ -344,13 +344,13 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
onMouseLeave={[Function]}
>
<StyledIconBase
ariaLabel="Info"
ariaLabel="Set the throughput — Request Units per second (RU/s) — required for the workload. A read of a 1 KB document uses 1 RU. Select manual if you plan to scale RU/s yourself. Select autoscale to allow the system to scale RU/s based on usage."
className="panelInfoIcon"
iconName="Info"
tabIndex={0}
>
<IconBase
ariaLabel="Info"
ariaLabel="Set the throughput — Request Units per second (RU/s) — required for the workload. A read of a 1 KB document uses 1 RU. Select manual if you plan to scale RU/s yourself. Select autoscale to allow the system to scale RU/s based on usage."
className="panelInfoIcon"
iconName="Info"
styles={[Function]}
@@ -630,7 +630,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
}
>
<i
aria-label="Info"
aria-label="Set the throughput — Request Units per second (RU/s) — required for the workload. A read of a 1 KB document uses 1 RU. Select manual if you plan to scale RU/s yourself. Select autoscale to allow the system to scale RU/s based on usage."
className="panelInfoIcon root-57"
data-icon-name="Info"
role="img"
@@ -1331,13 +1331,13 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
onMouseLeave={[Function]}
>
<StyledIconBase
ariaLabel="Info"
ariaLabel="Set the max RU/s to the highest RU/s you want your container to scale to. The container will scale between 10% of max RU/s to the max RU/s based on usage."
className="panelInfoIcon"
iconName="Info"
tabIndex={0}
>
<IconBase
ariaLabel="Info"
ariaLabel="Set the max RU/s to the highest RU/s you want your container to scale to. The container will scale between 10% of max RU/s to the max RU/s based on usage."
className="panelInfoIcon"
iconName="Info"
styles={[Function]}
@@ -1617,7 +1617,7 @@ exports[`ThroughputInput Pane should render Default properly 1`] = `
}
>
<i
aria-label="Info"
aria-label="Set the max RU/s to the highest RU/s you want your container to scale to. The container will scale between 10% of max RU/s to the max RU/s based on usage."
className="panelInfoIcon root-57"
data-icon-name="Info"
role="img"

View File

@@ -242,6 +242,11 @@ export const AddTableEntityPanel: FunctionComponent<AddTableEntityPanelProps> =
submitButtonText: getButtonLabel(userContext.apiType),
onSubmit,
};
const handlekeypressaddentity = (event: React.KeyboardEvent<HTMLElement>) => {
if (event.key === "Enter" || event.key === "Space") {
addNewEntity();
}
};
return (
<RightPaneForm {...props}>
@@ -284,7 +289,13 @@ export const AddTableEntityPanel: FunctionComponent<AddTableEntityPanelProps> =
);
})}
{userContext.apiType !== "Cassandra" && (
<Stack horizontal onClick={addNewEntity} className="addButtonEntiy">
<Stack
horizontal
onClick={addNewEntity}
className="addButtonEntiy"
tabIndex={0}
onKeyPress={handlekeypressaddentity}
>
<Image {...imageProps} src={AddPropertyIcon} alt="Add Entity" />
<Text className="addNewParamStyle">{getAddButtonLabel(userContext.apiType)}</Text>
</Stack>

View File

@@ -29,10 +29,14 @@ exports[`Excute Add Table Entity Pane should render Default properly 1`] = `
className="addButtonEntiy"
horizontal={true}
onClick={[Function]}
onKeyPress={[Function]}
tabIndex={0}
>
<div
className="ms-Stack addButtonEntiy css-53"
onClick={[Function]}
onKeyPress={[Function]}
tabIndex={0}
>
<StyledImageBase
alt="Add Entity"

View File

@@ -516,7 +516,7 @@ export default class QueryBuilderViewModel {
};
public onAddNewClauseKeyDown = (event: KeyboardEvent): boolean => {
if (event.keyCode === KeyCodes.Enter || event.keyCode === KeyCodes.Space) {
if (event.key === "Enter" || event.key === "Space") {
this.addClauseIndex(this.clauseArray().length - 1);
event.stopPropagation();
return false;

View File

@@ -70,24 +70,19 @@
<tbody data-bind="template: { name: 'queryClause-template', foreach: clauseArray, as: 'clause' }"></tbody>
</table>
</div>
<div
class="addClause"
role="button"
data-bind="click: addNewClause, event: { keydown: onAddNewClauseKeyDown }, attr: { title: addNewClauseLine }"
tabindex="0"
<button
data-bind="click: addNewClause, event: { keydown: onAddNewClauseKeyDown }"
style="border: none; background: none"
>
<div class="addClause" data-bind=" ">
<div class="addClause-heading">
<span class="clause-table addClause-title">
<img
class="addclauseProperty-Img"
style="margin-bottom: 5px"
src="/Add-property.svg"
alt="Add new clause"
/>
<img class="addclauseProperty-Img" style="margin-bottom: 5px" src="/Add-property.svg" />
<span style="margin-left: 5px" data-bind="text: addNewClauseLine"></span>
</span>
</div>
</div>
</button>
</div>
</div>
<!-- Tables Query Tab Query Helper - End-->
@@ -168,22 +163,20 @@
<script type="text/html" id="queryClause-template">
<tr class="clause-table-row">
<td class="clause-table-cell action-column">
<span
class="entity-Add-Cancel"
role="button"
tabindex="0"
<button
data-bind="click: $parent.addClauseIndex.bind($data, $index()), event: { keydown: $parent.onAddClauseKeyDown.bind($data, $index()) }, attr:{title: $parent.insertNewFilterLine}"
>
<span class="entity-Add-Cancel" role="button">
<img class="querybuilder-addpropertyImg" src="/Add-property.svg" alt="Add clause" />
</span>
<span
class="entity-Add-Cancel"
role="button"
tabindex="0"
</button>
<button
data-bind="hasFocus: isDeleteButtonFocused, click: $parent.deleteClause.bind($data, $index()), event: { keydown: $parent.onDeleteClauseKeyDown.bind($data, $index()) }, attr:{title: $parent.removeThisFilterLine}"
>
<span class="entity-Add-Cancel" role="button">
<img class="querybuilder-cancelImg" src="/Entity_cancel.svg" alt="Delete clause" />
</span>
</button>
</td>
<td class="clause-table-cell group-control-column">
<input type="checkbox" aria-label="And/Or" data-bind="checked: checkedForGrouping" />

View File

@@ -32,7 +32,7 @@ export const Tabs = ({ explorer }: TabsProps): JSX.Element => {
<MessageBar
messageBarType={MessageBarType.warning}
actions={
<MessageBarButton onClick={() => sendMessage({ type: MessageTypes.OpenCosmosDBNetworkingBlade })}>
<MessageBarButton onClick={() => sendMessage({ type: MessageTypes.OpenPostgresNetworkingBlade })}>
Change network settings
</MessageBarButton>
}

View File

@@ -382,7 +382,8 @@ function updateContextsFromPortalMessage(inputs: DataExplorerInputsFrame) {
}
}
useTabs.getState().setShowNetworkSettingsWarning(!doNetworkSettingsAllowDataExplorerAccess());
const isDataExplorerAccessAllowed = doNetworkSettingsAllowDataExplorerAccess();
useTabs.getState().setShowNetworkSettingsWarning(!isDataExplorerAccessAllowed);
if (inputs.features) {
Object.assign(userContext.features, extractFeatures(new URLSearchParams(inputs.features)));