feat(downloads): add option to limit amount of items (#3205)
This commit is contained in:
@@ -87,6 +87,7 @@ export default function DownloadClientsWidget({
|
||||
const [currentItems] = clientApi.widget.downloads.getJobsAndStatuses.useSuspenseQuery(
|
||||
{
|
||||
integrationIds,
|
||||
limitPerIntegration: options.limitPerIntegration,
|
||||
},
|
||||
{
|
||||
refetchOnMount: false,
|
||||
@@ -126,6 +127,7 @@ export default function DownloadClientsWidget({
|
||||
clientApi.widget.downloads.subscribeToJobsAndStatuses.useSubscription(
|
||||
{
|
||||
integrationIds,
|
||||
limitPerIntegration: options.limitPerIntegration,
|
||||
},
|
||||
{
|
||||
onData: (data) => {
|
||||
|
||||
@@ -82,6 +82,11 @@ export const { definition, componentLoader } = createWidgetDefinition("downloads
|
||||
applyFilterToRatio: factory.switch({
|
||||
defaultValue: true,
|
||||
}),
|
||||
limitPerIntegration: factory.number({
|
||||
defaultValue: 50,
|
||||
validate: z.number().min(1),
|
||||
withDescription: true,
|
||||
}),
|
||||
}),
|
||||
{
|
||||
defaultSort: {
|
||||
|
||||
@@ -43,7 +43,7 @@ interface SelectInput<TOptions extends readonly SelectOption[]>
|
||||
searchable?: boolean;
|
||||
}
|
||||
|
||||
interface NumberInput extends CommonInput<number | ""> {
|
||||
interface NumberInput extends CommonInput<number> {
|
||||
validate: z.ZodNumber;
|
||||
step?: number;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ const optionsFactory = {
|
||||
}),
|
||||
number: (input: NumberInput) => ({
|
||||
type: "number" as const,
|
||||
defaultValue: input.defaultValue ?? ("" as const),
|
||||
defaultValue: input.defaultValue ?? 0,
|
||||
step: input.step,
|
||||
withDescription: input.withDescription ?? false,
|
||||
validate: input.validate,
|
||||
|
||||
@@ -55,7 +55,7 @@ export default function RssFeed({ options }: WidgetComponentProps<"rssFeed">) {
|
||||
dir={languageDir}
|
||||
c="dimmed"
|
||||
size="sm"
|
||||
lineClamp={options.textLinesClamp as number}
|
||||
lineClamp={options.textLinesClamp}
|
||||
dangerouslySetInnerHTML={{ __html: feedEntry.description }}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user