Kind: Class
Source: Pams/Web/Pams.Web/Client/app/components/market/projects/newProject.ts (line 51)
Part of: Pams
NewProject is the client-side component for creating a market project. It tracks data changes and branch checks, reads project and tab state, opens supporting views, and submits the new project through AddNew().
Implements: OnInit, AfterViewInit, ComponentCanDeactivate
Methods
| Method | Signature | Returns |
|---|---|---|
DataChanged | DataChanged() | void |
ifSameBranch | ifSameBranch() | boolean |
ngOnInit | ngOnInit() | void |
ngAfterViewInit | ngAfterViewInit() | void |
getRecord | getRecord() | void |
getOpenedTabs | getOpenedTabs() | void |
selectText | selectText(e: undefined) | void |
openLibrary | openLibrary() | void |
openRegistrationDocs | openRegistrationDocs(reg: ProjectsSuppliersRegisteration) | void |
AddNew | AddNew(e: undefined, type: undefined) | void |
validate | validate(e: undefined) | void |
GetAuthorizationAccess | GetAuthorizationAccess(url: string) | void |
checkAllowedToEdit | checkAllowedToEdit() | boolean |
getClass | getClass(status: string) | string |
addNewPerson | addNewPerson() | void |
AddNewContact | AddNewContact(ID: undefined) | void |
EmitRemoveContact | EmitRemoveContact(ID: undefined) | void |
AddContact | AddContact(e: undefined) | void |
RemoveContact | RemoveContact(e: undefined) | void |
newOf | newOf() | void |
updateContactPersonImg | updateContactPersonImg() | void |
preview2 | preview2() | void |
addnewContactPersonContact | addnewContactPersonContact(type: undefined) | void |
deletePersonContactinfo | deletePersonContactinfo(i: number) | void |
resestPerson | resestPerson() | void |
geturl | geturl(path: undefined) | void |
setperson | setperson(e: undefined) | void |
deletePerson | deletePerson(e: undefined) | void |
EditPerson | EditPerson() | void |
preview3 | preview3() | void |
EditContactPersonImg | EditContactPersonImg() | void |
makeFileRequest | makeFileRequest(url: string, params: Array<string>, files: Array<File>) | void |
setPerson2 | setPerson2(e: any) | void |
gridItem_KeyPress_Number | gridItem_KeyPress_Number(event: undefined) | void |
addnewShareholder | addnewShareholder() | void |
onExpectedCompletionDateChanged | onExpectedCompletionDateChanged(e: undefined) | void |
onCreatedAtChanged | onCreatedAtChanged(e: undefined) | void |
onSalesResponsibleChange | onSalesResponsibleChange(e: undefined) | void |
onSalesResponsibleRemove | onSalesResponsibleRemove() | void |
matchSalesResposibleWithTeams | matchSalesResposibleWithTeams() | void |
currencyChange | currencyChange(e: any) | void |
getMarketSegments | getMarketSegments() | void |
setSelectedRegistration | setSelectedRegistration(e: undefined) | void |
getRegistrationStatus | getRegistrationStatus() | void |
getRegistrationData | getRegistrationData() | void |
formatCells | formatCells(e: undefined) | void |
OpenReg | OpenReg(e: undefined) | void |
editnewRegistreation | editnewRegistreation() | void |
addnewRegistreation | addnewRegistreation() | void |
updateRegistreation | updateRegistreation(newOrUpdate: string, Registreation: ProjectsSuppliersRegisteration) | void |
Properties
| Property | Type |
|---|---|
marketSegments | MarketSegment[] |
firstInitialized | boolean |
_passIdAsInput | number |
grid | DxDataGridComponent |
grid2 | DxDataGridComponent |
alerts | AlertsComponent |
sharedPopup | SharedPopupComponent |
DataValidator | DxValidationGroupComponent |
RegistrationValidator | DxValidationGroupComponent |
EditeRegistrationValidator | DxValidationGroupComponent |
printOptionsValidator | DxValidationGroupComponent |
FileLibrary | FilesComponent |
attachedDropdown | SharedAttachedDocsComponent |
attachedProjectRegistrationDropdown | SharedAttachedDocsComponent |
contactList | ContactsComponent |
logHistoryComponent | LogHistoryComponent |
environment | any |
popup | any |
selectedDocs | FileData[] |
project | Project |
oldData | Project |
supplierList | Account[] |
dataTypes | any |
List1 | string[] |
List2 | string[] |
List3 | string[] |
List4 | string[] |
List5 | string[] |
List6 | string[] |
users | Person[] |
errorMessage | string |
NoChange_CanLeave | boolean |
Change_Saved_CanLeave | boolean |
Change_NoSave_WantLeave | boolean |
RelatedToTypes | any |
ModuleEnumId | any |
LogModuleId | any |
projectStatuList | ProjectStatus[] |
TempName | string |
selectedRegisted | Account[] |
TempPercntage | number |
projectJobs | ProjectJobs[] |
ClientsList | any[] |
Comment | string |
Reply | string |
currenFeature | number |
subscriptionNotInclude | boolean |
registerationFeatureId | number |
registerationFeatureNotInclude | boolean |
subscription | Subscription |
Where it refuses work
NewProjectstops the work with an early return whenthis.project && this.project.CompanyBranchID == this.auth.User.CompanyBranchID.NewProjectstops the work with an early return whenthis.allowedtoEdit.NewProjectstops the work with an early return whenthis.allowedtoNew.NewProjectstops the work with an early return when!path || path.length < 1.NewProjectstops the work with an early return when!this.EditeRegistrationValidator.instance.validate().isValid.NewProjectstops the work with an early return when!this.RegistrationValidator.instance.validate().isValid.
Diagram
mermaidgraph LR User[User action] --> NewProject[NewProject] NewProject --> DataChanged[DataChanged] NewProject --> BranchCheck[ifSameBranch] NewProject --> Record[getRecord] NewProject --> Tabs[getOpenedTabs] NewProject --> Library[openLibrary] NewProject --> RegistrationDocs[openRegistrationDocs] NewProject --> Create[AddNew]
Usage
tsimport { AfterViewInit, Component, ViewChild } from '@angular/core';
import { NewProject } from './newProject';
@Component({
selector: 'app-project-host',
template: '<app-new-project></app-new-project>',
})
export class ProjectHostComponent implements AfterViewInit {
@ViewChild(NewProject) newProject!: NewProject;
ngAfterViewInit(): void {
this.newProject.getRecord();
if (this.newProject.ifSameBranch()) {
this.newProject.openLibrary();
} else {
this.newProject.openRegistrationDocs();
}
}
createProject(): void {
this.newProject.AddNew();
}
}
AI Coding Instructions
- Let Angular call
ngOnInit()andngAfterViewInit()through the component lifecycle; do not call them directly from application code. - Check
ifSameBranch()before actions that depend on the selected branch context. - Call
getRecord()andgetOpenedTabs()when current project or workspace state is needed. - Keep
AddNew()as the submission action after required project data has been prepared. - Use
openLibrary()andopenRegistrationDocs()for their respective navigation flows rather than duplicating their routing logic.
Relationships
- IMPORTS →
Shareholder - IMPORTS →
AppSettings - IMPORTS →
DataTypes - IMPORTS →
PermissionForSheetResponce - IMPORTS →
SubscriptionPackagesEnum - IMPORTS →
PrintOption - IMPORTS →
AuthService - IMPORTS →
ListOfNewResponse - IMPORTS →
Project - IMPORTS →
ProjectJobs - IMPORTS →
ProjectImportanceEnum - IMPORTS →
ProjectService - IMPORTS →
ProjectStatusService - IMPORTS →
RelatedToTypes - IMPORTS →
ContactInfo - IMPORTS →
PersonService - IMPORTS →
Account - IMPORTS →
AccountsService - IMPORTS →
Person - IMPORTS →
Departments - IMPORTS →
MarketSegmentService - IMPORTS →
MarketSegment - IMPORTS →
ContactPersons - IMPORTS →
ProjectsSuppliersRegisteration - IMPORTS →
ContactPersonService - IMPORTS →
RegistrationStatus - IMPORTS →
PreviousPageService - IMPORTS →
AlertsComponent - IMPORTS →
SharedPopupComponent - IMPORTS →
SharedAttachedDocsComponent - IMPORTS →
File - IMPORTS →
GeneralListView - IMPORTS →
FilesComponent - IMPORTS →
ContactsComponent - IMPORTS →
FilesPortService - IMPORTS →
FilesService - IMPORTS →
ComponentCanDeactivate - IMPORTS →
RecentlyOpenedService
Used by
2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (2)
AppRoutingModule—Pams/Web/Pams.Web/Client/app/app-routing.module.ts:1TranslateHandler—Pams/Web/Pams.Web/Client/app/app.module.ts:1
Was this page helpful?