mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 00:41:31 +00:00
Add more files to strict compile. Update CONTRIBUTING.md (#63)
* Add more files to strict compile. Update CONTRIBUTING.md to recommend FluentUI use * Remove eslint-disable and use non-null assertion
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
import * as ko from "knockout";
|
||||
import * as ReactBindingHandler from "./ReactBindingHandler";
|
||||
|
||||
interface RestorePoint {
|
||||
readonly element: JQuery;
|
||||
readonly width: number;
|
||||
}
|
||||
|
||||
export class BindingHandlersRegisterer {
|
||||
public static registerBindingHandlers() {
|
||||
ko.bindingHandlers.setTemplateReady = {
|
||||
@@ -17,7 +12,7 @@ export class BindingHandlersRegisterer {
|
||||
bindingContext?: ko.BindingContext
|
||||
) {
|
||||
const value = ko.unwrap(wrappedValueAccessor());
|
||||
bindingContext.$data.isTemplateReady(value);
|
||||
bindingContext?.$data.isTemplateReady(value);
|
||||
}
|
||||
} as ko.BindingHandler;
|
||||
|
||||
|
||||
@@ -59,13 +59,13 @@ function _generateLogEntry(
|
||||
level: Diagnostics.LogEntryLevel,
|
||||
message: string,
|
||||
area: string,
|
||||
code: number
|
||||
code?: number
|
||||
): Diagnostics.LogEntry {
|
||||
return {
|
||||
timestamp: new Date().getUTCSeconds(),
|
||||
level: level,
|
||||
message: message,
|
||||
area: area,
|
||||
code: code
|
||||
level,
|
||||
message,
|
||||
area,
|
||||
code
|
||||
};
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export interface LogEntry {
|
||||
/**
|
||||
* The message code.
|
||||
*/
|
||||
code: number;
|
||||
code?: number;
|
||||
/**
|
||||
* Any additional data to be logged.
|
||||
*/
|
||||
|
||||
@@ -198,7 +198,7 @@ export class Heatmap {
|
||||
let timeSelected: string = data.points[0].x;
|
||||
timeSelected = timeSelected.replace(" ", "T");
|
||||
timeSelected = `${timeSelected}Z`;
|
||||
let xAxisIndex;
|
||||
let xAxisIndex = 0;
|
||||
for (let i = 0; i < this._chartData.xAxisPoints.length; i++) {
|
||||
if (this._chartData.xAxisPoints[i] === timeSelected) {
|
||||
xAxisIndex = i;
|
||||
@@ -234,7 +234,8 @@ export function handleMessage(event: MessageEvent) {
|
||||
return;
|
||||
}
|
||||
Plotly.purge(Heatmap.elementId);
|
||||
document.getElementById(Heatmap.elementId).innerHTML = "";
|
||||
|
||||
document.getElementById(Heatmap.elementId)!.innerHTML = "";
|
||||
const data = event.data.data;
|
||||
const chartData: DataPayload = data.chartData;
|
||||
const chartSettings: HeatmapCaptions = data.chartSettings;
|
||||
@@ -259,8 +260,8 @@ export function handleMessage(event: MessageEvent) {
|
||||
noDataMessageContent.classList.add("dark-theme");
|
||||
}
|
||||
|
||||
document.getElementById(Heatmap.elementId).appendChild(chartTitleElement);
|
||||
document.getElementById(Heatmap.elementId).appendChild(noDataMessageElement);
|
||||
document.getElementById(Heatmap.elementId)!.appendChild(chartTitleElement);
|
||||
document.getElementById(Heatmap.elementId)!.appendChild(noDataMessageElement);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { NotebookContentRecordProps, selectors } from "@nteract/core";
|
||||
* A bunch of utilities to interact with nteract
|
||||
*/
|
||||
export default class NTeractUtil {
|
||||
public static getCurrentCellType(content: NotebookContentRecordProps): "markdown" | "code" | "raw" {
|
||||
public static getCurrentCellType(content: NotebookContentRecordProps): "markdown" | "code" | "raw" | undefined {
|
||||
if (!content) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ import { Notebook } from "../../../Common/Constants";
|
||||
import { CellId } from "@nteract/commutable";
|
||||
|
||||
export interface CdbRecordProps {
|
||||
databaseAccountName: string;
|
||||
defaultExperience: string;
|
||||
databaseAccountName: string | undefined;
|
||||
defaultExperience: string | undefined;
|
||||
kernelRestartDelayMs: number;
|
||||
hoveredCellId: CellId;
|
||||
hoveredCellId: CellId | undefined;
|
||||
}
|
||||
|
||||
export type CdbRecord = Immutable.RecordOf<CdbRecordProps>;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
if (window.parent !== window) {
|
||||
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
(window as any).__REACT_DEVTOOLS_GLOBAL_HOOK__ = (window.parent as any).__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ export class LocalStorageUtility {
|
||||
return !!localStorage.getItem(StorageKey[key]);
|
||||
}
|
||||
|
||||
public static getEntryString(key: StorageKey): string {
|
||||
public static getEntryString(key: StorageKey): string | null {
|
||||
return localStorage.getItem(StorageKey[key]);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export class SessionStorageUtility {
|
||||
return !!sessionStorage.getItem(StorageKey[key]);
|
||||
}
|
||||
|
||||
public static getEntryString(key: StorageKey): string {
|
||||
public static getEntryString(key: StorageKey): string | null {
|
||||
return sessionStorage.getItem(StorageKey[key]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export class StringUtility {
|
||||
public static toNumber(num: string): number {
|
||||
public static toNumber(num: string | null): number {
|
||||
return Number(num);
|
||||
}
|
||||
|
||||
public static toBoolean(valueStr: string): boolean {
|
||||
public static toBoolean(valueStr: string | null): boolean {
|
||||
return valueStr === "true";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,33 +82,35 @@ export default class TelemetryProcessor {
|
||||
}
|
||||
|
||||
public static traceOpen(action: Action, data?: any, timestamp?: number): number {
|
||||
const validTimestamp = timestamp || Date.now();
|
||||
MessageHandler.sendMessage({
|
||||
type: MessageTypes.TelemetryInfo,
|
||||
data: {
|
||||
action: Action[action],
|
||||
actionModifier: ActionModifiers.Open,
|
||||
timestamp: timestamp || Date.now(),
|
||||
timestamp: validTimestamp,
|
||||
data: JSON.stringify(data)
|
||||
}
|
||||
});
|
||||
|
||||
appInsights.startTrackEvent(Action[action]);
|
||||
return timestamp;
|
||||
return validTimestamp;
|
||||
}
|
||||
|
||||
public static traceMark(action: Action, data?: any, timestamp?: number): number {
|
||||
const validTimestamp = timestamp || Date.now();
|
||||
MessageHandler.sendMessage({
|
||||
type: MessageTypes.TelemetryInfo,
|
||||
data: {
|
||||
action: Action[action],
|
||||
actionModifier: ActionModifiers.Mark,
|
||||
timestamp: timestamp || Date.now(),
|
||||
timestamp: validTimestamp,
|
||||
data: JSON.stringify(data)
|
||||
}
|
||||
});
|
||||
|
||||
appInsights.startTrackEvent(Action[action]);
|
||||
return timestamp;
|
||||
return validTimestamp;
|
||||
}
|
||||
|
||||
private static getData(data?: any): any {
|
||||
|
||||
Reference in New Issue
Block a user