-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New "Promotion" Mode #59
base: main
Are you sure you want to change the base?
Conversation
halelidan
commented
Oct 8, 2024
- Implement config switching based on promotion flag
- Modify image services to use CONFIG or PROMOTION_CONFIG as appropriate
- Skip asset deletion in promotion mode for ImageExtensionService
- Add new ImagePauseService for pausing uploaded assets
src/config.ts
Outdated
} | ||
|
||
export const sheet = | ||
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Config')!; | ||
const DEFAULT_CONFIG = { | ||
export const promotionSheet = | ||
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Promotion_Config')!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can make the setup even more flexible if you use in the main config sheet Promotion Mode Config
= <PROMO_CONFIG_SHEET_NAME> (if empty it is equal to Is Promotion Mode
= no) instead of Is Promotion Mode
= yes|no. In this way you can have several configs for e.g. different promo seasons and quickly switch them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree! fixed in the new commit
src/config.ts
Outdated
.filter(e => e[0]) | ||
.reduce((res, e) => { | ||
return { ...res, [e[0]]: e[1] }; | ||
}, DEFAULT_CONFIG), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using the DEFAULT_CONFIG here, I would use CONFIG
, in this way the promo config sheet can have only the fields that need to be overwritten (other config params will be copied from the main config).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, fixed in the new commit
: {}), | ||
} ?? CONFIG; | ||
|
||
export const inPromotionMode = (): boolean => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be a function and not a constant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing to change here, just curious
Still need readability approvals from:
|
3 similar comments
Still need readability approvals from:
|
Still need readability approvals from:
|
Still need readability approvals from:
|
- Implement config switching based on promotion flag - Modify image services to use CONFIG or PROMOTION_CONFIG as appropriate - Skip asset deletion in promotion mode for ImageExtensionService - Add new ImagePauseService for pausing uploaded assets
- Replace yes/no flag with configurable sheet name - Make promotion config inherit from main config - Add helper function for promotion mode checks
0fd4bfb
to
8e7ad38
Compare