+
Review Package
+
+
+ Changes might take several minutes to show publicly! Info shown below
+ is always up to date.
+
+
+
Review status
+
+ {reviewStatus}
+
+
+
+
+ Reject reason (saved on reject)
+
+
setRejectionReason(e.target.value)}
+ placeholder="Invalid submission"
+ csSize="textarea"
+ rootClasses="review-package__textarea"
+ />
+
+
+
Internal notes
+
setInternalNotes(e.target.value)}
+ placeholder=".exe requires manual review"
+ csSize="textarea"
+ rootClasses="review-package__textarea"
+ />
+
+
+
+
+ rejectPackageAction({
+ config: config,
+ params: {
+ community: communityId,
+ namespace: namespaceId,
+ package: packageId,
},
- {
- itemProps: {
- primitiveType: "cyberstormLink",
- linkId: "PackageChangelog",
- community: listing.community_identifier,
- namespace: listing.namespace,
- package: listing.name,
- "aria-current": currentTab === "changelog",
- children: <>Changelog>,
- disabled: !listing.has_changelog,
- } as React.ComponentPropsWithRef,
- current: currentTab === "changelog",
- key: "changelog",
+ queryParams: {},
+ data: {
+ rejection_reason: rejectionReason,
+ internal_notes: internalNotes ? internalNotes : null,
},
- {
- itemProps: {
- primitiveType: "cyberstormLink",
- linkId: "PackageVersions",
- community: listing.community_identifier,
- namespace: listing.namespace,
- package: listing.name,
- "aria-current": currentTab === "versions",
- children: <>Versions>,
- } as React.ComponentPropsWithRef,
- current: currentTab === "versions",
- key: "versions",
- // TODO: Version count field needs to be added to the endpoint
- // numberSlateValue: listing.versionCount,
+ })
+ }
+ >
+ Reject
+
+
+ approvePackageAction({
+ config: config,
+ params: {
+ community: communityId,
+ namespace: namespaceId,
+ package: packageId,
},
- // TODO: Once Analysis page is ready, enable it
- // {
- // itemProps: {
- // key: "source",
- // primitiveType: "cyberstormLink",
- // linkId: "PackageSource",
- // community: listing.community_identifier,
- // namespace: listing.namespace,
- // package: listing.name,
- // "aria-current": currentTab === "source",
- // children: <>Analysis>,
- // },
- // current: currentTab === "source",
- // },
- {
- itemProps: {
- href: `${domain}/c/${listing.community_identifier}/p/${listing.namespace}/${listing.name}/source`,
- primitiveType: "link",
- "aria-current": currentTab === "source",
- children: (
- <>
- Analysis{" "}
-
-
-
- >
- ),
- } as React.ComponentPropsWithRef,
- current: currentTab === "source",
- key: "source",
+ queryParams: {},
+ data: {
+ internal_notes: internalNotes ? internalNotes : null,
},
- ]}
- renderTabItem={(key, itemProps, numberSlate) => {
- const { children, ...fItemProps } =
- itemProps as React.ComponentPropsWithRef;
- return (
-
- {children}
- {numberSlate}
-
- );
+ })
+ }
+ >
+ Approve
+
+
+
+ );
+}
+
+ReviewPackageForm.displayName = "ReviewPackageForm";
+
+const reportOptions: SelectOption<
+ | "Spam"
+ | "Malware"
+ | "Reupload"
+ | "CopyrightOrLicense"
+ | "WrongCommunity"
+ | "WrongCategories"
+ | "Other"
+>[] = [
+ { value: "Spam", label: "Spam" },
+ { value: "Malware", label: "Malware" },
+ { value: "Reupload", label: "Reupload" },
+ { value: "CopyrightOrLicense", label: "Copyright Or License" },
+ { value: "WrongCommunity", label: "Wrong Community" },
+ { value: "WrongCategories", label: "Wrong Categories" },
+ { value: "Other", label: "Other" },
+];
+
+function ReportPackageForm(props: {
+ // communityId: string;
+ // namespaceId: string;
+ // packageId: string;
+ id: string;
+ config: () => RequestConfig;
+ toast: ReturnType