Update toast after saving Groups

This commit is contained in:
Chewbacca 2023-04-05 10:11:11 -04:00
parent 5612cb6fdf
commit dd94dbad8e
4 changed files with 6 additions and 3 deletions

View file

@ -5,6 +5,7 @@ import { Button, Column, Form, FormActions, FormGroup, Icon, Input, Spinner, Tex
import { useAppSelector, useInstance } from 'soapbox/hooks'; import { useAppSelector, useInstance } from 'soapbox/hooks';
import { useGroup, useUpdateGroup } from 'soapbox/hooks/api'; import { useGroup, useUpdateGroup } from 'soapbox/hooks/api';
import { useImageField, useTextField } from 'soapbox/hooks/forms'; import { useImageField, useTextField } from 'soapbox/hooks/forms';
import toast from 'soapbox/toast';
import { isDefaultAvatar, isDefaultHeader } from 'soapbox/utils/accounts'; import { isDefaultAvatar, isDefaultHeader } from 'soapbox/utils/accounts';
import AvatarPicker from './components/group-avatar-picker'; import AvatarPicker from './components/group-avatar-picker';
@ -20,7 +21,7 @@ const messages = defineMessages({
heading: { id: 'navigation_bar.edit_group', defaultMessage: 'Edit Group' }, heading: { id: 'navigation_bar.edit_group', defaultMessage: 'Edit Group' },
groupNamePlaceholder: { id: 'manage_group.fields.name_placeholder', defaultMessage: 'Group Name' }, groupNamePlaceholder: { id: 'manage_group.fields.name_placeholder', defaultMessage: 'Group Name' },
groupDescriptionPlaceholder: { id: 'manage_group.fields.description_placeholder', defaultMessage: 'Description' }, groupDescriptionPlaceholder: { id: 'manage_group.fields.description_placeholder', defaultMessage: 'Description' },
success: { id: 'manage_group.success', defaultMessage: 'Group saved!' }, groupSaved: { id: 'group.update.success', defaultMessage: 'Group successfully saved' },
}); });
interface IEditGroup { interface IEditGroup {
@ -64,6 +65,7 @@ const EditGroup: React.FC<IEditGroup> = ({ params: { id: groupId } }) => {
}); });
setIsSubmitting(false); setIsSubmitting(false);
toast.success(intl.formatMessage(messages.groupSaved));
} }
const handleAddTag = () => { const handleAddTag = () => {

View file

@ -811,6 +811,7 @@
"group.tabs.members": "Members", "group.tabs.members": "Members",
"group.tags.hint": "Add up to 3 keywords that will serve as core topics of discussion in the group.", "group.tags.hint": "Add up to 3 keywords that will serve as core topics of discussion in the group.",
"group.tags.label": "Tags", "group.tags.label": "Tags",
"group.update.success": "Group successfully saved",
"group.upload_banner": "Upload photo", "group.upload_banner": "Upload photo",
"groups.discover.popular.empty": "Unable to fetch popular groups at this time. Please check back later.", "groups.discover.popular.empty": "Unable to fetch popular groups at this time. Please check back later.",
"groups.discover.popular.show_more": "Show More", "groups.discover.popular.show_more": "Show More",

View file

@ -25,7 +25,7 @@ describe('normalizeInstance()', () => {
}, },
groups: { groups: {
max_characters_name: 50, max_characters_name: 50,
max_characters_description: 100, max_characters_description: 160,
}, },
}, },
description: '', description: '',

View file

@ -37,7 +37,7 @@ export const InstanceRecord = ImmutableRecord({
}), }),
groups: ImmutableMap<string, number>({ groups: ImmutableMap<string, number>({
max_characters_name: 50, max_characters_name: 50,
max_characters_description: 100, max_characters_description: 160,
}), }),
}), }),
description: '', description: '',