mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-30 15:18:50 +01:00
⚖️ feat: Terms and Conditions Dialog (#3712)
* Added UI for Terms and Conditions Modal Dialogue * Handled the logout on not accepting * Added logic for terms acceptance * Add terms and conditions modal * Fixed bug on terms and conditions modal, clicking out of it won't close it now * Added acceptance of Terms to Database * Removed unnecessary api endpoints from index.js * Added NPM script to reset terms acceptance * Added translations, markdown terms and samples * Merged terms and conditions modal feature * feat/Modal Terms and Conditions Dialog * Amendments as requested by maintainers * Reset package-lock (again)
This commit is contained in:
parent
79f9cd5a4d
commit
618be4bf2b
35 changed files with 393 additions and 8 deletions
|
|
@ -202,3 +202,6 @@ export const conversationTagsList = (pageNumber: string, sort?: string, order?:
|
|||
|
||||
export const addTagToConversation = (conversationId: string) =>
|
||||
`${conversationTags()}/convo/${conversationId}`;
|
||||
|
||||
export const userTerms = () => '/api/user/terms';
|
||||
export const acceptUserTerms = () => '/api/user/terms/accept';
|
||||
|
|
|
|||
|
|
@ -407,6 +407,9 @@ export const configSchema = z.object({
|
|||
.object({
|
||||
externalUrl: z.string().optional(),
|
||||
openNewTab: z.boolean().optional(),
|
||||
modalAcceptance: z.boolean().optional(),
|
||||
modalTitle: z.string().optional(),
|
||||
modalContent: z.string().or(z.array(z.string())).optional(),
|
||||
})
|
||||
.optional(),
|
||||
endpointsMenu: z.boolean().optional(),
|
||||
|
|
|
|||
|
|
@ -581,3 +581,11 @@ export function rebuildConversationTags(): Promise<t.TConversationTagsResponse>
|
|||
export function healthCheck(): Promise<string> {
|
||||
return request.get(endpoints.health());
|
||||
}
|
||||
|
||||
export function getUserTerms(): Promise<t.TUserTermsResponse> {
|
||||
return request.get(endpoints.userTerms());
|
||||
}
|
||||
|
||||
export function acceptTerms(): Promise<t.TAcceptTermsResponse> {
|
||||
return request.post(endpoints.acceptUserTerms());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ export enum QueryKeys {
|
|||
roles = 'roles',
|
||||
conversationTags = 'conversationTags',
|
||||
health = 'health',
|
||||
userTerms = 'userTerms',
|
||||
}
|
||||
|
||||
export enum MutationKeys {
|
||||
|
|
|
|||
|
|
@ -299,6 +299,9 @@ export type TInterfaceConfig = {
|
|||
termsOfService?: {
|
||||
externalUrl?: string;
|
||||
openNewTab?: boolean;
|
||||
modalAcceptance?: boolean;
|
||||
modalTitle?: string;
|
||||
modalContent?: string;
|
||||
};
|
||||
endpointsMenu: boolean;
|
||||
modelSelect: boolean;
|
||||
|
|
@ -495,3 +498,11 @@ export type TGetRandomPromptsRequest = {
|
|||
};
|
||||
|
||||
export type TCustomConfigSpeechResponse = { [key: string]: string };
|
||||
|
||||
export type TUserTermsResponse = {
|
||||
termsAccepted: boolean;
|
||||
};
|
||||
|
||||
export type TAcceptTermsResponse = {
|
||||
success: boolean;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue