Skip to content

Commit

Permalink
Merge branch 'hotfix/2021.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
PenghaiZhang committed Jun 28, 2021
2 parents 32861fe + 245fb99 commit 28b28e9
Show file tree
Hide file tree
Showing 47 changed files with 1,628 additions and 169 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ public void ensureActivated(PluginDescriptor plugin) {
}
}

public boolean isActivated(String pluginId) {
return pluginManager.getRegistry().isPluginDescriptorAvailable(pluginId);
}

@SuppressWarnings("nls")
@Override
public ExtensionPoint getExtensionPoint(String pluginId, String pointId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ public interface PluginService {

void ensureActivated(PluginDescriptor plugin);

/**
* Check if a plugin is activated.
*
* @param pluginId The ID of plugin
* @return `true` if plugin available otherwise false
*/
default boolean isActivated(String pluginId) {
throw new UnsupportedOperationException();
}

void registerExtensionListener(
String pluginId, String extensionId, RegistryChangeListener listener);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
preview: false,
mimeType: "image/jpeg",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/fe79c485-a6dd-4743-81e8-52de66494633/1/?attachment.uuid=dbd6dd98-d731-4a8f-907e-ceaf9608da3b",
Expand Down Expand Up @@ -89,6 +90,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
preview: false,
mimeType: "image/jpeg",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/40e879db-393b-4256-bfe2-9a78771d6937/1/?attachment.uuid=4fddbeb7-8d16-4417-be60-8709ce9d7b15",
Expand All @@ -104,6 +106,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
preview: false,
mimeType: "image/jpeg",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/40e879db-393b-4256-bfe2-9a78771d6937/1/?attachment.uuid=df55f129-1bbb-427f-b8a0-46792559bea9",
Expand All @@ -117,6 +120,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
id: "44528005-fb39-4461-bac7-12cd33ce4330",
description: "Australian Kelpie Pet Profile | Bondi Vet",
preview: false,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/40e879db-393b-4256-bfe2-9a78771d6937/1/?attachment.uuid=44528005-fb39-4461-bac7-12cd33ce4330",
Expand Down Expand Up @@ -164,6 +168,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
preview: false,
mimeType: "image/jpeg",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/8d25bfcc-f877-4cb6-84cd-391a79c7c67a/1/?attachment.uuid=a09056f0-c867-40ea-80c0-a1433f487182",
Expand All @@ -179,6 +184,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
preview: false,
mimeType: "application/pdf",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/8d25bfcc-f877-4cb6-84cd-391a79c7c67a/1/?attachment.uuid=6411799f-052a-4926-8c67-0c851447c762",
Expand All @@ -194,6 +200,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
preview: false,
mimeType: "image/jpeg",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/8d25bfcc-f877-4cb6-84cd-391a79c7c67a/1/?attachment.uuid=e3f96e6b-a6aa-4c8e-975c-c2c3870daa34",
Expand All @@ -209,6 +216,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
preview: false,
mimeType: "image/jpeg",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/8d25bfcc-f877-4cb6-84cd-391a79c7c67a/1/?attachment.uuid=f226e79a-1d2c-4894-aaa1-032812351d29",
Expand All @@ -224,6 +232,7 @@ export const basicImageSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
preview: false,
mimeType: "image/jpeg",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/8d25bfcc-f877-4cb6-84cd-391a79c7c67a/1/?attachment.uuid=3afceca2-63d0-47ea-b921-f199b73194fc",
Expand Down Expand Up @@ -279,6 +288,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
id: "398dbef0-7d12-4b72-af3d-095dd70b019d",
description: "6 Tips For Caring for African Violets",
preview: false,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/de8fcb0b-0b1c-4c34-9173-a83d1b0be6b5/1/?attachment.uuid=398dbef0-7d12-4b72-af3d-095dd70b019d",
Expand Down Expand Up @@ -324,6 +334,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
preview: false,
mimeType: "video/mp4",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/59139c45-788b-4200-a9cb-e4a39e76ad35/1/?attachment.uuid=d81a7599-89a2-474e-b756-50bda202b349",
Expand Down Expand Up @@ -370,6 +381,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
preview: false,
mimeType: "image/jpeg",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/9d5112d4-87b6-4ac1-b773-ceaa4a6c5205/1/?attachment.uuid=e82207be-a9f2-442a-a17f-5c834d5b36cc",
Expand All @@ -384,6 +396,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
description:
"These Simple Words Will Help You Through Life's Most Difficult Situations | Ryan Holiday",
preview: false,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/9d5112d4-87b6-4ac1-b773-ceaa4a6c5205/1/?attachment.uuid=33eb363d-77f4-4d40-84a3-d0ae1687b5f6",
Expand All @@ -398,6 +411,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
description:
"Stoicism and the Art of Resilience | Ryan Holiday | Epictetus",
preview: false,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/9d5112d4-87b6-4ac1-b773-ceaa4a6c5205/1/?attachment.uuid=9fc093fa-f03a-45a5-98df-17381d63972f",
Expand All @@ -412,6 +426,7 @@ export const basicVideoSearchResponse: OEQ.Search.SearchResult<OEQ.Search.Search
description:
"Stoicism's Simple Secret To Being Happier | Ryan Holiday | Daily Stoic",
preview: false,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/ian/items/9d5112d4-87b6-4ac1-b773-ceaa4a6c5205/1/?attachment.uuid=97bc82ed-fda4-40a9-91ea-e32da76e66a2",
Expand Down
133 changes: 133 additions & 0 deletions Source/Plugins/Core/com.equella.core/js/__mocks__/OEQThumb.mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* The Apereo Foundation licenses this file to you under the Apache License,
* Version 2.0, (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as OEQ from "@openequella/rest-api-client";

export const fileAttachment: OEQ.Search.Attachment = {
attachmentType: "file",
id: "9e751549-5cba-47dd-bccb-722c48072287",
description: "broken.png",
preview: false,
mimeType: "image/png",
hasGeneratedThumb: true,
brokenAttachment: false,
links: {
view:
"http://localhost:8080/rest/items/72558c1d-8788-4515-86c8-b24a28cc451e/1/?attachment.uuid=78b8af7e-f0f5-4b5c-9f44-16f212583fe8",
thumbnail: "./thumb.jpg",
},
};

export const brokenFileAttachment: OEQ.Search.Attachment = {
attachmentType: "file",
id: "9e751549-5cba-47dd-bccb-722c48072287",
description: "broken.png",
preview: false,
mimeType: "image/png",
hasGeneratedThumb: true,
brokenAttachment: true,
links: {
view:
"http://localhost:8080/rest/items/72558c1d-8788-4515-86c8-b24a28cc451e/1/?attachment.uuid=78b8af7e-f0f5-4b5c-9f44-16f212583fe8",
thumbnail: "./thumb.jpg",
},
};

export const resourceFileAttachment: OEQ.Search.Attachment = {
attachmentType: "custom/resource",
id: "2c663052-a472-4b3e-b4d1-a25a5cd45675",
description: "miss-violet.jpg",
brokenAttachment: false,
preview: false,
mimeType: "image/jpeg",
links: {
view:
"http://localhost:8080/rest/items/9ba9a328-4697-4ae0-9dba-3f82f1876fb8/1/?attachment.uuid=2c663052-a472-4b3e-b4d1-a25a5cd45675",
thumbnail: "./thumb.jpg",
},
};
export const linkAttachment: OEQ.Search.Attachment = {
attachmentType: "link",
id: "7d84f75e-1756-4af0-b4e1-2553b52885f0",
description: "https://www.google.com",
brokenAttachment: false,
preview: false,
links: {
view:
"http://localhost:8080/rest/items/1dc04a21-9659-487f-b784-66726fa59bdc/1/?attachment.uuid=7d84f75e-1756-4af0-b4e1-2553b52885f0",
thumbnail: "./thumb.jpg",
},
};

export const resourceLinkAttachment: OEQ.Search.Attachment = {
attachmentType: "custom/resource",
id: "02f8f12e-8222-4c5b-b89a-888cbbbc402d",
description: "https://www.google.com",
brokenAttachment: false,
preview: false,
mimeType: "equella/link",
links: {
view:
"http://localhost:8080/rest/items/a321a2f7-2228-4853-8292-54f390976049/1/?attachment.uuid=02f8f12e-8222-4c5b-b89a-888cbbbc402d",
thumbnail: "./thumb.jpg",
},
};

export const equellaItemAttachment: OEQ.Search.Attachment = {
attachmentType: "custom/resource",
id: "7140295f-7fe0-4b6b-b621-eb2adfbd386f",
description: "a321a2f7-2228-4853-8292-54f390976049",
brokenAttachment: false,
preview: false,
mimeType: "equella/item",
links: {
view:
"http://localhost:8080/rest/items/475a5e1b-4558-43f9-aeb4-9d49408197be/1/?attachment.uuid=7140295f-7fe0-4b6b-b621-eb2adfbd386f",
thumbnail:
"http://localhost:8080/rest/thumbs/475a5e1b-4558-43f9-aeb4-9d49408197be/1/7140295f-7fe0-4b6b-b621-eb2adfbd386f",
},
};

export const htmlAttachment: OEQ.Search.Attachment = {
attachmentType: "html",
id: "ef533d4c-15fc-45d4-91ee-0873e17fa7cb",
description: "New Page",
brokenAttachment: false,
preview: false,
mimeType: "text/html",
links: {
view:
"http://localhost:8080/rest/items/eb099d2a-d1a8-4e4e-98ff-fec42587adb4/1/?attachment.uuid=ef533d4c-15fc-45d4-91ee-0873e17fa7cb",
thumbnail:
"http://localhost:8080/rest/thumbs/eb099d2a-d1a8-4e4e-98ff-fec42587adb4/1/ef533d4c-15fc-45d4-91ee-0873e17fa7cb",
},
};

export const resourceHtmlAttachment: OEQ.Search.Attachment = {
attachmentType: "custom/resource",
id: "1fa39170-ad0a-4607-9e37-bac86a8dea32",
description: "New Page",
brokenAttachment: false,
preview: false,
mimeType: "text/html",
links: {
view:
"http://localhost:8080/rest/items/550a3047-eb17-4db4-8b1e-6adbf6d63f3b/1/?attachment.uuid=1fa39170-ad0a-4607-9e37-bac86a8dea32",
thumbnail:
"http://localhost:8080/rest/thumbs/550a3047-eb17-4db4-8b1e-6adbf6d63f3b/1/1fa39170-ad0a-4607-9e37-bac86a8dea32",
},
};
Loading

0 comments on commit 28b28e9

Please sign in to comment.