Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

New "Promotion" Mode #59

wants to merge 1 commit into from

Conversation

halelidan
Copy link
Collaborator

  • 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

- 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
}

export const sheet =
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Config')!;
const DEFAULT_CONFIG = {
export const promotionSheet =
SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Promotion_Config')!;
Copy link
Collaborator

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.

.filter(e => e[0])
.reduce((res, e) => {
return { ...res, [e[0]]: e[1] };
}, DEFAULT_CONFIG),
Copy link
Collaborator

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants