1
0
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:
Scott Bishel 2022-09-05 17:02:39 -06:00 committed by GitHub
parent f9e6eb2791
commit 10f7e46038
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

View File

@ -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',
}],
},
}

View File

@ -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,

View File

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

View File

@ -198,6 +198,8 @@ class Constants {
static readonly globalTeamId = '0'
static readonly myInsights = 'MY'
static readonly SystemUserID = 'system'
}
export {Constants, Permission}