Skip to content

Commit

Permalink
Merge pull request #705 from bcgov/SRS-353
Browse files Browse the repository at this point in the history
Srs 353
  • Loading branch information
nikhila-aot authored Jun 5, 2024
2 parents ccb9297 + 74acb38 commit 9a78dac
Show file tree
Hide file tree
Showing 61 changed files with 3,040 additions and 852 deletions.
6 changes: 4 additions & 2 deletions frontend/Site/src/app/components/account/UserAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const UserAccount = ( props : any) =>{
aria-controls="account-menu"
aria-labelledby="user-account-label" onClick={toggleButton}>
{/* Profile image */}
<img src={user.profileImage} alt="User profile image." className="account-image" aria-hidden="true"/>
<img src={user.profileImage} alt="User profile image." className="account-image" aria-hidden="true" role="img"
aria-label="User profile image"/>
{/* User name */}
<div className="p-3">{user.name}</div>
<div id="account-dropdown" className="account-custom-toggle-mobile align-item-center" aria-label="Account Menu Button">
Expand Down Expand Up @@ -77,7 +78,8 @@ const UserAccount = ( props : any) =>{
<div className="account-custom-label">Logged in as:</div>
<div className="account-username py-3">
{/* Profile image */}
<img src={user.profileImage} alt="User profile image." className="account-image me-3"/>
<img src={user.profileImage} alt="User profile image." className="account-image me-3" role="img"
aria-label="User profile image"/>

{/* User name */}
<span>{user.name}</span>
Expand Down
40 changes: 40 additions & 0 deletions frontend/Site/src/app/components/action/Actions.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.custom-action-btn {
border-radius: var(--surface-border-radius-medium);
background: var(--surface-primary-default, #1E5189) !important;
padding: var(--layout-padding-small) var(--layout-padding-medium) var(--layout-padding-small) var(--layout-padding-medium);
font-size: 16px;
font-weight: 400;
line-height: 24px;
text-align: center;
color: var(--typography-color-primary-invert, #FFFFFF) !important;
}

.custom-action-btn:hover {
border: 3px solid var(--surface-color-primary-activeBorder, #2E5DD7) !important;
}

.custom-action-menu {
border-radius: var(--surface-border-radius-medium) !important;
padding: var(--layout-padding-medium) 0px var(--layout-padding-medium) 0px !important;
background-color: var(--surface-background-white) !important;
box-shadow: var(--surface-shadow-medium);
border: none !important;
}

.custom-action-item {
display: flex !important;
padding: var(--layout-padding-small) var(--layout-padding-medium) var(--layout-padding-small) var(--layout-padding-medium) !important;
gap: var(--layout-margin-medium) ;
font-family: BC Sans;
font-size: 16px;
font-weight: 400;
line-height: 27.01px;
text-align: left;
color: var(--typography-color-primary) !important;
}

.custom-action-item:hover {
background: var(--surface-color-secondary-hover, #EDEBE9) !important;
color: var(--typography-color-secondary, #474543) !important;
}

22 changes: 22 additions & 0 deletions frontend/Site/src/app/components/action/Actions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { IActions } from "./IActions";
import Dropdown from "react-bootstrap/Dropdown";
import './Actions.css';

const Actions: React.FC<IActions> = ({ label, items, onItemClick }) => {
return (
<Dropdown>
<Dropdown.Toggle variant="" id="dropdown-action" className="custom-action-btn">
{label}
</Dropdown.Toggle>
<Dropdown.Menu className="custom-action-menu">
{items.map((item, index) => (
<Dropdown.Item key={index} onClick={() => onItemClick(item.value)} className="custom-action-item">
{item.label}
</Dropdown.Item>
))}
</Dropdown.Menu>
</Dropdown>
);
}

export default Actions;
17 changes: 17 additions & 0 deletions frontend/Site/src/app/components/action/ActionsConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { UserMode } from "../../helpers/requests/userMode";
import { DropdownItem } from "./IActions";

export const ActionItems: DropdownItem[] = [
{
label:'Edit Mode',
value: UserMode.EditMode
},
{
label:'SR Mode',
value: UserMode.SrMode
},
{
label:'Delete',
value: UserMode.DeleteMode
},
]
13 changes: 13 additions & 0 deletions frontend/Site/src/app/components/action/IActions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { UserMode } from "../../helpers/requests/userMode";

export interface DropdownItem {
label: string;
value: UserMode;
}

export interface IActions {
label: string;
items: DropdownItem[];
onItemClick: (value: string) => void;
}

23 changes: 23 additions & 0 deletions frontend/Site/src/app/components/common/IChangeType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export enum IChangeType {
Added,
Modified,
Deleted,
None,
}

export class ChangeTracker {
changeType: IChangeType = IChangeType.None;
label: string = "";

constructor(changeType: IChangeType, label: string) {
this.changeType = changeType;
this.label = label;
}

toPlainObject() {
return {
changeType: this.changeType,
label: this.label,
};
}
}
13 changes: 12 additions & 1 deletion frontend/Site/src/app/components/common/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ import {
FaAngleLeft,
FaAngleRight,
FaChevronDown,
FaChevronUp
FaChevronUp,
FaFloppyDisk,
FaUserMinus,
FaUserPlus,
FaPlus,
} from "react-icons/fa6";

import { BsFillPinMapFill } from "react-icons/bs";


export const ShoppingCartIcon = FaCartShopping;
export const FolderPlusIcon = FaFolderPlus;
Expand Down Expand Up @@ -58,3 +64,8 @@ import {
export const AngleRight = FaAngleRight;
export const ChevronDown = FaChevronDown;
export const ChevronUp = FaChevronUp;
export const FloppyDisk = FaFloppyDisk ;
export const UserPlus = FaUserPlus;
export const UserMinus = FaUserMinus;
export const Plus = FaPlus;
export const FillPinMapFill = BsFillPinMapFill;
33 changes: 26 additions & 7 deletions frontend/Site/src/app/components/form/Form.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@

.custom-input {
border: 1px solid var(--surface-color-border-light, #D8D8D8) !important;
background-color: var(--surface-background-white) !important;
background-color: var(--surface-background-white, #FFFFFF) !important;
padding: var(--layout-padding-small) var(--layout-padding-medium) var(--layout-padding-small) var(--layout-padding-medium) !important;
border-radius: var(--layout-margin-xsmall) !important;
}

.custom-input-text {
font-size: 16px;
font-weight: 400;
line-height: 24px;
text-align: left;
}

.custom-input::placeholder {
font-size: 16px;
font-weight: 400;
Expand Down Expand Up @@ -45,10 +52,12 @@

.custom-select {
background-image: url('../../images/dropdown.png') !important;
background-repeat: no-repeat !important;
background-position: right .75rem center !important;
background-size: 12px !important;
font-size: 16px;
font-weight: 400;
line-height: 24px;
font-size: 16px !important;
font-weight: 400 !important;
line-height: 24px !important;
text-align: left;
}

Expand All @@ -60,13 +69,23 @@
}

.custom-option {
font-size: 16px;
font-weight: 400;
line-height: 24px;
font-size: 16px !important;
font-weight: 400 !important;
line-height: 24px !important;
text-align: left;
}

.custom-input.error:focus {
border-color: red;
box-shadow: 0 0 0 .25rem rgba(255,0,0, 0.25);
}

.custom-form-image {
border-radius: 100px;
height: 27px;
width: 27px;
}

.custom-checkbox[type="checkbox"]:checked {
background:#313132;
}
Loading

0 comments on commit 9a78dac

Please sign in to comment.