From 328f8c243360cbeed2337a80ba4d3d3c1500b2ee Mon Sep 17 00:00:00 2001 From: Hans-Georg Winkler Date: Wed, 31 Jul 2024 10:19:24 +0200 Subject: [PATCH] deat(Domain): better reading for project list and description (#1391) * new view for domain landing page with project description --- .../widgets/auth_projects/components/list.jsx | 12 +++++++++- .../auth_projects/components/modal.jsx | 2 +- .../app/views/identity/domains/show.html.haml | 22 +++++++------------ 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/plugins/identity/app/javascript/widgets/auth_projects/components/list.jsx b/plugins/identity/app/javascript/widgets/auth_projects/components/list.jsx index 852e1ac117..4cc0c13359 100644 --- a/plugins/identity/app/javascript/widgets/auth_projects/components/list.jsx +++ b/plugins/identity/app/javascript/widgets/auth_projects/components/list.jsx @@ -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 }) } @@ -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, } } @@ -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) => { @@ -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 ) { @@ -123,9 +129,13 @@ export default class List extends React.Component { {project.name} + + {project.description} + {hasChildren && children.length > 0 && } ) @@ -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 && ( diff --git a/plugins/identity/app/javascript/widgets/auth_projects/components/modal.jsx b/plugins/identity/app/javascript/widgets/auth_projects/components/modal.jsx index 1751b7c822..95a571cab1 100644 --- a/plugins/identity/app/javascript/widgets/auth_projects/components/modal.jsx +++ b/plugins/identity/app/javascript/widgets/auth_projects/components/modal.jsx @@ -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) => ( diff --git a/plugins/identity/app/views/identity/domains/show.html.haml b/plugins/identity/app/views/identity/domains/show.html.haml index fd0c05d1b2..64bd539215 100644 --- a/plugins/identity/app/views/identity/domains/show.html.haml +++ b/plugins/identity/app/views/identity/domains/show.html.haml @@ -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 @@ -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