Merged in feature/IO-2604-vendor-tagging (pull request #2428)
IO-2604 Add vendor tags to search select & vendor edit screen. Approved-by: Dave Richer
This commit is contained in:
@@ -52,6 +52,7 @@ const VendorSearchSelect = ({ value, onChange, options, onSelect, disabled, pref
|
||||
>
|
||||
{label}
|
||||
</div>
|
||||
|
||||
{discount && discount !== 0 ? <Tag color="green">{`${discount * 100}%`}</Tag> : null}
|
||||
</div>
|
||||
);
|
||||
@@ -116,6 +117,11 @@ const VendorSearchSelect = ({ value, onChange, options, onSelect, disabled, pref
|
||||
{o.name}
|
||||
</div>
|
||||
<Space style={{ marginLeft: "1rem" }}>
|
||||
{o.tags?.map((tag, idx) => (
|
||||
<Tag key={idx} style={{ marginLeft: "0.5rem" }}>
|
||||
{tag}
|
||||
</Tag>
|
||||
))}
|
||||
{o.phone && showPhone && <PhoneNumberFormatter>{o.phone}</PhoneNumberFormatter>}
|
||||
{o.discount && o.discount !== 0 ? <Tag color="green">{`${o.discount * 100}%`}</Tag> : null}
|
||||
</Space>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { DeleteFilled } from "@ant-design/icons";
|
||||
import { useApolloClient } from "@apollo/client";
|
||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
||||
import { Button, Divider, Form, Input, InputNumber, Space, Switch } from "antd";
|
||||
import { Button, Divider, Form, Input, InputNumber, Select, Space, Switch } from "antd";
|
||||
import { PageHeader } from "@ant-design/pro-layout";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -179,6 +179,18 @@ export function VendorsFormComponent({
|
||||
}
|
||||
</LayoutFormRow>
|
||||
|
||||
<Form.Item
|
||||
name="tags"
|
||||
label={t("vendor.fields.tags")}
|
||||
rules={[
|
||||
{
|
||||
//message: t("general.validation.required"),
|
||||
type: "array"
|
||||
}
|
||||
]}
|
||||
>
|
||||
<Select mode="tags" />
|
||||
</Form.Item>
|
||||
{DmsAp.treatment === "on" && (
|
||||
<Form.Item label={t("vendors.fields.dmsid")} name="dmsid">
|
||||
<Input />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SyncOutlined } from "@ant-design/icons";
|
||||
import { Button, Card, Input, Space, Table } from "antd";
|
||||
import { Button, Card, Input, Space, Table, Tag } from "antd";
|
||||
import queryString from "query-string";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -38,6 +38,18 @@ export default function VendorsListComponent({ handleNewVendor, loading, handleO
|
||||
title: t("vendors.fields.city"),
|
||||
dataIndex: "city",
|
||||
key: "city"
|
||||
},
|
||||
{
|
||||
title: t("vendors.fields.tags"),
|
||||
dataIndex: "tags",
|
||||
key: "tags",
|
||||
render: (text, record) => (
|
||||
<Space>
|
||||
{record?.tags?.map((tag, idx) => (
|
||||
<Tag key={idx}>{tag}</Tag>
|
||||
))}
|
||||
</Space>
|
||||
)
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user