1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

refactor(app): convert tag-selector to react [EE-2983] (#6783)

This commit is contained in:
Chaim Lev-Ari 2022-05-29 09:14:14 +03:00 committed by GitHub
parent 75d854e6ad
commit d52417c14f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 103 additions and 288 deletions

View file

@ -12,6 +12,11 @@ import { createMockTeams, createMockUsers } from '../react-tools/test-mocks';
import { azureHandlers } from './setup-handlers/azure';
const tags: Tag[] = [
{ ID: 1, Name: 'tag1' },
{ ID: 2, Name: 'tag2' },
];
const licenseInfo: LicenseInfo = {
nodes: 1000,
type: LicenseType.Subscription,
@ -48,11 +53,11 @@ export const handlers = [
};
return res(ctx.json(group));
}),
rest.get('/api/tags', (req, res, ctx) => {
const tags: Tag[] = [
{ ID: 1, Name: 'tag1' },
{ ID: 2, Name: 'tag2' },
];
return res(ctx.json(tags));
rest.get('/api/tags', (req, res, ctx) => res(ctx.json(tags))),
rest.post<{ name: string }>('/api/tags', (req, res, ctx) => {
const tagName = req.body.name;
const tag = { ID: tags.length + 1, Name: tagName };
tags.push(tag);
return res(ctx.json(tag));
}),
];