Skip to content

Commit

Permalink
Merge pull request #520 from scireum/aha/chartz
Browse files Browse the repository at this point in the history
Aha/chartz
  • Loading branch information
sabieber authored Nov 13, 2018
2 parents d6fabef + 8368946 commit 880b419
Show file tree
Hide file tree
Showing 18 changed files with 153 additions and 167 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<description>Provides a modern and scalable web server as SIRIUS module</description>

<properties>
<sirius.kernel>12.0-rc31</sirius.kernel>
<sirius.kernel>12.0-rc34</sirius.kernel>
</properties>

<dependencies>
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/sirius/tagliatelle/macros/I18nMacro.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void verifyArguments(List<Expression> args) {
if (exp instanceof ConstantString) {
String key = (String) exp.eval(null);
if (Strings.isFilled(key) && NLS.getTranslationEngine()
.getTranslations(key)
.getEntriesStartingWith(key)
.noneMatch(t -> key.equals(t.getKey()))) {
throw new IllegalArgumentException(Strings.apply("No translation found for key: %s", key));
}
Expand All @@ -64,7 +64,12 @@ public boolean isConstant(Expression[] args) {

@Override
public Object eval(LocalRenderContext ctx, Expression[] args) {
return NLS.get((String) args[0].eval(ctx));
String key = (String) args[0].eval(ctx);
if (Strings.isFilled(key)) {
return NLS.get(key);
} else {
return "";
}
}

@Nonnull
Expand Down
1 change: 1 addition & 0 deletions src/main/java/sirius/web/crunchlog/Crunchlog.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
* <p>
* To disable the crunchlog entirely, set <tt>frameworks.crunchlog = false</tt> in the system config.
*/
@Deprecated
@Register(classes = Crunchlog.class)
public class Crunchlog {

Expand Down
1 change: 1 addition & 0 deletions src/main/java/sirius/web/crunchlog/CrunchlogKernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
* indefinitely large nor having the filesystem run out of free space is feasible for a server system.
*/
@Framework("web.crunchlog")
@Deprecated
@Register(classes = {CrunchlogKernel.class, BackgroundLoop.class, Stoppable.class, MetricProvider.class, Command.class})
public class CrunchlogKernel extends BackgroundLoop implements Command, Stoppable, MetricProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
@Framework("web.crunchlog")
@Register
@Deprecated
public class DeleteOldCrunchlogs implements EveryDay {

private static final int ONE_YEAR = 365;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/sirius/web/tasks/ManagedTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* which mainly reports the state of running tasks.
* </p>
*/
@Deprecated
public interface ManagedTask {

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/sirius/web/tasks/ManagedTaskContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*
* @see ManagedTask
*/
@Deprecated
public interface ManagedTaskContext extends TaskContextAdapter {

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/sirius/web/tasks/ManagedTaskExecution.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* This acts as a bridge between the actual execution withing {@link Tasks}, the {@link ManagedTasks} framework and the
* task being executed itself.
*/
@Deprecated
class ManagedTaskExecution implements Runnable, ManagedTaskContext, ManagedTask {

protected final String taskId;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/sirius/web/tasks/ManagedTaskSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/**
* A builder pattern to create a {@link ManagedTask}.
*/
@Deprecated
public class ManagedTaskSetup {
protected ManagedTasks managedTasks;
protected String name;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/sirius/web/tasks/ManagedTasks.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* @see ManagedTask
*/
@Register(classes = ManagedTasks.class)
@Deprecated
public class ManagedTasks {

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/sirius/web/tasks/ManagedTasksController.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* Used to view and manage tasks.
*/
@Register(classes = Controller.class)
@Deprecated
public class ManagedTasksController extends BasicController {

/**
Expand Down
1 change: 1 addition & 0 deletions src/main/java/sirius/web/tasks/TaskLogEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/**
* Represents a log entry for a managed task.
*/
@Deprecated
public class TaskLogEntry {

/**
Expand Down
69 changes: 0 additions & 69 deletions src/main/java/sirius/web/util/TranslationController.java

This file was deleted.

13 changes: 2 additions & 11 deletions src/main/resources/default/taglib/w/doughnutChart.html.pasta
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,7 @@
<script type="text/javascript">
$(document).ready(function () {
@raw {
new Chart($('#@name').get(0).getContext("2d"), {
data: {
datasets: [{
data: [ @data ],
backgroundColor: ["#5cbae6","#b6d957","#fac364","#8cd3ff","#d998cb","#f2d249","#93b9c6","#ccc5a8","#52bacc","#dbdb46","#98aafb"]
}],
labels: [ @labels ]
},
type: 'doughnut'
});
dougnutChart('#@name', [ @labels ], [ @data ]);
}
});
</script>
</script>
47 changes: 1 addition & 46 deletions src/main/resources/default/taglib/w/lineChart.html.pasta
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,8 @@
</div>
<script type="text/javascript">
$(document).ready(function () {
var options = {
responsive: true,
maintainAspectRatio: false,
bezierCurve: true,
legend: {
display: false
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true,

}
}],
xAxes: [{
ticks: {
autoSkip: false
}
}]
}
};

@raw {
var labels = [ @labels ];
var data = [ @data ];

lineChart('#@name', [ @labels ], [ {data: @data } ]);
}

var selector = '#@name';
new Chart($(selector).get(0).getContext("2d"),
{
type: 'line',
data: {
labels: labels,
datasets: [
{
fillColor: "rgba(151,187,205,0.2)",
borderColor: "rgba(151,187,205,1)",
pointColor: "rgba(151,187,205,1)",
pointStrokeColor: "#fff",
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(151,187,205,1)",
data: data
}
]
},
options: options
});
});
</script>
14 changes: 1 addition & 13 deletions src/main/resources/default/taglib/w/polarAreaChart.html.pasta
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,7 @@
<script type="text/javascript">
$(document).ready(function () {
@raw {
new Chart($('#@name').get(0).getContext("2d"), {
data: {
datasets: [{
data: [ @data ],
backgroundColor: ["#5cbae6","#b6d957","#fac364","#8cd3ff","#d998cb","#f2d249","#93b9c6","#ccc5a8","#52bacc","#dbdb46","#98aafb"]
}],
labels: [ @labels ]
},
type: 'polarArea',
options: {
startAngle: -0.55 * Math.PI
}
});
polarAreaChart('#@name', [ @labels ], [ @data ]);
}
});
</script>
5 changes: 3 additions & 2 deletions src/main/resources/default/taglib/w/table.html.pasta
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<i:arg type="java.lang.Object" name="data" />
<i:arg type="boolean" name="colorized" default="false" />
<i:arg type="String" name="class" default="" />

<i:pragma name="inline" value="true" />
<i:pragma name="description" value="Renders table within a Wondergem template" />

<i:if test="(data.is(Page.class) && !data.as(Page.class).getItems().isEmpty()) || (data.is(java.util.Collection.class) && !data.as(java.util.Collection.class).isEmpty())">
<table class="table table-striped @if (colorized) { table-colorized }">
<table class="table table-striped @if (colorized) { table-colorized } @class">
<i:render name="body" />
</table>
<i:else>
Expand All @@ -15,4 +16,4 @@
</tr>
</table>
</i:else>
</i:if>
</i:if>
Loading

0 comments on commit 880b419

Please sign in to comment.