Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added log to refresj token on test server #684

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion frontend/app/src/people/utils/TokenRefresh.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ function TokenRefresh() {

useEffect(() => {
timeout = setTimeout(async () => {
if (ui.meInfo) {
if (ui.meInfo, ui.meInfo?.tribe_jwt) {
const res = await main.refreshJwt();

console.log("Refresh Token ==", res, res.jwt);

if (res && res.jwt) {
ui.setMeInfo({ ...ui.meInfo, tribe_jwt: res.jwt });
} else {
Expand Down
6 changes: 3 additions & 3 deletions frontend/app/src/people/widgetViews/OrganizationDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ const OrganizationDetails = (props: { close: () => void; org: Organization | und
const getOrganizationBudget = useCallback(async () => {
const organizationBudget = await main.getOrganizationBudget(uuid);
setOrgBudget(organizationBudget.total_budget);
}, [main]);
}, [main, uuid]);

const getPaymentsHistory = useCallback(async () => {
const paymentHistories = await main.getPaymentHistories(uuid);
Expand Down Expand Up @@ -545,8 +545,8 @@ const OrganizationDetails = (props: { close: () => void; org: Organization | und
style={
item.name === 'github_description' && !values.ticket_url
? {
display: 'none'
}
display: 'none'
}
: undefined
}
/>
Expand Down
105 changes: 52 additions & 53 deletions frontend/app/src/people/widgetViews/OrganizationView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,60 +211,59 @@ const Organizations = () => {
setFieldValue,
errors,
initialValues
}: any) => {
return (
<Wrap newDesign={true}>
<h5>Add new organization</h5>
<div className="SchemaInnerContainer">
{schema.length &&
schema.map((item: FormField) => (
<Input
{...item}
key={item.name}
values={values}
errors={errors}
value={values[item.name]}
error={errors[item.name]}
initialValues={initialValues}
deleteErrors={() => {
if (errors[item.name]) delete errors[item.name];
}}
handleChange={(e: any) => {
setFieldValue(item.name, e);
}}
setFieldValue={(e: any, f: any) => {
setFieldValue(e, f);
}}
setFieldTouched={setFieldTouched}
handleBlur={() => setFieldTouched(item.name, false)}
handleFocus={() => setFieldTouched(item.name, true)}
setDisableFormButtons={setDisableFormButtons}
borderType={'bottom'}
imageIcon={true}
style={
item.name === 'github_description' && !values.ticket_url
? {
display: 'none'
}
: undefined
}
/>
))}
}: any) => (
<Wrap newDesign={true}>
<h5>Add new organization</h5>
<div className="SchemaInnerContainer">
{schema.length &&
schema.map((item: FormField) => (
<Input
{...item}
key={item.name}
values={values}
errors={errors}
value={values[item.name]}
error={errors[item.name]}
initialValues={initialValues}
deleteErrors={() => {
if (errors[item.name]) delete errors[item.name];
}}
handleChange={(e: any) => {
setFieldValue(item.name, e);
}}
setFieldValue={(e: any, f: any) => {
setFieldValue(e, f);
}}
setFieldTouched={setFieldTouched}
handleBlur={() => setFieldTouched(item.name, false)}
handleFocus={() => setFieldTouched(item.name, true)}
setDisableFormButtons={setDisableFormButtons}
borderType={'bottom'}
imageIcon={true}
style={
item.name === 'github_description' && !values.ticket_url
? {
display: 'none'
}
: undefined
}
/>
))}

<Button
disabled={disableFormButtons || loading}
onClick={() => {
handleSubmit();
}}
loading={loading}
style={{ width: '100%' }}
color={'primary'}
text={'Add organization'}
/>
</div>
</Wrap>
);
}}
<Button
disabled={disableFormButtons || loading}
onClick={() => {
handleSubmit();
}}
loading={loading}
style={{ width: '100%' }}
color={'primary'}
text={'Add organization'}
/>
</div>
</Wrap>
)
}
</Formik>
</Modal>
)}
Expand Down
Loading