Skip to content

Commit

Permalink
Merge branch 'master' into enhancement/flow-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kurund authored Nov 25, 2024
2 parents 8b837b8 + 5a3b2b6 commit 2e26163
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 35 deletions.
5 changes: 2 additions & 3 deletions src/common/HelpData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export const triggerInfo: HelpDataProps = {
};

export const searchInfo: HelpDataProps = {
heading:
'Glific provides search functionality to NGO staff to find contacts from a large set of contacts list.',
heading: 'Glific provides search functionality to NGO staff to find contacts from a large set of contacts list.',

link: 'https://glific.github.io/docs/docs/Product%20Features/Searches',
};
Expand Down Expand Up @@ -105,5 +104,5 @@ export const blockedContactsInfo: HelpDataProps = {
export const assistantsInfo: HelpDataProps = {
heading:
'Assistants can call OpenAI’s models with specific instructions to tune their personality and capabilities. Assistants can access multiple tools in parallel. Assistants can access files in several formats as part of their creation. When using tools, Assistants can also create files (e.g., images, spreadsheets, etc) and cite files they reference in the Messages they create.',
link: 'https://glific.github.io/docs/docs/Product%20Features/Flows/Flow%20Variables/Flow%20variables%20vs%20Contact%20variables', // Replace with the actual Glific documentation link
link: 'https://glific.github.io/docs/docs/Integrations/RAG%20using%20OpenAI%20file%20search%20assistant', // Replace with the actual Glific documentation link
};
18 changes: 9 additions & 9 deletions src/config/menu.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { organizationHasDynamicRole } from 'common/utils';
import { ANALYTICS_URL, GLIFIC_DOCS_URL, NEW_UI_BLOG } from 'config';
import { ANALYTICS_URL, GLIFIC_DOCS_URL } from 'config';
import { getOrganizationServices } from 'services/AuthService';

const allRoles = ['Staff', 'Manager', 'Admin', 'Dynamic', 'Glific_admin'];
Expand Down Expand Up @@ -279,14 +279,14 @@ const menus = (): Menu[] => [
roles: staffLevel,
},

{
title: "What's new",
path: '/changelog',
url: NEW_UI_BLOG,
icon: 'new',
type: 'sideDrawer',
roles: staffLevel,
},
// {
// title: "What's new",
// path: '/changelog',
// url: NEW_UI_BLOG,
// icon: 'new',
// type: 'sideDrawer',
// roles: staffLevel,
// },
];

export const getMenus = (menuType = 'sideDrawer', role = 'Staff') =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ interface AssistantOptionsProps {

const temperatureInfo =
'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive.';

const filesInfo =
'Enables the assistant with knowledge from files that you or your users upload. Once a file is uploaded, the assistant automatically decides when to retrieve content based on user requests.';
export const AssistantOptions = ({ currentId, options, setOptions }: AssistantOptionsProps) => {
const [showUploadDialog, setShowUploadDialog] = useState(false);
const [files, setFiles] = useState<any[]>([]);
Expand Down Expand Up @@ -171,6 +172,11 @@ export const AssistantOptions = ({ currentId, options, setOptions }: AssistantOp
<div className={styles.FilesHeader}>
<Typography variant="subtitle2" className={styles.Label} data-testid="inputLabel">
Files
<HelpIcon
helpData={{
heading: filesInfo,
}}
/>
</Typography>
<Button data-testid="addFiles" onClick={() => setShowUploadDialog(true)} variant="outlined">
<AddIcon />
Expand Down
1 change: 1 addition & 0 deletions src/containers/Organization/Onboarding/Form.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ test('it should submit the form', async () => {
});

fireEvent.click(screen.getByText('I Agree'));
fireEvent.click(checkboxes[1]);

fireEvent.click(getByTestId('submitActionButton'));

Expand Down
29 changes: 7 additions & 22 deletions src/containers/Organization/Onboarding/FormLayout/FormLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,7 @@ export const FormLayout = ({

useEffect(() => {
if (handleEffect) handleEffect(identifier, formik);
}, [
formik.touched?.name,
formik.values.name,
formik.values.registered_address,
formik.values.same_address,
]);
}, [formik.touched?.name, formik.values.name, formik.values.registered_address, formik.values.same_address]);

const header = (
<div className={styles.Header}>
Expand Down Expand Up @@ -123,23 +118,15 @@ export const FormLayout = ({
if (field.children) {
return (
<div className={styles.FormSection} key={key}>
<Typography
data-testid="formLabel"
variant="h5"
className={styles.SectionHeading}
>
<Typography data-testid="formLabel" variant="h5" className={styles.SectionHeading}>
{field.label}
</Typography>
<div className={styles.FormFields}>
{field.children.map((child: any, i: number) => {
return (
<div className={child.additionalStyles} key={i}>
{child.label && (
<Typography
data-testid="formLabel"
variant="h5"
className={styles.FieldLabel}
>
<Typography data-testid="formLabel" variant="h5" className={styles.FieldLabel}>
{child.label}
</Typography>
)}
Expand All @@ -161,9 +148,7 @@ export const FormLayout = ({
)}

<Field key={key} {...field} onSubmit={formik.submitForm} />
{field.fieldEndAdornment &&
field.fieldEndAdornment.show &&
field.fieldEndAdornment.component(formik)}
{field.fieldEndAdornment && field.fieldEndAdornment.show && field.fieldEndAdornment.component(formik)}
</div>
);
})}
Expand All @@ -176,6 +161,8 @@ export const FormLayout = ({
variant="outlined"
color="primary"
onClick={() => {
const values = setPayload(formik.values);
saveData(values, identifier);
handleStepChange(false);
}}
className={styles.Button}
Expand Down Expand Up @@ -235,9 +222,7 @@ export const FormLayout = ({
buttonOkLoading={loading}
>
<div className={styles.Modal}>
<p>
You wont be able to make changes to this page once confirmed. Do you want to go ahead?
</p>
<p>You wont be able to make changes to this page once confirmed. Do you want to go ahead?</p>
{loading && <p className={styles.Wait}>Please wait, this might take a few seconds.</p>}
</div>
</DialogBox>
Expand Down

0 comments on commit 2e26163

Please sign in to comment.