mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
Resolved branch revision in Source Extension Point (#1803)
This adds the "resolved revision" of the HEAD (of the current branch, if branches are supported) to the extension point repos.sources.extensions. This "resolved revision" holds the current HEAD revision of the repository (or the selected branch, if branches are supported). This means you can check, whether the release has changed since an extension has been rendered for the first time. Co-authored-by: Konstantin Schaper <konstantin.schaper@cloudogu.com>
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
import { ApiResult, useIndexJsonResource, useIndexLinks } from "./base";
|
||||
import { ApiResult, ApiResultWithFetching, useIndexJsonResource, useIndexLinks } from "./base";
|
||||
import { Link, QueryResult, SearchableType } from "@scm-manager/ui-types";
|
||||
import { apiClient } from "./apiclient";
|
||||
import { createQueryString } from "./utils";
|
||||
@@ -58,10 +58,11 @@ export const useSearchCounts = (types: string[], query: string) => {
|
||||
apiClient.get(`${findLink(searchLinks, type)}?q=${query}&countOnly=true`).then((response) => response.json()),
|
||||
}))
|
||||
);
|
||||
const result: { [type: string]: ApiResult<number> } = {};
|
||||
const result: { [type: string]: ApiResultWithFetching<number> } = {};
|
||||
queries.forEach((q, i) => {
|
||||
result[types[i]] = {
|
||||
isLoading: q.isLoading,
|
||||
isFetching: q.isFetching,
|
||||
error: q.error as Error,
|
||||
data: (q.data as QueryResult)?.totalHits,
|
||||
};
|
||||
@@ -141,6 +142,12 @@ const pickLang = (language: string) => {
|
||||
};
|
||||
|
||||
export const useSearchHelpContent = (language: string) =>
|
||||
useObserveAsync((lang) => import(`./help/search/modal.${pickLang(lang)}`).then((module) => module.default), [language]);
|
||||
useObserveAsync(
|
||||
(lang) => import(`./help/search/modal.${pickLang(lang)}`).then((module) => module.default),
|
||||
[language]
|
||||
);
|
||||
export const useSearchSyntaxContent = (language: string) =>
|
||||
useObserveAsync((lang) => import(`./help/search/syntax.${pickLang(lang)}`).then((module) => module.default), [language]);
|
||||
useObserveAsync(
|
||||
(lang) => import(`./help/search/syntax.${pickLang(lang)}`).then((module) => module.default),
|
||||
[language]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user