Skip to content

Commit

Permalink
Merge branch 'release/0.2.2' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
straumat committed Jan 12, 2024
2 parents c3d3b77 + 172be56 commit 1283b6b
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 23 deletions.
2 changes: 1 addition & 1 deletion backend/explorer-core/autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
<parent>
<groupId>org.royllo.explorer</groupId>
<artifactId>explorer</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<!-- =========================================================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion backend/explorer-core/starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
<parent>
<groupId>org.royllo.explorer</groupId>
<artifactId>explorer</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<!-- =========================================================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion backend/servers/explorer-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
<parent>
<groupId>org.royllo.explorer</groupId>
<artifactId>explorer</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<!-- =========================================================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion backend/servers/explorer-batch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
<parent>
<groupId>org.royllo.explorer</groupId>
<artifactId>explorer</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<!-- =========================================================================================================== -->
Expand Down
14 changes: 7 additions & 7 deletions backend/servers/explorer-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/servers/explorer-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"autoprefixer": "^10.4.16",
"browser-sync": "^3.0.2",
"cssnano": "^6.0.3",
"daisyui": "^4.5.0",
"daisyui": "^4.6.0",
"mkdirp": "^3.0.1",
"ncp": "^2.0.0",
"npm-run-all": "^4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion backend/servers/explorer-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@
<parent>
<groupId>org.royllo.explorer</groupId>
<artifactId>explorer</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<!-- =========================================================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
import lombok.RequiredArgsConstructor;
import org.royllo.explorer.core.service.search.SearchService;
import org.royllo.explorer.web.util.base.BaseController;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Locale;

