Skip to content

Commit

Permalink
Logo bugs (#1742)
Browse files Browse the repository at this point in the history
* client, organisation, reports logo not reflecting bug fixed

* empty logo case handled

---------

Co-authored-by: Shruti Apte <shruti@saeloun.com>
  • Loading branch information
Shruti-Apte and Shruti Apte authored Mar 21, 2024
1 parent 64f6723 commit 8ac6bf5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 28 deletions.
11 changes: 9 additions & 2 deletions app/javascript/src/apis/clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ import axios from "./api";

const path = "/clients";

const formHeaders = {
headers: {
"Content-Type": "multipart/form-data",
},
};

const get = async queryParam => axios.get(`${path}${queryParam}`);

const create = async payload => axios.post(`${path}`, payload);
const create = async payload => axios.post(`${path}`, payload, formHeaders);

const show = async (id, queryParam) => axios.get(`${path}/${id}${queryParam}`);

const update = async (id, payload) => axios.patch(`${path}/${id}`, payload);
const update = async (id, payload) =>
axios.patch(`${path}/${id}`, payload, formHeaders);

const destroy = async id => axios.delete(`${path}/${id}`);

Expand Down
11 changes: 9 additions & 2 deletions app/javascript/src/apis/companies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ const authApi = axios.create({
},
});

const formHeaders = {
headers: {
"Content-Type": "multipart/form-data",
},
};

const index = async () => axios.get(`${path}`);

const create = payload => authApi.post(path, payload);
const create = payload => authApi.post(path, payload, formHeaders);

const update = (id, payload) => axios.put(`${path}/${id}`, payload);
const update = (id, payload) =>
axios.put(`${path}/${id}`, payload, formHeaders);

const destroy = id => axios.delete(`${path}/${id}`);

Expand Down
52 changes: 28 additions & 24 deletions app/javascript/src/components/Reports/Container/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,33 +84,37 @@ const Container = ({ selectedFilter }: ContainerProps) => {
<Fragment>
{timeEntryReport.reports?.length > 0 ? (
getAlphabeticallySortedReportList(timeEntryReport.reports)?.map(
({ label, clientLogo, entries }, index) => (
<Fragment key={index}>
{label !== "" && (
<div className="flex items-center justify-between border-b border-miru-han-purple-1000 py-5">
<div className="flex items-center">
{getTableLogo(
selectedFilter?.groupBy?.value || null,
clientLogo
({ label, entries }, index) => {
const clientLogo = entries[0]?.clientLogo || "";

return (
<Fragment key={index}>
{label !== "" && (
<div className="flex items-center justify-between border-b border-miru-han-purple-1000 py-5">
<div className="flex items-center">
{getTableLogo(
selectedFilter?.groupBy?.value || null,
clientLogo
)}
<h1 className="font-manrope text-xl font-bold text-miru-han-purple-1000">
{label}
</h1>
</div>
{entries?.length > 0 && (
<p className="text-right font-manrope text-base font-medium text-miru-dark-purple-1000">
Total Hours for {label} : &nbsp;
{getTotalHoursLogged(entries)}
</p>
)}
<h1 className="font-manrope text-xl font-bold text-miru-han-purple-1000">
{label}
</h1>
</div>
{entries?.length > 0 && (
<p className="text-right font-manrope text-base font-medium text-miru-dark-purple-1000">
Total Hours for {label} : &nbsp;
{getTotalHoursLogged(entries)}
</p>
)}
)}
<ReportHeader />
<div className="mb-6">
{entries.length > 0 && getEntryList(entries)}
</div>
)}
<ReportHeader />
<div className="mb-6">
{entries.length > 0 && getEntryList(entries)}
</div>
</Fragment>
)
</Fragment>
);
}
)
) : (
<EmptyStates
Expand Down

0 comments on commit 8ac6bf5

Please sign in to comment.