Skip to content

Commit

Permalink
fix tests after Typescript update
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkLark86 committed Mar 23, 2023
1 parent 46d2240 commit f61daef
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 21 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
"@superdesk/build-tools": "file:build-tools",
"@types/classnames": "^2.2.10",
"@types/webpack-env": "^1.17.0",
"@types/webrtc": "0.0.33",
"enzyme": "3.9.0",
"enzyme-adapter-react-16": "^1.15.5",
"grunt-karma": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class ContactFormContainer extends React.PureComponent<IProps, IState> {
} else if (
sanitizedValue instanceof Array &&
sanitizedValue.length > 0 &&
sanitizedValue.every((val) => typeof val === 'string')
(sanitizedValue as Array<any>).every((val) => typeof val === 'string')
) {
sanitizedValue = (sanitizedValue as Array<string>)
.map((arrayValue: string) => arrayValue.trim())
Expand Down
2 changes: 1 addition & 1 deletion scripts/apps/search/controllers/get-multi-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export function getMultiActions(
const selectedItems = getSelectedItems();

confirmPublish(selectedItems).then(() => {
Promise.all(
Promise.all<void>(
selectedItems.map((item) => new Promise((resolve) => {
authoring.publish(item, item)
.then((response) => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/helpers/waitUtil.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const waitUntil = (precondition, timeoutAt = 1000 * 60) => new Promise((resolve, reject) => {
export const waitUntil = (precondition, timeoutAt = 1000 * 60) => new Promise<void>((resolve, reject) => {
function checkNow() {
if (precondition() === true) {
window.clearInterval(interval);
Expand Down
2 changes: 1 addition & 1 deletion scripts/extensions/sams/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"peerDependencies": {
"react": "^16.9.0",
"superdesk-ui-framework": "^2.2.4",
"superdesk-ui-framework": "^3.0.8",
"classnames": "^2.2.5",
"lodash": "^4.17.5",
"json-merge-patch": "0.2.3"
Expand Down
12 changes: 0 additions & 12 deletions scripts/extensions/sams/src/api/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,18 +310,6 @@ export function queryAssets(
querySizeRange,
].forEach((func) => func(source, params));

if (source.query.bool.must.length === 0) {
delete source.query.bool.must;
}

if (source.query.bool.must_not.length === 0) {
delete source.query.bool.must_not;
}

if (Object.keys(source.query.bool).length === 0) {
delete source.query;
}

const sortOrder = params.sortOrder === SORT_ORDER.ASCENDING ? 1 : 0;
const sort = `[("${params.sortField}",${sortOrder})]`;

Expand Down
6 changes: 1 addition & 5 deletions scripts/extensions/videoEditor/src/VideoEditorTools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface IProps {
videoResolution: number;
}

class VideoEditorToolsComponent extends React.PureComponent<IProps> {
export class VideoEditorTools extends React.PureComponent<IProps> {
render() {
const resolutions = [{label: 'Same', value: 0}].concat(
[480, 720, 1080]
Expand Down Expand Up @@ -91,7 +91,3 @@ class VideoEditorToolsComponent extends React.PureComponent<IProps> {
);
}
}

export const VideoEditorTools = React.forwardRef((props: IProps, ref: React.Ref<HTMLDivElement>) =>
<VideoEditorToolsComponent wrapperRef={ref} {...props} />,
);

0 comments on commit f61daef

Please sign in to comment.