Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4b8b1e5ca0
Коммит
12dce033d6
@@ -30,6 +30,7 @@ export type Props = {
|
||||
team?: Team;
|
||||
urlError?: string;
|
||||
readOnly?: boolean;
|
||||
isEditingExistingChannel?: boolean;
|
||||
}
|
||||
|
||||
import './channel_name_form_field.scss';
|
||||
@@ -101,8 +102,8 @@ const ChannelNameFormField = (props: Props): JSX.Element => {
|
||||
displayName.current = updatedDisplayName;
|
||||
props.onDisplayNameChange(updatedDisplayName);
|
||||
|
||||
if (!urlModified.current) {
|
||||
// if URL isn't explicitly modified, it's derived from the display name
|
||||
if (!urlModified.current && !props.isEditingExistingChannel) {
|
||||
// Only auto-generate URL for new channels, not when editing existing ones
|
||||
const cleanURL = cleanUpUrlable(updatedDisplayName);
|
||||
setURL(cleanURL);
|
||||
setURLError('');
|
||||
|
||||
@@ -204,10 +204,11 @@ describe('ChannelSettingsInfoTab', () => {
|
||||
});
|
||||
|
||||
// Verify patchChannel was called with the updated values (without type change).
|
||||
// Note: URL should remain unchanged when editing existing channels
|
||||
expect(patchChannel).toHaveBeenCalledWith('channel1', {
|
||||
...mockChannel,
|
||||
display_name: 'Updated Channel Name',
|
||||
name: 'updated-channel-name',
|
||||
name: 'test-channel', // URL should remain unchanged when editing existing channels
|
||||
purpose: 'Updated purpose',
|
||||
header: 'Updated header',
|
||||
});
|
||||
@@ -249,7 +250,7 @@ describe('ChannelSettingsInfoTab', () => {
|
||||
expect(patchChannel).toHaveBeenCalledWith('channel1', {
|
||||
...mockChannel,
|
||||
display_name: 'Channel Name With Whitespace', // Whitespace should be trimmed
|
||||
name: 'channel-name-with-whitespace', // URL is generated from display name and should be trimmed
|
||||
name: 'test-channel', // URL should remain unchanged when editing existing channels
|
||||
purpose: 'Purpose with whitespace', // Whitespace should be trimmed
|
||||
header: 'Header with whitespace', // Whitespace should be trimmed
|
||||
});
|
||||
|
||||
@@ -364,6 +364,7 @@ function ChannelSettingsInfoTab({
|
||||
urlError={internalUrlError}
|
||||
currentUrl={channelUrl}
|
||||
readOnly={!canManageChannelProperties}
|
||||
isEditingExistingChannel={true}
|
||||
/>
|
||||
|
||||
{/* Channel Type Section*/}
|
||||
|
||||
Ссылка в новой задаче
Block a user