IO-951 IO-924 Phonebook fixes

This commit is contained in:
Patrick Fic
2021-04-27 09:32:54 -07:00
parent e99a5f5338
commit 31ce47796a
12 changed files with 136 additions and 0 deletions

View File

@@ -137,6 +137,28 @@ export default function GlobalSearch() {
};
}),
},
{
label: renderTitle(t("menus.header.search.phonebook")),
options: data.search_phonebook.map((pb) => {
return {
key: pb.id,
value: `${pb.firstname || ""} ${pb.lastname || ""} ${
pb.company || ""
}`,
label: (
<Link to={`/manage/phonebook?phonebookentry=${pb.id}`}>
<Space wrap split={<Divider type="vertical" />}>
<span>{`${pb.firstname || ""} ${pb.lastname || ""} ${
pb.company || ""
}`}</span>
<PhoneNumberFormatter>{pb.phone1}</PhoneNumberFormatter>
<span>{pb.email}</span>
</Space>
</Link>
),
};
}),
},
]
: [];

View File

@@ -55,6 +55,9 @@ export default function PhonebookFormComponent({
</Form.Item>
</LayoutFormRow>
<LayoutFormRow grow>
<Form.Item label={t("phonebook.fields.category")} name="category">
<Input />
</Form.Item>
<Form.Item label={t("phonebook.fields.street1")} name="street1">
<Input />
</Form.Item>

View File

@@ -52,5 +52,12 @@ export const GLOBAL_SEARCH_QUERY = gql`
name
}
}
search_phonebook(args: { search: $search }) {
id
firstname
lastname
company
phone1
}
}
`;

View File

@@ -76,6 +76,11 @@ export function PhonebookPageComponent({ bodyshop }) {
dataIndex: "company",
key: "company",
},
{
title: t("phonebook.fields.category"),
dataIndex: "category",
key: "category",
},
{
title: t("phonebook.fields.email"),
dataIndex: "email",

View File

@@ -1392,6 +1392,7 @@
"jobs": "Jobs",
"owners": "Owners",
"payments": "Payments",
"phonebook": "Phonebook",
"vehicles": "Vehicles"
},
"shiftclock": "Shift Clock",
@@ -1618,6 +1619,7 @@
"new": "New Phonebook Entry"
},
"fields": {
"category": "Category",
"city": "City",
"company": "Company",
"country": "Country",

View File

@@ -1392,6 +1392,7 @@
"jobs": "",
"owners": "",
"payments": "",
"phonebook": "",
"vehicles": ""
},
"shiftclock": "",
@@ -1618,6 +1619,7 @@
"new": ""
},
"fields": {
"category": "",
"city": "",
"company": "",
"country": "",

View File

@@ -1392,6 +1392,7 @@
"jobs": "",
"owners": "",
"payments": "",
"phonebook": "",
"vehicles": ""
},
"shiftclock": "",
@@ -1618,6 +1619,7 @@
"new": ""
},
"fields": {
"category": "",
"city": "",
"company": "",
"country": "",