Move vendors in a dedicated package
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@probo/react-lazy": "^0.1.0",
|
||||
"@probo/vendors": "^0.0.1",
|
||||
"@radix-ui/colors": "^3.0.0",
|
||||
"@radix-ui/react-avatar": "^1.1.3",
|
||||
"@radix-ui/react-checkbox": "^1.0.4",
|
||||
|
||||
24
apps/console/public/data/vendors/LICENSE.md
vendored
24
apps/console/public/data/vendors/LICENSE.md
vendored
@@ -1,24 +0,0 @@
|
||||
# Vendors Data
|
||||
|
||||
The [vendors.json](vendors.json) file contains data about various vendors and their security certifications. This data is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.
|
||||
|
||||
## License Requirements
|
||||
|
||||
When using this data, you must:
|
||||
|
||||
1. **Give appropriate credit** - Provide attribution to Probo Inc. and include a link to this license
|
||||
2. **Indicate if changes were made** - If you modify the data, you must indicate that changes were made
|
||||
3. **Share under the same license** - If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original
|
||||
|
||||
## Attribution Example
|
||||
|
||||
When using this data, please include the following attribution:
|
||||
|
||||
```
|
||||
Data sourced from Probo Inc. (https://www.getprobo.com) under CC BY-SA 4.0 license
|
||||
```
|
||||
|
||||
## More Information
|
||||
|
||||
For more information about the CC BY-SA 4.0 license, please visit:
|
||||
https://creativecommons.org/licenses/by-sa/4.0/
|
||||
2292
apps/console/public/data/vendors/vendors.json
vendored
2292
apps/console/public/data/vendors/vendors.json
vendored
File diff suppressed because it is too large
Load Diff
@@ -29,24 +29,7 @@ import {
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
|
||||
interface VendorData {
|
||||
name: string;
|
||||
headquarterAddress: string;
|
||||
legalName: string;
|
||||
websiteUrl: string;
|
||||
privacyPolicyUrl: string;
|
||||
serviceLevelAgreementUrl?: string;
|
||||
category: string;
|
||||
dataProcessingAgreementUrl?: string;
|
||||
description: string;
|
||||
categories: string[];
|
||||
certifications: string[];
|
||||
securityPageUrl?: string;
|
||||
trustPageUrl?: string;
|
||||
statusPageUrl?: string;
|
||||
termsOfServiceUrl?: string;
|
||||
}
|
||||
import { Vendor, Vendors } from "@probo/vendors";
|
||||
|
||||
const ITEMS_PER_PAGE = 25;
|
||||
|
||||
@@ -214,8 +197,8 @@ function ListVendorContent({
|
||||
const [, startTransition] = useTransition();
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const [showAddVendorDropdown, setShowAddVendorDropdown] = useState(false);
|
||||
const [filteredVendors, setFilteredVendors] = useState<VendorData[]>([]);
|
||||
const [vendorsData, setVendorsData] = useState<VendorData[]>([]);
|
||||
const [filteredVendors, setFilteredVendors] = useState<Vendors>([]);
|
||||
const [vendorsData, setVendorsData] = useState<Vendors>([]);
|
||||
const [isLoadingVendors, setIsLoadingVendors] = useState(false);
|
||||
const [createVendor] =
|
||||
useMutation<ListVendorViewCreateVendorMutation>(createVendorMutation);
|
||||
@@ -227,12 +210,8 @@ function ListVendorContent({
|
||||
const loadVendorsData = async () => {
|
||||
try {
|
||||
setIsLoadingVendors(true);
|
||||
const response = await fetch("/data/vendors/vendors.json");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to load vendors data");
|
||||
}
|
||||
const data = await response.json();
|
||||
setVendorsData(data);
|
||||
const { default: vendors } = await import("@probo/vendors");
|
||||
setVendorsData(vendors);
|
||||
} catch (error) {
|
||||
console.error("Error loading vendors data:", error);
|
||||
toast({
|
||||
@@ -265,7 +244,7 @@ function ListVendorContent({
|
||||
vendorsConnection.vendors.edges.map((edge) => edge.node) ?? [];
|
||||
const pageInfo = vendorsConnection.vendors.pageInfo;
|
||||
|
||||
const fuse = new Fuse<VendorData>(vendorsData, {
|
||||
const fuse = new Fuse<Vendor>(vendorsData, {
|
||||
keys: ["name"],
|
||||
threshold: 0.3,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user