Skip to content

Commit

Permalink
Merge branch 'develop' into feature/fix_comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Luphia authored Sep 5, 2024
2 parents dce09ee + 5be7268 commit 37ef81e
Show file tree
Hide file tree
Showing 90 changed files with 231 additions and 801 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iSunFA",
"version": "0.8.0+73",
"version": "0.8.0+71",
"private": false,
"scripts": {
"dev": "next dev",
Expand Down
11 changes: 1 addition & 10 deletions src/components/accounting_sidebar/accounting_sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,7 @@ import { useUserCtx } from '@/contexts/user_context';
import { useTranslation } from 'next-i18next';

const AccountingSidebar = () => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation(['common', 'journal']);
const [isExpanded, setIsExpanded] = useState(false);
const sidebarEnterHandler = () => setIsExpanded(true);
const sidebarLeaveHandler = () => setIsExpanded(false);
Expand Down
11 changes: 1 addition & 10 deletions src/components/accounting_stepper/accounting_stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,7 @@ interface IAccountingStepperProps {
}

const AccountingStepper = ({ step }: IAccountingStepperProps) => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation(['common', 'journal']);
const isStepTwo = step === AccountingStep.STEP_TWO;

// Info: (20240423 - Julian) Step 1 icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,7 @@ enum EquityOptions {
const ITEM_PER_PAGE = 10;

const AccountingTitlePageBody = () => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation(['common', 'setting']);
const { selectedCompany } = useUserCtx();
const { getAccountListHandler, accountList } = useAccountingCtx();

Expand Down Expand Up @@ -203,7 +194,7 @@ const AccountingTitlePageBody = () => {
<div className="mt-40px flex flex-col items-center gap-x-20px gap-y-8px lg:mt-0 lg:flex-row">
{/* Info: (20240717 - Julian) Assets */}
<div className="flex w-full flex-col gap-8px lg:w-200px">
<p className="font-semibold text-input-text-primary">{t('setting:SETTING.ASSETS')}</p>
<p className="font-semibold text-input-text-primary">{t('common:COMMON.ASSETS')}</p>
<div
onClick={assetDropmenuToggleHandler}
className={`relative flex items-center justify-between rounded-sm border bg-input-surface-input-background ${assetVisible ? 'border-input-stroke-selected' : 'border-input-stroke-input'} px-12px py-10px hover:cursor-pointer`}
Expand Down Expand Up @@ -256,7 +247,7 @@ const AccountingTitlePageBody = () => {
type="text"
value={searchValue}
onChange={searchValueHandler}
placeholder={t('report_401:AUDIT_REPORT.SEARCH')}
placeholder={t('common:COMMON.SEARCH')}
className="flex-1 bg-transparent text-input-text-input-filled outline-none"
/>
<FiSearch size={20} />
Expand Down
28 changes: 4 additions & 24 deletions src/components/accounting_title_table/accounting_title_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,7 @@ interface IAccountingTitleRowProps {
}

const AccountingRow = ({ rowData, actionType }: IAccountingTitleRowProps) => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation(['common', 'setting']);
const {
addAccountTitleModalVisibilityHandler,
addAccountTitleDataHandler,
Expand Down Expand Up @@ -67,7 +58,7 @@ const AccountingRow = ({ rowData, actionType }: IAccountingTitleRowProps) => {
messageType: MessageType.WARNING,
submitBtnStr: t('setting:SETTING.REMOVE'),
submitBtnFunction: () => deleteOwnAccountTitle(selectedCompany.id, id),
backBtnStr: t('report_401:REPORTS_HISTORY_LIST.CANCEL'),
backBtnStr: t('common:COMMON.CANCEL'),
});
messageModalVisibilityHandler();
};
Expand Down Expand Up @@ -175,16 +166,7 @@ const AccountingRow = ({ rowData, actionType }: IAccountingTitleRowProps) => {
};

const AccountingTitleTable = ({ accountingTitleData, actionType }: IAccountingTitleTableProps) => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation(['common', 'setting']);
const accountingTableBody = accountingTitleData.map((account) => (
<AccountingRow key={account.id} rowData={account} actionType={actionType} />
));
Expand All @@ -197,9 +179,7 @@ const AccountingTitleTable = ({ accountingTitleData, actionType }: IAccountingTi
<div className="hidden lg:table-row">
<div className="table-cell w-1/10 py-12px">{t('setting:SETTING.CODE')}</div>
<div className="table-cell w-6/10 py-12px">{t('setting:SETTING.NAME')}</div>
<div className="table-cell w-3/10 py-12px">
{t('report_401:REPORTS_HISTORY_LIST.OPERATIONS')}
</div>
<div className="table-cell w-3/10 py-12px">{t('common:COMMON.OPERATIONS')}</div>
</div>
{/* Info: (20240717 - Julian) Mobile Table Header Row */}
<div className="table-row lg:hidden">
Expand Down
15 changes: 3 additions & 12 deletions src/components/accounting_voucher_row/accounting_voucher_row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,7 @@ interface IAccountingVoucherRow {
}

const AccountingVoucherRow = ({ accountingVoucher }: IAccountingVoucherRow) => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation('common');
const { id, account, particulars, debit, credit } = accountingVoucher;
const {
accountList,
Expand Down Expand Up @@ -202,15 +193,15 @@ const AccountingVoucherRow = ({ accountingVoucher }: IAccountingVoucherRow) => {
<input
id="search-accounting"
type="text"
placeholder={t('report_401:AUDIT_REPORT.SEARCH')}
placeholder={t('common:COMMON.SEARCH')}
value={searchValue}
onChange={changeSearchHandler}
className="w-full outline-none placeholder:text-input-text-input-placeholder"
/>
<FiSearch size={16} />
</div>
<div className="px-12px py-8px uppercase text-dropdown-text-head">
{t('setting:SETTING.ASSETS')}
{t('common:COMMON.ASSETS')}
</div>
<div
ref={accountingRef}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,7 @@ interface IAccountingVoucherRowMobile {
}

const AccountingVoucherRowMobile = ({ type, accountingVoucher }: IAccountingVoucherRowMobile) => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation(['common', 'journal']);
const isDebit = type === 'Debit';

const { id, account, particulars, debit, credit } = accountingVoucher;
Expand Down Expand Up @@ -173,15 +164,15 @@ const AccountingVoucherRowMobile = ({ type, accountingVoucher }: IAccountingVouc
<input
id="search-accounting"
type="text"
placeholder={t('report_401:AUDIT_REPORT.SEARCH')}
placeholder={t('common:COMMON.SEARCH')}
value={searchValue}
onChange={changeSearchHandler}
className="w-full outline-none placeholder:text-input-text-input-placeholder"
/>
<FiSearch size={16} />
</div>
<div className="px-12px py-8px uppercase text-dropdown-text-head">
{t('setting:SETTING.ASSETS')}
{t('common:COMMON.ASSETS')}
</div>
<div
ref={accountingRef}
Expand Down
15 changes: 3 additions & 12 deletions src/components/add_account_title_modal/add_account_title_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@ const AddAccountTitleModal = ({
modalVisibilityHandler,
modalData,
}: IAddAccountTitleModalProps) => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation(['common', 'setting']);
const { selectedCompany } = useUserCtx();
const { toastHandler } = useGlobalCtx();
const { getAccountListHandler } = useAccountingCtx();
Expand Down Expand Up @@ -248,7 +239,7 @@ const AddAccountTitleModal = ({
{/* Info: (20240717 - Julian) Buttons */}
<div className="flex items-center justify-end gap-12px px-20px py-16px text-sm">
<Button id="cancel-button" type="button" variant={null} onClick={modalVisibilityHandler}>
{t('report_401:REPORTS_HISTORY_LIST.CANCEL')}
{t('common:COMMON.CANCEL')}
</Button>
<Button
id="add-accounting-title-button"
Expand All @@ -257,7 +248,7 @@ const AddAccountTitleModal = ({
disabled={disableSubmit}
onClick={addNewSubAccount}
>
<p>{t('project:PROJECT.ADD')}</p> <FaPlus />
<p>{t('common:COMMON.ADD')}</p> <FaPlus />
</Button>
</div>
</div>
Expand Down
19 changes: 5 additions & 14 deletions src/components/add_asset_modal/add_asset_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,7 @@ interface IAddAssetModalProps {
}

const AddAssetModal = ({ isModalVisible, modalVisibilityHandler }: IAddAssetModalProps) => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation(['common', 'journal']);
const [inputName, setInputName] = useState('');
const [inputDescription, setInputDescription] = useState('');
const [inputPurchasePrice, setInputPurchasePrice] = useState(0);
Expand Down Expand Up @@ -295,8 +286,8 @@ const AddAssetModal = ({ isModalVisible, modalVisibilityHandler }: IAddAssetModa
onChange={selectedUsefulLifeUnit}
className="h-full p-12px outline-none"
>
<option value="year">{t('journal:ADD_ASSET_MODAL.YEAR')}</option>
<option value="month">{t('journal:ADD_ASSET_MODAL.MONTH')}</option>
<option value="year">{t('common:COMMON.YEAR')}</option>
<option value="month">{t('common:COMMON.MONTH')}</option>
<option value="day">{t('journal:ADD_ASSET_MODAL.DAY')}</option>
</select>
</div>
Expand All @@ -310,15 +301,15 @@ const AddAssetModal = ({ isModalVisible, modalVisibilityHandler }: IAddAssetModa
onClick={modalVisibilityHandler}
variant={null}
>
{t('report_401:REPORTS_HISTORY_LIST.CANCEL')}
{t('common:COMMON.CANCEL')}
</Button>
<Button
className="px-16px py-8px"
type="submit"
variant="tertiary"
disabled={isAddButtonDisabled}
>
<p>{t('project:PROJECT.ADD')}</p> <FaPlus />
<p>{t('common:COMMON.ADD')}</p> <FaPlus />
</Button>
</div>
</form>
Expand Down
11 changes: 1 addition & 10 deletions src/components/add_journal_body/add_journal_body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ import { IMessageModal, MessageType } from '@/interfaces/message_modal';
import { useGlobalCtx } from '@/contexts/global_context';

const AddJournalBody = () => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation(['common', 'journal']);
const { messageModalVisibilityHandler, messageModalDataHandler } = useGlobalCtx();

const {
Expand Down
17 changes: 4 additions & 13 deletions src/components/add_project_modal/add_project_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,7 @@ const AddProjectModal = ({
modalVisibilityHandler,
defaultStage,
}: IAddProjectModalProps) => {
const { t } = useTranslation([
'common',
'project',
'journal',
'kyc',
'report_401',
'salary',
'setting',
'terms',
]);
const { t } = useTranslation(['common', 'project']);
const { selectedCompany } = useUserCtx();
const { messageModalDataHandler, messageModalVisibilityHandler } = useGlobalCtx();

Expand Down Expand Up @@ -249,7 +240,7 @@ const AddProjectModal = ({
<input
id="companySearchBar"
type="text"
placeholder={t('report_401:AUDIT_REPORT.SEARCH')}
placeholder={t('common:COMMON.SEARCH')}
value={searchMemberValue}
onChange={searchMemberChangeHandler}
className="w-full outline-none placeholder:text-input-text-input-placeholder"
Expand Down Expand Up @@ -351,15 +342,15 @@ const AddProjectModal = ({
onClick={modalVisibilityHandler}
variant={null}
>
{t('report_401:REPORTS_HISTORY_LIST.CANCEL')}
{t('common:COMMON.CANCEL')}
</Button>
<Button
className="px-16px py-8px"
type="submit"
variant="tertiary"
disabled={!isConfirmValid}
>
<p>{t('project:PROJECT.ADD')}</p> <FaPlus />
<p>{t('common:COMMON.ADD')}</p> <FaPlus />
</Button>
</div>
</form>
Expand Down
Loading

0 comments on commit 37ef81e

Please sign in to comment.