Skip to content

Commit

Permalink
Merge pull request #2681 from magda-io/2658-search-dropdown
Browse files Browse the repository at this point in the history
Search dropdown
  • Loading branch information
AlexGilleran committed Jan 6, 2020
2 parents 84d8c6f + 2b84a5d commit da15a87
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -146,6 +146,7 @@ UI:
- Removed help icons without content
- Made read-only calls to the registry api use `/registry-read-only`.
- Fixed: if featureFlags are not set, edit buttons are always shown on dataset page
- Add specific color to recent search item text

Gateway:

Expand Down
6 changes: 3 additions & 3 deletions magda-web-client/src/Components/Account/AccountPage.js
Expand Up @@ -27,14 +27,14 @@ class Account extends React.Component {
renderRoles() {
const user = this.props.user;
return (
<p>
<div>
Roles:{" "}
{user.roles && user.roles.length ? (
<ul>{user.roles.map(role => this.renderRole(role))}</ul>
) : (
"N/A"
)}
</p>
</div>
);
}

Expand Down Expand Up @@ -110,7 +110,7 @@ class Account extends React.Component {
<p>Email: {this.props.user.email}</p>
{this.renderRoles()}
{this.props.user.isAdmin && (
<a href="/admin" class="au-btn">
<a href="/admin" className="au-btn">
Administrate
</a>
)}
Expand Down
Expand Up @@ -89,7 +89,7 @@ export default class DatasetSummary extends Component {
datasetSummaryItems = datasetSummaryItems.reduce(
(arr, nextSummaryItem, idx) =>
idx < datasetSummaryItems.length - 1
? [...arr, nextSummaryItem, <Divider />]
? [...arr, nextSummaryItem, <Divider key={idx} />]
: [...arr, nextSummaryItem],
[]
);
Expand Down
Expand Up @@ -38,6 +38,9 @@
width: calc(100% - 50px);
text-align: left;
padding: 0px;
&.search-item-main-button {
color: $AU-color-foreground-action;
}
&.markdown {
margin-left: 0;
em {
Expand Down
Expand Up @@ -70,10 +70,10 @@ class SearchSuggestionBox extends Component<Props & any, any> {
manuallyHidden: false
};
this.cacheImgs();
this.createSearchDataFromProps(this.props);
this.searchInputRef = null;
this.onSearchInputKeyDown = this.onSearchInputKeyDown.bind(this);
this.containerRef = null;
this.saveRecentSearch(this.props);
}

cacheImgs() {
Expand Down Expand Up @@ -142,7 +142,7 @@ class SearchSuggestionBox extends Component<Props & any, any> {
return qStr ? qStr + " " + filters.join("; ") : filters.join("; ");
}

saveRecentSearch(newProps, prevProps) {
saveRecentSearch(newProps, prevProps?) {
const searchData = this.createSearchDataFromProps(newProps);
if (!searchData) return;
if (
Expand Down Expand Up @@ -392,7 +392,7 @@ class SearchSuggestionBox extends Component<Props & any, any> {
role="listbox"
className="search-history-items"
>
{recentSearchItems.map((item, idx) => (
{recentSearchItems.map((item, idx: number) => (
<li
key={idx}
className={`search-item-container ${
Expand Down

0 comments on commit da15a87

Please sign in to comment.