Skip to content

Commit

Permalink
fix: customresources lastVersion (kubesphere#3441)
Browse files Browse the repository at this point in the history
  • Loading branch information
51wangping authored Apr 22, 2024
1 parent 295d362 commit 4d13985
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/shared/src/utils/getter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ export const getServedVersion = (item: any) => {
return '';
}
let servedVersion = get(versions[versions.length - 1], 'name');
versions.some((ver: any) => {
versions.forEach((ver: any) => {
if (get(ver, 'served', false)) {
servedVersion = get(ver, 'name', servedVersion);
return true;
}
return false;
});
return servedVersion;
};
Expand Down Expand Up @@ -71,12 +69,14 @@ export function getAnnotationsAliasName(detail: any) {
export function getAnnotationsDescription(detail: any) {
return getAnnotationsName(detail, 'kubesphere.io/description');
}

export function getRepoAppDisplayName(item: any) {
const originalName = item?.metadata?.annotations?.['application.kubesphere.io/app-originalName'];
if (originalName) {
return originalName;
}
}

export const getDisplayName = <T extends Record<string, any>>(item?: T): string => {
if (isEmpty(item)) {
return '';
Expand Down Expand Up @@ -255,6 +255,7 @@ export function getQuery<T>(): T {

return QueryString.parse(search.split('?').pop() || '') as unknown as T;
}

export const mapAccessModes = (accessModes = [] as string[]) =>
accessModes.map(item => ACCESS_MODE_MAPPER[item]);

Expand Down

0 comments on commit 4d13985

Please sign in to comment.