-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'new/account_sidebar_rewrite' of github.com:RocketChat/R…
…ocket.Chat into new/rewrite_account_profile * 'new/account_sidebar_rewrite' of github.com:RocketChat/Rocket.Chat: Fix sidenav close Regresion: Issue with reply button on broadcast channels (#18057) Regression: Infinite render loop on Setup Wizard (#18074) Regression: Improve Omnichannel Business Hours (#18050) Regression: Fix threads badge color indicators (#18048) Regression: Improve the logic to get request IPs (#18033)
- Loading branch information
Showing
82 changed files
with
1,219 additions
and
746 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 19 additions & 15 deletions
34
app/livechat/client/views/app/business-hours/BusinessHours.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,37 @@ | ||
import { IBusinessHour } from './IBusinessHour'; | ||
import { SingleBusinessHour } from './Single'; | ||
import { IBusinessHourBehavior } from './IBusinessHourBehavior'; | ||
import { SingleBusinessHourBehavior } from './Single'; | ||
import { ILivechatBusinessHour } from '../../../../../../definition/ILivechatBusinessHour'; | ||
|
||
class BusinessHoursManager { | ||
private businessHour: IBusinessHour; | ||
private behavior: IBusinessHourBehavior; | ||
|
||
constructor(businessHour: IBusinessHour) { | ||
this.setBusinessHourManager(businessHour); | ||
constructor(businessHour: IBusinessHourBehavior) { | ||
this.setBusinessHourBehavior(businessHour); | ||
} | ||
|
||
setBusinessHourManager(businessHour: IBusinessHour): void { | ||
this.registerBusinessHourMethod(businessHour); | ||
setBusinessHourBehavior(businessHour: IBusinessHourBehavior): void { | ||
this.registerBusinessHourBehavior(businessHour); | ||
} | ||
|
||
registerBusinessHourMethod(businessHour: IBusinessHour): void { | ||
this.businessHour = businessHour; | ||
registerBusinessHourBehavior(behavior: IBusinessHourBehavior): void { | ||
this.behavior = behavior; | ||
} | ||
|
||
getTemplate(): string { | ||
return this.businessHour.getView(); | ||
return this.behavior.getView(); | ||
} | ||
|
||
shouldShowCustomTemplate(businessHourData: ILivechatBusinessHour): boolean { | ||
return this.businessHour.shouldShowCustomTemplate(businessHourData); | ||
showCustomTemplate(businessHourData: ILivechatBusinessHour): boolean { | ||
return this.behavior.showCustomTemplate(businessHourData); | ||
} | ||
|
||
shouldShowBackButton(): boolean { | ||
return this.businessHour.shouldShowBackButton(); | ||
showBackButton(): boolean { | ||
return this.behavior.showBackButton(); | ||
} | ||
|
||
showTimezoneTemplate(): boolean { | ||
return this.behavior.showTimezoneTemplate(); | ||
} | ||
} | ||
|
||
export const businessHourManager = new BusinessHoursManager(new SingleBusinessHour() as IBusinessHour); | ||
export const businessHourManager = new BusinessHoursManager(new SingleBusinessHourBehavior()); |
7 changes: 0 additions & 7 deletions
7
app/livechat/client/views/app/business-hours/IBusinessHour.ts
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
app/livechat/client/views/app/business-hours/IBusinessHourBehavior.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ILivechatBusinessHour } from '../../../../../../definition/ILivechatBusinessHour'; | ||
|
||
export interface IBusinessHourBehavior { | ||
getView(): string; | ||
showCustomTemplate(businessHourData: ILivechatBusinessHour): boolean; | ||
showBackButton(): boolean; | ||
showTimezoneTemplate(): boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
import { IBusinessHour } from './IBusinessHour'; | ||
import { IBusinessHourBehavior } from './IBusinessHourBehavior'; | ||
|
||
export class SingleBusinessHour implements IBusinessHour { | ||
export class SingleBusinessHourBehavior implements IBusinessHourBehavior { | ||
getView(): string { | ||
return 'livechatBusinessHoursForm'; | ||
} | ||
|
||
shouldShowCustomTemplate(): boolean { | ||
showCustomTemplate(): boolean { | ||
return false; | ||
} | ||
|
||
shouldShowBackButton(): boolean { | ||
showBackButton(): boolean { | ||
return false; | ||
} | ||
|
||
showTimezoneTemplate(): boolean { | ||
return false; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
app/livechat/client/views/app/business-hours/livechatBusinessHoursForm.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.