Skip to content

Добавил фичу "Цитирование сообщения"#83

Merged
Kibnet merged 7 commits intomasterfrom
feature/#9-responding-to-a-message
Sep 22, 2021
Merged

Добавил фичу "Цитирование сообщения"#83
Kibnet merged 7 commits intomasterfrom
feature/#9-responding-to-a-message

Conversation

@KlinskiyDD
Copy link
Copy Markdown
Collaborator

@KlinskiyDD KlinskiyDD commented Sep 6, 2021

Добавил новую фичу "Цитирование сообщения"
Поправил дизайн для сообщений.
Изменил SendMessageControl.
Наконец добавил дизайн для ContextMenu и ItemMenu.

@KlinskiyDD KlinskiyDD linked an issue Sep 6, 2021 that may be closed by this pull request
8 tasks
@KlinskiyDD KlinskiyDD force-pushed the feature/#9-responding-to-a-message branch 9 times, most recently from f67a870 to edc4ce9 Compare September 8, 2021 15:50
@KlinskiyDD KlinskiyDD changed the title Тест Добавил фичу "Цитирование сообщения" Sep 8, 2021
@Mileeena Mileeena self-requested a review September 9, 2021 12:11
@KlinskiyDD KlinskiyDD force-pushed the feature/#9-responding-to-a-message branch from edc4ce9 to 1d4684e Compare September 9, 2021 14:45
Mileeena
Mileeena previously approved these changes Sep 9, 2021
@KlinskiyDD KlinskiyDD force-pushed the feature/#9-responding-to-a-message branch 2 times, most recently from 8fec19f to ca653dc Compare September 12, 2021 17:12
Copy link
Copy Markdown
Collaborator

@EvgeniyLyapunov EvgeniyLyapunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Дима, привет. Всё работает. Ты молодец!
Есть мнение, что комментарии в коде не нужны, они просто захламляют, надо писать код так, что бы он был понятен без комментариев.
Мне не хватает комментариев. При обЪявлении переменной или свойства, при описание метода.

Kozlov-AE
Kozlov-AE previously approved these changes Sep 13, 2021
Copy link
Copy Markdown
Contributor

@Kozlov-AE Kozlov-AE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом нормально. Работает вроде хорошо)

UnluckyD
UnluckyD previously approved these changes Sep 13, 2021
@KlinskiyDD KlinskiyDD force-pushed the feature/#9-responding-to-a-message branch 3 times, most recently from 5d4c197 to c6cca86 Compare September 14, 2021 12:26
Поправил разметку для всех сообщений.
Сделал новое контекстное меню
Удалил лишние классы, а вместо них использовал ReactiveUI
Также переписал логику получения комманд для ContextMenu
Переименовал свойства, чтобы их названия более наглядно отображили их суть.
Добавил автомаппер для MessageMold и MessageViewModel
Визуально поправил код в Message, Messages и ReplyMessages, чтобы было легче читать код.
Добавил оранжевую подсветку при редактировании сообщения.
Добавил комментарии к коду.
Сделал рефакторинг HubMessage, IChatHub,  удалив ненужные свойства и строки.
@KlinskiyDD KlinskiyDD force-pushed the feature/#9-responding-to-a-message branch from 4710125 to 7bcc568 Compare September 16, 2021 14:27
Copy link
Copy Markdown
Contributor

@Kibnet Kibnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Работает хорошо. Проделана очень большая и сложная работа.

  1. Есть пару багов, отметил в комментах знаком 🪲.
  2. В разных местах одно и тоже названо по разному, нужно привести к единому "Quoted".
  3. Есть несколько мест с откровенным копипастом, нужно вынести в методы для переиспользования.

@KlinskiyDD KlinskiyDD force-pushed the feature/#9-responding-to-a-message branch 2 times, most recently from 8e77b02 to 1316d65 Compare September 21, 2021 16:38
@KlinskiyDD KlinskiyDD force-pushed the feature/#9-responding-to-a-message branch from 1316d65 to 5a2886f Compare September 21, 2021 21:28
@Kibnet Kibnet force-pushed the feature/#9-responding-to-a-message branch from 9c23fa2 to ddb50c7 Compare September 21, 2021 21:50
try
{
messageDictionary.Clear();
Messages.Clear();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут нужно очищать цитируемое сообщение

Comment on lines +28 to +32
<ItemGroup>
<Compile Update="Views\QuotedMessage.axaml.cs">
<DependentUpon>QuotedMessage.axaml</DependentUpon>
</Compile>
</ItemGroup>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут беспорядок

Comment on lines +201 to +222
/// <summary>
/// Получает список вложений
/// </summary>
/// <param name="message"></param>
/// <returns></returns>
private async Task<List<AttachmentHubMold>> GetAttachments(Message message)
{
var Attachments = new List<AttachmentHubMold>();
if (message.Attachments != null)
{
var attach = await _ravenSession.LoadAsync<Attachment>(message.Attachments);

foreach (var id in message.Attachments)
{
if (attach.TryGetValue(id, out var attachment))
{
Attachments.Add(Mapper.Map<AttachmentHubMold>(attachment));
}
}
}
return Attachments;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почти полный копипаст из ChatService. Можно было бы вынести общий метод без финального маппинга, а маппинг у же по месту применять через Select

Comment on lines +231 to +233



Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Слишком много пустых строк

{
Id = quotedMessage.Id,
UserLogin = user.Login,
UserNickname = user.DisplayName,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Рассинхрон, в одном месте UserNickname, в другом DisplayName. Нужно единообразие.

<PackageReference Include="ServiceStack.Api.OpenApi" Version="5.11.0" />
<PackageReference Include="ServiceStack.Api.Swagger" Version="5.11.0" />
<PackageReference Include="SignalR.EasyUse.Server" Version="0.2.1" />
<PackageReference Include="Splat" Version="13.1.10" />
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splat предназначен только для клиентских приложений из-за своего удобства. На сервере есть и так встроенные средства для инверсии зависимостей. Нужно выпилить.

@Kibnet Kibnet merged commit 20f0d81 into master Sep 22, 2021
@Kibnet Kibnet deleted the feature/#9-responding-to-a-message branch September 24, 2021 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Цитирование сообщения (Ответ на сообщение)

6 participants