Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 93a318b7

Přidáno uživatelem Ondřej Váně před téměř 3 roky(ů)

#1 Add links to AP Detail

- added links to anti-pattern detail in result table header
- added some basic comments in edited files
- html code rafactor

Zobrazit rozdíly:

src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/model/AntiPattern.java
65 65
        this.configurations = configurations;
66 66
    }
67 67

  
68
    public String getUrl() {
69
        return "<a href='/anti-patterns/" + this.id.toString() + "'>Detail</a>";
70
    }
71

  
68 72
    @Override
69 73
    public String toString() {
70 74
        return "AntiPattern{" +
......
72 76
                ", printName='" + printName + '\'' +
73 77
                ", name='" + name + '\'' +
74 78
                ", description='" + description + '\'' +
79
                ", configurations=" + configurations +
75 80
                '}';
76 81
    }
77 82
}
src/main/webapp/WEB-INF/templates/result.html
28 28
<!-- Navigation bar imported -->
29 29
<div th:replace="fragments/navbar :: navBar"></div>
30 30
<!-- ./Navigation bar imported -->
31

  
32
<!-- Result table container -->
31 33
<div class="container">
32 34
    <h1>Results</h1>
33 35
    <table class="table table-bordered table-hover">
36
        <!-- Result table header -->
34 37
        <thead>
35 38
        <tr>
36 39
            <th scope="col">#</th>
37 40
            <th scope="col">Project Name</th>
38
            <th scope="col" th:text="${antiPattern.getAntiPattern().printName}"
39
                th:each="antiPattern: ${queryResults.get(0).getQueryResultItems()}"></th>
41
            <th scope="col" th:each="antiPattern: ${queryResults.get(0).getQueryResultItems()}">
42
                <a data-toggle="popover"
43
                   title="Anti-Pattern info"
44
                   data-html="true"
45
                   data-content=""
46
                   th:text="${antiPattern.getAntiPattern().printName}"
47
                   th:attr="data-content=${antiPattern.getAntiPattern().getUrl()}"
48
                >
49
                </a>
50
            </th>
40 51
        </tr>
41 52
        </thead>
53
        <!-- ./Result table header -->
54

  
55
        <!-- Result table content -->
42 56
        <tbody>
43 57
        <tr th:each="queryResult : ${queryResults}">
44 58
            <td th:text="${queryResult.getProject().id}"></td>
......
47 61

  
48 62
                <div th:if="${resultItems.isDetected()}">
49 63
                    <div class="container">
50
                        <a data-toggle="popover" title="Detection details" data-html="true" data-content="" th:attr="data-content=${resultItems.resultDetailsToString()}">
64
                        <a data-toggle="popover"
65
                           title="Detection details"
66
                           data-html="true"
67
                           data-content=""
68
                           th:attr="data-content=${resultItems.resultDetailsToString()}">
51 69
                            <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25"
52
                                fill="currentColor" class="bi bi-check my-center found-bg icon-style" viewBox="0 0 16 16">
70
                                 fill="currentColor" class="bi bi-check my-center found-bg icon-style"
71
                                 viewBox="0 0 16 16">
53 72
                                <path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"/>
54 73
                            </svg>
55 74
                        </a>
......
57 76
                </div>
58 77
                <div th:unless="${resultItems.isDetected()}">
59 78
                    <div class="container">
60
                        <a data-toggle="popover" title="Detection details" data-html="true" data-content="" th:attr="data-content=${resultItems.resultDetailsToString()}">
61
                            <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-x not-found-bg icon-style" viewBox="0 0 16 16">
62
                            <path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/>
63
                        </svg>
79
                        <a data-toggle="popover"
80
                           title="Detection details"
81
                           data-html="true" data-content=""
82
                           th:attr="data-content=${resultItems.resultDetailsToString()}">
83
                            <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor"
84
                                 class="bi bi-x not-found-bg icon-style" viewBox="0 0 16 16">
85
                                <path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/>
86
                            </svg>
64 87
                        </a>
65 88
                    </div>
66 89
                </div>
67 90
            </td>
68 91
        </tr>
69 92
        </tbody>
93
        <!-- ./Result table content -->
70 94
    </table>
95

  
96
    <!-- Table legend -->
71 97
    <h6>Legend:</h6>
72 98
    <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25"
73 99
         fill="currentColor" class="bi bi-check my-center found-bg icon-style" viewBox="0 0 16 16">
......
75 101
    </svg>
76 102
    - Anti-pattern detected
77 103
    <br>
78
    <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-x not-found-bg icon-style" viewBox="0 0 16 16">
104
    <svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor"
105
         class="bi bi-x not-found-bg icon-style" viewBox="0 0 16 16">
79 106
        <path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/>
80 107
    </svg>
81 108
    - Anti-pattern NOT detected
......
84 111
            <button type="submit" class="btn btn-primary btn-lg btn-block">Back Home</button>
85 112
        </form>
86 113
    </div>
114
    <!-- ./Table legend -->
87 115
</div>
116
<!-- ./Result table container -->
88 117

  
89

  
118
<!-- Script to popover -->
90 119
<script>
91
    $(document).ready(function(){
120
    $(document).ready(function () {
92 121
        $('[data-toggle="popover"]').popover();
93 122
    });
94 123
</script>
124
<!-- ./Script to popover -->
125

  
95 126
</body>
96 127
</html>

Také k dispozici: Unified diff