El nostre pipeline

Última actualizació, juliol 2022.

S'ha produït un error mentre es processava la plantilla.
The following has evaluated to null or missing:
==> row.category  [in template "4257042#4257090#4793507" at line 44, column 24]

----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign key = row.category.getData()  [in template "4257042#4257090#4793507" at line 44, column 9]
----
1<style> 
2    .star{ 
3        position: absolute; 
4    right: calc(100% - 55px); 
5    top: 50%; 
6    transform: translateY(-50%); 
7    font-size: 16px; 
8    visibility: visible; 
9
10</style> 
11<div class="pipeline-table"> 
12  <table class="table table-responsive page-table--pipeline" id="table-pipeline1"> 
13    <thead> 
14      <tr> 
15        <th width="20%" scope="col"> 
16              <@liferay.language key="sep.almirall.pipeline.commercial.molecule" /> 
17        </th> 
18        <th width="25%" scope="col"> 
19              <@liferay.language key="sep.almirall.pipeline.indication" /> 
20        </th> 
21        <th width="10%" scope="col"> 
22            <@liferay.language key="sep.almirall.pipeline.phase.zero" /> 
23        </th> 
24        <th width="10%" scope="col"> 
25          <@liferay.language key="sep.almirall.pipeline.phase.one" /> 
26        </th> 
27        <th width="10%"  scope="col"> 
28          <@liferay.language key="sep.almirall.pipeline.phase.two" /> 
29        </th> 
30        <th width="10%"  scope="col"> 
31          <@liferay.language key="sep.almirall.pipeline.phase.three" /> 
32        </th> 
33        <th width="10%"  scope="col"> 
34          <@liferay.language key="sep.almirall.pipeline.phase.under.registration" /> 
35        </th> 
36        <th width="10%" scope="col" > 
37          <@liferay.language key="sep.almirall.pipeline.geography" /> 
38        </th> 
39      </tr> 
40    </thead> 
41    <tbody id="download-forms-table-tbody"> 
42      <#assign groupedData = {} /> 
43      <#list Project.getSiblings() as row> 
44        <#assign key = row.category.getData() /> 
45          <#if groupedData[key]?exists> 
46 
47              <#assign newList = [] /> 
48              <#list groupedData[key] as existingRow> 
49                  <#assign newList = newList + [existingRow] /> 
50              </#list> 
51              <#assign newList = newList + [row] /> 
52              <#assign groupedData = groupedData + { (key): newList } /> 
53          <#else> 
54 
55              <#assign groupedData = groupedData + { (key): [row] } /> 
56          </#if> 
57      </#list> 
58 
59        <#list groupedData?keys as groupKey> 
60        <tr> 
61            <td colspan="8" class="category-row"> 
62                <strong>${groupKey}</strong> 
63            </td> 
64        </tr> 
65          <#list groupedData[groupKey] as row> 
66            <#assign nombreProducto=row.CommercialName.getData()> 
67              <tr class="content"> 
68                <td class="first-row"> 
69                  <div class="cell-content">${nombreProducto}</div> 
70                </td> 
71                <td class="td-border"> 
72                  <div class="cell-content">${row.Indication.getData()}</div> 
73                </td> 
74                <td class="progressColumn td-border"> 
75                    <div class="cell-content"> 
76                    <#assign percentageNumber=row.PhasePercentage.getData()?number /> 
77                    <div class="progressW-bar progressW"> 
78                        <div class="progress-value progressW " style="overflow: hidden" data-progress-percent="${percentageNumber}"> 
79                        <span style="visibility:hidden;"> 
80                            ${percentageNumber} ${definePhase(percentageNumber)} 
81                        </span> 
82                        </div> 
83                    </div> 
84                    </div> 
85                </td> 
86                <td class="td-border"><div class="cell-content"></div></td> 
87                <td class="td-border"><div class="cell-content"></div></td> 
88                <td class="td-border"><div class="cell-content"></div></td> 
89                <td class="td-border"><div class="cell-content"></div></td> 
90                <td> 
91                <div class="cell-content"> 
92                  <div class="wrap-geo"> 
93                    <#list row.Country.getSiblings() as geo> 
94                      <div class="wrap-geo-icon"> 
95                        <#assign country=geo.getData()?lower_case> 
96                          <#if country?starts_with("worldwide")> 
97                            <img src="/o/almirall-restyling-theme/images/icons/worldwide.svg" alt="Worldwide" /> 
98                            <#assign isExChina="*" /> 
99                              <#if country=="worldwide_exchina"><span class="star"> 
100                                  ${isExChina} 
101                                </span></#if> 
102                                <#if country=="worldwide_atopicderma"><span class="star">  **</span></#if> 
103                            <#break> 
104                              <#else> 
105                                <#if country=="eu" || country=="europe"> 
106                                  <img src="/o/almirall-restyling-theme/images/icons/EU.svg" alt="EU" /> 
107                                </#if> 
108                                <#if country=="u.s" || country=="united states"> 
109                                  <img src="/o/almirall-restyling-theme/images/icons/US.svg" alt="U.S." /> 
110                                </#if> 
111                                <#if country=="china"> 
112                                  <img src="/o/almirall-restyling-theme/images/icons/china.svg" alt="China" /> 
113                                </#if> 
114                                <#if country=="uk"> 
115                                  <img src="/o/almirall-restyling-theme/images/icons/UK.svg" alt="UK" /> 
116                                </#if> 
117                          </#if> 
118                      </div> 
119                    </#list> 
120                  </div> 
121                </div> 
122                </td> 
123              </tr> 
124          </#list> 
125        </#list> 
126    </tbody> 
127  </table> 
128 
129  <#list Project.getSiblings() as row> 
130    <#assign percentageNumber=row.PhasePercentage.getData()?number 
131      countryList="" /> 
132    <#list row.Country.getSiblings() as geo> 
133      <#assign currentCountry=geo.getData()?lower_case /> 
134      <#if currentCountry=="europe"> 
135        <#assign currentCountry="EU" /> 
136        <#elseif currentCountry=="united states" || currentCountry=="u.s." || currentCountry=="u.s"> 
137          <#assign currentCountry="U.S." /> 
138      </#if> 
139      <#assign countryList+=" " +currentCountry /> 
140    </#list> 
141    <p class="content"><span style="display:none;"> 
142        ${row.Indication.getData()} ${row.CommercialName.getData()} ${definePhase(percentageNumber)} ${countryList} 
143      </span> 
144      ${row.ProjectLegend.getData()} 
145    </p> 
146  </#list> 
147</div> 
148 
149<#function definePhase n> 
150  <#assign percentageNumber=n 
151    phaseName="" 
152    phasesNumber=4 
153    number=0 /> 
154  <#list 1..phasesNumber as phase> 
155    <#assign number=number+(100/phasesNumber) /> 
156    <#if percentageNumber <= number> 
157      <#if phase==1> 
158        <#assign phaseName="Phase 1"> 
159      <#elseif phase == phasesNumber> 
160            <#assign phaseName="Under registration"> 
161      <#else> 
162            <#assign phaseName="Fase" +(phase)> 
163      </#if> 
164      <#return phaseName /> 
165      <#break> 
166    </#if> 
167  </#list> 
168  <#return phaseName /> 
169</#function> 
170<script> 
171$(function() { 
172  moveProgressBar(); 
173    const startColor = "#C9FFF4"; 
174    const endColor = "#E9C3FF"; 
175    const barStartColor = "#008C93"; 
176    const barEndColor = "#8700D3"; 
177 
178  var rows = $(".page-table--pipeline tbody").find(".cell-content"); 
179 
180 
181  if (rows.length > 0) { 
182    const colorStep = 1 / (rows.length - 1); 
183 
184    rows.each(function(index) { 
185 
186      const position = index * colorStep; 
187 
188 
189      const color = interpolateColor(startColor, endColor, position); 
190      const barColor = interpolateColor(barStartColor, barEndColor, position); 
191 
192 
193      $(this).css("background-color", color); 
194      var progressBar = $(this).closest("td").find(".progress-value"); 
195 
196      if (progressBar.length) { 
197        progressBar.css("background-color", barColor); 
198
199    }); 
200
201 
202 
203  function interpolateColor(color1, color2, factor) { 
204    function hexToRgb(hex) { 
205      return { 
206        r: parseInt(hex.substr(1, 2), 16), 
207        g: parseInt(hex.substr(3, 2), 16), 
208        b: parseInt(hex.substr(5, 2), 16) 
209      }; 
210
211 
212    function rgbToHex(r, g, b) { 
213      return "#" + (1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1).toUpperCase(); 
214
215 
216 
217    var color1Rgb = hexToRgb(color1); 
218    var color2Rgb = hexToRgb(color2); 
219 
220 
221    var r = Math.round(color1Rgb.r + (color2Rgb.r - color1Rgb.r) * factor); 
222    var g = Math.round(color1Rgb.g + (color2Rgb.g - color1Rgb.g) * factor); 
223    var b = Math.round(color1Rgb.b + (color2Rgb.b - color1Rgb.b) * factor); 
224 
225 
226    return rgbToHex(r, g, b); 
227
228}) 
229</script>