mirror of
https://github.com/mattermost/focalboard.git
synced 2025-03-26 20:53:55 +02:00
check createdBy instead of team id to determine global templates (#3766)
* check createdBy instead of team id to determine global templates * fix tests * remove import Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
parent
f9e6eb2791
commit
10f7e46038
@ -123,6 +123,7 @@ describe('components/boardTemplateSelector/boardTemplateSelector', () => {
|
||||
properties: {
|
||||
trackingTemplateId: 'template_id_2',
|
||||
},
|
||||
createdBy: 'system',
|
||||
},
|
||||
],
|
||||
membersInBoards: {
|
||||
@ -151,6 +152,7 @@ describe('components/boardTemplateSelector/boardTemplateSelector', () => {
|
||||
properties: {
|
||||
trackingTemplateId: 'template_id_global',
|
||||
},
|
||||
createdBy: 'system',
|
||||
}],
|
||||
},
|
||||
}
|
||||
|
@ -79,8 +79,8 @@ describe('components/boardTemplateSelector/boardTemplateSelectorItem', () => {
|
||||
id: 'global-1',
|
||||
title: 'Template global',
|
||||
teamId: '0',
|
||||
createdBy: 'user-1',
|
||||
modifiedBy: 'user-1',
|
||||
createdBy: 'system',
|
||||
modifiedBy: 'system',
|
||||
createAt: 10,
|
||||
updateAt: 20,
|
||||
deleteAt: 0,
|
||||
|
@ -44,7 +44,7 @@ const BoardTemplateSelectorItem = (props: Props) => {
|
||||
<span className='template-name'>{template.title || intl.formatMessage({id: 'View.NewTemplateTitle', defaultMessage: 'Untitled'})}</span>
|
||||
|
||||
{/* don't show template menu options for default templates */}
|
||||
{template.teamId !== Constants.globalTeamId &&
|
||||
{template.createdBy !== Constants.SystemUserID &&
|
||||
<div className='actions'>
|
||||
<BoardPermissionGate
|
||||
boardId={template.id}
|
||||
|
@ -198,6 +198,8 @@ class Constants {
|
||||
static readonly globalTeamId = '0'
|
||||
|
||||
static readonly myInsights = 'MY'
|
||||
|
||||
static readonly SystemUserID = 'system'
|
||||
}
|
||||
|
||||
export {Constants, Permission}
|
||||
|
Loading…
x
Reference in New Issue
Block a user