Make existing and new issue URLs configurable (#10710)

* Make existing and new issue URLs configurable

* Apply a deep merge over sdk config to allow sane nested structures

* Defaultize

* Fix types

* Iterate

* Add FeedbackDialog snapshot test

* Add SdkConfig snapshot tests

* Iterate

* Fix tests

* Iterate types

* Fix test
This commit is contained in:
Michael Telatynski 2023-04-26 10:36:00 +01:00 committed by GitHub
parent e4610e4672
commit 6166dbb661
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 259 additions and 78 deletions

View file

@ -18,6 +18,7 @@ import { MatrixClient } from "matrix-js-sdk/src/client";
import BasePlatform from "../../BasePlatform";
import { IConfigOptions } from "../../IConfigOptions";
import { DeepReadonly } from "../../@types/common";
export type DeviceClientInformation = {
name?: string;
@ -49,7 +50,7 @@ export const getClientInformationEventType = (deviceId: string): string => `${cl
*/
export const recordClientInformation = async (
matrixClient: MatrixClient,
sdkConfig: IConfigOptions,
sdkConfig: DeepReadonly<IConfigOptions>,
platform?: BasePlatform,
): Promise<void> => {
const deviceId = matrixClient.getDeviceId()!;

View file

@ -141,3 +141,12 @@ export function objectKeyChanges<O extends {}>(a: O, b: O): (keyof O)[] {
export function objectClone<O extends {}>(obj: O): O {
return JSON.parse(JSON.stringify(obj));
}
/**
* Simple object check.
* @param item
* @returns {boolean}
*/
export function isObject(item: any): item is object {
return item && typeof item === "object" && !Array.isArray(item);
}