Skip to content

Commit

Permalink
Add paging, sorting, and row counts to AnySearch
Browse files Browse the repository at this point in the history
  • Loading branch information
tieniber committed May 11, 2021
1 parent 89a06f6 commit 74ee74b
Show file tree
Hide file tree
Showing 9 changed files with 2,151 additions and 1,109 deletions.
159 changes: 92 additions & 67 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated on 2017-01-23 using generator-mendix 2.0.1 :: git+https://github.com/mendix/generator-mendix.git
// Generated on 2021-02-15 using generator-mendix 2.2.5 :: git+https://github.com/mendix/generator-mendix.git
/*jshint -W069,-W097*/
"use strict";

Expand All @@ -13,78 +13,103 @@ var gulp = require("gulp"),
zip = require("gulp-zip"),
del = require("del"),
newer = require("gulp-newer"),
gutil = require("gulp-util"),
log = require('fancy-log'),
colors = require('ansi-colors'),
plumber = require("gulp-plumber"),
gulpif = require("gulp-if"),
jsonTransform = require("gulp-json-transform"),
intercept = require("gulp-intercept"),
argv = require("yargs").argv,
widgetBuilderHelper = require("widgetbuilder-gulp-helper");
widgetBuilderHelper = require("widgetbuilder-gulp-helper"),
jsValidate = require("gulp-jsvalidate");

var pkg = require("./package.json"),
paths = widgetBuilderHelper.generatePaths(pkg),
xmlversion = widgetBuilderHelper.xmlversion;

gulp.task("default", function() {
gulp.watch("./src/**/*", ["compress"]);
gulp.watch("./src/**/*.js", ["copy:js"]);
});

gulp.task("copyonly", function() {
gulp.watch("./src/**/*.js", ["copy:js"]);
});

gulp.task("clean", function () {
return del([
paths.WIDGET_TEST_DEST,
paths.WIDGET_DIST_DEST
], { force: true });
});

gulp.task("compress", ["clean"], function () {
return gulp.src("src/**/*")
.pipe(zip(pkg.name + ".mpk"))
.pipe(gulp.dest(paths.TEST_WIDGETS_FOLDER))
.pipe(gulp.dest("dist"));
});

gulp.task("copy:js", function () {
return gulp.src(["./src/**/*.js"])
.pipe(newer(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER))
.pipe(gulp.dest(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER));
});

gulp.task("version:xml", function () {
return gulp.src(paths.PACKAGE_XML)
.pipe(xmlversion(argv.n))
.pipe(gulp.dest("./src/"));
});

gulp.task("version:json", function () {
return gulp.src("./package.json")
.pipe(gulpif(typeof argv.n !== "undefined", jsonTransform(function(data) {
data.version = argv.n;
return data;
}, 2)))
.pipe(gulp.dest("./"));
});

gulp.task("icon", function (cb) {
var icon = (typeof argv.file !== "undefined") ? argv.file : "./icon.png";
console.log("\nUsing this file to create a base64 string: " + gutil.colors.cyan(icon));
gulp.src(icon)
.pipe(intercept(function (file) {
console.log("\nCopy the following to your " + pkg.name + ".xml (after description):\n\n" + gutil.colors.cyan("<icon>") + file.contents.toString("base64") + gutil.colors.cyan("<\\icon>") + "\n");
cb();
}));
});

gulp.task("folders", function () {
paths.showPaths(); return;
});

gulp.task("modeler", function (cb) {
widgetBuilderHelper.runmodeler(MODELER_PATH, MODELER_ARGS, paths.TEST_PATH, cb);
});

gulp.task("build", ["compress"]);
gulp.task("version", ["version:xml", "version:json"]);
gulp.task("clean", function () {
return del([
paths.WIDGET_TEST_DEST,
paths.WIDGET_DIST_DEST
], { force: true });
});

gulp.task("compress", gulp.series(["clean"], function () {
return gulp.src("src/**/*")
.pipe(zip(pkg.name + ".mpk"))
.pipe(gulp.dest(paths.TEST_WIDGETS_FOLDER))
.pipe(gulp.dest("dist"));
}));

gulp.task("build", gulp.series(["compress"]));

gulp.task("default", gulp.series(['build'], function() {
gulp.watch("./src/**/*", gulp.series('compress'));
gulp.watch("./src/**/*.js", gulp.series('copy:js'));
gulp.watch("./src/**/*.html", gulp.series('copy:html'))
}));

gulp.task("compress", gulp.series(["clean"], function () {
return gulp.src("src/**/*")
.pipe(zip(pkg.name + ".mpk"))
.pipe(gulp.dest(paths.TEST_WIDGETS_FOLDER))
.pipe(gulp.dest("dist"));
}));

gulp.task("copy:js", function () {
return gulp.src(["./src/**/*.js"])
.pipe(plumber(function (error) {
var msg = colors.red("Error");
if (error.fileName) {
msg += colors.red(" in ") + colors.cyan(error.fileName);
}
msg += " : " + colors.cyan(error.message);
log(msg);
this.emit("end");
}))
.pipe(jsValidate())
.pipe(newer(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER))
.pipe(gulp.dest(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER));
});

gulp.task("copy:html", function () {
return gulp.src(["./src/**/*.html"])
.pipe(newer(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER))
.pipe(gulp.dest(paths.TEST_WIDGETS_DEPLOYMENT_FOLDER));
});

gulp.task("version:xml", function () {
return gulp.src(paths.PACKAGE_XML)
.pipe(xmlversion(argv.n))
.pipe(gulp.dest("./src/"));
});

gulp.task("version:json", function () {
return gulp.src("./package.json")
.pipe(gulpif(typeof argv.n !== "undefined", jsonTransform(function(data) {
data.version = argv.n;
return data;
}, 2)))
.pipe(gulp.dest("./"));
});

gulp.task("icon", function (cb) {
var icon = (typeof argv.file !== "undefined") ? argv.file : "./icon.png";
console.log("\nUsing this file to create a base64 string: " + colors.cyan(icon));
gulp.src(icon)
.pipe(intercept(function (file) {
console.log("\nCopy the following to your " + pkg.name + ".xml (after description):\n\n" + colors.cyan("<icon>") + file.contents.toString("base64") + colors.cyan("<\/icon>") + "\n");
cb();
}));
});

gulp.task("folders", function () {
paths.showPaths(); return;
});

gulp.task("modeler", function (cb) {
widgetBuilderHelper.runmodeler(MODELER_PATH, MODELER_ARGS, paths.TEST_PATH, cb);
});

gulp.task("version", gulp.parallel(["version:xml", "version:json"]));

3 changes: 3 additions & 0 deletions cssToAdd.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.hide-load-more .mx-listview-loadMore {
display: none !important;
}
Binary file modified dist/GridSearch.mpk
100644 → 100755
Binary file not shown.
Loading

0 comments on commit 74ee74b

Please sign in to comment.