Skip to content

Commit

Permalink
Br234 (#698)
Browse files Browse the repository at this point in the history
* Replace comma in CSV exports with a tab #681

* Update push-to-docker-hub.yml

* Deselect All on Crawl Permissions page appears to be broken #675

* ACT’s permissions form does not recognise an email which uses an apostrophe #665

* Update NLS email permission templates with new phone number #686

* Targets > Reports > Target creation > Date created threw ERROR (on sorting) #625

* Send button on Crawl Permission view does not send email #674

* Replace comma in CSV exports with a tab #681 (restore from TAB back to comma (as its CSV))

* Deselect All on Crawl Permissions page appears to be broken #675 (use current ordering and sorting)

* Replace comma in CSV exports with a tab #681

* Replace comma in CSV exports with a tab #681

* Add JSON data format support for Target List export #690

* Add JSON data format support for Target List export #690

* Reports page taking a long time to load #608 (initial commit)

* Add endpoints for JSON data (Subjects and Collections) #694

* Add endpoints for JSON data (Subjects and Collections) #694

* Reports page taking a long time to load #608 (update)

* Targets > Reports > Target Creation - count mismatch (listed vs exported) #695 (in addition pagination fix too - not starting from 0 page after new search)

* Possibility that Targets are added as Watched Targets by mistake #621 (remove redirect if ddhapt User)

* Reports page taking a long time to load #608 (design style Update)

* Add TSV & JSON data format support for CrawlPermissions export #697

* Add JSON data format support for Target List export #690 (optimize code)

* Deleting a collection that is tagged into a higher taxonomy #687

* Add TSV & JSON data format support for CrawlPermissions export #697
  • Loading branch information
min2ha authored Jan 6, 2023
1 parent e05063b commit 1c43180
Show file tree
Hide file tree
Showing 19 changed files with 990 additions and 546 deletions.
1 change: 1 addition & 0 deletions .github/workflows/push-to-docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- '*'
branches:
- master
- BR234

jobs:
push_to_docker_hub:
Expand Down
12 changes: 6 additions & 6 deletions app/controllers/ApplicationController.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ public static Result javascriptRoutes() {

@Security.Authenticated(SecuredController.class)
public static Result home() {
String email = session().get("email");
User user = User.findByEmail(email);
if (user.ddhaptUser && getDDHAPTStatus())
return redirect(routes.WatchedTargets.overview(0, "target.title", "asc"));
else
return redirect(routes.ApplicationController.index());
//String email = session().get("email");
//User user = User.findByEmail(email);
//if (user.ddhaptUser && getDDHAPTStatus())
// return redirect(routes.WatchedTargets.overview(0, "target.title", "asc"));
//else
return redirect(routes.ApplicationController.index());
}

public static boolean getDDHAPTStatus(){
Expand Down
8 changes: 8 additions & 0 deletions app/controllers/CollectionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ public static Result filterByJson(String name) {
return ok(jsonData);
}

@Security.Authenticated(SecuredController.class)
@BodyParser.Of(BodyParser.Json.class)
public static Result json() {
return ok(Json.toJson(Collection.findAllCollections()));
}

@Security.Authenticated(SecuredController.class)
@BodyParser.Of(BodyParser.Json.class)
public static Result getByJson() {
Expand Down Expand Up @@ -419,6 +425,8 @@ else if (collections.length > 1) {
} else if (action.equals("delete")) {
Collection collection = Collection.findById(id);
flash("message", "Collection " + filledForm.get().name + " has been deleted");
Ebean.createSqlUpdate("DELETE FROM taxonomy_parents_all where parent_id=:id")
.setParameter("id", id).execute();
collection.delete();
Logger.debug("invalidate cache on Collection Delete, key CollectionsData: ");
getCache().remove("CollectionsData");
Expand Down
16 changes: 12 additions & 4 deletions app/controllers/CrawlPermissionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@
public class CrawlPermissionController extends AbstractController {
//final static Form<CrawlPermission> crawlPermissionForm = new Form<CrawlPermission>(CrawlPermission.class);

public static String EMAIL_REGEX = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
/**
* RFC5322
*/
public static String EMAIL_REGEX = "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$";

/**
* Display the crawl permissions.
Expand Down Expand Up @@ -917,6 +919,12 @@ public static Result send() throws ActException {
int pageNo = Integer.parseInt(requestData.get("pageNo"));
Logger.debug("pageNo: " + pageNo);

String sortBy = requestData.get("sortByValue");
Logger.debug("sortByValue: " + sortBy);

String orderBy = requestData.get("orderByValue");
Logger.debug("orderByValue: " + orderBy);

Map<String, String[]> formParams = request().body().asFormUrlEncoded();
String[] permissionValues = formParams.get("permissionsList");

Expand Down Expand Up @@ -1000,12 +1008,12 @@ public static Result send() throws ActException {
if (action.equals("selectall")) {
Logger.debug("select all listed in page crawl permissions");
res = redirect(routes.CrawlPermissionController.list(
pageNo, Const.NAME, Const.ASC, "", status, organisation, Const.SELECT_ALL));
pageNo, sortBy, orderBy, "", status, organisation, Const.SELECT_ALL));
}
if (action.equals("deselectall")) {
Logger.debug("deselect all listed in page crawl permissions");
res = redirect(routes.CrawlPermissionController.list(
pageNo, Const.NAME, Const.ASC, "", status, organisation, Const.DESELECT_ALL));
pageNo, sortBy, orderBy, "", status, organisation, Const.DESELECT_ALL));
}
}
return res;
Expand Down
Loading

0 comments on commit 1c43180

Please sign in to comment.