Skip to content

Commit

Permalink
updated Tags section
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulch07 committed Jan 6, 2025
1 parent 7a3b7d0 commit 8090392
Show file tree
Hide file tree
Showing 13 changed files with 103 additions and 133 deletions.
54 changes: 0 additions & 54 deletions src/components/AddPeopleToTag/AddPeopleToTag.module.css

This file was deleted.

18 changes: 11 additions & 7 deletions src/components/AddPeopleToTag/AddPeopleToTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, { useEffect, useState } from 'react';
import { Modal, Form, Button } from 'react-bootstrap';
import { useParams } from 'react-router-dom';
import type { InterfaceQueryUserTagsMembersToAssignTo } from 'utils/interfaces';
import styles from './AddPeopleToTag.module.css';
import styles from '../../style/app.module.css';
import type { InterfaceTagUsersToAssignToQuery } from 'utils/organizationTagsUtils';
import {
TAGS_QUERY_DATA_CHUNK_SIZE,
Expand Down Expand Up @@ -244,7 +244,10 @@ const AddPeopleToTag: React.FC<InterfaceAddPeopleToTagProps> = ({
data-testid={
isToBeAssigned ? 'deselectMemberBtn' : 'selectMemberBtn'
}
variant={!isToBeAssigned ? 'primary' : 'danger'}
// variant={!isToBeAssigned ? 'primary' : 'danger'}
className={
!isToBeAssigned ? styles.editButton : `btn btn-danger btn-sm`
}
>
{isToBeAssigned ? 'x' : '+'}
</Button>
Expand All @@ -263,7 +266,7 @@ const AddPeopleToTag: React.FC<InterfaceAddPeopleToTagProps> = ({
centered
>
<Modal.Header
className="bg-primary"
className={`bg-primary ${styles.modalHeader}`}
data-testid="modalOrganizationHeader"
closeButton
>
Expand Down Expand Up @@ -301,7 +304,7 @@ const AddPeopleToTag: React.FC<InterfaceAddPeopleToTagProps> = ({
<Form.Control
type="text"
id="firstName"
className="bg-light"
className={`bg-light ${styles.inputField}`}
placeholder={tCommon('firstName')}
onChange={(e) =>
setMemberToAssignToSearchFirstName(e.target.value.trim())
Expand All @@ -315,7 +318,7 @@ const AddPeopleToTag: React.FC<InterfaceAddPeopleToTagProps> = ({
<Form.Control
type="text"
id="lastName"
className="bg-light"
className={`bg-light ${styles.inputField}`}
placeholder={tCommon('lastName')}
onChange={(e) =>
setMemberToAssignToSearchLastName(e.target.value.trim())
Expand Down Expand Up @@ -396,16 +399,17 @@ const AddPeopleToTag: React.FC<InterfaceAddPeopleToTagProps> = ({
<Modal.Footer>
<Button
onClick={hideAddPeopleToTagModal}
variant="outline-secondary"
variant="outline-danger"
data-testid="closeAddPeopleToTagModal"
className={styles.removeButton}
>
{tCommon('cancel')}
</Button>
<Button
type="submit"
disabled={addPeopleToTagLoading}
variant="primary"
data-testid="assignPeopleBtn"
className={styles.addButton}
>
{t('assign')}
</Button>
Expand Down
42 changes: 0 additions & 42 deletions src/components/TagActions/TagActions.module.css

This file was deleted.

15 changes: 10 additions & 5 deletions src/components/TagActions/TagActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
InterfaceQueryOrganizationUserTags,
InterfaceTagData,
} from 'utils/interfaces';
import styles from './TagActions.module.css';
import styles from '../../style/app.module.css';
import { ORGANIZATION_USER_TAGS_LIST } from 'GraphQl/Queries/OrganizationQueries';
import {
ASSIGN_TO_TAGS,
Expand Down Expand Up @@ -270,7 +270,7 @@ const TagActions: React.FC<InterfaceTagActionsProps> = ({
centered
>
<Modal.Header
className="bg-primary"
className={styles.modalHeader}
data-testid="modalOrganizationHeader"
closeButton
>
Expand Down Expand Up @@ -312,7 +312,7 @@ const TagActions: React.FC<InterfaceTagActionsProps> = ({
<Form.Control
type="text"
id="userName"
className="bg-light"
className={styles.inputField}
placeholder={tCommon('searchByName')}
onChange={(e) => setTagSearchName(e.target.value.trim())}
data-testid="searchByName"
Expand Down Expand Up @@ -388,13 +388,18 @@ const TagActions: React.FC<InterfaceTagActionsProps> = ({

<Modal.Footer>
<Button
variant="secondary"
className={`btn btn-danger ${styles.removeButton}`}
onClick={(): void => hideTagActionsModal()}
data-testid="closeTagActionsModalBtn"
>
{tCommon('cancel')}
</Button>
<Button type="submit" value="add" data-testid="tagActionSubmitBtn">
<Button
type="submit"
value="add"
data-testid="tagActionSubmitBtn"
className={`btn ${styles.addButton}`}
>
{tagActionType === 'assignToTags' ? t('assign') : t('remove')}
</Button>
</Modal.Footer>
Expand Down
2 changes: 1 addition & 1 deletion src/components/TagActions/TagNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
} from 'utils/interfaces';
import type { InterfaceOrganizationSubTagsQuery } from 'utils/organizationTagsUtils';
import { TAGS_QUERY_DATA_CHUNK_SIZE } from 'utils/organizationTagsUtils';
import styles from './TagActions.module.css';
import styles from '../../style/app.module.css';
import InfiniteScroll from 'react-infinite-scroll-component';
import InfiniteScrollLoader from 'components/InfiniteScrollLoader/InfiniteScrollLoader';
import { WarningAmberRounded } from '@mui/icons-material';
Expand Down
13 changes: 10 additions & 3 deletions src/screens/ManageTag/EditUserTagModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { TFunction } from 'i18next';
import type { FormEvent } from 'react';
import React from 'react';
import { Button, Form, Modal } from 'react-bootstrap';
import styles from '../../style/app.module.css';

/**
* Edit UserTag Modal component for the Manage Tag screen.
Expand Down Expand Up @@ -37,7 +38,7 @@ const EditUserTagModal: React.FC<InterfaceEditUserTagModalProps> = ({
centered
>
<Modal.Header
className="bg-primary"
className={styles.modalHeader}
data-testid="modalOrganizationHeader"
closeButton
>
Expand All @@ -56,7 +57,7 @@ const EditUserTagModal: React.FC<InterfaceEditUserTagModalProps> = ({
<Form.Control
type="text"
id="tagName"
className="mb-3"
className={`mb-3 ${styles.inputField}`}
placeholder={t('tagNamePlaceholder')}
data-testid="tagNameInput"
autoComplete="off"
Expand All @@ -73,10 +74,16 @@ const EditUserTagModal: React.FC<InterfaceEditUserTagModalProps> = ({
variant="secondary"
onClick={(): void => hideEditUserTagModal()}
data-testid="closeEditTagModalBtn"
className={styles.removeButton}
>
{tCommon('cancel')}
</Button>
<Button type="submit" value="invite" data-testid="editTagSubmitBtn">
<Button
type="submit"
value="invite"
data-testid="editTagSubmitBtn"
className={styles.addButton}
>
{tCommon('edit')}
</Button>
</Modal.Footer>
Expand Down
14 changes: 8 additions & 6 deletions src/screens/ManageTag/ManageTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function ManageTag(): JSX.Element {
minWidth: 100,
align: 'center',
headerAlign: 'center',
headerClassName: `${styles.tableHeaders}`,
headerClassName: `${styles.tableHeader}`,
sortable: false,
renderCell: (params: GridCellParams) => {
return <div>{params.row.id}</div>;
Expand All @@ -304,7 +304,7 @@ function ManageTag(): JSX.Element {
flex: 2,
minWidth: 100,
sortable: false,
headerClassName: `${styles.tableHeaders}`,
headerClassName: `${styles.tableHeader}`,
renderCell: (params: GridCellParams) => {
return (
<div data-testid="memberName">
Expand All @@ -321,7 +321,7 @@ function ManageTag(): JSX.Element {
minWidth: 100,
headerAlign: 'center',
sortable: false,
headerClassName: `${styles.tableHeaders}`,
headerClassName: `${styles.tableHeader}`,
renderCell: (params: GridCellParams) => {
return (
<div>
Expand All @@ -330,7 +330,9 @@ function ManageTag(): JSX.Element {
state={{ id: params.row._id }}
data-testid="viewProfileBtn"
>
<div className="btn btn-sm btn-primary me-3">
<div
className={`btn btn-sm btn-primary me-3 ${styles.editButton}`}
>
{t('viewProfile')}
</div>
</Link>
Expand Down Expand Up @@ -519,7 +521,7 @@ function ManageTag(): JSX.Element {
setTagActionType('assignToTags');
showTagActionsModal();
}}
className="my-2 btn btn-primary btn-sm w-75"
className={`my-2 btn btn-primary btn-sm w-75 ${styles.editButton}`}
data-testid="assignToTags"
>
{t('assignToTags')}
Expand All @@ -543,7 +545,7 @@ function ManageTag(): JSX.Element {
/>
<div
onClick={showEditUserTagModal}
className="mt-1 mb-2 btn btn-primary btn-sm w-75"
className={`mt-1 mb-2 btn btn-primary btn-sm w-75 ${styles.editButton}`}
data-testid="editUserTag"
>
{tCommon('edit')}
Expand Down
7 changes: 4 additions & 3 deletions src/screens/ManageTag/RemoveUserTagModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { TFunction } from 'i18next';
import React from 'react';
import { Button, Modal } from 'react-bootstrap';
import styles from '../../style/app.module.css';

/**
* Remove UserTag Modal component for the Manage Tag screen.
Expand Down Expand Up @@ -33,7 +34,7 @@ const RemoveUserTagModal: React.FC<InterfaceRemoveUserTagModalProps> = ({
keyboard={false}
centered
>
<Modal.Header closeButton className="bg-primary">
<Modal.Header closeButton className={styles.modalHeader}>
<Modal.Title className="text-white" id="removeUserTag">
{t('removeUserTag')}
</Modal.Title>
Expand All @@ -44,7 +45,7 @@ const RemoveUserTagModal: React.FC<InterfaceRemoveUserTagModalProps> = ({
<Modal.Footer>
<Button
type="button"
className="btn btn-danger"
className={`btn btn-danger ${styles.removeButton}`}
data-dismiss="modal"
role="button"
aria-label={tCommon('no')}
Expand All @@ -55,7 +56,7 @@ const RemoveUserTagModal: React.FC<InterfaceRemoveUserTagModalProps> = ({
</Button>
<Button
type="button"
className="btn btn-success"
className={`btn ${styles.addButton}`}
role="button"
aria-label={tCommon('yes')}
onClick={handleRemoveUserTag}
Expand Down
8 changes: 4 additions & 4 deletions src/screens/ManageTag/UnassignUserTagModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { TFunction } from 'i18next';
import React from 'react';
import { Button, Modal } from 'react-bootstrap';

import styles from '../../style/app.module.css';
/**
* Unassign UserTag Modal component for the Manage Tag screen.
*/
Expand Down Expand Up @@ -35,7 +35,7 @@ const UnassignUserTagModal: React.FC<InterfaceUnassignUserTagModalProps> = ({
>
<Modal.Header
closeButton
className="bg-primary"
className={styles.modalHeader}
aria-label={t('closeModal')}
>
<Modal.Title className="text-white" id={`unassignTag`}>
Expand All @@ -46,7 +46,7 @@ const UnassignUserTagModal: React.FC<InterfaceUnassignUserTagModalProps> = ({
<Modal.Footer>
<Button
type="button"
className="btn btn-danger"
className={`btn btn-danger ${styles.removeButton}`}
data-dismiss="modal"
onClick={toggleUnassignUserTagModal}
data-testid="unassignTagModalCloseBtn"
Expand All @@ -56,7 +56,7 @@ const UnassignUserTagModal: React.FC<InterfaceUnassignUserTagModalProps> = ({
</Button>
<Button
type="button"
className="btn btn-success"
className={`btn ${styles.addButton}`}
onClick={async (e) => {
const btn = e.currentTarget;
btn.disabled = true;
Expand Down
Loading

0 comments on commit 8090392

Please sign in to comment.