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