* Added convert to channel menu item * WIP * refactored channel name input field and created conversion modal * style * style * WIP * wip * Created API to fetch common teams of GM members * Added UI for all members deactivated * Fetched common teams in client * WIP * Added a required attribute to DropdownInput component * Fixed a case with dropdown input required flag * WIP * API first draft * Genetayed layers and mocks * Fixed create channel bug * WIP * Added cache invalidation * Calling API from client * Updated API to accept name and display name as well * WIP * Moved converted GM to correct category * Style fixes * Added logic to move user to new team/channel after GM conversion * Prevented guest user from performing action * Added loading indicator * Added smoother height transistion when loading finishes * UI imporvements * WIP * Formatted GM conversion message on client side * lint fix * Moved convert option from sidebar menu to channel header menu * Some cleanup * Updated server layers * Fixed i18n * Fixed types * Fix server i18n * Fixed channel creation bug * Added store test for GetCommonTeamIDsForMultipleUsers * Server tests done * Updated snapshots * Updated layers * lint fix * Update tests * For CI * lint * restored debug code * Used user ID instead of username in channel conversion post * WIP * Review fixes * LInt fixes * Test fix * WIP * WIP * WIP * wip * Review fixes, lots of them * Review fix * Disabled WIP test * test * Cleanup * Test fix * removed testing line * Fixed incorrect default message * Review fixes * Fixes * lint and i18n fix * Setting category on server side * updated i18n * Updated tests * Added tests * Refs cleanup * added test --------- Co-authored-by: Harshil Sharma <harshilsharma@Harshils-MacBook-Pro.local>
43 строки
1.4 KiB
TypeScript
43 строки
1.4 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import classNames from 'classnames';
|
|
import React from 'react';
|
|
|
|
import type {CustomMessageInputType} from 'components/widgets/inputs/input/input';
|
|
|
|
import {ItemStatus} from 'utils/constants';
|
|
|
|
type Props = {
|
|
message?: string;
|
|
custom?: CustomMessageInputType;
|
|
}
|
|
|
|
const InputError = (props: Props) => {
|
|
if (props.message) {
|
|
return (
|
|
<div className='Input___error'>
|
|
<i className='icon icon-alert-outline'/>
|
|
<span>{props.message}</span>
|
|
</div>
|
|
);
|
|
} else if (props.custom) {
|
|
return (
|
|
<div className={`Input___customMessage Input___${props.custom.type}`}>
|
|
<i
|
|
className={classNames(`icon ${props.custom.type}`, {
|
|
'icon-alert-outline': props.custom.type === ItemStatus.WARNING,
|
|
'icon-alert-circle-outline': props.custom.type === ItemStatus.ERROR,
|
|
'icon-information-outline': props.custom.type === ItemStatus.INFO,
|
|
'icon-check': props.custom.type === ItemStatus.SUCCESS,
|
|
})}
|
|
/>
|
|
<span>{props.custom.value}</span>
|
|
</div>
|
|
);
|
|
}
|
|
return null;
|
|
};
|
|
|
|
export default InputError;
|