fix(typescript): Missed renames UIModalService and UserAuthenticationService (#3171)
This commit is contained in:
parent
8af0362d12
commit
ecfdc9a687
@ -196,15 +196,15 @@ const commandsModule = ({ servicesManager }) => {
|
||||
},
|
||||
showDownloadViewportModal: () => {
|
||||
const { activeViewportIndex } = viewportGridService.getState();
|
||||
const { UIModalService } = servicesManager.services;
|
||||
const { uiModalService } = servicesManager.services;
|
||||
|
||||
if (UIModalService) {
|
||||
UIModalService.show({
|
||||
if (uiModalService) {
|
||||
uiModalService.show({
|
||||
content: CornerstoneViewportDownloadForm,
|
||||
title: 'Download High Quality Image',
|
||||
contentProps: {
|
||||
activeViewportIndex,
|
||||
onClose: UIModalService.hide,
|
||||
onClose: uiModalService.hide,
|
||||
cornerstoneViewportService,
|
||||
},
|
||||
});
|
||||
|
||||
@ -62,11 +62,11 @@ export default async function init({
|
||||
);
|
||||
|
||||
const {
|
||||
UserAuthenticationService,
|
||||
userAuthenticationService,
|
||||
measurementService,
|
||||
displaySetService,
|
||||
uiDialogService,
|
||||
UIModalService,
|
||||
uiModalService,
|
||||
uiNotificationService,
|
||||
cineService,
|
||||
cornerstoneViewportService,
|
||||
@ -87,7 +87,7 @@ export default async function init({
|
||||
}
|
||||
|
||||
if (cornerstone.getShouldUseCPURendering()) {
|
||||
_showCPURenderingModal(UIModalService, hangingProtocolService);
|
||||
_showCPURenderingModal(uiModalService, hangingProtocolService);
|
||||
}
|
||||
|
||||
const labelmapRepresentation =
|
||||
@ -128,7 +128,7 @@ export default async function init({
|
||||
prefetch: appConfig?.maxNumRequests?.prefetch || 10,
|
||||
};
|
||||
|
||||
initWADOImageLoader(UserAuthenticationService, appConfig);
|
||||
initWADOImageLoader(userAuthenticationService, appConfig);
|
||||
|
||||
/* Measurement Service */
|
||||
const measurementServiceSource = connectToolsToMeasurementService(
|
||||
@ -403,10 +403,10 @@ function CPUModal() {
|
||||
);
|
||||
}
|
||||
|
||||
function _showCPURenderingModal(UIModalService, hangingProtocolService) {
|
||||
function _showCPURenderingModal(uiModalService, hangingProtocolService) {
|
||||
const callback = progress => {
|
||||
if (progress === 100) {
|
||||
UIModalService.show({
|
||||
uiModalService.show({
|
||||
content: CPUModal,
|
||||
title: 'OHIF Fell Back to CPU Rendering',
|
||||
});
|
||||
|
||||
@ -34,7 +34,7 @@ function initWebWorkers(appConfig) {
|
||||
}
|
||||
|
||||
export default function initWADOImageLoader(
|
||||
UserAuthenticationService,
|
||||
userAuthenticationService,
|
||||
appConfig
|
||||
) {
|
||||
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
|
||||
@ -55,7 +55,7 @@ export default function initWADOImageLoader(
|
||||
convertFloatPixelDataToInt: false,
|
||||
},
|
||||
beforeSend: function(xhr) {
|
||||
const headers = UserAuthenticationService.getAuthorizationHeader();
|
||||
const headers = userAuthenticationService.getAuthorizationHeader();
|
||||
|
||||
// Request:
|
||||
// JPEG-LS Lossless (1.2.840.10008.1.2.4.80) if available, otherwise accept
|
||||
|
||||
@ -157,8 +157,8 @@ class CornerstoneCacheService {
|
||||
// getSOPClassHandler method
|
||||
|
||||
if (displaySet.load && displaySet.load instanceof Function) {
|
||||
const { UserAuthenticationService } = this.servicesManager.services;
|
||||
const headers = UserAuthenticationService.getAuthorizationHeader();
|
||||
const { userAuthenticationService } = this.servicesManager.services;
|
||||
const headers = userAuthenticationService.getAuthorizationHeader();
|
||||
await displaySet.load({ headers });
|
||||
|
||||
volumeData.push({
|
||||
|
||||
@ -49,7 +49,7 @@ const metadataProvider = classes.MetadataProvider;
|
||||
* @param {bool} lazyLoadStudy - "enableStudyLazyLoad"; Request series meta async instead of blocking
|
||||
* @param {string|bool} singlepart - indicates of the retrieves can fetch singlepart. Options are bulkdata, video, image or boolean true
|
||||
*/
|
||||
function createDicomWebApi(dicomWebConfig, UserAuthenticationService) {
|
||||
function createDicomWebApi(dicomWebConfig, userAuthenticationService) {
|
||||
const {
|
||||
qidoRoot,
|
||||
wadoRoot,
|
||||
@ -65,7 +65,7 @@ function createDicomWebApi(dicomWebConfig, UserAuthenticationService) {
|
||||
url: qidoRoot,
|
||||
staticWado,
|
||||
singlepart,
|
||||
headers: UserAuthenticationService.getAuthorizationHeader(),
|
||||
headers: userAuthenticationService.getAuthorizationHeader(),
|
||||
errorInterceptor: errorHandler.getHTTPErrorHandler(),
|
||||
};
|
||||
|
||||
@ -73,7 +73,7 @@ function createDicomWebApi(dicomWebConfig, UserAuthenticationService) {
|
||||
url: wadoRoot,
|
||||
staticWado,
|
||||
singlepart,
|
||||
headers: UserAuthenticationService.getAuthorizationHeader(),
|
||||
headers: userAuthenticationService.getAuthorizationHeader(),
|
||||
errorInterceptor: errorHandler.getHTTPErrorHandler(),
|
||||
};
|
||||
|
||||
@ -105,7 +105,7 @@ function createDicomWebApi(dicomWebConfig, UserAuthenticationService) {
|
||||
studies: {
|
||||
mapParams: mapParams.bind(),
|
||||
search: async function (origParams) {
|
||||
const headers = UserAuthenticationService.getAuthorizationHeader();
|
||||
const headers = userAuthenticationService.getAuthorizationHeader();
|
||||
if (headers) {
|
||||
qidoDicomWebClient.headers = headers;
|
||||
}
|
||||
@ -130,7 +130,7 @@ function createDicomWebApi(dicomWebConfig, UserAuthenticationService) {
|
||||
series: {
|
||||
// mapParams: mapParams.bind(),
|
||||
search: async function (studyInstanceUid) {
|
||||
const headers = UserAuthenticationService.getAuthorizationHeader();
|
||||
const headers = userAuthenticationService.getAuthorizationHeader();
|
||||
if (headers) {
|
||||
qidoDicomWebClient.headers = headers;
|
||||
}
|
||||
@ -146,7 +146,7 @@ function createDicomWebApi(dicomWebConfig, UserAuthenticationService) {
|
||||
},
|
||||
instances: {
|
||||
search: (studyInstanceUid, queryParameters) => {
|
||||
const headers = UserAuthenticationService.getAuthorizationHeader();
|
||||
const headers = userAuthenticationService.getAuthorizationHeader();
|
||||
if (headers) {
|
||||
qidoDicomWebClient.headers = headers;
|
||||
}
|
||||
@ -184,7 +184,7 @@ function createDicomWebApi(dicomWebConfig, UserAuthenticationService) {
|
||||
sortFunction,
|
||||
madeInClient = false,
|
||||
} = {}) => {
|
||||
const headers = UserAuthenticationService.getAuthorizationHeader();
|
||||
const headers = userAuthenticationService.getAuthorizationHeader();
|
||||
if (headers) {
|
||||
wadoDicomWebClient.headers = headers;
|
||||
}
|
||||
@ -218,7 +218,7 @@ function createDicomWebApi(dicomWebConfig, UserAuthenticationService) {
|
||||
|
||||
store: {
|
||||
dicom: async dataset => {
|
||||
const headers = UserAuthenticationService.getAuthorizationHeader();
|
||||
const headers = userAuthenticationService.getAuthorizationHeader();
|
||||
if (headers) {
|
||||
wadoDicomWebClient.headers = headers;
|
||||
}
|
||||
|
||||
@ -34,15 +34,15 @@ const commandsModule = ({ servicesManager, commandsManager }) => {
|
||||
const { displaySetInstanceUIDs } = activeViewportSpecificData;
|
||||
|
||||
const displaySets = displaySetService.activeDisplaySets;
|
||||
const { UIModalService } = servicesManager.services;
|
||||
const { uiModalService } = servicesManager.services;
|
||||
|
||||
const displaySetInstanceUID = displaySetInstanceUIDs[0];
|
||||
UIModalService.show({
|
||||
uiModalService.show({
|
||||
content: DicomTagBrowser,
|
||||
contentProps: {
|
||||
displaySets,
|
||||
displaySetInstanceUID,
|
||||
onClose: UIModalService.hide,
|
||||
onClose: uiModalService.hide,
|
||||
},
|
||||
title: 'DICOM Tag Browser',
|
||||
});
|
||||
|
||||
@ -357,7 +357,7 @@ export default class ExtensionManager {
|
||||
};
|
||||
|
||||
_initDataSourcesModule(extensionModule, extensionId, dataSources = []) {
|
||||
const { UserAuthenticationService } = this._servicesManager.services;
|
||||
const { userAuthenticationService } = this._servicesManager.services;
|
||||
dataSources.forEach(dataSource => {
|
||||
this.dataSourceDefs[dataSource.sourceName] = dataSource;
|
||||
});
|
||||
@ -369,7 +369,7 @@ export default class ExtensionManager {
|
||||
if (dataSource.namespace === namespace) {
|
||||
const dataSourceInstance = element.createDataSource(
|
||||
dataSource.configuration,
|
||||
UserAuthenticationService
|
||||
userAuthenticationService
|
||||
);
|
||||
|
||||
if (this.dataSourceMap[dataSource.sourceName]) {
|
||||
|
||||
@ -11,6 +11,7 @@ import {
|
||||
* The interface for the services object
|
||||
*/
|
||||
export default interface Services {
|
||||
userAuthenticationService?: Record<string, unknown>;
|
||||
hangingProtocolService?: HangingProtocolService;
|
||||
customizationService?: CustomizationService;
|
||||
measurementService?: MeasurementService;
|
||||
@ -21,6 +22,7 @@ export default interface Services {
|
||||
uiDialogService?: Record<string, unknown>;
|
||||
toolGroupService?: Record<string, unknown>;
|
||||
uiNotificationService?: Record<string, unknown>;
|
||||
uiModalService?: Record<string, unknown>;
|
||||
viewportGridService?: ViewportGridService;
|
||||
syncGroupService?: Record<string, unknown>;
|
||||
cornerstoneCacheService?: Record<string, unknown>;
|
||||
|
||||
@ -60,18 +60,18 @@ function App({ config, defaultExtensions, defaultModes }) {
|
||||
|
||||
const {
|
||||
UIDialogService,
|
||||
UIModalService,
|
||||
uiModalService,
|
||||
UINotificationService,
|
||||
UIViewportDialogService,
|
||||
ViewportGridService,
|
||||
CineService,
|
||||
UserAuthenticationService,
|
||||
userAuthenticationService,
|
||||
customizationService,
|
||||
} = servicesManager.services;
|
||||
|
||||
const providers = [
|
||||
[AppConfigProvider, { value: appConfigState }],
|
||||
[UserAuthenticationProvider, { service: UserAuthenticationService }],
|
||||
[UserAuthenticationProvider, { service: userAuthenticationService }],
|
||||
[I18nextProvider, { i18n }],
|
||||
[ThemeWrapper],
|
||||
[ViewportGridProvider, { service: ViewportGridService }],
|
||||
@ -79,7 +79,7 @@ function App({ config, defaultExtensions, defaultModes }) {
|
||||
[CineProvider, { service: CineService }],
|
||||
[SnackbarProvider, { service: UINotificationService }],
|
||||
[DialogProvider, { service: UIDialogService }],
|
||||
[ModalProvider, { service: UIModalService, modal: Modal }],
|
||||
[ModalProvider, { service: uiModalService, modal: Modal }],
|
||||
];
|
||||
const CombinedProviders = ({ children }) =>
|
||||
Compose({ components: providers, children });
|
||||
@ -106,7 +106,7 @@ function App({ config, defaultExtensions, defaultModes }) {
|
||||
<OpenIdConnectRoutes
|
||||
oidc={oidc}
|
||||
routerBasename={routerBasename}
|
||||
UserAuthenticationService={UserAuthenticationService}
|
||||
userAuthenticationService={userAuthenticationService}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ const createRoutes = ({
|
||||
);
|
||||
}
|
||||
|
||||
const { UserAuthenticationService } = servicesManager.services;
|
||||
const { userAuthenticationService } = servicesManager.services;
|
||||
|
||||
// Note: PrivateRoutes in react-router-dom 6.x should be defined within
|
||||
// a Route element
|
||||
@ -96,7 +96,7 @@ const createRoutes = ({
|
||||
element={
|
||||
<PrivateRoute
|
||||
handleUnauthenticated={
|
||||
UserAuthenticationService.handleUnauthenticated
|
||||
userAuthenticationService.handleUnauthenticated
|
||||
}
|
||||
>
|
||||
<RouteWithErrorBoundary route={route} />
|
||||
|
||||
@ -104,12 +104,12 @@ function LoginComponent(userManager) {
|
||||
function OpenIdConnectRoutes({
|
||||
oidc,
|
||||
routerBasename,
|
||||
UserAuthenticationService,
|
||||
userAuthenticationService,
|
||||
}) {
|
||||
const userManager = initUserManager(oidc, routerBasename);
|
||||
|
||||
const getAuthorizationHeader = () => {
|
||||
const user = UserAuthenticationService.getUser();
|
||||
const user = userAuthenticationService.getUser();
|
||||
|
||||
return {
|
||||
Authorization: `Bearer ${user.access_token}`,
|
||||
@ -145,9 +145,9 @@ function OpenIdConnectRoutes({
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
UserAuthenticationService.set({ enabled: true });
|
||||
userAuthenticationService.set({ enabled: true });
|
||||
|
||||
UserAuthenticationService.setServiceImplementation({
|
||||
userAuthenticationService.setServiceImplementation({
|
||||
getAuthorizationHeader,
|
||||
handleUnauthenticated,
|
||||
});
|
||||
@ -200,7 +200,7 @@ function OpenIdConnectRoutes({
|
||||
sessionStorage.getItem('ohif-redirect-to')
|
||||
);
|
||||
|
||||
UserAuthenticationService.setUser(user);
|
||||
userAuthenticationService.setUser(user);
|
||||
|
||||
navigate({
|
||||
pathname,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user