Skip to content

Commit

Permalink
deat(Domain): better reading for project list and description (#1391)
Browse files Browse the repository at this point in the history
* new view for domain landing page with project description
  • Loading branch information
hgw77 authored Jul 31, 2024
1 parent 01d4d1e commit 328f8c2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default class List extends React.Component {
}

updateSearchTerm = (e) => {
//console.log("updateSearchTerm", e.target.value)
this.setState({ searchTerm: e.target.value })
}

Expand All @@ -60,6 +61,7 @@ export default class List extends React.Component {
parent_id: item.parent_id,
domain_id: item.domain_id,
id: item.id,
description: item.description,
}
}

Expand All @@ -86,6 +88,7 @@ export default class List extends React.Component {
}

renderHierarchy = (projects) => {
//console.log("projects", projects)
const searchMode = this.state.searchTerm && this.state.searchTerm.length > 0

return projects.map((project, index) => {
Expand All @@ -102,6 +105,9 @@ export default class List extends React.Component {
searchMode &&
this.state.searchTerm &&
project.name
.toLowerCase()
.indexOf(this.state.searchTerm.toLowerCase()) < 0 &&
project.description
.toLowerCase()
.indexOf(this.state.searchTerm.toLowerCase()) < 0
) {
Expand All @@ -123,9 +129,13 @@ export default class List extends React.Component {
<a
href={`/${project.domain_id}/${project.id}/home`}
className={labelClass}
title={project.description}
>
{project.name}
</a>
<span className="info-text small" style={{ paddingLeft: "5px" }}>
{project.description}
</span>
{hasChildren && children.length > 0 && <ul>{children}</ul>}
</li>
)
Expand Down Expand Up @@ -169,7 +179,7 @@ export default class List extends React.Component {
onChange={this.updateSearchTerm}
value={this.state.searchTerm || ""}
className="form-control"
placeholder="Search project name"
placeholder="Search name or description"
/>

{this.state.searchTerm && this.state.searchTerm.length > 0 && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { Modal, Button, Tabs, Tab } from "react-bootstrap"
import { Modal, Button } from "react-bootstrap"
import List from "./list"

const ModalAuth = (props) => (
Expand Down
22 changes: 8 additions & 14 deletions plugins/identity/app/views/identity/domains/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@
%li
= link_to 'Find by Child Objects', plugin('lookup').reverselookup_index_path, data: {modal: true}

.col-md-3
%h4.heading-top
= @scoped_domain_name
Actions

%h5
%i.inquiry-icon
Requests
Expand All @@ -124,17 +119,16 @@
= " (#{::Inquiry::Inquiry.requestor_requests_count(@scoped_domain_id, current_user.id)})"


- if current_user.is_allowed?('identity:project_request', domain_id: @scoped_domain_id) && plugin_available?(:identity)
%h5
%i.project-icon
Projects

%ul.plain-list
%li
= link_to 'Request a New Project', plugin('identity').projects_request_project_path(project_id: nil), data: {modal: true}
-# if current_user.is_allowed?('identity:project_request', domain_id: @scoped_domain_id) && plugin_available?(:identity)
%h5
%i.project-icon
Projects

%ul.plain-list
%li
= link_to 'Request a New Project', plugin('identity').projects_request_project_path(project_id: nil), data: {modal: true}

.col-md-3
.col-md-6
-# this is a placeholder for React Component!
%div{data: {react_auth_projects: true} }
%h4.action-heading.heading-top Your Projects
Expand Down

0 comments on commit 328f8c2

Please sign in to comment.