Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# AGENTS.md

Explicitly import subdirectory instruction files that must always be in context:
@server/AGENTS.md

## Pull Requests

When creating a pull request, follow `.github/PULL_REQUEST_TEMPLATE.md` exactly:
Expand Down
25 changes: 18 additions & 7 deletions api/v4/source/channels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@
managed_category_name:
type: string
description: The name of the managed category to assign this channel to.
Requires an Enterprise license and the `EnableManagedChannelCategories`
config setting to be enabled.
Requires an Enterprise license and the `ManagedChannelCategories` feature flag
to be enabled.
default_category_name:
type: string
description: Default sidebar category name for members when joining this channel.
Requires `EnableChannelCategorySorting` to be enabled on the server.
description: Channel object to be created
required: true
responses:
Expand Down Expand Up @@ -683,7 +687,12 @@
type: string
description: The name of the managed category to assign this channel to.
Set to an empty string to clear. Requires an Enterprise license and
the `EnableManagedChannelCategories` config setting to be enabled.
the `ManagedChannelCategories` feature flag to be enabled.
default_category_name:
type: string
description: Default sidebar category name for members when joining this channel.
Set to an empty string to clear. Requires `EnableChannelCategorySorting`
to be enabled on the server.
description: Channel patch object; include only the fields to update. At least
one field must be provided.
required: true
Expand Down Expand Up @@ -1195,8 +1204,8 @@
managed category assigned.


Requires an Enterprise license and the `EnableManagedChannelCategories`
config setting to be enabled.
Requires an Enterprise license and the `ManagedChannelCategories` feature flag
to be enabled.


##### Permissions
Expand All @@ -1222,8 +1231,10 @@
description: A map of channel ID to managed category name
"401":
$ref: "#/components/responses/Unauthorized"
"403":
$ref: "#/components/responses/Forbidden"
"404":
description: Returned when the `ManagedChannelCategories` feature flag is disabled.
"501":
description: Returned when the server does not have an Enterprise license.
"/api/v4/teams/{team_id}/channels/search":
post:
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ describe('Team Permissions', () => {
cy.get('.url-input-button').should('be.visible').and('not.be.disabled');

// * Verify user can edit channel purpose
cy.get('#channel_settings_purpose_textbox').should('be.visible').and('not.be.disabled');
cy.get('#channel_settings_purpose_textbox').scrollIntoView().should('be.visible').and('not.be.disabled');

// * Verify user can edit channel header
cy.get('#channel_settings_header_textbox').should('be.visible').and('not.be.disabled');
cy.get('#channel_settings_header_textbox').scrollIntoView().should('be.visible').and('not.be.disabled');

// # Close the modal
cy.get('.GenericModal .modal-header button[aria-label="Close"]').click();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

// ***************************************************************
// - [#] indicates a test step (e.g. # Go to a page)
// - [*] indicates an assertion (e.g. * Check the title)
// - Use element ID when selecting an element. Create one if none.
// ***************************************************************

// Group: @channels @incoming_webhook

import {getRandomId} from '@/utils';

describe('Incoming webhook', () => {
let testTeam;
let testChannel;
let incomingWebhook;

before(() => {
cy.apiInitSetup().then(({team, channel}) => {
testTeam = team;
testChannel = channel;

const newIncomingHook = {
channel_id: channel.id,
channel_locked: true,
description: 'Incoming webhook - thread reply',
display_name: 'thread-reply',
};

cy.apiCreateWebhook(newIncomingHook).then((hook) => {
incomingWebhook = hook;
});
});
});

it('posts a webhook message as a reply when root_id references a thread root post', () => {
cy.visit(`/${testTeam.name}/channels/${testChannel.name}`);

const rootMessage = `Root for webhook thread ${getRandomId()}`;

// # Post a root message to open a thread
cy.postMessage(rootMessage);

cy.getLastPostId().then((rootPostId) => {
const webhookReplyText = `Webhook thread reply ${getRandomId()}`;

// # Post to the incoming webhook with root_id set to the thread root
cy.postIncomingWebhook({
url: incomingWebhook.url,
data: {
text: webhookReplyText,
root_id: rootPostId,
},
waitFor: 'text',
});

cy.getLastPostId().then((replyId) => {
// * Reply is stored as part of the thread (author-independent)
cy.request({
headers: {'X-Requested-With': 'XMLHttpRequest'},
url: `/api/v4/posts/${replyId}`,
}).then(({body: replyPost}) => {
expect(replyPost.root_id).to.eq(rootPostId);
});

// * Center-channel reply styling for threaded posts (CommentedOn is only shown when
// isFirstReply is true, which is false when the reply follows its root directly)
cy.get(`#post_${replyId}`).
should('have.class', 'post--comment').
within(() => {
cy.get(`#postMessageText_${replyId}`).should('have.text', webhookReplyText);
});
});
});
});
});
1 change: 1 addition & 0 deletions e2e-tests/cypress/tests/support/ui_commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ function updateChannelHeader(text: string) {

// # Edit channel header in the modal
cy.get('#channel_settings_header_textbox').
scrollIntoView().
should('be.visible').
clear().
type(text);
Expand Down
3 changes: 2 additions & 1 deletion e2e-tests/playwright/lib/src/server/default_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ const defaultServerConfig: AdminConfig = {
LockTeammateNameDisplay: false,
ExperimentalPrimaryTeam: '',
ExperimentalDefaultChannels: [],
EnableChannelCategorySorting: true,
},
ClientRequirements: {
AndroidLatestVersion: '',
Expand Down Expand Up @@ -618,7 +619,6 @@ const defaultServerConfig: AdminConfig = {
DisableWakeUpReconnectHandler: false,
UsersStatusAndProfileFetchingPollIntervalMilliseconds: 3000,
YoutubeReferrerPolicy: false,
ExperimentalChannelCategorySorting: false,
EnableWatermark: false,
},
AnalyticsSettings: {
Expand Down Expand Up @@ -789,6 +789,7 @@ const defaultServerConfig: AdminConfig = {
ClassificationMarkings: true,
IntegratedBoards: false,
CJKSearch: false,
ManagedChannelCategories: false,
},
ImportSettings: {
Directory: './import',
Expand Down
Loading
Loading