Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hierarchical locations #4794

Merged
merged 18 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7ae44e3
AB#1085 Add locationRelationships
gjvoosten May 23, 2024
40f948c
AB#1085 Add recursive location search for locations
gjvoosten May 27, 2024
95dcdba
AB#1085 Add recursive location search for reports
gjvoosten May 27, 2024
11d7642
AB#1085 Add recursive location search for organizations
gjvoosten May 27, 2024
3cd13da
AB#1085 Add recursive location search for positions
gjvoosten May 27, 2024
c2fc91e
AB#1085 Add recursive location search for people
gjvoosten May 27, 2024
a610a80
Replace triple-dots in strings with proper ellipsis character
gjvoosten May 27, 2024
66f46bb
AB#1085 Allow any response size during testing
gjvoosten May 27, 2024
b2c40e0
AB#1085 Improve message when no locations/organizations are selected …
gjvoosten May 28, 2024
f0f40b3
AB#1085 Refactor loop detection code
gjvoosten May 28, 2024
08a2bfa
AB#1085 Add loop detection when updating locations
gjvoosten May 28, 2024
a1aaade
AB#1085 Add parentLocations to location merge
gjvoosten May 29, 2024
1866b02
Fix approvalSteps merge when merging locations
gjvoosten May 29, 2024
7d96916
AB#1085 Extend wdio tests for location merge
gjvoosten May 29, 2024
0a89da9
AB#1110 Add alpha-2 and alpha-3 codes to location merge
Chessray Jun 6, 2024
7db764c
AB#1083 Clear out alpha-2 and alpha-3 codes when saving a non-country…
gjvoosten Jun 11, 2024
f68af0f
AB#1110 Add wdio tests for alpha-2 and alpha-3 codes in location merge
gjvoosten Jun 11, 2024
02dc6e1
AB#1111 Optionally hide the map for location and position merge
gjvoosten Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const OrganizationAdvisorsTable = ({
function filterRows(rows, filterText) {
const nothingFound = (
<tr className="nothing-found">
<td colSpan="8">No organizations found...</td>
<td colSpan="8">No organizations found</td>
</tr>
)
const filterResult = rows.filter(element => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/AdvisorReports/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Toolbar = ({ onFilterTextInput, onExportButtonClick }) => (
className="form-control"
id="advisorSearch"
type="text"
placeholder="Search organizations..."
placeholder="Search organizations"
onChange={e => onFilterTextInput(e.target.value)}
/>
</div>
Expand Down
6 changes: 5 additions & 1 deletion client/src/components/ApprovalSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ function ApprovalSteps({ approvalSteps }) {
return (
<tr key={pos.uuid}>
<td>
<LinkTo modelType="Person" model={pos.person} />
<LinkTo
modelType="Person"
model={pos.person}
whenUnspecified="Unfilled"
/>
</td>
<td>
<LinkTo modelType="Position" model={pos} />
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/EditAssociatedPositionsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const EditAssociatedPositionsModal = ({
widget={
<AdvancedMultiSelect
fieldName="associatedPositions"
placeholder={`Search for a ${assignedRole} position...`}
placeholder={`Search for a ${assignedRole} position`}
value={values.associatedPositions}
renderSelected={
<AssociatedPositionsTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const EditOrganizationsAdministratedModal = ({
organizations={
values.organizationsAdministrated || []
}
noOrganizationsMessage="No organizations selected"
showDelete
/>
}
Expand Down
10 changes: 7 additions & 3 deletions client/src/components/Leaflet.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ import MARKER_ICON from "resources/leaflet/marker-icon.png"
import MARKER_SHADOW from "resources/leaflet/marker-shadow.png"
import Settings from "settings"

export const DEFAULT_MAP_STYLE = {
width: "100%",
height: "500px",
marginBottom: "18px"
}

const css = {
zIndex: 1
}
Expand Down Expand Up @@ -289,9 +295,7 @@ Leaflet.propTypes = {
onMapClick: PropTypes.func
}
Leaflet.defaultProps = {
width: "100%",
height: "500px",
marginBottom: "18px"
...DEFAULT_MAP_STYLE
}

export default Leaflet
18 changes: 17 additions & 1 deletion client/src/components/LocationTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
PageDispatchersPropType,
useBoilerplate
} from "components/Page"
import RemoveButton from "components/RemoveButton"
import UltimatePaginationTopDown from "components/UltimatePaginationTopDown"
import _get from "lodash/get"
import { Location } from "models"
Expand Down Expand Up @@ -91,13 +92,14 @@ const BaseLocationTable = ({
showDelete,
onDelete,
locations,
noLocationsMessage,
pageSize,
pageNum,
totalCount,
goToPage
}) => {
if (_get(locations, "length", 0) === 0) {
return <em>No locations found</em>
return <em>{noLocationsMessage}</em>
}

return (
Expand All @@ -115,6 +117,7 @@ const BaseLocationTable = ({
<tr>
<th>Name</th>
<th>Type</th>
{showDelete && <th />}
</tr>
</thead>
<tbody>
Expand All @@ -124,6 +127,14 @@ const BaseLocationTable = ({
<LinkTo modelType="Location" model={loc} />
</td>
<td>{Location.humanNameOfType(loc.type)}</td>
{showDelete && (
<td id={"locationDelete_" + loc.uuid}>
<RemoveButton
title="Remove location"
onClick={() => onDelete(loc)}
/>
</td>
)}
</tr>
))}
</tbody>
Expand All @@ -139,11 +150,16 @@ BaseLocationTable.propTypes = {
onDelete: PropTypes.func,
// list of locations:
locations: PropTypes.array.isRequired,
noLocationsMessage: PropTypes.string,
// fill these when pagination wanted:
totalCount: PropTypes.number,
pageNum: PropTypes.number,
pageSize: PropTypes.number,
goToPage: PropTypes.func
}

BaseLocationTable.defaultProps = {
noLocationsMessage: "No locations found"
}

export default connect(null, mapPageDispatchersToProps)(LocationTable)
8 changes: 7 additions & 1 deletion client/src/components/OrganizationTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const BaseOrganizationTable = ({
showDelete,
onDelete,
organizations,
noOrganizationsMessage,
pageSize,
pageNum,
totalCount,
Expand All @@ -107,7 +108,7 @@ const BaseOrganizationTable = ({
toggleSelection
}) => {
if (_get(organizations, "length", 0) === 0) {
return <em>No organizations found</em>
return <em>{noOrganizationsMessage}</em>
}

return (
Expand Down Expand Up @@ -190,6 +191,7 @@ BaseOrganizationTable.propTypes = {
onDelete: PropTypes.func,
// list of organizations:
organizations: PropTypes.array,
noOrganizationsMessage: PropTypes.string,
// fill these when pagination wanted:
totalCount: PropTypes.number,
pageNum: PropTypes.number,
Expand All @@ -204,4 +206,8 @@ BaseOrganizationTable.propTypes = {
toggleSelection: PropTypes.func
}

BaseOrganizationTable.defaultProps = {
noOrganizationsMessage: "No organizations found"
}

export default connect(null, mapPageDispatchersToProps)(OrganizationTable)
2 changes: 1 addition & 1 deletion client/src/components/PlanningConflictForPerson.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const BasePlanningConflictForPerson = ({ person, report, iconOnly }) => {

if (loading) {
return (
<Tooltip content="Checking for planning conflicts...">
<Tooltip content="Checking for planning conflicts">
<Spinner intent={Intent.WARNING} size={20} />
</Tooltip>
)
Expand Down
Loading
Loading