Skip to content

Commit c697564

Browse files
committed
Remove AccentGraphic
1 parent d798dcc commit c697564

File tree

8 files changed

+1
-51
lines changed

8 files changed

+1
-51
lines changed

src/controllers/bannerController.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,6 @@ function extractFileUrls(banner: any): string[] {
408408
if (banner.Logo?.Url) urls.push(banner.Logo.Url);
409409
if (banner.BackgroundImage?.Url) urls.push(banner.BackgroundImage.Url);
410410
if (banner.MainImage?.Url) urls.push(banner.MainImage.Url);
411-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
412-
// if (banner.AccentGraphic?.Url) urls.push(banner.AccentGraphic.Url);
413411

414412
// Partner logos for partnership charter banners (nested structure)
415413
if (banner.PartnershipCharter?.PartnerLogos && Array.isArray(banner.PartnershipCharter.PartnerLogos)) {
@@ -432,8 +430,6 @@ function processMediaFields(req: Request): any {
432430
// Note: I still not sure if it makes sense to use this merging instead of req.body
433431
const processedData = { ...req.body, ...req.preValidatedData };
434432

435-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
436-
// Process single media assets: Logo, BackgroundImage, MainImage, AccentGraphic
437433
['Logo', 'BackgroundImage', 'MainImage' /*, 'AccentGraphic'*/].forEach(field => {
438434
const newFileData = processedData[`newfile_${field}`];
439435
const newMetadata = processedData[`newmetadata_${field}`]

src/middleware/uploadMiddleware.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ async function processUploads(req: Request, res: Response, next: NextFunction) {
158158
}
159159

160160
// Store in appropriate field
161-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
162-
if (fieldName === 'newfile_Logo' || fieldName === 'newfile_BackgroundImage' || fieldName === 'newfile_MainImage' /* || fieldName === 'newfile_AccentGraphic' */) {
161+
if (fieldName === 'newfile_Logo' || fieldName === 'newfile_BackgroundImage' || fieldName === 'newfile_MainImage') {
163162
uploadedAssets[fieldName] = asset;
164163
} else if (fieldName === 'newfile_PartnerLogos') {
165164
if (!uploadedAssets[fieldName]) {
@@ -208,11 +207,8 @@ const handleMultipartData = upload.fields([
208207
{ name: 'newfile_Logo', maxCount: 1 },
209208
{ name: 'newfile_BackgroundImage', maxCount: 1 },
210209
{ name: 'newfile_MainImage', maxCount: 1 },
211-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
212-
// { name: 'newfile_AccentGraphic', maxCount: 1 },
213210
{ name: 'newfile_PartnerLogos', maxCount: 5 },
214211
{ name: 'newfile_ResourceFile', maxCount: 1 }
215-
// SWEP banner image uses uploadSwepImage middleware
216212
]);
217213

218214
// Middleware for Banners

src/models/bannerModel.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
21
import {
32
BannerTemplateType,
43
CharterType,
54
IBanner,
65
LayoutStyle,
76
TextColour,
87
UrgencyLevel,
9-
// AccentGraphicSchema,
108
BannerBackgroundSchema,
119
CTAButtonSchema,
1210
DonationGoalSchema,
@@ -63,8 +61,6 @@ export const BannerSchema = new Schema({
6361
Logo: MediaAssetSchema,
6462
BackgroundImage: MediaAssetSchema,
6563
MainImage: MediaAssetSchema, // Separate image for split layout (not background)
66-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
67-
// AccentGraphic: AccentGraphicSchema,
6864

6965
// Actions
7066
CtaButtons: {

src/schemas/bannerSchema.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { z } from 'zod';
22
import {
33
MediaAssetSchemaCore,
4-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
5-
// AccentGraphicSchemaCore,
64
BannerBackgroundSchemaCore,
75
CTAButtonSchemaCore,
86
DonationGoalSchemaCore,
@@ -27,8 +25,6 @@ import { BannerTemplateType, UrgencyLevel, CharterType, LayoutStyle, TextColour,
2725

2826
// API-specific schemas with preprocessing for FormData
2927
export const MediaAssetSchema = MediaAssetSchemaCore;
30-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
31-
// export const AccentGraphicSchema = AccentGraphicSchemaCore;
3228
export const BannerBackgroundSchema = BannerBackgroundSchemaCore;
3329
export const CTAButtonSchema = CTAButtonSchemaCore;
3430

src/schemas/bannerSchemaCore.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ export const BannerSchemaCore = z.object({
113113
Logo: MediaAssetSchemaCore,
114114
BackgroundImage: MediaAssetSchemaCore,
115115
MainImage: MediaAssetSchemaCore,
116-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
117-
// AccentGraphic: AccentGraphicSchemaCore,
118116

119117
// Styling
120118
Background: BannerBackgroundSchemaCore,

src/types/banners/IAccentGraphic.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/types/banners/IBanner.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { Document, Types } from "mongoose";
22
import { IMediaAsset } from "./IMediaAsset.js";
3-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
4-
// import { IAccentGraphic } from "./IAccentGraphic.js";
53
import { IBannerBackground } from "./IBannerBackground.js";
64
import { ICTAButton } from "./ICTAButton.js";
75
import { IDonationGoal } from "./IDonationGoal.js";
@@ -41,8 +39,6 @@ export interface IBanner extends Document {
4139
Logo?: IMediaAsset;
4240
BackgroundImage?: IMediaAsset;
4341
MainImage?: IMediaAsset;
44-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
45-
// AccentGraphic?: IAccentGraphic;
4642

4743
// Actions
4844
CtaButtons?: ICTAButton[];

src/types/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ export * from './organisations/IServiceAddress.js';
2121

2222
// Banner related types
2323
export * from './banners/IBanner.js';
24-
// TODO: Uncomment if AccentGraphic is needed. In the other case, remove.
25-
// export * from './IAccentGraphic.js';
2624
export * from './banners/IBannerBackground.js';
2725
export * from './banners/ICTAButton.js';
2826
export * from './banners/IDonationGoal.js';

0 commit comments

Comments
 (0)