🛒 feat: Implement Marketplace Permissions Management UI

- Added MarketplaceAdminSettings component for managing marketplace permissions.
- Updated roles.js to include marketplace permissions in the API.
- Refactored interface.js to streamline marketplace permissions handling.
- Enhanced Marketplace component to integrate admin settings.
- Updated localization files to include new marketplace-related keys.
- Added new API endpoint for updating marketplace permissions in data-service.
This commit is contained in:
Danny Avila 2025-08-10 19:01:10 -04:00
parent a434d28579
commit d07c2b3475
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
10 changed files with 297 additions and 29 deletions

View file

@ -278,6 +278,9 @@ export const updateAgentPermissions = (roleName: string) => `${getRole(roleName)
export const updatePeoplePickerPermissions = (roleName: string) =>
`${getRole(roleName)}/people-picker`;
export const updateMarketplacePermissions = (roleName: string) =>
`${getRole(roleName)}/marketplace`;
/* Conversation Tags */
export const conversationTags = (tag?: string) =>
`/api/tags${tag != null && tag ? `/${encodeURIComponent(tag)}` : ''}`;

View file

@ -541,16 +541,7 @@ export const interfaceSchema = z
.optional(),
marketplace: z
.object({
admin: z
.object({
use: z.boolean().optional(),
})
.optional(),
user: z
.object({
use: z.boolean().optional(),
})
.optional(),
use: z.boolean().optional(),
})
.optional(),
fileSearch: z.boolean().optional(),
@ -576,12 +567,7 @@ export const interfaceSchema = z
roles: true,
},
marketplace: {
admin: {
use: false,
},
user: {
use: false,
},
use: false,
},
fileSearch: true,
fileCitations: true,

View file

@ -800,6 +800,12 @@ export function updatePeoplePickerPermissions(
);
}
export function updateMarketplacePermissions(
variables: m.UpdateMarketplacePermVars,
): Promise<m.UpdatePermResponse> {
return request.put(endpoints.updateMarketplacePermissions(variables.roleName), variables.updates);
}
/* Tags */
export function getConversationTags(): Promise<t.TConversationTagsResponse> {
return request.get(endpoints.conversationTags());

View file

@ -305,6 +305,15 @@ export type UpdatePeoplePickerPermOptions = MutationOptions<
types.TError | null | undefined
>;
export type UpdateMarketplacePermVars = UpdatePermVars<p.TMarketplacePermissions>;
export type UpdateMarketplacePermOptions = MutationOptions<
UpdatePermResponse,
UpdateMarketplacePermVars,
unknown,
types.TError | null | undefined
>;
export type UpdateConversationTagOptions = MutationOptions<
types.TConversationTag,
types.TConversationTagRequest