Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/2.8' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
petrjasek committed Dec 4, 2024
2 parents ab27e6b + f4aaad9 commit 7cd607d
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 48 deletions.
60 changes: 30 additions & 30 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "superdesk-core",
"version": "2.8.0",
"version": "2.8.1",
"license": "AGPL-3.0",
"repository": {
"type": "git",
Expand Down Expand Up @@ -123,7 +123,7 @@
"sass-loader": "6.0.6",
"shortid": "2.2.8",
"style-loader": "0.20.2",
"superdesk-ui-framework": "^4.0.3",
"superdesk-ui-framework": "4.0.3",
"ts-loader": "3.5.0",
"typescript": "4.9.5",
"uuid": "8.3.1",
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/activity/views/activity-modal.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div style="z-index: 1051 !important;" class="modal in {{activity.cssClass}}" ng-if="activity">
<div ng-style="!activity.zIndex ? {'z-index': '1051'} : {'z-index': activity.zIndex}" class="modal in {{activity.cssClass}}" ng-if="activity">
<div class="modal__dialog" ng-controller="activity.controller">
<div class="modal__content" ng-include="activity.templateUrl"></div>
</div>
Expand Down
46 changes: 38 additions & 8 deletions scripts/core/ui/components/SelectUser.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable react/no-multi-comp */
import React from 'react';
import {IPropsSelectUser, IUser} from 'superdesk-api';
import {gettext, searchUsers} from 'core/utils';
import {IPropsSelectUser, IUser, IRestApiResponse} from 'superdesk-api';
import {gettext, getUserSearchMongoQuery} from 'core/utils';
import {UserAvatar} from 'apps/users/components/UserAvatar';
import {SelectWithTemplate, Spacer} from 'superdesk-ui-framework/react';
import {httpRequestJsonLocal} from 'core/helpers/network';
import {SuperdeskReactComponent} from 'core/SuperdeskReactComponent';
import {sdApi} from 'api';

interface IState {
selectedUser: IUser | null | 'loading';
Expand Down Expand Up @@ -117,11 +117,41 @@ export class SelectUser extends SuperdeskReactComponent<IPropsSelectUser, IState
inlineLabel={true}
labelHidden={true}
getItems={(searchString) => {
const users = this.props.deskId
? sdApi.desks.getDeskMembers(this.props.deskId)
: sdApi.user.getAll().toArray();

return Promise.resolve(searchUsers(users, searchString));
this.abortController?.abort();
this.abortController = new AbortController();

let url = '/users';

if (this.props.deskId != null && this.props.deskId != '') {
url = `/desks/${this.props.deskId}/users`;
}

const urlParams = {max_results: 50};

if (searchString != null && searchString.length > 0) {
urlParams['where'] = getUserSearchMongoQuery(searchString);
}

// Wrapping into additional promise in order to avoid having to handle rejected promise
// in `SelectWithTemplate` component. The component takes a generic promise
// as an argument and not a fetch result so it wouldn't be good to handle
// fetch-specific rejections there.
return new Promise((resolve) => {
httpRequestJsonLocal<IRestApiResponse<IUser>>({
method: 'GET',
path: url,
urlParams,
abortSignal: this.abortController.signal,
}).then((res) => {
resolve(res._items);
}).catch((err) => {
// If user types something in the filter input all unfinished requests will be aborted.
// This is expected behaviour here and should not throw an error.
if (err?.name !== 'AbortError') {
throw err;
}
});
});
}}
value={this.state.selectedUser}
onChange={(user) => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/extensions/ai-widget/src/superdesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import {ISuperdesk} from 'superdesk-api';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export const superdesk = window['extensionsApiInstances']['ai-widget'] as ISuperdesk;
export const superdesk: ISuperdesk = window['extensionsApiInstances']['ai-widget'] as ISuperdesk;
2 changes: 1 addition & 1 deletion scripts/extensions/auto-tagging-widget/src/superdesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import {ISuperdesk} from 'superdesk-api';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export const superdesk = window['extensionsApiInstances']['auto-tagging-widget'] as ISuperdesk;
export const superdesk: ISuperdesk = window['extensionsApiInstances']['auto-tagging-widget'] as ISuperdesk;
2 changes: 1 addition & 1 deletion scripts/extensions/booleanField/src/superdesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import {ISuperdesk} from 'superdesk-api';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export const superdesk = window['extensionsApiInstances']['booleanField'] as ISuperdesk;
export const superdesk: ISuperdesk = window['extensionsApiInstances']['booleanField'] as ISuperdesk;
2 changes: 1 addition & 1 deletion scripts/extensions/broadcasting/src/superdesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import {ISuperdesk} from 'superdesk-api';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export const superdesk = window['extensionsApiInstances']['broadcasting'] as ISuperdesk;
export const superdesk: ISuperdesk = window['extensionsApiInstances']['broadcasting'] as ISuperdesk;
2 changes: 1 addition & 1 deletion scripts/extensions/datetimeField/src/superdesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import {ISuperdesk} from 'superdesk-api';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export const superdesk = window['extensionsApiInstances']['datetimeField'] as ISuperdesk;
export const superdesk: ISuperdesk = window['extensionsApiInstances']['datetimeField'] as ISuperdesk;
2 changes: 1 addition & 1 deletion scripts/extensions/helloWorld/src/superdesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import {ISuperdesk} from 'superdesk-api';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export const superdesk = window['extensionsApiInstances']['helloWorld'] as ISuperdesk;
export const superdesk: ISuperdesk = window['extensionsApiInstances']['helloWorld'] as ISuperdesk;
2 changes: 1 addition & 1 deletion scripts/extensions/predefinedTextField/src/superdesk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import {ISuperdesk} from 'superdesk-api';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
export const superdesk = window['extensionsApiInstances']['predefinedTextField'] as ISuperdesk;
export const superdesk: ISuperdesk = window['extensionsApiInstances']['predefinedTextField'] as ISuperdesk;

0 comments on commit 7cd607d

Please sign in to comment.