Compare commits

..

4 Commits

Author SHA1 Message Date
sunilyadav840
76abac36a0 Merge master 2021-08-17 19:38:19 +05:30
Tanuj Mittal
410f582378 Fix notebooksTemporarilyDown feature flag (#983) 2021-08-17 07:27:41 +05:30
sunilyadav840
0b03202844 update snapshot and format code 2021-03-09 17:00:37 +05:30
sunilyadav840
f6f787817b fix lint issue of cosmosclient and splitter 2021-03-09 16:34:08 +05:30
9 changed files with 59 additions and 7 deletions

View File

@@ -8,9 +8,6 @@ src/Bindings/BindingHandlersRegisterer.ts
src/Bindings/ReactBindingHandler.ts
src/Common/Constants.ts
src/Common/CosmosClient.test.ts
src/Common/CosmosClient.ts
src/Common/DataAccessUtilityBase.test.ts
src/Common/DataAccessUtilityBase.ts
src/Common/EditableUtility.ts
src/Common/HashMap.test.ts
src/Common/Logger.test.ts
@@ -20,6 +17,7 @@ src/Common/MongoProxyClient.test.ts
src/Common/MongoUtility.ts
src/Common/NotificationsClientBase.ts
src/Common/QueriesClient.ts
src/Common/UrlUtility.ts
src/Common/Splitter.ts
src/Config.ts
src/Contracts/ActionContracts.ts

11
externals/jquery.typeahead.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as Cosmos from "@azure/cosmos";
import { RequestInfo, setAuthorizationTokenHeaderUsingMasterKey } from "@azure/cosmos";
import { configContext, Platform } from "../ConfigContext";
@@ -80,7 +81,9 @@ export async function getTokenFromAuthService(verb: string, resourceType: string
let _client: Cosmos.CosmosClient;
export function client(): Cosmos.CosmosClient {
if (_client) return _client;
if (_client) {
return _client;
}
const options: Cosmos.CosmosClientOptions = {
endpoint: endpoint() || "https://cosmos.azure.com", // CosmosClient gets upset if we pass a bad URL. This should never actually get called
key: userContext.masterKey,

View File

@@ -36,7 +36,10 @@ export class Splitter {
}
public initialize() {
if (document.getElementById(this.splitterId) !== null && document.getElementById(this.leftSideId) != null) {
if (
document.getElementById(this.splitterId) !== undefined &&
document.getElementById(this.leftSideId) !== undefined
) {
this.splitter = <HTMLElement>document.getElementById(this.splitterId);
this.leftSide = <HTMLElement>document.getElementById(this.leftSideId);
}

34
src/Definitions/jquery-typescript.d.ts vendored Normal file
View File

@@ -0,0 +1,34 @@
/* Type definitions for code-runner's jquery-typeahead v2.8.0
* https://github.com/running-coder/jquery-typeahead
*
* There is no DefinitelyTyped support for this library, yet, so we only define here what we use.
* https://github.com/running-coder/jquery-typeahead/issues/156
* TODO: Replace this minimum definition by the official one when it comes out.
*/
/// <reference path="jquery.d.ts" />
interface JQueryTypeaheadParam {
input: string;
order?: string;
source: any;
callback?: any;
minLength?: number;
searchOnFocus?: boolean;
template?: string | { (query: string, item: any): string };
dynamic?: boolean;
mustSelectItem?: boolean;
}
/**
* For use with: $.typeahead()
*/
interface JQueryStatic {
typeahead(arg: JQueryTypeaheadParam): void;
}
/**
* For use with $('').typehead()
*/
// interface JQuery {
// typeahead(arg: JQueryTypeaheadParam): void;
// }

View File

@@ -1,6 +1,7 @@
import { shallow } from "enzyme";
import React from "react";
import { shallow } from "enzyme";
import { InputTypeaheadComponent, InputTypeaheadComponentProps } from "./InputTypeaheadComponent";
import "../../../../externals/jquery.typeahead.min.js";
describe("inputTypeahead", () => {
it("renders <input />", () => {

View File

@@ -4,6 +4,7 @@ import { mount, ReactWrapper } from "enzyme";
import * as Q from "q";
import React from "react";
import * as sinon from "sinon";
import "../../../../externals/jquery.typeahead.min";
import { queryDocuments } from "../../../Common/dataAccess/queryDocuments";
import { queryDocumentsPage } from "../../../Common/dataAccess/queryDocumentsPage";
import * as DataModels from "../../../Contracts/DataModels";

View File

@@ -9,6 +9,7 @@ import "../externals/jquery-ui.structure.min.css";
import "../externals/jquery-ui.theme.min.css";
import "../externals/jquery.dataTables.min.css";
import "../externals/jquery.typeahead.min.css";
import "../externals/jquery.typeahead.min.js";
// Image Dependencies
import "../images/CosmosDB_rgb_ui_lighttheme.ico";
import "../images/favicon.ico";

View File

@@ -75,6 +75,6 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear
autoscaleDefault: "true" === get("autoscaledefault"),
partitionKeyDefault: "true" === get("partitionkeytest"),
partitionKeyDefault2: "true" === get("pkpartitionkeytest"),
notebooksTemporarilyDown: "true" === get("notebooksTemporarilyDown", "true"),
notebooksTemporarilyDown: "true" === get("notebookstemporarilydown", "true"),
};
}