docbrown/app/javascript/chat/ChatChannelSettings/ChatChannelSettingsSection.jsx
Sarthak Sharma 3addb64326
[deploy] 🚀 Feature: Chat channel membership manager component (#8945)
* Feature 🚀 : Ability to delete messages in chat channels

- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime

* Minor Bug 🐞: Show message action only for current user

- User can delete or edit their own messages

* Test cases added

* Bug 🐞: Update message id for receiver

Message id was not sent to receiver by pusher

* Refactoring🛠: Message controller refactoring

* Test Cases📝 : Specs for Delete message added

* Feature 🚀 : Ability to edit messages

* Test Cases📝 : Specs for Edit message added

* Merge conflict resolved

* fix video content issue

* add UI for membership management

* add api to update memberahip role

* add methods for manage membership

* Add integration test cases

* add emoji for admin

* Open member profile in sidecar only

* 🐞 Problem with direct channel sidecar

* 🐞 Few other UI enhancements

* fix mod typo

* add limit upto 4 for display active memberships

* fix UI issues

* fix action ui for membership

* fix sidebar redirection issue

* fix svg buttons

* add test cases

* fixed broken spec

* fix PR suggestions

* remove not used code

* fix typo

* fix PR suggestion

* fix typos

* add invitation url expiry

* fix specs

* fix PR suggestions

* removed unused gem

* remove presenter format

* handle invitation link expiry with redis

* fix PR suggestions

* user can view non-discoverable channel invitation link

* fix typos

* remove commented code

* add spacing

* PR suggestions

* remove class from button

* replace componentDidMount with commen function

* remove action button for single membership

* add chat message on update role

* add spece between lines

Co-authored-by: Narender Singh <narender2031@gmail.com>
Co-authored-by: Fernando Valverde <fdov88@gmail.com>
2020-07-20 08:08:31 -04:00

106 lines
3.9 KiB
JavaScript

import { h } from 'preact';
import PropTypes from 'prop-types';
import ModSection from './ModSection';
import PersonalSettings from './PersonalSetting';
import LeaveMembershipSection from './LeaveMembershipSection';
import ModFaqSection from './ModFaqSection';
import ChannelDescriptionSection from './ChannelDescriptionSection';
import ChatChannelMembershipSection from './ChatChannelMembershipSection';
const ChatChannelSettingsSection = ({
channelDiscoverable,
updateCurrentMembershipNotificationSettings,
handleleaveChannelMembership,
handlePersonChannelSetting,
handleChannelDescriptionChanges,
handleChannelDiscoverableStatus,
handleDescriptionChange,
handleChannelInvitations,
handleInvitationUsernames,
toggleScreens,
removeMembership,
chatChannelAcceptMembership,
channelDescription,
chatChannel,
currentMembership,
activeMemberships,
pendingMemberships,
requestedMemberships,
invitationUsernames,
showGlobalBadgeNotification,
}) => (
<div>
<ChannelDescriptionSection
channelName={chatChannel.name}
channelDescription={chatChannel.description}
currentMembershipRole={currentMembership.role}
className="channel-description-section"
/>
<ChatChannelMembershipSection
currentMembershipRole={currentMembership.role}
activeMemberships={activeMemberships}
removeMembership={removeMembership}
pendingMemberships={pendingMemberships}
requestedMemberships={requestedMemberships}
chatChannelAcceptMembership={chatChannelAcceptMembership}
toggleScreens={toggleScreens}
className="channel-membership-sections"
/>
<ModSection
invitationUsernames={invitationUsernames}
handleInvitationUsernames={handleInvitationUsernames}
handleChannelInvitations={handleChannelInvitations}
channelDescription={channelDescription}
handleDescriptionChange={handleDescriptionChange}
channelDiscoverable={channelDiscoverable}
handleChannelDiscoverableStatus={handleChannelDiscoverableStatus}
handleChannelDescriptionChanges={handleChannelDescriptionChanges}
currentMembershipRole={currentMembership.role}
className="channel-mod-section"
/>
<PersonalSettings
updateCurrentMembershipNotificationSettings={
updateCurrentMembershipNotificationSettings
}
showGlobalBadgeNotification={showGlobalBadgeNotification}
handlePersonChannelSetting={handlePersonChannelSetting}
className="channel-personal-seeting"
/>
<LeaveMembershipSection
currentMembershipRole={currentMembership.role}
handleleaveChannelMembership={handleleaveChannelMembership}
className="channel-leave-membership-section"
/>
<ModFaqSection
currentMembershipRole={currentMembership.role}
email="yo@dev.to"
className="channel-mod-faq"
/>
</div>
);
ChatChannelSettingsSection.propTypes = {
chatChannel: PropTypes.isRequired,
currentMembership: PropTypes.isRequired,
activeMemberships: PropTypes.isRequired,
pendingMemberships: PropTypes.isRequired,
requestedMemberships: PropTypes.isRequired,
invitationUsernames: PropTypes.string.isRequired,
channelDescription: PropTypes.string.isRequired,
channelDiscoverable: PropTypes.bool.isRequired,
showGlobalBadgeNotification: PropTypes.bool.isRequired,
handleleaveChannelMembership: PropTypes.func.isRequired,
chatChannelAcceptMembership: PropTypes.func.isRequired,
removeMembership: PropTypes.func.isRequired,
toggleScreens: PropTypes.func.isRequired,
handleInvitationUsernames: PropTypes.func.isRequired,
handleChannelInvitations: PropTypes.func.isRequired,
handleDescriptionChange: PropTypes.func.isRequired,
handleChannelDiscoverableStatus: PropTypes.func.isRequired,
handleChannelDescriptionChanges: PropTypes.func.isRequired,
handlePersonChannelSetting: PropTypes.func.isRequired,
updateCurrentMembershipNotificationSettings: PropTypes.func.isRequired,
};
export default ChatChannelSettingsSection;