< Summary

Class:SectionDeployedScenesView
Assembly:BuilderProjectsPanel
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Scripts/Views/MenuSections/SectionDeployedScenesView.cs
Covered lines:33
Uncovered lines:2
Coverable lines:35
Total lines:81
Line coverage:94.2% (33 of 35)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SetParent(...)0%110100%
SetActive(...)0%110100%
ResetScrollRect()0%110100%
SetEmpty()0%110100%
SetLoading()0%110100%
SetNoSearchResult()0%110100%
SetFilled()0%110100%
GetCardsContainer()0%2100%
Dispose()0%220100%
Awake()0%110100%
OnDestroy()0%110100%
OnScrollValueChanged(...)0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/HUD/BuilderProjectsPanel/Scripts/Views/MenuSections/SectionDeployedScenesView.cs

#LineLine coverage
 1using System;
 2using DCL.Helpers;
 3using UnityEngine;
 4using UnityEngine.UI;
 5
 6internal class SectionDeployedScenesView : MonoBehaviour, IDisposable
 7{
 8    public event Action OnScrollRectValueChanged;
 9
 10    [SerializeField] public Transform scenesCardContainer;
 11    [SerializeField] public ScrollRect scrollRect;
 12    [SerializeField] internal GameObject contentContainer;
 13    [SerializeField] internal GameObject emptyContainer;
 14    [SerializeField] internal GameObject noSearchResultContainer;
 15    [SerializeField] internal GameObject loadingAnimationContainer;
 16
 17    private bool isDestroyed = false;
 18
 19    public void SetParent(Transform parent)
 20    {
 121        transform.SetParent(parent);
 122        transform.ResetLocalTRS();
 123    }
 24
 225    public void SetActive(bool active) { gameObject.SetActive(active); }
 26
 827    public void ResetScrollRect() { scrollRect.verticalNormalizedPosition = 1; }
 28
 29    public void SetEmpty()
 30    {
 231        contentContainer.SetActive(false);
 232        emptyContainer.SetActive(true);
 233        noSearchResultContainer.SetActive(false);
 234        loadingAnimationContainer.SetActive(false);
 235    }
 36
 37    public void SetLoading()
 38    {
 339        contentContainer.SetActive(false);
 340        emptyContainer.SetActive(false);
 341        noSearchResultContainer.SetActive(false);
 342        loadingAnimationContainer.SetActive(true);
 343    }
 44
 45    public void SetNoSearchResult()
 46    {
 147        contentContainer.SetActive(false);
 148        emptyContainer.SetActive(false);
 149        noSearchResultContainer.SetActive(true);
 150        loadingAnimationContainer.SetActive(false);
 151    }
 52
 53    public void SetFilled()
 54    {
 455        contentContainer.SetActive(true);
 456        emptyContainer.SetActive(false);
 457        noSearchResultContainer.SetActive(false);
 458        loadingAnimationContainer.SetActive(false);
 459        ResetScrollRect();
 460    }
 61
 062    public Transform GetCardsContainer() { return scenesCardContainer; }
 63
 64    public void Dispose()
 65    {
 366        if (!isDestroyed)
 67        {
 368            Destroy(gameObject);
 69        }
 370    }
 71
 2072    private void Awake() { scrollRect.onValueChanged.AddListener(OnScrollValueChanged); }
 73
 74    private void OnDestroy()
 75    {
 1076        isDestroyed = true;
 1077        scrollRect.onValueChanged.RemoveListener(OnScrollValueChanged);
 1078    }
 79
 080    private void OnScrollValueChanged(Vector2 value) { OnScrollRectValueChanged?.Invoke(); }
 81}