diff --git a/projects/adf-office-services-ext/package.json b/projects/adf-office-services-ext/package.json index 397ccbc9c9..3270785f35 100644 --- a/projects/adf-office-services-ext/package.json +++ b/projects/adf-office-services-ext/package.json @@ -1,6 +1,6 @@ { "name": "@alfresco/adf-office-services-ext", - "version": "0.0.4", + "version": "0.0.5", "license": "Apache-2.0", "author": { "name": "Keensoft", diff --git a/projects/adf-office-services-ext/src/lib/evaluators.ts b/projects/adf-office-services-ext/src/lib/evaluators.ts index 7b39cd5680..e63abdc742 100644 --- a/projects/adf-office-services-ext/src/lib/evaluators.ts +++ b/projects/adf-office-services-ext/src/lib/evaluators.ts @@ -1,10 +1,17 @@ import { RuleContext, RuleParameter } from '@alfresco/adf-extensions'; +import { AuthenticationService } from '@alfresco/adf-core'; import { getFileExtension, supportedExtensions } from './utils'; export function canOpenWithOffice( context: RuleContext, ...args: RuleParameter[] ): boolean { + // todo: needs to have typed access via SDK (1.8) + const auth: AuthenticationService = (context).auth; + if (auth && auth.isOauth()) { + return false; + } + const file = context.selection.file; if (!file || !file.entry || !file.entry.properties) { diff --git a/src/app/extensions/app.interface.ts b/src/app/extensions/app.interface.ts index 8570fb9851..dfae10563d 100644 --- a/src/app/extensions/app.interface.ts +++ b/src/app/extensions/app.interface.ts @@ -24,7 +24,9 @@ */ import { RuleContext, RepositoryState } from '@alfresco/adf-extensions'; +import { AuthenticationService } from '@alfresco/adf-core'; export interface AppRuleContext extends RuleContext { repository: RepositoryState; + auth: AuthenticationService; } diff --git a/src/app/extensions/extension.service.ts b/src/app/extensions/extension.service.ts index d36ed03476..cbd2636608 100644 --- a/src/app/extensions/extension.service.ts +++ b/src/app/extensions/extension.service.ts @@ -35,7 +35,6 @@ import { SelectionState, NavigationState, ExtensionConfig, - RuleContext, RuleEvaluator, ViewerExtensionRef, ContentActionRef, @@ -52,15 +51,16 @@ import { RepositoryState, ExtensionRef } from '@alfresco/adf-extensions'; -import { AppConfigService } from '@alfresco/adf-core'; +import { AppConfigService, AuthenticationService } from '@alfresco/adf-core'; import { DocumentListPresetRef } from './document-list.extensions'; import { BehaviorSubject, Observable } from 'rxjs'; import { IconRef } from './icon.extensions'; +import { AppRuleContext } from './app.interface'; @Injectable({ providedIn: 'root' }) -export class AppExtensionService implements RuleContext { +export class AppExtensionService implements AppRuleContext { private _references = new BehaviorSubject([]); defaults = { @@ -108,6 +108,7 @@ export class AppExtensionService implements RuleContext { references$: Observable; constructor( + public auth: AuthenticationService, protected store: Store, protected loader: ExtensionLoaderService, protected extensions: ExtensionService,