import static org.royllo.explorer.web.configuration.WebConfiguration.ASSET_SEARCH_DEFAULT_PAGE_SIZE;
import static org.royllo.explorer.web.util.constants.ModelAttributeConstants.PAGE_ATTRIBUTE;
import static org.royllo.explorer.web.util.constants.ModelAttributeConstants.PAGE_TITLE_ATTRIBUTE;
import static org.royllo.explorer.web.util.constants.ModelAttributeConstants.QUERY_ATTRIBUTE;
import static org.royllo.explorer.web.util.constants.ModelAttributeConstants.RESULT_ATTRIBUTE;
import static org.royllo.explorer.web.util.constants.SearchPageConstants.SEARCH_PAGE;
Expand All @@ -23,13 +27,17 @@
@RequiredArgsConstructor
public class SearchController extends BaseController {

/** Message source. */
private final MessageSource messageSource;

/** Search service. */
private final SearchService searchService;

/**
* Page displaying search results.
*
* @param model model
* @param locale locale
* @param request request
* @param query query
* @param page page number
Expand All @@ -38,6 +46,7 @@ public class SearchController extends BaseController {
@SuppressWarnings("SameReturnValue")
@GetMapping("/search")
public String search(final Model model,
final Locale locale,
final HttpServletRequest request,
@RequestParam(required = false) final String query,
@RequestParam(defaultValue = "1") final int page) {
Expand All @@ -48,6 +57,11 @@ public String search(final Model model,

// If the query is present, we make the search and add result to the page.
model.addAttribute(RESULT_ATTRIBUTE, searchService.queryAssets(query.trim(), page, ASSET_SEARCH_DEFAULT_PAGE_SIZE));

// Set the page title.
model.addAttribute(PAGE_TITLE_ATTRIBUTE,
messageSource.getMessage("search.title", null, locale) + " " + query.trim());

}

return getPageOrFragment(request, SEARCH_PAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import static org.royllo.explorer.web.util.constants.ModelAttributeConstants.ASSET_STATES_LIST_ATTRIBUTE;
import static org.royllo.explorer.web.util.constants.ModelAttributeConstants.ASSET_URL_ATTRIBUTE;
import static org.royllo.explorer.web.util.constants.ModelAttributeConstants.PAGE_ATTRIBUTE;
import static org.royllo.explorer.web.util.constants.ModelAttributeConstants.PAGE_TITLE_ATTRIBUTE;
import static org.royllo.explorer.web.util.constants.ModelAttributeConstants.PROOF_LIST_ATTRIBUTE;
import static org.royllo.explorer.web.util.constants.ModelAttributeConstants.WEB_BASE_URL_ATTRIBUTE;

Expand Down Expand Up @@ -178,6 +179,7 @@ private Optional<AssetDTO> addAssetToModel(final Model model, final String asset
model.addAttribute(ASSET_ATTRIBUTE, asset.get());
// We also set the url to share the asset.
model.addAttribute(ASSET_URL_ATTRIBUTE, model.getAttribute(WEB_BASE_URL_ATTRIBUTE) + "/asset/" + asset.get().getAssetIdAlias());
model.addAttribute(PAGE_TITLE_ATTRIBUTE, asset.get().getName() + " - " + asset.get().getAssetId());
}

return asset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ public class AssetPageConstants {
/** Asset proofs page. */
public static final String ASSET_PROOFS_PAGE = "asset/proofs";


}
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ public class ModelAttributeConstants {
/** Asset url attribute. */
public static final String ASSET_URL_ATTRIBUTE = "assetUrl";

/** Proof id attribute. */
public static final String PROOF_ID_ATTRIBUTE = "proofId";

/** Request id attribute. */
public static final String REQUEST_ID_ATTRIBUTE = "requestId";

Expand All @@ -60,4 +57,7 @@ public class ModelAttributeConstants {
/** sitemap urls. */
public static final String SITEMAP_URLS_ATTRIBUTE = "urls";

/** Page title attribute. */
public static final String PAGE_TITLE_ATTRIBUTE = "pageTitle";

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ======================================================================================================================
# Search
# Search title
search.title=Searching Taproot assets with query:
# Search description
search.view.field.helper=Search by group key, asset id or name
# Search errors
search.error.noResult=No asset found for your query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<meta content="width=device-width, initial-scale=1" name="viewport">

<!--/* Page description */-->
<title th:text="#{head.title}"></title>
<title th:text="${pageTitle} ?: #{head.title}"></title>
<meta name="description" th:content="#{head.description}">
<meta name="author" th:content="#{head.author}">

<!--/* Open Graph */-->
<meta property="og:title" th:content="#{og.title}">
<meta property="og:title" th:content="${pageTitle} ?: #{og.title}">
<meta property="og:type" th:content="#{og.type}">
<meta property="og:url" th:content="#{og.url}">
<meta property="og:description" th:content="#{og.description}">
Expand Down
8 changes: 4 additions & 4 deletions backend/servers/explorer-web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,10 @@ culori@^3:
resolved "https://registry.npmjs.org/culori/-/culori-3.2.0.tgz"
integrity sha512-HIEbTSP7vs1mPq/2P9In6QyFE0Tkpevh0k9a+FkjhD+cwsYm9WRSbn4uMdW9O0yXlNYC3ppxL3gWWPOcvEl57w==

daisyui@^4.5.0:
version "4.5.0"
resolved "https://registry.npmjs.org/daisyui/-/daisyui-4.5.0.tgz"
integrity sha512-RWQCPQ0vBUaxGy768O7Ku8SRQgwdoto1lDzuKeVOcMtYghuSbUY7NoPoMK+k8JH4s1J02OvpNAgtB9MeKpZIwg==
daisyui@^4.6.0:
version "4.6.0"
resolved "https://registry.npmjs.org/daisyui/-/daisyui-4.6.0.tgz"
integrity sha512-B5ZB/sczXpp4LMdo/SZrtYY/U2hq+Vr9I15QawuWZ0VwgtSAbuZpAZUftKVryEsPuv3BM0yVlBED0nAmtis/dw==
dependencies:
css-selector-tokenizer "^0.8"
culori "^3"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Project information -->
<groupId>org.royllo.explorer</groupId>
<artifactId>explorer</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<name>Royllo - A Taproot asset explorer</name>
<description>Royllo explorer allows you to search for Taproot assets created on the Bitcoin blockchain</description>
<packaging>pom</packaging>
Expand Down

0 comments on commit 1283b6b

Please sign in to comment.