[MM-52926] Deprecating work templates (#23466)
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -8773,37 +8773,6 @@ func (c *Client4) CheckCWSConnection(userId string) (*Response, error) {
|
||||
return BuildResponse(r), nil
|
||||
}
|
||||
|
||||
// Worktemplates sections
|
||||
|
||||
func (c *Client4) worktemplatesRoute() string {
|
||||
return "/worktemplates"
|
||||
}
|
||||
|
||||
// GetWorktemplateCategories returns categories of worktemplates
|
||||
func (c *Client4) GetWorktemplateCategories() ([]*WorkTemplateCategory, *Response, error) {
|
||||
r, err := c.DoAPIGet(c.worktemplatesRoute()+"/categories", "")
|
||||
if err != nil {
|
||||
return nil, BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var categories []*WorkTemplateCategory
|
||||
err = json.NewDecoder(r.Body).Decode(&categories)
|
||||
return categories, BuildResponse(r), err
|
||||
}
|
||||
|
||||
func (c *Client4) GetWorkTemplatesByCategory(category string) ([]*WorkTemplate, *Response, error) {
|
||||
r, err := c.DoAPIGet(c.worktemplatesRoute()+"/categories/"+category+"/templates", "")
|
||||
if err != nil {
|
||||
return nil, BuildResponse(r), err
|
||||
}
|
||||
defer closeBody(r)
|
||||
|
||||
var templates []*WorkTemplate
|
||||
err = json.NewDecoder(r.Body).Decode(&templates)
|
||||
return templates, BuildResponse(r), err
|
||||
}
|
||||
|
||||
func (c *Client4) SubmitTrueUpReview(req map[string]any) (*Response, error) {
|
||||
reqBytes, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
|
||||
@@ -54,8 +54,6 @@ type FeatureFlags struct {
|
||||
// A/B Test on posting a welcome message
|
||||
SendWelcomePost bool
|
||||
|
||||
WorkTemplate bool
|
||||
|
||||
PostPriority bool
|
||||
|
||||
// Enable WYSIWYG text editor
|
||||
@@ -101,7 +99,6 @@ func (f *FeatureFlags) SetDefaults() {
|
||||
f.SendWelcomePost = true
|
||||
f.PostPriority = true
|
||||
f.PeopleProduct = false
|
||||
f.WorkTemplate = false
|
||||
f.ReduceOnBoardingTaskList = false
|
||||
f.ThreadsEverywhere = false
|
||||
f.GlobalDrafts = true
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
// CompleteOnboardingRequest describes parameters of the requested plugin.
|
||||
type CompleteOnboardingRequest struct {
|
||||
Organization string `json:"organization"` // Organization is the name of the organization
|
||||
Role string `json:"role"` // Role is the role selected by first admin
|
||||
InstallPlugins []string `json:"install_plugins"` // InstallPlugins is a list of plugins to be installed
|
||||
}
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
package model
|
||||
|
||||
const (
|
||||
// used to assign the work template id to newly created channels
|
||||
WorkTemplateIDChannelProp = "work_template_id"
|
||||
|
||||
// Visibility
|
||||
WorkTemplateVisibilityPublic = "public"
|
||||
WorkTemplateVisibilityPrivate = "private"
|
||||
)
|
||||
|
||||
type WorkTemplateCategory struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
type WorkTemplate struct {
|
||||
ID string `json:"id"`
|
||||
Category string `json:"category"`
|
||||
UseCase string `json:"useCase"`
|
||||
Illustration string `json:"illustration"`
|
||||
Visibility string `json:"visibility"`
|
||||
FeatureFlag *WorkTemplateFeatureFlag `json:"featureFlag,omitempty"`
|
||||
Description Description `json:"description"`
|
||||
Content []WorkTemplateContent `json:"content"`
|
||||
}
|
||||
|
||||
type WorkTemplateFeatureFlag struct {
|
||||
Name string `json:"name"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
type DescriptionContent struct {
|
||||
Message string `json:"message"`
|
||||
Illustration string `json:"illustration"`
|
||||
}
|
||||
|
||||
type Description struct {
|
||||
Channel *DescriptionContent `json:"channel"`
|
||||
Board *DescriptionContent `json:"board"`
|
||||
Playbook *DescriptionContent `json:"playbook"`
|
||||
Integration *DescriptionContent `json:"integration"`
|
||||
}
|
||||
|
||||
type WorkTemplateChannel struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Purpose string `json:"purpose"`
|
||||
Playbook string `json:"playbook"`
|
||||
Illustration string `json:"illustration"`
|
||||
}
|
||||
|
||||
type WorkTemplateBoard struct {
|
||||
ID string `json:"id"`
|
||||
Template string `json:"template"`
|
||||
Name string `json:"name"`
|
||||
Channel string `json:"channel"`
|
||||
Illustration string `json:"illustration"`
|
||||
}
|
||||
|
||||
type WorkTemplatePlaybook struct {
|
||||
Template string `json:"template"`
|
||||
Name string `json:"name"`
|
||||
ID string `json:"id"`
|
||||
Illustration string `json:"illustration"`
|
||||
}
|
||||
|
||||
type WorkTemplateIntegration struct {
|
||||
ID string `json:"id"`
|
||||
Recommended bool `json:"recommended"`
|
||||
}
|
||||
|
||||
type WorkTemplateContent struct {
|
||||
Channel *WorkTemplateChannel `json:"channel,omitempty"`
|
||||
Board *WorkTemplateBoard `json:"board,omitempty"`
|
||||
Playbook *WorkTemplatePlaybook `json:"playbook,omitempty"`
|
||||
Integration *WorkTemplateIntegration `json:"integration,omitempty"`
|
||||
}
|
||||
|
||||
type WorkTemplateExecutionResult struct {
|
||||
ChannelWithPlaybookIDs []string `json:"channel_with_playbook_ids"`
|
||||
ChannelIDs []string `json:"channel_ids"`
|
||||
}
|
||||
Ссылка в новой задаче
Block a user