Skip to content

Commit

Permalink
feat(takeABreak): add config for lock screen
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Jul 19, 2019
1 parent 14e6ce4 commit d751533
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/features/config/default-global-config.const.ts
Expand Up @@ -20,6 +20,7 @@ export const DEFAULT_GLOBAL_CONFIG: GlobalConfigState = {
},
takeABreak: {
isTakeABreakEnabled: false,
isLockScreen: false,
/* tslint:disable-next-line */
takeABreakMessage: 'Take a break! You have been working for ${duration} without one. Go away from the computer! Take a short walk! Makes you more productive in the long run!',
takeABreakMinWorkingTime: 60 * minute,
Expand Down
7 changes: 7 additions & 0 deletions src/app/features/config/form-cfgs/take-a-break-form.const.ts
Expand Up @@ -14,6 +14,13 @@ export const TAKE_A_BREAK_FORM_CFG: ConfigFormSection<TakeABreakConfig> = {
label: T.GCF.TAKE_A_BREAK.IS_ENABLED
},
},
{
key: 'isLockScreen',
type: 'checkbox',
templateOptions: {
label: T.GCF.TAKE_A_BREAK.IS_LOCK_SCREEN
},
},
{
key: 'takeABreakMinWorkingTime',
type: 'duration',
Expand Down
1 change: 1 addition & 0 deletions src/app/features/config/global-config.model.ts
Expand Up @@ -56,6 +56,7 @@ export type IdleConfig = Readonly<{

export type TakeABreakConfig = Readonly<{
isTakeABreakEnabled: boolean;
isLockScreen: boolean;
takeABreakMessage: string;
takeABreakMinWorkingTime: number;
}>;
Expand Down
1 change: 1 addition & 0 deletions src/app/t.const.ts
Expand Up @@ -810,6 +810,7 @@ export const T = {
'TAKE_A_BREAK': {
'HELP': 'GCF.TAKE_A_BREAK.HELP',
'IS_ENABLED': 'GCF.TAKE_A_BREAK.IS_ENABLED',
'IS_LOCK_SCREEN': 'GCF.TAKE_A_BREAK.IS_LOCK_SCREEN',
'MESSAGE': 'GCF.TAKE_A_BREAK.MESSAGE',
'MIN_WORKING_TIME': 'GCF.TAKE_A_BREAK.MIN_WORKING_TIME',
'TITLE': 'GCF.TAKE_A_BREAK.TITLE'
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en.json
Expand Up @@ -810,6 +810,7 @@
"TAKE_A_BREAK": {
"HELP": "<div> <p>Allows you to configure a reoccurring reminder when you have worked for a specified amount of time without taking a break.</p> <p>You can modify the message displayed. ${duration} will be replaced with the time spent without a break.</p> </div>",
"IS_ENABLED": "Enable take a break reminder",
"IS_LOCK_SCREEN": "Lock screen when a break is due",
"MESSAGE": "Take a break message",
"MIN_WORKING_TIME": "Trigger take a break notification after X working without one",
"TITLE": "Break Reminder"
Expand Down

0 comments on commit d751533

Please sign in to comment.