1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-07 14:55:27 +02:00

feat(waiting-room): choose relations when associated endpoint [EE-5187] (#8720)

This commit is contained in:
Chaim Lev-Ari 2023-05-14 09:26:11 +07:00 committed by GitHub
parent 511adabce2
commit 365316971b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 1712 additions and 303 deletions

View file

@ -9,3 +9,15 @@ export function promiseSequence<T>(promises: (() => Promise<T>)[]) {
Promise.resolve<T>(undefined as unknown as T)
);
}
export function isFulfilled<T>(
result: PromiseSettledResult<T>
): result is PromiseFulfilledResult<T> {
return result.status === 'fulfilled';
}
export function getFulfilledResults<T>(
results: Array<PromiseSettledResult<T>>
) {
return results.filter(isFulfilled).map((result) => result.value);
}

View file

@ -10,7 +10,7 @@ import { EnvironmentId } from '@/react/portainer/environments/types';
import { createTag, getTags } from './tags.service';
import { Tag, TagId } from './types';
const tagKeys = {
export const tagKeys = {
all: ['tags'] as const,
tag: (id: TagId) => [...tagKeys.all, id] as const,
};