< Summary

Class:DCL.Chat.HUD.ChannelJoinErrorWindowComponentView
Assembly:WorldChatWindowHUD
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/WorldChatWindowHUD/ChannelJoinErrorWindowComponentView.cs
Covered lines:10
Uncovered lines:1
Coverable lines:11
Total lines:44
Line coverage:90.9% (10 of 11)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
Show(...)0%110100%
Hide()0%110100%
Create()0%110100%
Awake()0%220100%
RefreshControl()0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/WorldChatWindowHUD/ChannelJoinErrorWindowComponentView.cs

#LineLine coverage
 1using System;
 2using TMPro;
 3using UnityEngine;
 4
 5namespace DCL.Chat.HUD
 6{
 7    public class ChannelJoinErrorWindowComponentView : BaseComponentView, IChannelJoinErrorWindowView
 8    {
 9        [SerializeField] internal ButtonComponentView[] acceptButton;
 10        [SerializeField] internal ButtonComponentView retryButton;
 11        [SerializeField] internal TMP_Text titleLabel;
 12
 13        public event Action OnClose;
 14        public event Action OnRetry;
 15
 16        public void Show(string channelName)
 17        {
 118            gameObject.SetActive(true);
 119            titleLabel.SetText($"There was an error while trying to join the channel #{channelName}. Please try again.")
 120        }
 21
 122        public void Hide() => gameObject.SetActive(false);
 23
 24        public static ChannelJoinErrorWindowComponentView Create()
 25        {
 426            return Instantiate(
 27                Resources.Load<ChannelJoinErrorWindowComponentView>("SocialBarV1/ChannelJoinErrorModal"));
 28        }
 29
 30        public override void Awake()
 31        {
 432            base.Awake();
 33
 3234            foreach (var button in acceptButton)
 1535                button.onClick.AddListener(() => OnClose?.Invoke());
 36
 537            retryButton.onClick.AddListener(() => OnRetry?.Invoke());
 438        }
 39
 40        public override void RefreshControl()
 41        {
 042        }
 43    }
 44}