mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../../../extension.schema.json",
|
||||
"$id": "9a635542-d87a-4558-ae64-ffa199d1a364",
|
||||
"$version": "0.0.8",
|
||||
"$version": "0.0.9",
|
||||
"$name": "keensoft.aos.plugin",
|
||||
"$description": "Extension that provides Office Edit Online Action",
|
||||
"$vendor": "Keensoft",
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@alfresco/adf-office-services-ext",
|
||||
"version": "0.0.8",
|
||||
"version": "0.0.9",
|
||||
"license": "Apache-2.0",
|
||||
"homepage": "https://github.com/Alfresco/alfresco-content-app",
|
||||
"keywords": ["Alfresco", "ADF", "ACA", "Content Application"],
|
||||
|
@@ -83,6 +83,58 @@ describe('evaluators', () => {
|
||||
expect(canOpenWithOffice(context)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return [false] if selected file is a record with containing aspect rma:declaredRecord', () => {
|
||||
const context: any = {
|
||||
selection: {
|
||||
file: {
|
||||
entry: {
|
||||
name: 'document.docx',
|
||||
isLocked: false,
|
||||
properties: {},
|
||||
aspectNames: ['rma:declaredRecord']
|
||||
}
|
||||
}
|
||||
},
|
||||
permissions: {
|
||||
check: () => true
|
||||
}
|
||||
};
|
||||
expect(canOpenWithOffice(context)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return [false] if selected file is a record with containing aspect rma:record', () => {
|
||||
const context: any = {
|
||||
selection: {
|
||||
file: {
|
||||
entry: {
|
||||
name: 'document.docx',
|
||||
isLocked: false,
|
||||
properties: {},
|
||||
aspectNames: ['rma:record']
|
||||
}
|
||||
}
|
||||
},
|
||||
permissions: {
|
||||
check: () => true
|
||||
}
|
||||
};
|
||||
expect(canOpenWithOffice(context)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return [false] if selected file is a record 1', () => {
|
||||
const context: any = {
|
||||
selection: {
|
||||
file: {
|
||||
entry: {
|
||||
aspectName: ['rma:declaredRecord']
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
expect(canOpenWithOffice(context)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return [false] if selected file is locked', () => {
|
||||
const context: any = {
|
||||
selection: {
|
||||
|
@@ -98,5 +98,14 @@ export function canOpenWithOffice(
|
||||
return false;
|
||||
}
|
||||
|
||||
// check if record
|
||||
if (
|
||||
file.entry.aspectNames &&
|
||||
(file.entry.aspectNames.includes('rma:declaredRecord') ||
|
||||
file.entry.aspectNames.includes('rma:record'))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return context.permissions.check(file, ['update']);
|
||||
}
|
||||
|
Reference in New Issue
Block a user