File tree Expand file tree Collapse file tree
lib/public/views/Logs/Create Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,11 @@ import { RcDailyMeetingTemplate } from './templates/RcDailyMeetingTemplate.js';
2323 * @typedef {'on-call'|'rc-daily-meeting' } logTemplateKey
2424 */
2525
26+ const TemplateClasses = Object . freeze ( {
27+ [ 'on-call' ] : OnCallLogTemplate ,
28+ [ 'rc-daily-meeting' ] : RcDailyMeetingTemplate ,
29+ } ) ;
30+
2631/**
2732 * Return a new instance of log template for the given key
2833 *
@@ -31,10 +36,7 @@ import { RcDailyMeetingTemplate } from './templates/RcDailyMeetingTemplate.js';
3136 * @return {LogTemplate|null } the new log template
3237 */
3338const logTemplatesFactory = ( key , templateData ) => {
34- const templateClass = {
35- [ 'on-call' ] : OnCallLogTemplate ,
36- [ 'rc-daily-meeting' ] : RcDailyMeetingTemplate ,
37- } [ key ] ?? null ;
39+ const templateClass = TemplateClasses [ key ] ?? null ;
3840 if ( templateClass ) {
3941 return new templateClass ( templateData ) ;
4042 }
You can’t perform that action at this time.
0 commit comments