Selaa lähdekoodia

update project

tags/Baseline_30082024_FRONTEND_UAT
cyril.tsui 1 vuosi sitten
vanhempi
commit
fd25f5de03
10 muutettua tiedostoa jossa 30 lisäystä ja 16 poistoa
  1. +0
    -0
      src/app/(main)/projects/createSub/not-found.tsx
  2. +0
    -0
      src/app/(main)/projects/createSub/page.tsx
  3. +0
    -0
      src/app/(main)/projects/editSub/not-found.tsx
  4. +0
    -0
      src/app/(main)/projects/editSub/page.tsx
  5. +1
    -1
      src/app/(main)/projects/page.tsx
  6. +2
    -2
      src/components/Breadcrumb/Breadcrumb.tsx
  7. +10
    -10
      src/components/ControlledAutoComplete/ControlledAutoComplete.tsx
  8. +10
    -0
      src/components/CreateProject/Milestone.tsx
  9. +6
    -2
      src/components/CreateProject/ProjectClientDetails.tsx
  10. +1
    -1
      src/components/ProjectSearch/ProjectSearch.tsx

src/app/(main)/projects/create/sub/not-found.tsx → src/app/(main)/projects/createSub/not-found.tsx Näytä tiedosto


src/app/(main)/projects/create/sub/page.tsx → src/app/(main)/projects/createSub/page.tsx Näytä tiedosto


src/app/(main)/projects/edit/sub/not-found.tsx → src/app/(main)/projects/editSub/not-found.tsx Näytä tiedosto


src/app/(main)/projects/edit/sub/page.tsx → src/app/(main)/projects/editSub/page.tsx Näytä tiedosto


+ 1
- 1
src/app/(main)/projects/page.tsx Näytä tiedosto

@@ -43,7 +43,7 @@ const Projects: React.FC = async () => {
color="secondary"
startIcon={<Add />}
LinkComponent={Link}
href="/projects/create/sub"
href="/projects/createSub"
>
{t("Create Sub Project")}
</Button>}


+ 2
- 2
src/components/Breadcrumb/Breadcrumb.tsx Näytä tiedosto

@@ -15,9 +15,9 @@ const pathToLabelMap: { [path: string]: string } = {
"/home": "User Workspace",
"/projects": "Projects",
"/projects/create": "Create Project",
"/projects/create/sub": "Sub Project",
"/projects/createSub": "Sub Project",
"/projects/edit": "Edit Project",
"/projects/edit/sub": "Sub Project",
"/projects/editSub": "Sub Project",
"/tasks": "Task Template",
"/tasks/create": "Create Task Template",
"/staffReimbursement": "Staff Reimbursement",


+ 10
- 10
src/components/ControlledAutoComplete/ControlledAutoComplete.tsx Näytä tiedosto

@@ -72,11 +72,11 @@ function ControlledAutoComplete<
</li>
);
}}
// renderTags={(tagValue, getTagProps) => {
// return tagValue.map((option, index) => (
// <Chip {...getTagProps({ index })} key={option?.id} label={option.label ?? option.name} />
// ))
// }}
renderTags={(tagValue, getTagProps) => {
return tagValue.map((option, index) => (
<Chip {...getTagProps({ index })} key={option?.id} label={option.label ?? option.name} />
))
}}
onChange={(event, value) => {
field.onChange(value?.map(v => v.id))
}}
@@ -99,11 +99,11 @@ function ControlledAutoComplete<
</MenuItem>
);
}}
// renderTags={(tagValue, getTagProps) => {
// return tagValue.map((option, index) => (
// <Chip {...getTagProps({ index })} key={option?.id} label={option.label ?? option.name} />
// ))
// }}
renderTags={(tagValue, getTagProps) => {
return tagValue.map((option, index) => (
<Chip {...getTagProps({ index })} key={option?.id} label={option.label ?? option.name} />
))
}}
onChange={(event, value) => {
field.onChange(value?.id ?? null)
}}


+ 10
- 0
src/components/CreateProject/Milestone.tsx Näytä tiedosto

@@ -50,6 +50,16 @@ const Milestone: React.FC<Props> = ({ allTasks, isActive }) => {
const [currentTaskGroupId, setCurrentTaskGroupId] = useState(
taskGroups[0].id,
);

/*const onSelectTaskGroup = useCallback(
(event: SelectChangeEvent<TaskGroup["id"]>) => {
const id = event.target.value;
const newTaksGroupId = typeof id === "string" ? parseInt(id) : id;
setCurrentTaskGroupId(newTaksGroupId);
},
[],
);*/

const onSelectTaskGroup = useCallback(
(event: SyntheticEvent<Element, Event>, value: NonNullable<TaskGroup>) => {
const id = value.id;


+ 6
- 2
src/components/CreateProject/ProjectClientDetails.tsx Näytä tiedosto

@@ -113,6 +113,7 @@ const ProjectClientDetails: React.FC<Props> = ({

// get customer (client) contact combo
const [firstCustomerLoaded, setFirstCustomerLoaded] = useState(false)
const [isMainProjectInfoLoading, setIsMainProjectInfoLoading] = useState(false)
useEffect(() => {
if (selectedCustomerId !== undefined) {
fetchCustomer(selectedCustomerId).then(({ contacts, subsidiaryIds }) => {
@@ -120,8 +121,10 @@ const ProjectClientDetails: React.FC<Props> = ({
setCustomerSubsidiaryIds(subsidiaryIds);

// if (subsidiaryIds.length > 0) setValue("clientSubsidiaryId", subsidiaryIds[0])
// else
if (isEditMode && !firstCustomerLoaded) { setFirstCustomerLoaded(true) } else setValue("clientSubsidiaryId", null)
// else
if (isEditMode && !firstCustomerLoaded) { setFirstCustomerLoaded(true) }
else if (!isEditMode && isMainProjectInfoLoading) { setIsMainProjectInfoLoading(false) }
else setValue("clientSubsidiaryId", null)
// if (contacts.length > 0) setValue("clientContactId", contacts[0].id)
// else setValue("clientContactId", undefined)
});
@@ -160,6 +163,7 @@ const ProjectClientDetails: React.FC<Props> = ({
const mainProject = mainProjects.find(project => project.projectId === mainProjectId);

if (mainProject !== undefined) {
setIsMainProjectInfoLoading(() => true)
setValue("projectName", mainProject.projectName)
setValue("projectCategoryId", mainProject.projectCategoryId)
setValue("projectLeadId", mainProject.projectLeadId)


+ 1
- 1
src/components/ProjectSearch/ProjectSearch.tsx Näytä tiedosto

@@ -62,7 +62,7 @@ const ProjectSearch: React.FC<Props> = ({ projects, projectCategories }) => {
const onProjectClick = useCallback(
(project: ProjectResult) => {
if (Boolean(project.mainProject)) {
router.push(`/projects/edit/sub?id=${project.id}`);
router.push(`/projects/editSub?id=${project.id}`);
} else router.push(`/projects/edit?id=${project.id}`);
},
[router],


Ladataan…
Peruuta
Tallenna