mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
upload limit and import ui tweaks (#2998)
This commit is contained in:
parent
527ed5feaf
commit
6b9a242be5
@ -159,12 +159,16 @@ export const ValidationStage: FC<{
|
|||||||
the import, they will be overwritten with the
|
the import, they will be overwritten with the
|
||||||
configuration from this import file
|
configuration from this import file
|
||||||
</WarningHeader>
|
</WarningHeader>
|
||||||
{validationResult.warnings.map(error => (
|
{validationResult.warnings.map(warning => (
|
||||||
<Box sx={{ p: 2 }}>
|
<Box key={warning.message} sx={{ p: 2 }}>
|
||||||
<WarningMessage>{error.message}</WarningMessage>
|
<WarningMessage>
|
||||||
|
{warning.message}
|
||||||
|
</WarningMessage>
|
||||||
<StyledItems>
|
<StyledItems>
|
||||||
{error.affectedItems.map(item => (
|
{warning.affectedItems.map(item => (
|
||||||
<StyledItem>{item}</StyledItem>
|
<StyledItem key={item}>
|
||||||
|
{item}
|
||||||
|
</StyledItem>
|
||||||
))}
|
))}
|
||||||
</StyledItems>
|
</StyledItems>
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -26,6 +26,7 @@ import { conditionalMiddleware } from './middleware/conditional-middleware';
|
|||||||
import patMiddleware from './middleware/pat-middleware';
|
import patMiddleware from './middleware/pat-middleware';
|
||||||
import { Knex } from 'knex';
|
import { Knex } from 'knex';
|
||||||
import maintenanceMiddleware from './middleware/maintenance-middleware';
|
import maintenanceMiddleware from './middleware/maintenance-middleware';
|
||||||
|
import { unless } from './middleware/unless-middleware';
|
||||||
|
|
||||||
export default async function getApp(
|
export default async function getApp(
|
||||||
config: IUnleashConfig,
|
config: IUnleashConfig,
|
||||||
@ -62,7 +63,17 @@ export default async function getApp(
|
|||||||
|
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
app.use(cookieParser());
|
app.use(cookieParser());
|
||||||
app.use(express.json({ strict: false }));
|
|
||||||
|
app.use(
|
||||||
|
`${baseUriPath}/api/admin/features-batch`,
|
||||||
|
express.json({ strict: false, limit: '500kB' }),
|
||||||
|
);
|
||||||
|
app.use(
|
||||||
|
unless(
|
||||||
|
`${baseUriPath}/api/admin/features-batch`,
|
||||||
|
express.json({ strict: false }),
|
||||||
|
),
|
||||||
|
);
|
||||||
if (unleashSession) {
|
if (unleashSession) {
|
||||||
app.use(unleashSession);
|
app.use(unleashSession);
|
||||||
}
|
}
|
||||||
|
11
src/lib/middleware/unless-middleware.ts
Normal file
11
src/lib/middleware/unless-middleware.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { RequestHandler } from 'express';
|
||||||
|
|
||||||
|
export const unless =
|
||||||
|
(path: string, middleware: RequestHandler): RequestHandler =>
|
||||||
|
(req, res, next) => {
|
||||||
|
if (path === req.path) {
|
||||||
|
return next();
|
||||||
|
} else {
|
||||||
|
return middleware(req, res, next);
|
||||||
|
}
|
||||||
|
};
|
@ -18,12 +18,6 @@ import { ExportQuerySchema } from '../openapi/spec/export-query-schema';
|
|||||||
import { FEATURES_EXPORTED, IFlagResolver, IUnleashServices } from '../types';
|
import { FEATURES_EXPORTED, IFlagResolver, IUnleashServices } from '../types';
|
||||||
import { ExportResultSchema } from '../openapi';
|
import { ExportResultSchema } from '../openapi';
|
||||||
|
|
||||||
export interface IImportDTO {
|
|
||||||
data: ExportResultSchema;
|
|
||||||
project: string;
|
|
||||||
environment: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class ExportImportService {
|
export default class ExportImportService {
|
||||||
private logger: Logger;
|
private logger: Logger;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user