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CAAE9oJ,SAAY,eACrDopB,QAAQJ,MAAMpP,EAAd,EAHR,oBCbA,QACA,aACA,gBACA,WACA,eACA,kBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,cACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,aACA,gBACA,YACA,eACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,mBACA,gBACA,aACA,gBACA,aACA,gBACA,gBACA,mBACA,gBACA,mBACA,eACA,kBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,cACA,iBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,mBACA,gBACA,WACA,cACA,aACA,gBACA,aACA,gBACA,YACA,eACA,mBACA,sBACA,kBACA,qBACA,aACA,gBACA,aACA,gBACA,WACA,cACA,aACA,gBACA,aACA,gBACA,gBACA,mBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,aACA,gBACA,iBACA,oBACA,gBACA,mBACA,aACA,gBACA,aACA,gBACA,mBACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,kBACA,qBACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,cACA,iBACA,aACA,gBACA,aACA,gBACA,aACA,gBACA,gBACA,mBACA,cACA,iBACA,aACA,gBACA,cACA,iBACA,cACA,kBACA,qBACA,iBACA,gBACA,mBACA,aACA,gBACA,aACA,gBACA,aACA,kBACA,qBACA,gBACA,aACA,gBACA,mBACA,sBACA,aACA,gBACA,gBACA,mBACA,gBACA,mBACA,gBACA,mBACA,gBACA,oBAIA,eACA,YACA,WACA,CACA,eACA,gBACA,+CACA,gCACAslD,CACA,CACA,aACA,CACAvpE,kBACA,sBACA,EACAA,YACAozJ,aACApzJ","names":["Repository","constructor","_emProvider","_entityTypeName","_expand","_resourceName","_isCachedBundle","this","Error","_errorLogger","errorLogger","_defaultFetchStrategy","FetchStrategy","manager","entityManager","_cachedManager","metadataStore","entityType","getEntityType","setProperties","defaultResourceName","localResourceName","setEntityTypeForResourceName","withId","key","fromCache","p","fetchEntityByKey","then","data","entity","where","predicate","orderBy","query","baseQueryWithExpand","executeQuery","wherePaged","pageNumber","pageSize","skip","take","whereWithParams","queryParameters","baseQuery","withParameters","whereInCache","executeCacheQuery","all","r","length","remoteQuery","from","EntityQuery","q","expand","fetchStrategy","using","results","catch","e","log","executeQueryLocally","ReferenceRepository","emProvider","entityTypeName","resourceName","super","populateBiologicalData","reference","navQuery","populateToxData","populateAnalyticalResultData","populateSpecialLinkData","populateWorkflowData","EntityBase","getErrorFor","prop","entityAspect","getValidationErrors","map","ve","errorMessage","join","filter","property","cascadeDelete","cascadeDeleteCore","entityState","isAdded","rejectChanges","setDeleted","AnalyticalResult","uvsFileList","typeAnalyticalProcedureID","observedResult","containsFileName","push","splitUVFileList","uvObservedResult","indexOf","uvFiles","split","UtilFns","static","collection","isAscending","fn","sort","a","b","localeCompare","wnd","window","doc","document","isOpera","opr","addons","opera","navigator","userAgent","isFirefox","InstallTrigger","isSafari","Object","prototype","toString","call","HTMLElement","isIE","documentMode","isEdge","StyleMedia","isChrome","chrome","webstore","isBlink","CSS","el","body","range","sel","createRange","getSelection","removeAllRanges","selectNodeContents","addRange","selectNode","createTextRange","moveToElementText","select","dt","format","moment","num","width","decimalDigits","parts","toFixed","replace","_","obj1","obj2","obj3","attrname","divisor","formatNumber","instance","funcNameRegex","exec","url","base","paramHash","ix","substr","stringToHash","queryHash","urlParts","paramString","queryString","v","k","qs","delimiter","i","decodeURIComponent","part","path","component","str","encodeURIComponent","ele","eleClone","cloneNode","printSelectEle","getElementById","createElement","id","appendChild","innerHTML","print","parentElement","removeChild","parent","validateFn","modalEle","$","elementRef","nativeElement","firstElementChild","modalParent","validationMessage","validationFn","bind","Promise","resolve","modal","backdrop","keyboard","on","modalResult","result","hideModal","LocationFns","location","partIx","tab","getParamValue","tabs","tabNum","parseInt","isNaN","setTimeout","setParamValue","value","canReplace","shouldReplace","s","replaceState","go","stateMap","currentState","updateFn","updateState","savedState","pd","getOwnPropertyDescriptor","undefined","writable","set","retKey","ret","retIx","getRetState","displayName","storeRetState","PageLoadStatus","PageState","canShowMessage","isLoading","loadStatus","IsLoading","IsLoaded","isLoaded","IsLoadedWithNoData","o","updateLoadStatusMsg","isLoadedWithNoData","hasMessage","itemCount","loadStatusClass","getPaginationInfo","currentPage","itemsPerPage","totalItems","itemCountEstimate","resetPaging","_maxItemCount","hasMoreThanOnePage","Number","MAX_VALUE","updateEstimate","currentPageLength","Math","max","count","pluralize","loadStatusMsg","EditManager","_host","uow","pageName","pageState","errorMessages","ngOnInit","onlyEntity","entities","singleEntityOnly","currentEntity","_currentIx","movePrev","moveNext","isStaff","currentUser","femaRestricted","isInRole","hasEntities","hasEdits","hasChanges","hasErrors","addError","message","clearErrors","status","onSelect","editing","onEdit","canAdd","canAddCore","hasValidationErrors","onAdd","onAddPromise","setStatus","classes","isTemp","canDelete","canDeleteCore","onDelete","captureEntityType","onDeleteCore","updatePageState","canApply","ea","isUnchanged","onApply","onApplyCore","validateCurrent","canCancel","canShowBack","onBack","onCancel","onCancelCore","es","n","isModified","isDetached","restoreDeleted","rollback","fs","_entityType","deletedEntities","getChanges","isDeleted","canSave","canSaveCore","onSave","onSaveCore","validateBeforeSave","commitSave","validateEntity","every","ok","commit","setSavedStatus","handleSaveError","entityErrors","forEach","err","startsWith","setSaveFailedStatus","EntityTypeAnnotation","arg","validators","propertyAnnotations","EntityPropertyAnnotation","propertyName","config","Material","cASNumber","realCASNumber","numberDashValidator","Validator","match","messageTemplate","atLeastOneDashValidator","nonZeroCodeValidator","casLengthValidator","propAnnotations","eINECSELINCS","eiec","eINECSNumber","eCNNumber","mETIENCS","typeTscaClass","genericClass","mETI","eCInventoryEINECSELINCSNumbers","eCInventoryNumber","isCaptive","confidential","getCaptiveText","captiveCompany","functionalUseExt","functionalUse","naturalOccurrence","occurrence","typeNaturalOccurrence","occurrenceDetail","pSynonym","principalSynonym","synonymWordOrWebVersion","addedToTransparencyListDate","materialTransparencyLists","lists","m","removedFromList","addedToList","hasRegistration","eINECSRegistration","dSLRegistration","nDSLRegistration","tSCARegistration","reachRegistration","registrationText","text","eCNRegistration","trim","formattedRIFMId","monographNumber","naturalsId","typeBotanicalSubdivisionId","typeEssentialOilId","molecularWeightWithUnit","molecularWeight","typeMaterialUnitId","synonyms","find","principal","principalSynonymText","ps","principalNameSizeFactor","factor","summaryDescription","fEMANumber","DermalExposure","ECOSARToxicEffect","EPIData","EPISuite","TypeEPISuiteParameter","TypeEPISuiteCategory","nullBiologicalData","typeStudy","studyLong","typeSpecies","speciesLong","typeRoute","routeLong","briefReference","briefRef","restrictedDistribution","rIFMAsAuthor","sponsoringCompany","subReference","typeStudyId","typeRouteId","typeSpeciesId","referenceId","bioDataStudySubTypes","inputString","_monthNames","date","day","getDate","monthIndex","getMonth","year","getFullYear","ExperimentalMaterial","getBiologicalData","biologicalData","studySubTypeDescriptions","x","typeStudySubType","subTypeDescription","studySubTypeIds","studySubTypeId","modifiedOn","formatDate","modified","modifiedAsISO","toISOString","M","R","fFDS","isNullOrEmpty","fFDSShortVersion","substring","fFDSStatement","material","materialHazardCodes","fFDSModified","activateTheLink","unfinishedReference","finished","experimentalResults","er","addDeletedChild","_deleted","getDeletedChildren","clearDeletedChildren","showExperimentalMaterialVehicle","vehicles","typeExperimentVehicleId","calculatedResultTypeAndValue","typeToxicEffect","toxicEffectDescription","calculatedResult","Reference","briefReferenceValidator","extractBriefRefParts","formatBriefReference","br","author","description","captiveText","captivePaper","finishedText","captiveFinishedText","authorDisplay","referenceAuthors","authors","counter","initials","authorName","abstractText","abstract","citationText","authorList","authorNames","brParts","annotatedYear","suffix","citation","refPart1","yearOfPublication","title","refPart2","journal","journalName","journalDetail","setYearOfPublicationFromBriefReference","rx","toLocaleLowerCase","search","BiologicalData","anySubjects","subjectsMale","subjectsFemale","subjectsUnspecifiedSex","fileReference","_tempSubReference","getMethodologyBriefRefs","methodologyReference","briefRefs","normalizedRefs","tempBrParts","tempBr","expMats","experimentalMaterials","ed","BioDataStudySubType","TypeStudySubType","Abstract","JournalReserveItem","name","vol","issue","pages","notes","journalReserveId","journalYear","volume","_monthFullNames","JournalSubscriptionItem","subDesc","subStartMonth","subStartYear","subEndMonth","subEndYear","issuesPerYear","dept","publisher","journalSubscriptionId","subscriptionDescription","subscriptionStartMonth","subscriptionStartYear","subscriptionEndMonth","subscriptionEndYear","department","subscriptionStartYearAndMonth","subscriptionEndYearAndMonth","subscriptionStartDateForSort","journalSubscriptionEndDateForSort","month","d","concat","Date","Journal","journalReserveItems","_reserves","journalSubscriptionItems","_subscriptions","journalNameStartYearAndMonth","journalNameStartYear","journalNameStartMonth","journalNameEndYearAndMonth","journalNameEndYear","journalNameEndMonth","journalNameStartDateForSort","journalNameEndDateForSort","prepareJournalData","journalReserves","reserve","journalSubscriptions","sub","typeJournalSubscription","Project","ReferenceAuthor","authorInitials","referenceYearOfPublication","referenceTitle","Author","ReferenceRelation","TypeReferenceRelation","SpecialLink","sentinalStringValidator","reason","explanation","typeKeywords","TypeKeyword","TypeKlimisch","TypePublication","TypeSearchService","WorkflowRecordedAction","TypeWorkflowAction","TypeWorkflowContact","TypeRoute","TypeSpecies","TypeStudy","TypeTitle","TypeTimeUnit","TypeUsefulness","ExperimentalResult","formattedDose","compOp","dose","getTypeUnitDescription","formattedDoseAndEffects","toxicEffects","experimentalToxicEffects","typeUnit","unitDescription","et","ExperimentalToxicEffect","TypeToxicEffect","TypeExperimentVehicle","TypeUnit","TypeStudyMixture","FoodStatus","evaluatingAgency","typeFoodStatus","foodAgencyLabel","agencyTitle","foodStatusTitle","regulatoryStatement","foodStatusStmnt","prefixedDetermination","determination","webReferenceExt","monographID","jECFAMonograph","monographAddress","webReference","linkDisplayExt","regulatoryTypeForCompare","regulatoryType","numberFlavis_JECFA","foodAgencyId","toLowerCase","fL_No","jECFA_No","JECFAMonograph","TypeFoodStatus","HouseStatus","MaterialAdditionalIdentifier","obj","materialAdditionalIdentifierId","materialId","eCL","typeMaterialIdentifierId","created","createdUser","modifyUser","TypeMaterialIdentifier","MaterialAlertRule","TypeAlertRule","MaterialAssessmentCategory","AssessmentCategory","MaterialConsumption","geographicalArea","type","survey","typeGeographicalArea","surveyYear","Survey","TypeGeographicalArea","TypeSponsor","MaterialExpertPanelSummary","ExpertPanelSummary","MaterialFSAG","FSAG","normNote","note","MaterialHazardCode","TypeHazardCode","MaterialPrecautionCode","TypePrecautionStatement","MaterialRelation","TypeMaterialRelation","MaterialTransparencyList","MaterialUNTransport","MaterialUNTransportCode","TypeHazardousSymbol","NaturalOccurrenceDescriptor","Prediction","TypePrediction","TypePredictionClass","REACHRegistration","TypeREACHTonnageBand","RegulatoryStatus","typeRegulatoryStatus","evaluatingAgencyLabel","linkDisplay","statusType","TypeRegulatoryStatus","SafetyAssessmentMaterial","SafetyComment","TypeSafety","SafetyEUComment","TypeSafetyEU","SynonymNamer","Synonym","minLength","maxLength","synonymWord","toLocaleUpperCase","root","matches","formatSynonymWebVersion","syn","abbrevs","escapeNoCase","isoandsubs","italicizeTerm","italicizeAbbreviations","findterm","expr","RegExp","term","lpart","rpart","index","webVersion","useList","synonymNamers","sn","typeSynonymUse","synonymUseLong","useLongNames","removeSynonymNamer","typeSynonymUseId","addSynonymNamer","namer","synonymId","addEntity","materialCASNumber","materialFormattedRIFMId","materialFEMANumber","TypeSynonymUse","TypeBotanicalSubdivision","TypeEssentialOil","TypeNarrativeSummary","TypeNaturalOccurrence","TypeTSCAClass","MaterialUses","TypeFoodCategory","TypeAnalyticalProcedure","AnnouncementDetail","TypeLinkTarget","Announcement","ApplicationConfigurationSetting","ClusterGroup","ClusterNodeAndEdge","ClusterPart","ClusterPath","ClusterPartWithParent","ExposureAdditionalMaterial","ExposureAdditionalMaterialSurveyMeasure","ExposureSurvey","exposureSurveyMonthYear","exposureSurveyDate","getUTCMonth","getUTCFullYear","exposureSurveyMonthYearNumber","exposureSurveyNumber","MaterialExposureSurveyMeasure","hasQualitativeValue","typeExposureMeasureValue","measureValueType","hasQuantitativeValue","TypeCremeVersion","TypeExposureMeasure","TypeExposureMeasureValue","TypeHouseholdProduct","MaterialExposureSurvey","bannedMaterialCaption","bannedMaterial","TypeExposureSurveyResponse","TypeExposureSurveyStatus","ExposureAdditionalMaterialSurvey","ExposureSurveyMaterialMeasureCount","ExposureSurveyMaterialMostRecent","LabelingManualPublication","MaterialCluster","MaterialComponent","isMaterial","TypeMaterialComponentClass","MaterialComposition","MaterialExposureSurveyIsomer","NationalToxicologyProgram","TypeNTPStatus","RIFMProductLicense","RIFMProduct","RIFMReport","StaffWorkflowReport","SuperClusterPath","SuperCluster","SurveyAndCompany","SurveyReportedUse","SynonymWebVersion","TypeAlertConcLevelScore","TypeAlertVolumeScore","TypeChangeReportFrequency","TypeChangeReportTopic","TypeComplianceGuideline","TypeSearch","TypeStudyDesignation","TypeWorkflowActionTransition","UserAcknowledgement","UserChangeReportAuthor","UserChangeReport","UserChangeReportMaterial","UserChangeReportStudy","UserChangeReportTopic","UserSessionToken","SurveyUsesByMaterialAndYear","SurveyUsesByCompanyAndMaterialAndYear","SurveyWhoUsedMostMaterial","WorkflowPendingAction","abbreviatedTitle","WorkflowReferenceAssignment","RIFMDocument","assignedReference","RIFMDocumentArchive","RIFMDocumentFolder","TypeRIFMDocument","MaterialExposureCustomSurveyMeasure","MaterialMonograph","RIFMDownloadableFile","ErrorEntry","error","errorLevel","formatError","ErrorLogger","console","ee","_errors","getErrors","factory","environment","Configuration","EntityManagerProvider","configuration","prepare","_preparePromise","NamingConvention","_masterManager","EntityManager","serviceBase","fetchMetadata","_RegistrationHelper","registerEntityTypeCtor","registerAnnotations","_uowManager","newManager","createEmptyCopy","importEntities","exportEntities","hasChangesChanged","subscribe","args","getEntityTypes","t","ctor","getCtor","getEntityTypeAnnotation","etAnnotation","pa","getProperty","i0","UserManager","_http","_location","_router","User","nullUser","_currentUser","accessToken","sessionStorage","getItem","setItem","removeItem","destUrl","logout","get","toPromise","Raven","checkIfLoggedInOAuth","checkSessionTimeout","isNullUser","isAuthorizedDownloadUser","isUserLoggedInPromise","res","handleAuthResponse","loc","href","showLogin","includes","isLoggedInPromise","isValidString","_oauthRedirectURL","queryOAuthRedirectURL","code","params","_loginErrorMessage","headers","HttpHeaders","validateTokenPromise","post","JSON","stringify","requestPromise","initializeUserFromResponse","_fileServiceURL","allowed","tree","parseUrl","sessionDurationMinutes","_loginHandle","clearTimeout","reload","getFileServiceFilePathUrl","filePath","getFileServiceUrl","getFFIDSUrl","fileServiceUrl","authenticationToken","getMonographUrl","getExpertPanelSummaryUrl","narrativeLink","getReportUrl","getSearchServiceReportUrl","getUVUrl","fileName","UserAcknowledgementDuration","_userAcknowledgmentDurationDays","UserName","AuthenticationToken","Roles","SessionStartTime","SessionDuration","IsAuthorizedDownloadUser","AccessToken","$id","email","username","trackUser","OAuthRedirectURL","teststring","ga","userId","appVersion","versionNo","_name","_authenticationToken","roles","_sessionStartTime","_sessionDuration","_dbAuthorizedDownloadUser","_roles","_isAuthorizedDownloadUser","toggleRoles","_tempRoles","isAdmin","isReallyStaff","roleName","useRealRoles","sessionStartTime","sessionDuration","EntityFactory","create","createEntity","UnitOfWork","_userManager","analyticalResultRepository","createRepository","assessmentCategoryRepository","announcementRepository","bioDataStudySubTypeRepository","biologicalDataRepository","clusterGroupRepository","clusterPathRepository","docUniqReferenceRepository","ecoSARToxicEffectRepository","epiSuiteRepository","experimentalMaterialRepository","exposureAdditionalMaterialRepository","exposureSurveyRepository","exposureSurveyMaterialMostRecentRepository","fSAGRepository","foodStatusRepository","houseStatusRepository","labelingManualPublicationRepository","materialAdditionalIdentifierRepository","materialAlertRuleRepository","materialComponentRepository","materialCompositionRepository","materialConsumptionRepository","materialExpertPanelSummaryRepository","materialExposureSurveyRepository","materialExposureCustomSurveyMeasureRepository","materialExposureSurveyIsomerRepository","materialExposureSurveyMeasureRepository","materialFSAGRepository","materialMonographRepository","materialRelationRepository","materialReciprocalRelationRepository","materialRepository","materialUsesRepository","materialAssessmentCategoriesRepository","nationalToxicologyProgramRepository","naturalOccurrenceDescriptorRepository","predictionRepository","projectRepository","rEACHRegistrationRepository","reportingOrganizationRepository","rIFMProductLicenseRepository","rIFMProductRepository","rIFMReportRepository","referenceAuthorRepository","referenceRelationRepository","referenceRepository","regulatoryStatusRepository","rifmDocumentRepository","rifmDocumentFolderRepository","specialLinkMaterialRepository","specialLinkReferenceRepository","surveyRepository","surveyAndCompanyRepository","surveyReportedUseRepository","surveyUsesByMaterialAndYearRepository","surveyWhoUsedMostRepository","synonymRepository","userChangeReportRepository","userAcknowledgementRepository","workflowRecordedActionRepository","workflowMaterialRecordedActionRepository","typeAlertRuleRepository","typeAnalyticalProcedureRepository","typeBotanicalSubdivisionRepository","typeChangeReportFrequencyRespository","typeChangeReportTopicRepository","typeComplianceGuidelineRepository","typeCremeVersionRepository","typeEPISuiteCategoryRepository","typeEPISuiteParameterRepository","typeEssentialOilRepository","typeExposureMeasureRepository","typeExposureMeasureValueRepository","typeExposureSurveyResponseRepository","typeExperimentVehicleRepository","typeExposureSurveyStatusRepository","typeFoodCategoryRepository","typeGeographicalAreaRepository","typeJournalSubscriptionRepository","typeKeywordRepository","typeKlimischRepository","typeLinkTargetRepository","typeMaterialComponentClassRepository","typeMaterialIdentifierRepository","typeMaterialRelationRepository","typeMaterialUnitRepository","typeNTPStatusRepository","typeNaturalOccurrenceRepository","typePredictionClassRepository","typePredictionRepository","typePublicationRepository","typeREACHTonnageBandRepository","typeReferenceRelationRepository","typeRegulatoryStatusRepository","typeRIFMDocumentRepository","typeRouteRepository","typeSearchRepository","typeSearchServiceRepository","typeSpeciesRepository","typeStudyRepository","typeStudyMixtureRepository","typeStudyDesignationRepository","typeStudySubTypeRepository","typeSynonymUseRepository","typeTimeUnitRepository","typeToxicEffectRepository","typeTSCAClassRepository","typeUnitRepository","typeUsefulnessRepository","typeWorkflowActionRepository","typeWorkflowActionTransitionRepository","typeWorkflowContactRepository","typeWorkflowMaterialActionRepository","typeWorkflowMaterialActionTransitionRepository","abstractFactory","createFactory","analyticalResultFactory","announcementFactory","assessmentCategoryFactory","authorFactory","bioDataStudySubTypeFactory","biologicalDataFactory","experimentalMaterialFactory","experimentalResultFactory","experimentalToxicEffectFactory","exposureAdditionalMaterialFactory","exposureAdditionalMaterialSurveyFactory","exposureAdditionalMaterialSurveyMeasureFactory","exposureSurveyFactory","foodStatusFactory","fSAGFactory","houseStatusFactory","journalFactory","journalReserveFactory","journalSubscriptionFactory","materialAdditionalIdentifierFactory","materialFSAGFactory","materialFactory","materialComponentFactory","materialCompositionFactory","materialConsumptionFactory","materialMonographFactory","materialRelationFactory","materialExposureCustomSurveyMeasureFactory","materialExposureSurveyFactory","materialExposureSurveyIsomerFactory","materialExposureSurveyMeasureFactory","materialUsesFactory","nationalToxicologyProgramFactory","naturalOccurrenceDescriptorFactory","predictionFactory","projectFactory","rEACHRegistrationFactory","referenceAuthorFactory","reportingOrganizationFactory","rifmDocumentFactory","rifmDocumentFolderFactory","rIFMProductFactory","rIFMProductLicenseFactory","referenceFactory","referenceRelationFactory","regulatoryStatusFactory","specialLinkFactory","surveyReportedUseFactory","synonymFactory","typeCremeVersionFactory","typeExperimentVehicleFactory","typePredictionFactory","typePredictionClassFactory","typeReferenceRelationFactory","userAcknowledgementFactory","userChangeReportAuthorFactory","userChangeReportFactory","userChangeReportMaterialFactory","userChangeReportTopicFactory","userChangeReportStudyFactory","workflowMaterialRecordedActionFactory","workflowRecordedActionFactory","isCached","clearEntityManager","fetch","fetchTyped","saveOptions","SaveOptions","processAuditFields","saveChanges","saveResult","commitSelected","currentUserName","StateMap","shortVersionNo","slice","utilFns","currentJournal","_currentJournal","_journalDataMap","currentMaterial","_currentMaterial","_hasMaterialDataMap","currentReference","_currentReference","_hasReferenceDataMap","hasJournalDataFor","hasMaterialDataFor","hasReferenceDataFor","getJournalDataFor","setJournalDataFor","setHasMaterialDataFor","setHasReferenceDataFor","skey","keyToString","_map","altKey","getLastRetId","_nextRetId","_retMap","checkRetMapSize","_firstRetId","currentRouteName","_currentRouteName","MolImageService","getMaterialImage","getImageUrlForMaterial","getBase32SmileUrl","getImageUrlForSmile","smile","getMoleculeFromMaterial","getBase32SmileUrlWithSize","size","getImageUrlForMaterialWithSize","imageSize","FoundInCode","FoundInReferenceCode","SearchService","_uow","SearchFEMAorMonograph","SearchRIFMId","SearchCAS","SearchSynonymsPlus","SearchSafetyAssessments","SearchFFIDS","SearchSynonyms","SearchRegulatory","SearchMaterialId","SearchInternalMaterialNotes","SearchSecondRoundNCS","SearchAbstracts","SearchAuthors","SearchBriefReferences","SearchCompliance","SearchContractorId","SearchGovDocNumber","SearchGovSponsor","SearchJournalDetail","SearchJournals","SearchProtocols","SearchSponsoringCompany","SearchStaffComments","SearchTitles","SearchAll","searchTerm","searchType","sr","materialSearchResult","resolveMaterialSearchResult","referenceSearchResult","resolveReferenceSearchResult","fetchMaterialsPage","fetchReferencesPage","user","searchDescription","_materialSearchCodeMap","materialSearchCode","monographNumbers","relatedMonographNumbers","materials","locs","FEMA","foundText","RIFM_ID","Internal_Material_Notes","CAS","alternateCASNumber","Alternate_CAS","EINECS","ECN","ECNo","alternativeIdFound","Alternative_Identifier","internalMaterialNotes","Matching_RIFM_ID","formattedRifmId","synonymFound","Regulatory_Agency","MaterialId","secondRoundNCS","Second_Round_NCS","tmps","l","searchResolution","getMaterialSearchDescription","_referenceSearchCodeMap","referenceSearchCode","references","Abstracts","Brief_Reference","Compliance","Protocols","Title","ReferenceId","contractorId","Contractor_Id","staffComments","Staff_Comments","allAuthorNames","Journal_Detail","Govt_Doc_Number","Govt_Sponsor","Sponsoring_Company","EditorService","createEditManager","Parent","parentClassAsInterface","provide","useExisting","forwardRef","WorkflowEntityState","WorkflowState","entityName","objectId","contactId","contactEmail","workflowHoldReason","workflowReferenceId","workflowMaterialId","workflowObjectId","workflowEntityName","workflowPropertyName","workflowEntityState","Undefined","workflowContactId","workflowContactEmail","parsedEntityName","parseEntityName","idx","WorkflowService","_typeWorkflowActionTransitions","addWorkflowEvent","workflowState","mapStateToAction","_mappedActions","doNotComplete","updatePendingWorkflowRecordedActionsForReference","actionCurrent","markCompleteOnly","actionNext","createWorkflowRecordedAction","ignoreThisProperty","state","convertEntityStateToWorkflowActionState","actions","w","typeWorkflowActionId","markComplete","completedWorkflowActionId","alert","wfs","workflowRecordedAction","actionObjectId","sentToContactId","workflowNotes","holdReason","contact","c","emailAddress","toUpperCase","createdWorkflowContactId","actionChange","workflowRecordedActions","pending","actionCompletedDate","completedWorkflowContactId","completedUser","rejectWorkflowRecordedNotification","notifications","referenceActions","action","referenceActionsWithPendingRequiredAction","referenceMostRecentPendingAction","mostrecentaction","completed","sorted","date1","date2","getTime","referenceMostRecentCompletedAction","cancelPendingWorkflowRecordedActionsForReference","pendingAction","mostRecentOnly","reverse","deleteActionBeforeSave","todeletes","ReferenceFinishState","ReferenceFinishedService","Array","enumerateMissingData","_unfinishedReasons","isReferenceAbstracted","isReferenceProofed","rIFMArticle","fEMAArticle","incompletes","distinctPendingWorkflowActions","linkable","hasLinks","datacheck","hasIncompleteProtocolData","precedence","missingBiologicalData","missingExperimentalMaterials","missingExperimentalResults","isReferenceFinished","isFinishedByOverride","FinishOverride","MissingData","DataComplete","allWorkflowActionsCompleted","unfinishedReasons","abstracted","complete","hasAnalyticalResultLinks","hasSpecialLinks","hasMaterialLinks","analyticalResults","bddata","biologicalDatas","specialLinks","completedTypeWorkflowAction","includeInStaffReport","coreData","exists","toCompleteDescription","missingBioData","missingExpMats","missingExpResults","bd","missingExperimentalMaterial","em","hasexisting","hasnew","shortName","biologicalDataId","experimentalMaterialId","WorkflowDeletionService","_workflowService","_referenceFinishedService","reconcileLinkedAnalyticalResultDeletesWithPendingActions","arrayIsEmpty","lastmat","anyArray","hasBioDataDeletionsToProcess","deletes","some","deleteaction","reconcileProtocolDeletesWithPendingActions","expmats","missingMaterialLink","protocolsMissingMaterialLinks","reconcileToxDataDeletesWithPendingActions","addBackRequiredActions","expresults","lastresult","expMatsCount","dataCheck","workflow","processDeleteWorkflowAction","completedOnlyType","deleteCompletedOnlyAction","workflowRecordedActionId","deleteWorkflowAction","item","ReferenceState","referenceFinishedService","workflowService","_workflowDeletionService","recordReferenceFinishedStateChange","finishOverride","recordAnalyticalResultAdd","recordLinkedAction","recordAnalyticalResultDelete","recordAnalyticalResultsChecked","recordProtocolAdd","recordProtocolDelete","recordMaterialLinkAdd","recordMaterialLinkDelete","recordToxDataAdd","recordToxDataDelete","recordToxAudit","recordSpecialLinkAdd","recordSpecialLinkDelete","recordAddHold","recordRemoveHold","getHoldAction","isOnHold","recordRIFMDocument","archived","recordRIFMDocumentAdded","recordRIFMDocumentArchive","recordRIFMDocumentFileModified","recordRIFMDocumentFileDelete","recordRIFMDocumentRemove","recordRIFMDocumentReplace","recordRIFMDocumentRestore","recordLinkable","recordSearchService","typeSearchServiceId","hasUnauditedToxData","hasAuditedToxData","hasUncheckedAnalyticalResults","hasCheckedAnalyticalResults","recordEntityChange","relatedEntityKey","changedProperties","originalValues","propName","appendValueToReferenceProperty","xtraPropertyInfo","specialProcessing","getCompletedWorkflowActions","completedActions","typeWorkflowAction","sentToName","isSentToOrNotifyAction","sentToTypeWorkflowContact","firstName","workflowActivityCompletedItemId","staffFirstName","createdTypeWorkflowContact","workflowActionDescription","actionData","canDeleteFromWorkflowHistory","completedNext","completedTypeWorkflowContact","actionId","WorkflowEmailService","addEmailToSendToList","resend","_workflowSendToEmails","reassignPreviousSentTo","sentto","removeEmailFromSendToList","save","addEmailToNotifyList","_workflowNotifyEmails","removeEmailFromNotifyList","sendEmails","pop","sendSendToAssigmentEmail","sendNotifyEmail","isResend","AuthGuard","canActivate","AuthGuardAllowAuthorized","CanDeactivateGuard","canDeactivate","MaterialResolver","_stateMap","route","_url","cm","fetchHasDataInfo","yesNoComponent","showModal","navigateByUrl","rfs","items","naturalItems","sagId","hasRelationsData","materialType","hasFlavorsData","hasStatusData","hasAssessment","assessmentReportName","hasFFIDS","fFIDSFile","hasMonograph","materialMonographs","summariesLength","expertPanelSummary","mc","withuse","kilogramsConsumed","hasCompositionData","isComponent","mes","mis","cs","ReferenceResolver","cr","JournalReserve","JournalSubscription","ReportingOrganization","ModalDialog","SortColumn","up","ColumnSorter","_parentComponent","_sortMap","sortColumn","_sortColumnChanged","_sortColumn","_defaultSortColumn","sc","reset","updateClasses","iconMap","iconChild","colName","className","getClasses","columnName","applySort","sortWith","getOrderBy","ColumnSorterDirective","_el","ne","_colName","textContent","spans","getElementsByTagName","_iconChild","colSorter","clickColumnHeader","selectors","ctx","HtmlGreekTranslator","buildMaps","safeEncode","greekToUnicode","_htmlTranslations","replaceAll","tag","encTag","escapeHtml","greek","_greekUnicodeMap","repl","endKey","cfg","HtmlGreekDirective","ngOnChanges","newVal","htmlGreek","TabPane","viewContainer","templateRef","active","_active","createEmbeddedView","remove","TabContainer","EventEmitter","selectTab","pane","currentPane","getCurrentPane","comp","onDeactivate","panes","toArray","tabChange","emit","getCurrentComponent","EditPropParent","EditPropComponent","_parent","_cols","szs","hasError","getError","topLevelClass","hasClass","isChild","labelClass","contentClass","inputGroupVisibilityStyle","errorClass","UserAcknowledgementComponent","onAccept","accept","cancel","WhatsNewComponent","_announcements","linkTo","webLink","open","HomePageComponent","_httpClient","_route","_isInitialized","userEmail","userAcknowledgementDate","_currentEntity","validateUserAcknowledgement","showUserAcknowledgement","_hasAcceptedUseAgreement","getDocumentManagementUrl","_documentManagementUrl","documentManagementBaseUrl","ack","today","diffDays","round","abs","msDay","navigateLocal","navigate","relativeTo","isIFRA","downloadRequestForm","_isLoading","exportDownloadableFile","downloadIFRANCSDocument","goIntro","HOME_ROUTES","goDatabaseSubscription","goIFRAAttachments","goSafetyAssessments","goMaterialGroups","goSearchAuthors","goSearchSynonyms","goSearchStructure","goToolsAndModels","goReportDatabaseChanges","goSystemRequirements","goStaffEditing","ROUTES","goIFRASurveyUses","goMaterialClusters","goExposureAdmin","goDocManagement","goEnvironmentalData","_userAcknowledgementComponent","onUserAcknowledgementAccept","canShowDocManagementAdmin","canShowExposureAdmin","dm","getDownloadFileURL","subFolder","responseType","_validationMessage","response","file","Blob","fileURL","URL","createObjectURL","target","download","click","IntroComponent","PageStatusComponent","MaterialResultsComponent","_searchService","dataSource","DataSource","store","CustomStore","load","loadOptions","_searchResult","_pageState","totalCount","isDesc","selector","desc","orderByProp","clientOrderBy","onSelectionChanged","evt","selectMaterial","selectedRowsData","loading","update","parentComponent","searchResult","promise","hasData","PaginationService","defaultId","DEFAULT_ID","register","instances","changed","updateInstance","change","getCurrentPage","setCurrentPage","page","ceil","setTotalItems","setItemsPerPage","getInstance","clone","hasOwnProperty","ReferenceResultsComponent","selectReference","decls","SearchResultsComponent","ngAfterViewInit","_sub","makeKey","restoreState","ngOnDestroy","unsubscribe","decodeURI","saveState","_key","_materialSearchResult","_referenceSearchResult","val","_materialResultsComponent","_referenceResultsComponent","_pageSize","_firstSearchedPerformed","PageStateExt","SearchAuthorsComponent","operatorName","_operators","defineGridCustomDataStore","dataGrid","visible","opChange","event","opName","newSearch","_pageStatusMessage","pageIndex","getReferenceAuthorSearchTotalCount","refresh","clear","_componentInitializing","opType","_totalItemCount","onSelectReferenceAuthor","getGridElement","jQuery","opValue","pred","hasStatusMessage","DxDataGridComponent","SearchSynonymsComponent","getSynonymSearchTotalCount","synonym","onSelectMaterial","DefaultTableComponent","MarvinSearchComponent","_molImageService","http","_cd","_isShowingSearch","molData","smiles","_originalSMILES","getSketcherInstance","si","importStructure","_sketcherInstance","MarvinJSUtil","getEditor","onMolChangeEvent","_isSearching","_materials","_isError","validateSimilarityThreshold","threshold","parseFloat","_similarityThreshold","exportStructure","mrv","marvin","similarityThreshold","Base32SmileUrl","getMaterialImageUrl","onCasSelect","canDrawSMILES","_inputSmiles","detectChanges","_maintainOriginalSMILES","getSMILESFromStructure","onChangeSMILES","_isStructureError","onDrawSMILES","msg","regex","test","preventDefault","hasSearchResults","searchResultsStatus","_sketchSmiles","onCopyCASToClipboard","casNumbers","RealCASNumber","selBox","style","position","left","top","opacity","focus","execCommand","MaterialGroupsComponent","_elementRef","_tab","unshift","_FSAGs","fsagIx","selectFSAGIndex","selectEntireTable","eles","selectFSAG","currentTarget","selectedIndex","_fsagIx","fsag","_canShowMaterials","sAGID","_materialFSAGs","getName","_materialIds","base32SmileUrl","_tabContainer","materialFSAG","onTabChange","paneNumber","PaginatePipe","service","transform","start","end","usingConfig","serverSideMode","createInstance","stateIsIdentical","pure","SafetyAssessmentsComponent","drafts","reports","matWith","_pagination","_colSorter","assessmentReportDate","isReturning","ar","_countSafetyAssessments","ac","_assessmentCategories","assessmentCategoryId","selectSafetyAssessment","downloadSAFile","selectCAS","addlmap","assessmentReportNameModified","addlMaterials","safetyAssessmentMaterials","sam","additionalMaterial","mats","materialCount","getAssessmentCategories","materialAssessmentCategories","IFRAAttachmentsComponent","loadData","_labelingManuals","category","currentLM","lm","fileIdentifier","_labelingManualYear","fileDescription","downloadFile","dfs","exportSubscriptionFile","fileSubFolder","ToolsAndModelComponent","_typeLinkTargets","provideParent","ToolsAndModelsLicenseComponent","EditorHeaderComponent","edm","ToolsAndModelsComponent","_edm","fetchAuthorizedDownloads","_toolFileURL","enabled","productName","_licenses","hasLicense","productId","licenseAcceptDate","getDownloadText","linkTargetType","getImage","formatProductName","showLicense","_licenseProduct","_licenseComponent","onLicenseAccept","license","onDownload","linkToSecuredProduct","productLink","contentType","downloadModelFile","token","link","uname","MaterialSelectorComponent","canSearch","_searchTerm","onSearch","_entities","mli","AuthorSelectorComponent","ReportDatabaseChangesComponent","_typeChangeReportFrequencies","_typeStudies","_typeChangeReportTopics","topicDisplayOrder","_userChangeReport","_materialListItems","_authors","topic","_topicMap","typeChangeReportTopicId","userChangeReportTopics","materialIds","userChangeReportMaterials","_studyTypeMap","_selectedStudyTypes","userChangeReportStudies","_studyFilterMode","authorIds","userChangeReportAuthors","authorId","dataReady","createSettings","staffReport","typeChangeReportFrequencyId","_hasPendingEdits","topics","userChangeReportTopic","userChangeReportId","reportMaterials","reportMaterial","rm","userChangeReportMaterial","reportAuthors","reportAuthor","ra","userChangeReportAuthor","studies","userChangeReportStudy","hasSelectedStudyTopic","onTopicChanged","onSelectingMaterial","_materialSelectorComponent","validateMaterial","removeMaterial","onSelectingAuthor","_authorSelectorComponent","validateAuthor","onRemoveStudyType","filterStudyType","_filterStudyType","topicsWithoutStudies","changeReportTopicDesc","topicsOnlyStudies","isStudyTypeSelected","isStudyTypeUnselected","studytopics","st","showStudyTypeFilter","setStudyFilterMode","mode","isNotActiveStudyFilter","isActiveStudyFilter","removeAuthor","_status","SystemRequirementsComponent","IFRASurveyUseComponent","DatabaseSubscriptionComponent","files","_databaseApplicationFiles","f","_databasePricingFiles","setYearLabel","_yearLabel","SelectableEntity","color","sortField","isMultiple","backgroundColor","selected","relevance","ClusterHelpVideoComponent","onClose","ClusterPathFilterComponent","loadMaterialClusterPathData","_materialCluster","_selectedMaterial","loadMatchingClusterGroups","clearSelections","partSearchTerms","_clusterPartSearchTerms","g","_clusterGroups","onSelectClusterGroup","clusterGroupId","_userNotifications","loadMatchingClusterPathData","_clusterPaths","_clusterPathsEx","_selectedClusterPathIds","_selectedClusterGroup","formatSelectableEntities","element","SelectedClusterPathIds","findClusterGroupById","clusterGroups","SelectedClusterGroupId","_selectedClusterGroupId","canAddSearchTerm","_searchClusterTerm","showUserMessage","onAddSearchTerm","searchClusterParts","onRemoveSearchTerm","onSelectClusterPath","clusterPathId","currentpaths","checked","splice","addClusterTermLabel","ClusterPathSelectorComponent","_superClusterPathGroups","paths","SuperClusterPaths","_superClusterPaths","groups","superCluster","superClusterName","isCollapsed","selectedClusterPaths","clusterPathIds","selectClusterPath","cpx","superClusterPathCollapse","collapsed","onSelectGroup","_selectEntireGroup","onSelectSuperCluster","groupId","onUnselectAll","require","cytoscape","NodePosition","CytoscapeGraphComponent","_layout","nodeSep","edgeSep","padding","avoidOverlap","rankSep","rankDir","_rankDir","spacingFactor","nodeDimensionsIncludeLabels","_hasData","layout","directed","zoom","min","nodeLevelMin","_nodeLevelMin","level","nodeLevelMax","_nodeLevelMax","layoutType","resetNodeLevelsToAll","centerAndFitGraph","graphObject","cy","elements","fit","centerGraph","center","centerGraphToOrigin","nodes","moveGraphToTop","yvalue","shift","clearGraph","makeLayout","_layoutOptions","renderClusterData","clusterData","graphdata","buildCytoscapeGraphFromClusterData","render","materialNodes","ismaterial","updateMaterialNodesWithImage","highlightTopNode","highlightTopLevelNode","renderClusterJSON","graphData","self","container","wheelSensitivity","label","shape","onGraphNodeClicked","contextMenus","menuItems","content","tooltipText","image","src","height","y","onClickFunction","onCollapseNode","hasTrailingDivider","onExpandNodeAll","onExpandNode","onCopyPathToClipboard","onNavigateToStructureSearch","menuItemClasses","addClusterDataToGraph","skipLayout","add","run","removeNode","nodeId","_cytoscapeElements","edges","alreadyGraphed","clusterPartNode","clusterPartLabel","degree_layout","colorcode","colorCode","shapeType","clusterRelevance","parentNode","edgeId","source","interaction","strength","css","showOriginPosition","collapseNodePath","node","successors","targets","zoomToNode","zoomToOrigin","getGraphData","jsons","getGraphImageData","png","getNodePosition","np","hasImage","exc","selectedNodeIds","showStudyData","isOriginNode","connectedEdges","expandNodeNextLevel","expandAllNodes","copyPathToClipboard","onShowStudiesMenuItemClick","navigateToStructureSearch","exportGraphToImageFile","png64","bg","full","filename","setAttribute","createEvent","initEvent","dispatchEvent","contains","MaterialClustersComponent","loadClusterGroups","setTab","_quickSearchCASNumber","navigateToMaterialClusterPath","setSelectedClusterGroup","clusterPath","clusterGroup","loadClusterData","_clusterObjectMap","_cytoscapeGraphComponent","expandClusterPath","alignGraph","onClearGraph","loadClusterPathData","formatSuperSelectableEntities","_superClusterPathsEx","resetGraph","isDictionaryEmpty","dict","keys","hasNodeData","hasSelectedClusterGroup","pageTitle","clusterGroupName","formatNodeId","nodeIds","parentNodeId","saveGraphData","clusterNode","findClusterNode","_selected_node_name","clusters","_savedGraphData","onRedrawGraphWithCurrentData","tabNumber","_currentTabNumber","_isClusterGraphDisplayed","group","onShowTopLevelNodes","graphTopLevelNodesForClusterGroup","_nodeLevel","onShowSelectClusterGroupPaths","_clusterPathSelectorComponent","previouslySelectedClusterPaths","processClusterPathSelections","currentPathIds","newPathIds","addedIds","removedIds","displaySelectedClusterPaths","graphablePaths","removePath","graphableData","isSharedNode","onShowClusterFilterModal","_clusterPathFilterComponent","canQuickSearch","onQuickSearch","searchMaterial","onQuickSearchCASNumber","onExportClusterImage","onExportClusterFile","canExportGraphData","pathnames","prepareVisibleClusterPathDataForClipboard","copytext","pathname","getFullPathName","getPathMaterials","clusterPathName","isClusterPathAlreadySelected","isSelectedClusterGroup","findAndGraphExpandNodes","isNode","clusterPartName","onShowHelpVideoModal","_clusterHelpVideoComponent","toggleTooltip","whichButton","toggleShowSelectClusterGroupPaths","toggleShowTopLevelNodes","toggleShowClusterFilterModal","toggleShowHelpVideo","toggleClearGraph","toggleCenterGraph","toggleExportClusterImage","toggleExportClusterFile","toggleMaterialLookup","HomePage","AfterLogin","rolesExcluded","Introduction","SearchResults","_SearchResults","SearchStructure","_SearchStructure","MaterialGroups","SafetyAssessments","IFRAAttachments","ToolsAndModels","ReportDatabaseChanges","SystemRequirements","IFRASurveyUse","rolesPermitted","DatabaseSubscription","MaterialClusters","EnvironmentalData","EnvironmentalDataComponent","_envDataFiles","exportEnvironmentalFile","HomeComponent","SynonymComponent","_synonymChanged","tsus","allTsus","longNames","tsuChecks","tsu","origTsuChecks","setRootWord","rootWord","validateSynonymWord","_synonymCollisionWarning","onSetModified","setModified","setPrincipalName","apply","tsuHasChanged","tsuId","onSynonymWordChange","originalSynonymWord","SynonymsComponent","_editorService","MATERIAL_ROUTES","_material","synonymComponent","sy","_principalNameWarning","principalNameCount","stopProp","stopPropagation","StructureIdentityComponent","ReferenceSelectorComponent","rsr","rli","PDFEditorComponent","changeDetectorRef","toolbarItem","_toolbarSettingsView","ajaxHeaders","headerName","headerValue","withCredentials","_pdfViewerComponent","freeTextSettings","fontSize","_canShowHeader","unloadPDF","destroyData","destroy","loadPDF","documentPath","savePDF","_processingMessage","unload","refreshPDF","rifmDocumentSource","_rifmDocumentSource","downloadFileName","canShowPDF","_canShowPDF","_documentPath","enableToolbar","_enableToolbar","toolbar","showToolbar","showAnnotationToolbar","_hasChanges","stateChange","pdfPageCount","pageCount","showPDFTronDocument","_showPDFTronDocument","toolbarSettings","_toolbarSettings","setEditMode","_toolbarSettingsEdit","setViewMode","ajaxRequestInitiate","ajaxRequestSuccess","ajaxRequestFailed","downloadStart","downloadEnd","annotationAdded","annotationRemoved","annotationResized","beforeAddFreeText","commentAdded","commentDeleted","commentEdited","documentLoad","documentLoadFailed","exportFailure","errorDetails","formFieldAdd","annotationPropertiesChange","pageChange","PdfViewerComponent","LinkAnnotationService","BookmarkViewService","MagnificationService","ThumbnailViewService","ToolbarService","NavigationService","TextSearchService","TextSelectionService","PrintService","AnnotationService","FormFieldsService","ShowAndDownloadPDFComponent","showUVSFile","documentManagementUrl","_pdfEditorComponent","clearPDFViewerCache","_fileName","loadPDFFileData","onExportFile","exportPDFFile","pdfEditorEventHandler","_pdfEditorMessage","testString","getExportFileURL","AnalyticalResultComponent","UVFileData","_data","_uvsFileActionLabels","_uvsFileCancelRemoveLabels","taps","_typeAnalyticalProcedures","analyticalProcedure","prepareUVSFiles","_fileInputElement","fileList","dataFiles","analyticalResultId","processType","UVFileAction","processResultMsg","fileData","onSourceChange","onSelectReference","_referenceSelectorComponent","_loading","analyticalSource","entityUVFiles","hasUVFileData","disablePropertyTypeSelection","canShowFileInformationalMessage","onCancelAddUVSFile","currentFileData","onAddUVSFile","addCount","materialID","incrementNumber","setObservedResultForUVTypes","onPropertyTypeChange","resetUVData","onRemoveUVSFile","onShowUVSFile","_showAndDownloadPDFComponent","uvsfiles","translateUVSFileActionToLabel","translateUVSFileCancelRemoveToLabel","isUVAdd","isUVS","AnalyticalResultsComponent","MaterialWorkflowService","_typeWorkflowContacts","_typeWorkflowMaterialActionTransitions","recordNewReportingOrganization","userName","findWorkflowContactId","recordMaterialWorkflowActions","recordChangedReportingOrganizationName","recordMaterialSurveyReportedUseChange","changeNumberValue","surveyId","userNotes","workflowChangeValueNumber","workflowActionObjectId","workflowActionPropertyName","workflowUserNotes","recordMaterialSurveyReportedUseUserNotesOnlyChange","recordMaterialMonographChange","materialMonographId","workflowChangeValueString","recordMaterialUVSFileAdded","recordMaterialUVSFileDeleted","recordMaterialMonographNumberChange","monographNumberNew","monographNumberPrevious","newMonographNumber","previousMonographNumber","recordMaterialBotanicalPartChange","botanicalPartNew","botanicalPartPrevious","newBotanicalPart","previousBotanicalPart","recordMaterialExtractTypeChange","extractTypeNew","extractTypePrevious","newExtractType","previousExtractType","recordMaterialFEMANumberChange","femaNumberNew","femaNumberPrevious","newFEMANumber","previousFEMANumber","recordMaterialRealCASNumberChange","realCASNumberNew","realCASNumberPrevious","newCASNumber","previousCASNumber","recordMaterialAdded","recordMaterialDeleted","transitions","createWorkflowMaterialRecordedAction","typeWorkflowMaterialActionId","sequenceNumber","changeValueNumber","changeValueString","actionPropertyName","completedWorkflowMaterialActionId","createdWorkflowMaterialContactId","contacts","ctx_r17","ctx_r22","ReferenceLink","hasAddition","hasDeletion","_referenceId","_hasAddition","_hasDeletion","_referenceState","materialWorkflowService","_materialWorkflowService","_edmWorkflowReferences","_uvsFileURL","typeAnalyticalProcedure","selectAnalyticalResult","getEntities","hasAnalyticalResults","subscriberData","navToRef","formatAnalyticalSource","downloadReport","_editingComponent","addedFiles","u","ADD","recordMaterialWorkflowActivity","recordWorkflowChanges","be","_unfinishedRefs","_finishedMessage","hasUVFileChanges","_uvsFileSavedMessage","addUVFile","DELETE","removeUVFile","fetchDeletedLinkedReference","indexOfEditReference","_workflowLinkedReferences","indexOfReferenceLink","findIndex","markWorkflowAdds","func","processWorkflowItem","promises","reflink","changedEntities","checkWorkflowItemFinishedState","downloadUVSFile","exportUVSFile","referenceFinishedStatesHaveChanged","showUVFileMessage","NONE","getAddUVDocumentURL","fileIdx","append","formData","FormData","subject","Subject","next","Success","ExceptionMessage","asObservable","getRemoveUVFileURL","ToxicDataComponent","FlavorComponent","PrintToPdfDocComponent","getModalEle","ChemFormulaDirective","translateToUseSubscripts","chemFormula","tparts","SynopsisReportComponent","_reportDate","_flavorConsumptions","_uses","_flavorStatuses","_ifraStatuses","_occupationalStatuses","_matIds","_rifmAsAuthorOnly","filterExpMatsForRIFMAsAuthor","filterExpMats","_expMats","_typeStudyIds","_hhExpMats","humanHealthData","expRes","_envExpMats","environmentalData","refs","citations","_refCitations","referenceIds","printReport","querySelector","getSmileUrl","showPrintToPdfDoc","_printToPdfDocComponent","SynopsisComponent","studyIds","pEm","checkIfTooLarge","ts","_browser","_largeResultMessage","selectAll","generateReport","rifmAsAuthorOnly","filteredStudies","_canShowReport","NaturalsComponent","StatusRootComponent","FragranceUseComponent","PredictionsComponent","RelationsComponent","REACHRegistrationComponent","_types","REACHRegistrationsComponent","_materialId","Type","registrationType","registrationCASNumber","Name","registrationName","typeREACHTonnageBandId","linkToDossier","dossierWebLink","HouseStatusComponent","HouseStatusesComponent","editingComponent","MaterialFileEditorComponent","_saveData","editMaterialFileData","isExpertPanelSummary","fileType","MaterialFileType","isFragranceMaterialReview","isMonograph","isAdding","fileAction","MaterialFileAction","isEditing","isRemoving","onFileInput","fname","fext","fileExtension","edmMaterialMonograph","nextFileName","hasFileChanges","MaterialFileManagerComponent","MaterialFileData","fileLabel","materialFileAction","EDIT","materialFileType","EXPERTPANELSUMMARY","FRAGRANCEMATERIALREVIEW","MONOGRAPH","MaterialFileEditData","PublicationData","_parentData","inSubEditor","_fmr","review","summaries","_summaries","_hasMonographFiles","prepareFileDisplay","_materialFilesEx","mfiles","recordMaterialFile","expertPanelID","narrativeTitle","canConfirmRemove","canShowRemove","mf","hasFileData","nextMonographFileName","monographNum","maxSeq","uscore","charAt","seqChar","isValidNumber","seqNum","onAddMonographFile","newMonographFile","isEditingFiles","refreshMonographStatus","onConfirmRemove","removeMonographFile","fetchMaterialMonographForEdit","onRemove","saveMonographFile","recordMaterialWorkflow","removeMaterialFile","uploadMaterialFile","refreshMaterialData","filterToExpertPanelSummaryId","eps","fetchMaterialForEdit","getUploadFileURL","getRemoveMaterialFileURL","PublicationsComponent","_allSummaries","materialMonographFiles","linkToSummary","summary","downloadPublicationFile","linkToFmr","linkToMonographFile","onEditFiles","SafetyAssessmentComponent","getRelatedMaterials","assessment","hasElsevierAssessment","elsevierReportName","downloadElsevierReport","mlItems","folderName","MaterialConsumptionsComponent","_materialConsumptions","_consumptionsYearGroups","consumptions","_unitOfMeasure","hasConsumptions","yearGroupCollapse","expandAll","setUnitOfMeasure","uom","MeasureSurveyCategoryGroup","measuresByCategory","isomers","fontColor","MeasuresByCategory","categoryId","measureValues","CustomSurveyMeasuresByCategory","MeasureCustomSurveyCategoryGroup","customSurveyMeasuresByCategory","customSurveyDate","compareCustomSurveyMeasures","sortOrder","compareCustomSurveys","compareMeasures","compareSurveys","Synonyms","StructureIdentity","Relations","AnalyticalResults","ToxicData","Flavor","Synopsis","Status","FragranceUse","staffOnly","Naturals","Predictions","Publications","Reach","SafetyAssessment","RIFMStatus","MaterialConsumptions","MaterialExposure","MaterialExposureComponent","_materialExposureSurveys","_measureSurveyCategoryGroups","exposureSurveyId","exposureSurvey","_materialExposureMeasures","_measureSurveyGroups","measures","forEachMeasureCategoryAsync","fetchMaterialAsIsomerSurveys","fetchCustomSurveyMeasureData","_materialExposureCustomSurveyMeasureItems","uniqueCustomSurveys","Set","_measureCustomSurveyCategoryGroups","_measureCustomSurveyGroups","forEachCustomSurveyMeasureCategoryAsync","cg","displayCategory","categorygroups","sortedcategorygroups","sortedmeasurevalues","measureCustomSurveyCategoryGroup","filterToMeasureCustomSurveyCategoryGroup","fetchIsomers","measureSurveyCategoryGroup","filterToMeasureSurveyCategoryGroup","formatIsomerIdentifiers","_isomerOfMaterialExposureSurveys","surveyGroupCollapse","surveyGroupCollapseNew","surveyDescription","grp","hasCustomSurveyData","customSurveyGroupCollapse","customSurveyGroupCollapseNew","customSurveyDescription","csDate","onShowMaterial","isomer","materialExposureSurvey","filterToExposureSurveyById","_exposureSurveys","expsurvey","mscg","MaterialAdditionalIdentifiersComponent","visibility","defaultVisibility","getMaterialAdditionalIdentifiers","_additionalMaterialIds","toggleVisibility","trigger","transition","animate","MaterialHeaderComponent","hasRIFMTooltip","typeBotanicalSubdivision","typeEssentialOil","showTooltip","formatRIFMTooltip","bs","te","botanicalSource","essentialOilTerm","getRegistration","registrations","_materialResolver","canShow","routeDef","additionalIdsVisibility","userRoleFound","currentMaterialId","_materialNotFound","isActiveTab","_routes","WorkflowHistoryComponent","_workflowActivityCompletedItems","_workflowPendingActions","_isDataLoading","hasCompletedActions","hasPendingActions","currentReferenceId","onReferenceChange","removeAction","ReferenceDetailsComponent","REFERENCE_ROUTES","tps","_typePublications","fetchSpecialLinks","getAbstract","isProofed","isGovernmentDocument","publicationTypeId","groupedLinks","groupLinks","sl","keyExpl","keyDescr","_groupedLinks","specialLink","ReferenceDataReportComponent","getSelectedExpMaterials","selectedExpMaterial","_selectedExpMaterials","expMat","printFullReport","ix_r7","ReferenceDataComponent","initTitle","_queryParamsSub","queryParams","_casContext","cas","_bioIdContext","bioid","fetchBioData","that","initializeLocals","doReport","expMaterial","_printBd","_printExpMaterial","abbreviate","tempIx","prefix","isNotZero","showHide","op","jx","visibleIxs","isVisible","expanded","getShowHideText","show","isClickableBriefRef","_briefRefsNotFound","goToBriefRef","_emptyQueryParams","goToSynonyms","expmaterial","showDetailsToggle","toxaudit","toggleDetailsDisplay","ReferenceDetails","ReferenceData","ReferenceRelations","ReferenceRelationsComponent","fetchEntities","ReferenceHeaderComponent","ReferenceComponent","_referenceResolver","_referenceNotFound","fetchReferenceDocumentFileStatus","_hasReferenceDocumentFile","rd","_referenceFileName","canDownloadReferenceDocument","matchDocumentToRole","role","showReferenceDocument","ctx_r73","ctx_r77","ctx_r78","MaterialAdditionalIdentifierMode","MaterialEditorBaseComponent","NotSet","onCancelMap","onSaveMap","_edmIds","_typeTSCAClasses","_typeBotanicalSubdivisions","_typeEssentialOils","_typeNaturalOccurrences","materialAdditionalIdentifiers","currentTab","_tabNumber","checkIfNull","_synonymName","onSynonymChange","_fEMAMaterials","_monographMaterials","_CASCollisionWarning","editingAdditionalIdentifiers","missingAllAdditionalIdentifierFields","_materialAdditionalIdentifierMode","refreshData","adding","_synonymError","onChangeCAS","_CASChanged","numericalCASNumber","mlis","maxNumber","maxMli","maxSuffix","floor","onShowMongraphMaterials","_noMonographNumberMatchesMsg","maxMonographNumber","onShowFEMAMaterials","_noFEMANumberMatchesMsg","maxFEMANumber","femaNumber","checkConfidential","hasFEMAMatchResponse","hasMonographMatchResponse","materialHasChanges","materialAdditionalIdentifiersHasChanges","materialHasValidationErrors","hasAtLeastOneAdditionalIdentifierField","editMaterialAdditionalIdentifer","confirmMaterialAdditionalIdChanges","Adding","addMaterialAdditionalIdentifier","Editing","editMaterialAdditionalIdentifier","applyMaterialAdditionalIdentifierChanges","_materialAdditionalIdentifiersHasChanges","cancelMaterialAdditionalIdChanges","matId","matAdditionalId","isStringNullOrEmpty","onAddMaterialAdditionalIdentifiers","onDeleteAdditionalIdentifier","matid","onEditAdditionalIdentifier","changeModeDescription","MaterialEditorComponent","ctx_r5","ctx_r7","PredictionCramerEditorComponent","_typePredictions","_typePredictionClasses","prediction","PredictionsCramerEditorComponent","_edmPredictions","predictions","_adding","typePredictionId","onDeletePrediction","onEditPrediction","MaterialWorkflowHistoryComponent","activityType","loadReportedUseData","loadAllData","_workflowMaterialRecordedActions","rowColor","materialWorkflowChangeValue","typeWorkflowMaterialAction","formatDecimals","canClose","_isEditing","canShowEditSection","wmra","BusyService","isBusy","busyCounter","busy","MaterialLoader","busyService","shouldLoad","MaterialEditData","MaterialWorkflowEventFields","materialLoader","STAFF_ROUTES","maxIds","mat","editMaterial","focusInitialTab","setTabNumber","resetMaterialWorkflowModal","staffMaterialId","_materialEditorBaseComponent","storeMaterialWorkflowEventData","createMaterial","typeNaturalOccurrenceId","canDeactivateEditor","canEdit","errMap","otherErrorMap","_userMessage","hadEdits","onMore","recordMaterialWorkflowAdd","processMaterialWorkflowEvents","deleteMaterial","recordMaterialWorkflowDelete","onShowMaterialWorkflowHistory","_materialWorkflowHistoryComponent","mrun","_canShowWorkflowModal","_workflowEventData","SearchType","JournalSearchComponent","canSelect","_journal","hasJournalReservesInLibrary","activeSubscriptionsOnly","subscriptionType","clearDisplayData","_currentSearchTerm","_searchType","searchText","_journalSearchResults","searchPublications","Publisher","_journalsEx","_selectedJournalListItem","selectedEntity","resetBackgroundColor","colorSelected","selectedJournalId","journalId","journals","colorUnselected","onReset","resultsCount","userMessage","showFoundIn","showPublishers","whichTip","toggleShowJournalIdTip","toggleShowJournalNameTip","toggleShowJournalReservesTip","toggleShowJournalSubscriptionsTip","toggleShowJournalSubscriptionTypeTip","toggleShowJournalNotesTip","toggleShowJournalRelatedNamesTip","toggleShowJournalFoundInTip","toggleShowJournalSubscriptionPublishersTip","formatTooltipContent","hcode","JournalSelectorComponent","JournalSearchData","types","_typeJournalSubscriptions","_activeSubscriptionsOnly","_hasJournalReservesInLibrary","selectedJournalSubscriptionType","_publishersOnly","canSearchPublications","canDownloadPublisherSearchResults","_journalSearchComponent","onOk","_selectOnlyMode","_showJournalData","subType","_startsWith","resetJournalDataDisplay","fetchJournal","j","prepareData","_journalDataIsPrepared","onResetMap","clearSearchResults","setShowJournalData","onRestrictSearchToPublishersChange","restrictToPublishers","downloadPublisherSearchResults","_selectedJournalSubscriptionType","subTypeId","ConfirmFinishOverrideComponent","isYes","_result","reasons","buttonNames","_title","_message","_reasons","_buttonNames","reject","NotifyContact","contactName","_contactId","_contactName","_selected","ReferenceEditorBaseComponent","_workflowEmailService","tks","_typeKlimischs","ss","_typeSearchServices","_allContacts","sendTos","workflowStaff","_sendToContacts","notifies","notifyOnAddReference","lastName","_notifyContacts","holdData","otherError","onCaptivePaperChange","onRestrictedDistributionChange","isEditingRef","resetSelections","refreshWorkflowHistory","onEditRefId","origRefId","onShowHideMatches","showBriefRefMatches","getMatchingBriefRefs","onSuggestNext","newBr","getNextBriefRef","onCheckBriefRef","onSelectJournal","_journalSelectorComponent","_abstractText","ref","onInputBriefRef","_matchingAuthors","_showAuthorMatches","onDetachNewReferenceAuthors","ascii","charCodeAt","String","fromCharCode","asciiData","toBriefRef","briefRefMatches","briefRefKey","briefParts","hasBriefReferenceMatches","canShowAuthors","hasAuthorMatches","onShowHideAuthorMatches","getMatchingAuthors","_loadingAuthors","onAttachSelectedAuthor","maxCounter","onChangeAuthorSelection","selectedAuthor","onDetachReferenceAuthors","onCreateAuthor","canShowAuthorMatches","isProofable","abstractProofed","proofAbstract","_holdReason","canSaveHold","_isOnHold","showHoldReasonInput","_showHoldReasonInput","_canSaveHold","addHold","cancelAddHold","saveHold","removeHold","finishReference","confirmFinishOverride","_confirmFinishOverrideComponent","sendToStaff","_selectedContactId","recordSendTo","notifyContact","workflowContact","onSetPublicationType","govDocNumbers","govSponsors","_workflowHistoryComponent","ReferenceEditorComponent","WorkflowReferenceAssignmentsComponent","_currentWorkflowContact","fetchTypesOfPendingWorkflowRecordedActions","_workflowPendingActionTypes","_filterToCompleteDescription","_filterSettingsDescription","_hasNextPages","_hasPreviousPages","_pages","_paginationTotalItems","_searchParams","_isTypeDataLoading","consultant","getWorkflowReferenceAssignmentCounts","fetchAllWorkflowReferenceAssignments","_isPendingActionDataLoading","hasPages","nextPage","previousPage","missingContactInformation","canFilter","filterResults","onSelectReferenceAssignment","ReferenceEditData","setReferenceMinAndMax","projects","projectName","fetchThenEditReference","_referenceEditorBaseComponent","resetPageDisplay","onSelectAssignedReference","_workflowReferenceAssignmentsComponent","onNext","onPrev","canShowPrev","_referenceObservations","minReferenceId","canShowNext","maxReferenceId","isFEMA","isReady","editReference","createReference","typeKlimischId","deleteReference","rrs","rr","addedlinks","canEditReferenceDocument","onNavToReferenceDocument","documentManagementReferenceId","MaterialSummaryComponent","ctx_r21","ExpMaterialEditorComponent","_bd","_typeUnits","_typeToxicEffects","sortDescription","_calculatedToxicEffects","tte","calculated","_typeExperimentVehicles","tev","vehicle","_typeStudyMixtures","expandProtocol","expandExpMaterial","expandExpResults","_sortedExperimentalResults","onAddVehicle","_isAddingVehicle","canAcceptVehicle","_addedVehicleCode","_addedVehicleDescription","onAcceptVehicle","formattedVehicleCode","expVehicle","onCancelVehicle","parseVehicle","onAddExperimentalResult","getPreviousDoseAndUnitType","expResult","_defaultProps","typeUnitId","onAddExperimentalToxicEffect","onDeleteExperimentalResult","typeToxicEffectId","_typeToxicEffectIdCandidate","ete","experimentalResultId","onDeleteExperimentalToxicEffect","tevs","onSetCalculatedResult","onSetTypeToxicEffectId","lastexpres","ProtocolMaterialSelectorComponent","captiveLabel","_selectedMaterialIdentifiersItems","SelectedMaterials","onSelectExperimentalMaterial","mex","currentSelectedMaterials","convertMaterialToMaterialIdentifiersItem","_protocolExperimentalMaterialsEx","loadExperimentalMaterials","excludedMaterialIds","expMaterialIdsForSortOrder","_biologicalDataId","_expMaterialIdsForSortOrder","_subReference","_protocolExperimentalMaterialItems","pem","isSelected","getselectedMaterialIdentifiersItems","removeFromSelectedList","CopyStatus","ExpMaterialFromTemplateComponent","STARTCOPY","_sharedProtocolData","_edmExpMat","_edmExpRes","_step1Message","fetchSelectedExperimentalMaterials","_materialWarning","checkForMaterialDuplicates","checkForExperimentalMaterialDuplicates","convertMaterialListItemToMaterialIdentifiersItem","_step2Message","_copyStatus","MATERIALSSELECTED","onSelectingExperimentalMaterial","_protocolMaterialSelectorComponent","expMaterialIdsForSorting","duplicatesFound","matchesTemplateMaterial","_expMaterialWarning1","_expMaterialWarning2","validateExperimentalMaterial","mi","removeExperimentalMaterial","canCreateExperimentalMaterials","canRemoveSelectedMaterials","canSaveOrCancelExperimentalMaterials","EXPERIMENTALMATERIALSAPPLIED","canCreateExperimentalResults","EXPERIMENTALMATERIALSSAVED","canSaveOrCancelExperimentalResults","EXPERIMENTALRESULTSAPPLIED","canSelectMaterials","showStep1","showStep2","EXPERIMENTALMATERIALSCREATED","showStep3","EXPERIMENTALRESULTSCREATED","showStep4","EXPERIMENTALRESULTSSAVED","_savingUnfinishedReferenceDuringCopy","onSaveExperimentalMaterials","onCancelExperimentalMaterials","onSaveExperimentalResults","onCancelExperimentalResults","createExperimentalMaterialsFromTemplate","copyDetailsToExperimentalMaterials","createNewExperimentalMaterials","addExperimentalMaterials","sampleText","experimentalDetails","experimentalSummary","typeStudyMixtureId","newEM","fFDSSequenceNo","createExperimentalResultsFromTemplate","addExperimentalResults","expMaterialId","newER","dPMperLymphNode","resultNote","stimulationIndex","addExperimentalToxicEffect","experimentalMaterialsAddedCount","experimentalResultsAddedCount","experimentalResultsTemplateCount","applyComplete","saveComplete","_madeDataChanges","_finalEMCountMessage","_finalERCountMessage","allSelectedMaterialIds","COPYCOMPLETE","_informationalMessage","_step3Message","_step4Message","viewableExperimentalMaterials","askUserToConfirm","ProtocolEditorComponent","ReferenceLoader","ctx_r35","ProtocolData","referenceLoader","fetchBiologicalData","_currentBd","updateExpMats","onEditBiologicalData","onKeyDown","keyIdentifier","fetchReference","canSelectReference","_reference","_copyingExperimentalMaterial","clearEdms","staffReferenceId","sortExperimentalResults","refreshBioData","onAddBioData","biodata","typeTimeUnitId","typeUsefulnessId","onAddExpMat","onCopyExpMat","_templateExperimentalMaterial","onDeleteBioData","onDeleteExpMat","canShowSave","_hasAddsOrDeletes","_expMaterialFromTemplateComponent","expMatHasChanges","canShowApply","expMatValidate","currentExpMat","isAddedModifiedOrDeleted","expMatCancel","_expMaterialEditorComponent","canShowCancel","stateChangeNewBioData","stateChangeNewMaterialLink","stateChangeNewToxData","matLink","toxAdd","copyExperimentalMaterialEventHandler","bioDataId","expMatId","bioDataIdx","findBiologicalDataIndex","expMaterialIdx","findExperimentalMaterialIndex","_errorMessage","JournalEditorComponent","_edmNextJournalName","_journalNameStartYear","_journalNameEndYear","_selectedNameStartMonthIndex","_selectedNameEndMonthIndex","fetchJournalWithPreviousName","deleting","fetchJournalNextName","_nextJournal","rootJournalId","_previousJournal","onSearchForRelatedJournal","invalidFormerJournal","removeRelatedJournal","onChangeJournalNameStartYear","yearString","isValidYear","onChangeJournalNameEndYear","checkDate","dateString","parse","onSelectNameStartMonth","monthidx","_dateErrMsg","hasValidJournalNameDates","onSelectNameEndMonth","isDuplicateJournalName","_hasJournalNameCollision","_hasBeenDeleted","hasRelatedJournalName","_journalNameCollisionDesc","JournalsComponent","JournalEditState","JournalEditData","None","tabnum","staffJournalId","onSearchForJournal","_referencesEx","fetchJournalsRelatedByName","formatReferenceSelectableEntities","activeSubs","_hasActiveSubscription","_relatedJournals","journalEditState","Reserve","Reassign","hasFormerJournalName","formerJournalName","onAddJournal","onDownloadJournalSubscriptionReport","onDownloadJournalActiveSubscriptionReport","onDownloadJournalInactiveSubscriptionReport","onDownloadJournalReserveReport","onEditJournal","hasAssignedReferences","onDeleteJournal","hasRelatedJournalData","hasRelatedJournals","hasReservesData","onAddJournalReserve","onEditJournalReserve","h","onDeleteJournalReserve","hasSubscriptionsData","onAddJournalSubscription","Subscription","onEditJournalSubscription","onDeleteJournalSubscription","onNavigateToJournal","onSelectReferences","check","canReassignReferences","onReassignReference","selectedRefIds","selectedReferenceIds","getReferenceCountText","referenceTabTitle","cnt","ProjectSelectorComponent","project","ProjectEditorComponent","returned","getProjects","projectId","editProject","_projects","_maxProjectId","_projectSelectorComponent","deleteProject","entitiesToSave","FSAGSelectorComponent","FSAGs","FSAGEditorComponent","_maxId","sortFSAGs","fetchFSAG","getDescription","findFSAG","onNoteChange","sAG","onSelectParent","_fsagSelectorComponent","validateParent","prevParent","child","editFSAG","onAttachMaterial","setEntityState","EntityState","onDetachMaterial","createFSAG","getMaterialsCountText","deleteFSAG","wasAdding","wasAdded","TypeReferenceRelationSelectorComponent","typeReferenceRelations","typeReferenceRelation","TypeReferenceRelationEditorComponent","typeReferenceRelationId","_selectorComponent","editEntity","findEntity","inv","inverseTypeReferenceRelation","_inverseId","_inverseLabel","_inverseDescription","setId","deleteEntity","updateInv","inverseTypeReferenceRelationId","sortEntities","WhatsNewSelectorComponent","announcement","WhatsNewEditorComponent","_whatsNewSelectorComponent","ann","editAnnouncement","deleteAnnouncement","announcementDetails","ad","DatePickerDirective","WorkflowActivityReportComponent","groupData","_activityGroups","expCollapse","reportItems","workflowCompletedActions","hasReportData","printWorkflowActivityReport","ReferenceWorkflowStatsComponent","_currentFilters","fromDate","toDate","createdContactId","actionIds","_typeCompletedByContacts","_staffContact","allFilter","_filterTaskCompletedByContact","_filterWorkflowContact","fetchFilteredPendingTaskCounts","fetchPendingTaskCounts","_filterErrorMsg","_pendingTaskCounts","_hasWorkflowData","_workflowGroups","formatDateToString","fetchFilteredPendingActions","_pendingTasks","pendingWorkflowRecordedActions","workflowGroupCollapse","stillLoadingMsg","showEmptyResultsMessage","canViewStaffReport","filterName","filterCompletedByName","_fromDateString","_toDateString","filterContactChange","filterCompletedByContactChange","onDisplayAction","selectedActions","showFinishActionsFilter","dateValue","anyFilters","filterClear","resetFilterBindings","resetFilterProperties","objDate","assigned","showSearchServiceReport","showWorkflowActivityReport","anyReportFilters","fetchFilteredWorkflowActivityReport","fetchWorkflowActivityReport","_reportItems","filterFromDate","filterToDate","ReferenceAuditComponent","_toxPendingAudit","_toxAlreadyAudited","_canLoad","onAuditComplete","SurveyWhoUsedMostComponent","displayCAS","_displayCAS","surveyWhoUsedMost","rifmId","_formattedRIFMId","SurveyReportedUseComponent","sortDescending","_reportingOrganizations","names","organizationName","_organizationNames","_filterOrganizationName","minYear","_surveys","_surveyYears","_selectedYears","_filterSurveyYear","clearReportData","generateReportByCompany","generateReportByMaterialAndYear","_reportTitle","_selectedMaterialId","years","casNumber","_surveyReportedUseByMaterialAndYears","companyName","_surveyReportedUseByCompany","_hasLinks","fetchNextPage","fetchSurveyUsesPage","fetchSurveyUsesByCompanyPage","paramsReport","isActive","isInactive","clearSelectedMaterial","_selectedCASDisplay","filterSurveyYearChange","filterOrganizationChange","onShowWhoUsedMost","use","_surveyWhoUsedMostComponent","wum","SafetyAssessmentCategoryEditorComponent","assessmentCategories","assessmentCounts","assessmentsCount","isValid","isUnchangedOrModified","getAssessmentCount","hasUniqueError","onCategorySelected","PredictionEditData","TypePredictionEditorBaseComponent","MaterialReportedUseEditorComponent","MaterialReportedUseEditData","selectedSurveyYear","_typeGeographicalAreas","setUnreportedGeographicAreas","createNotesDictionary","_originalKgs","surveyReportedUseId","materialReportedUseEditState","MaterialReportedUseEditState","selectedReportingOrganization","surveys","_unreportedTypeGeographicalAreas","currentTypeGeoAreas","typeGeographicalAreaId","_dictNotes","rem","backgroundGeo","addSurveyReportedUse","findSurvey","newUse","selectedMaterial","reportedCASNumber","submitter","unmapped","reportingOrganizationId","removeSurveyReportedUse","sru","materialUseIdx","processEdits","userNote","originalSurveyReportedUsesIdx","diffKgs","findSurveyById","buildWorkflowNotes","updateMaterialConsumptions","findReportingOrganizationByName","orgIdx","reportingOrganizations","surveyIdx","processRemoveAll","validateSurveyReportedUseData","materialConsumptionIdx","edmMaterialConsumption","addMaterialConsumptions","newKgs","newMaterialConsumption","canAddNewGeoRegion","hasUserNotes","MaterialReportedUsesComponent","ReportingOrganizationEditorComponent","edmReportingOrganization","_searchedOrganizationName","_saveOrganizationName","onChangeOrganizationName","_organizationNameStringDistances","_organizationNameChanged","distThreshold","pctThreshold","validateReportingOrganization","hasCalculatedDistances","distance","recordReportingOrganizationWorkflowAction","fetchFilterData","fetchMaterialReportedUses","_surveyReportedUsesByCompanyAndMaterialAndYear","_unreportedMaterial","_surveyReportedUsesByCompanyAndMaterialAndYearEx","filterToMaterialSurveyUseById","materialUses","applyFilter","_materialWasSelected","canApplyFilter","canShowNotes","onSelectMaterialFromList","msux","onShowNotes","materialSurveyUses","canAddUnreportedMaterial","canAddReportingOrganization","canEditReportingOrganization","_materialReportedUseEditorComponent","Add","Edit","Delete","canShowConfirmDelete","canShowEditButtons","canShowEditReportingOrganizationComponent","AddReportingOrganization","EditReportingOrganization","canFilterAndView","hasUseData","onAddReportingOrganization","ro","onEditReportingOrganization","_saveMessage","_reportingOrganizationEditorComponent","_refreshReportingOrganizations","onConfirmDelete","editReportedUses","_selectedSurveyUsesByCompanyAndMaterialAndYear","removeAll","resetFiltersAndData","MaterialById","ReferenceAudit","Protocol","ReferenceEditor","ReferenceAuditById","ProtocolById","Journals","WhatsNew","RefWorkflowStats","MaterialReportedUses","AssessmentCategories","StaffEditingComponent","routes","definition","getPath","routeInfo","currentRoute","routeName","canUseMaterialHeader","canUseReferenceHeader","canUseDefaultHeader","getPageTitle","refreshLookups","ExposureSurveyEditorComponent","_typeExposureSurveyStatuses","_typeCremeVersions","cremeVersion","_years","createYearSequence","_selectedMonthIndex","_selectedYearIndex","currentYear","additionalYears","onSelectMonth","formatExposureSurveyDate","onSelectYear","yearidx","surveydate","ExposureSurveysComponent","EXPOSURE_ROUTES","getDefaultMeasureTypeIds","_exposureSurveysEx","_lastNumber","expSurvey","showExposureSurveyStatistics","esx","_selectedExposureSurvey","_exposureSurveyStatistics","exposureSurveys","typeExposureSurveyStatusId","typeCremeVersionId","_typeCremeVersionId","_typeExposureSurveyStatusId","typeCremeVersion","isDuplicateSurveyEntry","onShowMaterialList","_showExposureSurveyMaterialList","dateandnumber","MaterialExposureSurveyEditorComponent","_typeExposureSurveyResponses","fetchPreviousSurveys","_previousExposureSurveys","MaterialExposureSurveysComponent","_edmMeasures","_canClearMaterialFilter","_selectedMaterialExposureSurvey","_materialExposureSurveyIsomers","_materialExposureSurveysEx","getIsomersForMaterial","filterToMaterialExposureSurveyById","materialExposureSurveyId","expsurveymaterial","canAddToMaterialList","typeExposureSurveyResponseId","isDuplicateMaterialEntry","mesx","removeMaterialSurveyMeasures","onShowMaterialExposureSurveyNotes","materialExposureSurveys","onShowMeasures","exposuresurveyid","onSurveyChange","onClearFilter","_materialFilter","onEnterMaterialFilter","onFilterDisplayedMaterials","canFilterMaterialList","ExposureSurveyListsComponent","ExposureEditData","_navparam","filterId","filterExposureSurveyByIndex","_selectedExposureSurveyIndex","_materialExposureSurveysComponent","onExportCremeReport","onExportFullSurveyReport","onShowExposureSurvey","ExposureAdditionalMaterialEditorComponent","ExposureAdditionalMaterialsComponent","_selectedExposureAdditionalMaterial","_exposureAdditionalMaterialsEx","isDuplicateAdditionalMaterialEntry","exposureAdditionalMaterialId","amx","filterToExposureAdditionalMaterialById","expAdditionalMaterial","casMat","ExposureAdditionalMaterialSurveyMeasureEditorComponent","_typeExposureMeasures","setCurrentMeasureType","typeExposureMeasure","typeExposureMeasureValueId","_typeExposureMeasureValues","_currentTypeExposureMeasure","onSelectMeasure","typeExposureMeasureId","ExposureAdditionalMaterialSurveyMeasuresComponent","_exposureAdditionalMaterials","filterToAdditionalMaterialById","_selectedExposureAdditionalMaterialIndex","fetchExposureAdditionalMaterialSurveys","_exposureAdditionalMaterialSurveys","_unsurveyedMessage","additionalExposureSurveyId","expsurveyid","_currentExposureAdditionalMaterialSurvey","fetchMeasures","_exposureAdditionalMaterialSurveyMeasuresEx","isDuplicateMeasureEntry","_typeExposureMeasureId","_typeExposureMeasureValueId","measureDescription","measureQualitativeResult","measureQuantitativeResult","mx","_selectedExposureAdditionalMaterialSurveyMeasure","filterToExposureAdditionalMaterialSurveyMeasureById","exposureAdditionalMaterialSurveyMeasureId","onShowMaterialSurveys","measure","additionalmaterial","filterExposureAdditionalMaterialByIndex","measureName","RecordExposureSurveyMeasuresComponent","MaterialExposureSurveyMeasureEditorComponent","MaterialExposureSurveyMeasuresComponent","fetchMaterial","fetchMaterialExposureSurveys","_currentMaterialExposureSurvey","_materialExposureSurveyMeasuresEx","_selectedMaterialExposureSurveyMeasure","filterToMaterialExposureSurveyMeasureById","materialExposureSurveyMeasureId","MeasureEditData","ExposureSurveyLastReportComponent","printExposureSurveyLastReport","exportReportFile","ExposureSurveyReportsComponent","reportTopic","_rifmReports","reportTitle","onShowRIFMReport","reportWebLink","reportFileName","onShowMostRecentSurveyReport","_exposureSurveyMostRecents","onExportMaterialThresholdReport","TypeCremeVersionEditorComponent","ExposureSurveys","ExposureSurveyLists","TypeCremeVersionsComponent","_typeCremeVersionsEx","_selectedTypeCremeVersion","cv","isDuplicateTypeCremeVersionEntry","px","filterToTypeCremeVersionById","cx","versions","version","ExposureComponent","QuickDocumentUploadComponent","DOCUMENTMANAGEMENT_ROUTES","fetchRIFMDocuments","_referenceDocumentListItems","_isProcessingFiles","fileCount","_files","parseFileName","filePart","lastIndexOf","refId","allowDrop","onDragOver","onDragLeave","onDrop","dataTransfer","onAddDocument","addReferenceDocument","onReplaceFile","replaceReferenceDocumentFile","onRemoveFileFromList","_fileValidList","ignore","onUploadAll","newFiles","hasRIFMDocumentRecord","_readyForMore","clearData","_fileInvalidList","canDragFiles","canPrepareFiles","canUploadAll","onAddMore","onPrepareFiles","errorMsg","fileIndex","rIFMDocumentId","successAdd","successReplace","refIds","rifmdoc","fileValidList","onNavToRefDoc","getAddDocumentURL","getReplaceDocumentURL","ArchivedDocumentSelectorComponent","REFERENCEID","fetchRIFMDocumentArchivesByReferenceIds","_rifmDocumentArchivesEx","_searchErrorMessage","fetchRecentlyArchivedRIFMDocuments","_recentRIFMDocumentArchivesEx","takeCount","showSearchElements","RECENTLYARCHIVED","filterButtonColor","filtertype","onSelectFilterType","refreshWithRecentlyArchived","onView","dx","_selectedRIFMDocumentArchive","onRestore","archives","filterSearchType","searchTypeMessage","_searchTypeMessage","selectedFileName","selectedOriginalFileName","originalFileName","selectedReferenceId","selectedRIFMDocumentArchive","RIFMArchivedDocumentsComponent","documentManagementArchiveUrl","serviceUrl","archivedDocumentSelectorEventHandler","restoreRIFMDocumentFile","_archivedDocumentSelector","rIFMDocumentArchiveId","loadPDFFileDataAPI","_isRestoring","rifmDocumentSelectorNextAction","_rifmDocumentSelectorNextAction","showRIFMDocumentSelector","_showRIFMDocumentSelector","onSetSelectorVisibility","_selectorDisplay","_editorWidth","getRestoreFileURL","rifmDocumentArchiveId","getDocumentManagementArchiveUrl","DocumentSelectorComponent","searchAndLoadReferenceDocument","fetchAllFolders","_rifmDocumentFolders","_selectedRIFMDocumentFolderId","_selectedDocumentFolder","archiveFolder","fetchFoldersByFolderId","folderIds","_foldersAndFiles","foldername","documents","folderId","referenceDocumentsEx","fetchFoldersByReferenceId","fetchAndFormatFiles","_rifmDocumentsEx","fetchRecentlyModifiedRIFMDocuments","_recentRIFMDocumentsEx","rifmDocuments","foldersAndFilesCollapse","filterRIFMDocumentFolderByIndex","rIFMDocumentFolderId","FOLDER","RECENTLYMODIFIED","specialColorSelected","refreshWithRecentlyModified","_selectedReferenceId","_selectedRIFMDocumentId","_selectedFileName","onDeleteFile","onEditPDFPages","onExport","onReplace","onNavToRef","isDisabled","_isDisabled","selectedRIFMDocumentId","canConvertToNumber","refDocEx","filterToReferenceDocumentByReferenceId","testnum","docs","ReferenceDocumentEditData","RIFMDocumentsComponent","inPDFSubEditor","_paramSearchTerm","fetchRIFMDocumentThenEditPDF","rifmDocumentId","_selectedRIFMDocument","editingPDF","replacing","documentFileName","fetchRIFMDocumentThenEditForEditPDFPages","editingPDFPages","documentSelectorEventHandler","showSelectionMessage","_documentSelector","_pdfEditorLastRequest","onReplaceRIFMDocumentFile","removeReferenceDocument","deleteFile","_isSavingPDFFile","_pdfProcessingMessage","removeRIFMDocumentApiCall","deleteAndArchiveRIFMDocumentFile","_documentFileName","pdfEditorDisplayElement","pdfEditorDisplayElementHeight","pdfHasChanges","_showSelectionMessage","addCompleted","editPagesCompleted","replaceCompleted","resetDisplay","getArchiveFileURL","getRemoveDocumentURL","RIFMDocuments","QuickDocumentUpload","RIFMArchivedDocuments","DocumentManagementReports","DocumentManagementReportsComponent","_referenceDocumentReports","_documentManagementReportUrl","fetchMissingDocuments","_missingReferenceDocuments","onSelectReport","_selectedReportIndex","selectedReportDescription","getMissingDocumentReportURL","exportMissingDocumentCSVFile","encodeURI","getDocumentManagementReportUrl","Home","childRoutes","Staff","Exposure","DocumentManagement","DocumentManagementComponent","paramMap","routeDefObj","navPath","processPaths","redirectTo","pathMatch","children","appRouterProviders","RouterModule","relativeLinkResolution","SERVICE_PROVIDERS","CustomExceptionHandler","injector","exception","stackTrace","originalError","errors","exceptionDialog","Location","exDescription","handleError","customExceptionHandlerProvider","ErrorHandler","useFactory","deps","Injector","YesNoComponent","ExceptionDialogComponent","_ele","_errorHeader","updateErrorVars","_errorMessages","_addlErrorText","lastError","onRespond","onSendEmail","ToolBar","_typeSearches","searchFilters","defaults","defaultOption","_filter","_defaultFilter","radioOptionId","_noFilterData","refreshSearchOptions","_filters","printBody","isOnHomePage","canToggleStaff","isStaffOnlyPage","toggleStaff","_nullSearchParts","back","goHome","goMaterial","goReference","goSearchResults","searchIfEnter","keyCode","canShowDocManagement","staffOnlyOption","userReady","AppComponent","events","NavigationEnd","newRoute","_currentRoute","addClass","successfulLogin","toolBar","LoginComponent","tryLogin","getOAuthRedirectURL","DOCUMENT","ExposureAdditionalMaterialData","ExposureAdditionalMaterialSurveyEditorComponent","edmAdditionalMaterial","exposureAdditionalMaterial","ExposureAdditionalMaterialSurveysComponent","_exposureAdditionalMaterialSurveysEx","filterToExposureAdditionalMaterialSurveyById","exposureAdditionalMaterialSurveyId","_selectedExposureAdditionalMaterialSurvey","removeExposureAdditionalMaterialSurvey","removeAdditionalMaterialMeasures","additionalMaterialId","onShowAdditionalMaterialMeasures","MaterialExposureCustomSurveyMeasureEditorComponent","onCheckCustomSurveyDate","_dateErrorMsg","_customSurveyDate","MaterialExposureCustomSurveyMeasuresComponent","fetchMaterialAndCustomSurveys","_materialExposureCustomSurveyMeasuresEx","hasNoCustomMeassureData","_selectedMaterialExposureCustomSurveyMeasure","filterToMaterialExposureCustomSurveyMeasureById","materialExposureCustomSurveyMeasureId","MaterialExposureSurveyIsomerMeasuresComponent","clearFilteredData","_selectedIsomerMaterial","_selectedIsomerMaterialIndex","_uniqueExposureSurveys","_materialExposureSurveyMeasures","_uniqueIsomerMaterials","casandrifmid","textId","filterIsomerMaterialByIndex","surveyIsomers","matsurveys","filterMaterialExposureSurveyByIndex","_selectedMaterialExposureSurveyIndex","RegulatoryStatusComponent","agencies","_typeRegulatoryStatuses","trs","evaluatingAgencyId","validate","wr","ld","errText","_valError","removeValidationError","ValidationError","addValidationError","FlavorStatusesComponent","_registeredFlavors","_foodStatuses","isRegulatoryStatus","selectWebRef","parseFilePath","downloadFoodStatusFile","rs","onSelectRegulatoryStatus","filepath","newpath","tempSubFolder","FlavorUsesItemComponent","_typeFoodCategories","FlavorUsesComponent","mu","averageUsual","averageMaximum","typeFoodCategory","meanDailyConsumption","foodDescription","calcPADI","_PADI","reduce","typeFoodCategoryId","FlavorVolumesComponent","Area","getGeoArea","_groups","collapseGroup","t1","FragranceComponent","_crossTab","crossTabulate","crossTabRow","mcs","areaMap","China","Japan","Europe","EEC","USA","SOUTHAMERICA","currentRow","area","total","_totals","HumanHealthComponent","_maxExpMats","tabPath","isHumanHealth","Sponsor","_groupByMap","Study","Route","Species","_groupByKeys","groupBy","fetchAndGroupBy","calculateM","calculateR","_allGroups","toxType","navToRefData","_expMatGroups","emg","isVeryLarge","_allExpMats","getGroupDescription","filterChange","doGroupBy","propFnName","expMatGroups","biologicalDataType","shouldFetchMaterials","sText","mText","_studiesText","MaterialCompositionComponent","_componentAmountTotal","_materialCompositions","componentAmount","MaterialPartOfCompoundsComponent","pMatId","componentMaterialId","NaturalOccurrenceComponent","NaturalOccurrencesComponent","product","PredictionEnvironmentalComponent","Parameter","typeEpiSuiteParameter","ePISuiteParameter","Value","ePIValue","fetchAndGroup","_epiSuites","ePISuiteSortOrder","epiSuite","typeEpiSuiteCategory","categoryName","_epiGroups","epiSuites","_ecoSARToxicEffects","fish_96hr_LC50_Class","setBIOWINCollapse","_biowinCollapsed","setECOSARCollapse","_ecoSARCollapsed","PredictionHHAlertComponent","_scoreNotFound","_score","_materialAlertRules","Rule","mar","rule","hasStockImage","typeAlertRule","gIF","getStockImage","PredictionHHCramerComponent","_predictions","predictionName","typePrediction","primaryJudgements","primaryJudgment","primaryJudgement","predictionClass","_cramerClassification","typePredictionClass","predictionClassDescription","_cramerComment","comment","PredictionHHTTCComponent","PredictionHumanHealthComponent","ctx_r9","RegulatoryStatusesComponent","formatWebReference","regulatoryStatus","RelationsGroupComponent","ToxDataOtherReferencesComponent","_specialLinks","onReferenceSelect","RelationsGroupsComponent","baseMaterialFSAG","_fsagNote","fSAG","ents","RelationsMaterialComponent","reciprocalRelation","_isNew","reciprocalTypeMaterialRelationId","typeMaterialRelationId","relationType","_reciprocalTypes","_relatedMaterial","relatedMaterialId","_typeMaterialRelationId","_reciprocalTypeMaterialRelationId","onSetRelationId","_editErrorMessage","onSetReciprocalRelationId","validateTypeRelationSelection","getRelationTypeText","reciprocalRelationType","RelationsMaterialsComponent","_containsType","tmr","getMaterialRelations","_colSorter1","sortColumn1","_items","_materialRelations","_reciprocalMaterialRelations","mrli","_isReciprocalRelation","filteredItems","mr","typeMaterialRelation","_addedMaterialRelation","_editing","hasEditableRelation","_deleting","_editComponent","amr","StatusNtpComponent","_typeSpecies","_typeRoutes","_typeNTPStatuses","checkNull","markAsReviewed","lastReviewDate","_lastReviewDateAlertWarning","removeReviewDate","onSetNTPStatusTypeId","typeNTPStatusId","_typeNTPStatusIdAlertWarning","StatusNtpsComponent","sortedNTPEntities","StructureComponent","_typeMaterialUnits","fetchMaterialClusterPath","_clusterPath","secondRoundNCSComment","isEmptyString","mtl","navToStructureSearch","navToClusters","hasSMILES","onCopySMILESToClipboard","onMolecularWeightChange","checkSecondRoundNCS","JournalReservesComponent","prepareReservesData","JournalReserveEditorComponent","_edmReserve","createJournalReserve","fetchThenEditJournalReserve","journalReserve","isValidJournalReserve","JournalNamesComponent","hasNamesData","JournalReassignComponent","_selectedReferences","reassignJournalName","_reassignJournal","onSearchForReassignJournal","reassignJournalReferences","_hasBeenReassigned","canReassign","sameStringWithoutSpaces","compare1","compare2","JournalSubscriptionEditorComponent","_edmSubscription","createJournalSubscription","_journalSubscription","typeJournalSubscriptionId","fetchThenEditJournalSubscription","journalSubscription","_subscriptionStartYear","_subscriptionEndYear","_selectedSubscriptionStartMonthIndex","_selectedSubscriptionEndMonthIndex","hasValidJournalSubscriptionDates","isValidSubscription","subscription","onChangeJournalSubscriptionStartYear","onChangeJournalSubscriptionEndYear","onSelectSubscriptionStartMonth","onSelectSubscriptionEndMonth","endMonth","JournalSubscriptionsComponent","prepareSubscriptionsData","ComplianceSelectorComponent","_allEntities","guideline","hasSearchTerm","ProtocolEditorBiodataComponent","_typeStudyDesignations","_typeTimeUnits","_typeUsefulnesses","updateStudy","updateHHorEnv","updateSpecies","tsd","designation","onAddBriefRef","validateReference","refreshBriefRefs","onDeleteBriefRef","onSelectCompliance","_complianceSelectorComponent","compliance","ProtocolEditorSubStudiesComponent","_typeStudyId","typeStudySubTypeId","_filteredSubTypes","getStudySubTypes","_typeStudySubTypes","addSubStudy","onDeleteSubStudy","subStudy","studyId","ReferenceAnalyticalResultsComponent","special","_linkedAnalyticalResults","linkedAnalyticalResults","goToMaterialAnalyticalResults","hasCheckedSpecialLinks","hasUncheckedSpecialLinks","onLinkedAnalyticalResultsChecked","AuthorEditorComponent","canApplyAuthor","onApplyAuthor","canCheckForSimilarAuthors","canShowNoAuthorMatchesMessage","_authorNameStringDistances","_noAuthorMatchesMessage","onCheckForSimilarAuthors","ReferenceEditorAuthorComponent","_etAlRefAuthor","getEtAlRefAuthor","_etAlEnabled","_newEtAlAuthor","_entity","onEtAlChange","etAlRefAuthor","onDetachAuthor","addReferenceAuthorFor","onAttachAuthor","editAuthor","onEditAuthor","ReferenceEditorRelationsComponent","_typeReferenceRelations","_typeReferenceRelation","referenceRelations","setTypeReferenceRelation","getTypeReferenceRelation","trr","onAttachReference","attachRelatedReference","onDetachReference","referenceRelation","relatedReferenceId","_inverseRelations","relatedReference","invTypeReferenceRelation","rr2","SpecialLinkEditorComponent","_typeKeywords","keyword","_keyword","_keywordErrorMessage","_materialErrorMessage","ReferenceEditorSpecialComponent","groupSpecialLinks","onCreateLink","getPreviousLinkProperties","newSpecialLink","onApplyLink","onDetachLink","_linksDeleted","lastlink","TypePredictionClassEditorComponent","predictionClassKey","TypePredictionClassesComponent","_typePredictionClassesEx","_selectedTypePredictionClass","_typePredictionClassEditorComponent","matchTypePredictionClassEntry","filterToTypePredictionClass","pcx","pclass","TypePredictionEditorComponent","TypePredictionsComponent","_typePredictionsEx","_selectedTypePrediction","isDuplicateTypePredictionEntry","numberOfPrimaryJudgements","filterToTypePredictionById","primaries","AddReferenceDocumentComponent","cancelAdd","_filedata","_lastAddedReferenceId","_lastAddedReferenceMessage","_selectedReferenceForAdd","onSelectReferenceForAdd","checkIfFileNameMatchReferenceId","_showAddButton","assignedReferenceId","canAddReferenceDocument","canShowBackFromAddReferenceDocument","_addedSuccessfully","onBackFromAddReferenceDocument","onSaveAdd","PageActionType","InsertType","EditPDFPagesComponent","EXTRACTPAGES","_extractPageNumberString","_removePageNumberString","hasAddPagesEdits","selectedPageActionType","ADDPAGES","_addPageIndex","hasExtractPagesEdits","_extractPageRangeStart","_extractPageRangeEnd","hasRemovePagesEdits","REMOVEPAGES","_removePageRangeStart","_removePageRangeEnd","onBackAndView","clearParameterValues","_addedPagesSuccessfully","_extractPagesSuccessfully","_removePagesSuccessfully","isValidExtract","canConvertToPageNumber","nums","extractAndValidateStringOfNumbers","isValidAddPages","_selectedInsertionOptionPageIndex","isValidRemovePages","stringOfNumbers","hasParameterErrors","pageNumbers","pagesWithBaseZero","substractValueFromNumberArray","numbers","decrementValue","extractPages","extractPDFPagesIntoFile","addPages","addPagesToPDF","removePages","removePagesFromPDFFile","onselectedInsertionOption","BYINDEX","_selectedInsertionOptionBeginning","_selectedInsertionOptionEnd","BEGINNING","END","pdfPageActionType","_selectedPageActionType","pageActionButtonColor","onSelectPageActionType","getAddPagesURL","insertAtEnd","shiftedAddPageIndex","getExtractPagesURL","pageString","pageRangeStart","pageRangeEnd","getRemovePDFPagesURL","extractFileName","getDocumentManagementPDFEditingUrl","ReplaceReferenceDocumentComponent","cancelReplace","_replacedSuccessfully","AuthHttpInterceptor","userManager","intercept","request","authReq","handle","pipe","tap","AppModule","ModelLibraryBackingStoreAdapter","UriBuilderODataAdapter","AjaxHttpClientAdapter","DataServiceWebApiAdapter","registerLicense","bootstrap","FormDesignerService","HTTP_INTERCEPTORS","useClass","multi","imports","BrowserModule","FormsModule","HttpClientModule","BrowserAnimationsModule","DxDataGridModule","DxTooltipModule","PdfViewerModule","ToolbarModule","DxButtonModule","Settings","enableLogging","sentryIoDsn","initialize","release","install","configRavenLogging","enableProdMode","__NgCli_bootstrap_1","bootstrapModule","tags","qe"],"sourceRoot":"webpack:///","sources":["./src/app/services/repository.ts","./src/app/services/reference-repository.ts","./src/app/entities/EntityBase.ts","./src/app/entities/AnalyticalResult.ts","./src/app/utils/util-fns.ts","./src/app/utils/location-fns.ts","./src/app/controls/page-state.ts","./src/app/utils/edit-manager.ts","./src/app/entities/EntityTypeAnnotation.ts","./src/app/entities/Material.ts","./src/app/entities/DermalExposure.ts","./src/app/entities/ECOSARToxicEffect.ts","./src/app/entities/EPIData.ts","./src/app/entities/EPISuite.ts","./src/app/entities/TypeEPISuiteParameter.ts","./src/app/entities/TypeEPISuiteCategory.ts","./src/app/entities/ExperimentalMaterial.ts","./src/app/entities/Reference.ts","./src/app/entities/BiologicalData.ts","./src/app/entities/BioDataStudySubType.ts","./src/app/entities/TypeStudySubType.ts","./src/app/entities/Abstract.ts","./src/app/entities/projections/JournalReserveItem.ts","./src/app/entities/projections/JournalSubscriptionItem.ts","./src/app/entities/Journal.ts","./src/app/entities/Project.ts","./src/app/entities/ReferenceAuthor.ts","./src/app/entities/Author.ts","./src/app/entities/ReferenceRelation.ts","./src/app/entities/TypeReferenceRelation.ts","./src/app/entities/SpecialLink.ts","./src/app/entities/TypeKeyword.ts","./src/app/entities/TypeKlimisch.ts","./src/app/entities/TypePublication.ts","./src/app/entities/TypeSearchService.ts","./src/app/entities/WorkflowRecordedAction.ts","./src/app/entities/TypeWorkflowAction.ts","./src/app/entities/TypeWorkflowContact.ts","./src/app/entities/TypeRoute.ts","./src/app/entities/TypeSpecies.ts","./src/app/entities/TypeStudy.ts","./src/app/entities/TypeTitle.ts","./src/app/entities/TypeTimeUnit.ts","./src/app/entities/TypeUsefulness.ts","./src/app/entities/ExperimentalResult.ts","./src/app/entities/ExperimentalToxicEffect.ts","./src/app/entities/TypeToxicEffect.ts","./src/app/entities/TypeExperimentVehicle.ts","./src/app/entities/TypeUnit.ts","./src/app/entities/TypeStudyMixture.ts","./src/app/entities/FoodStatus.ts","./src/app/entities/JECFAMonograph.ts","./src/app/entities/TypeFoodStatus.ts","./src/app/entities/HouseStatus.ts","./src/app/entities/MaterialAdditionalIdentifier.ts","./src/app/entities/TypeMaterialIdentifier.ts","./src/app/entities/MaterialAlertRule.ts","./src/app/entities/TypeAlertRule.ts","./src/app/entities/MaterialAssessmentCategory.ts","./src/app/entities/AssessmentCategory.ts","./src/app/entities/MaterialConsumption.ts","./src/app/entities/Survey.ts","./src/app/entities/TypeGeographicalArea.ts","./src/app/entities/TypeSponsor.ts","./src/app/entities/MaterialExpertPanelSummary.ts","./src/app/entities/ExpertPanelSummary.ts","./src/app/entities/MaterialFSAG.ts","./src/app/entities/FSAG.ts","./src/app/entities/MaterialHazardCode.ts","./src/app/entities/TypeHazardCode.ts","./src/app/entities/MaterialPrecautionCode.ts","./src/app/entities/TypePrecautionStatement.ts","./src/app/entities/MaterialRelation.ts","./src/app/entities/TypeMaterialRelation.ts","./src/app/entities/MaterialTransparencyList.ts","./src/app/entities/MaterialUNTransport.ts","./src/app/entities/MaterialUNTransportCode.ts","./src/app/entities/TypeHazardousSymbol.ts","./src/app/entities/NaturalOccurrenceDescriptor.ts","./src/app/entities/Prediction.ts","./src/app/entities/TypePrediction.ts","./src/app/entities/TypePredictionClass.ts","./src/app/entities/REACHRegistration.ts","./src/app/entities/TypeREACHTonnageBand.ts","./src/app/entities/RegulatoryStatus.ts","./src/app/entities/TypeRegulatoryStatus.ts","./src/app/entities/SafetyAssessmentMaterial.ts","./src/app/entities/SafetyComment.ts","./src/app/entities/TypeSafety.ts","./src/app/entities/SafetyEUComment.ts","./src/app/entities/TypeSafetyEU.ts","./src/app/entities/SynonymNamer.ts","./src/app/entities/Synonym.ts","./src/app/entities/TypeSynonymUse.ts","./src/app/entities/TypeBotanicalSubdivision.ts","./src/app/entities/TypeEssentialOil.ts","./src/app/entities/TypeNarrativeSummary.ts","./src/app/entities/TypeNaturalOccurrence.ts","./src/app/entities/TypeTSCAClass.ts","./src/app/entities/MaterialUses.ts","./src/app/entities/TypeFoodCategory.ts","./src/app/entities/TypeAnalyticalProcedure.ts","./src/app/entities/AnnouncementDetail.ts","./src/app/entities/TypeLinkTarget.ts","./src/app/entities/Announcement.ts","./src/app/entities/ApplicationConfigurationSetting.ts","./src/app/entities/ClusterGroup.ts","./src/app/entities/ClusterNodeAndEdge.ts","./src/app/entities/ClusterPart.ts","./src/app/entities/ClusterPath.ts","./src/app/entities/ClusterPartWithParent.ts","./src/app/entities/ExposureAdditionalMaterial.ts","./src/app/entities/ExposureAdditionalMaterialSurveyMeasure.ts","./src/app/entities/ExposureSurvey.ts","./src/app/entities/MaterialExposureSurveyMeasure.ts","./src/app/entities/TypeCremeVersion.ts","./src/app/entities/TypeExposureMeasure.ts","./src/app/entities/TypeExposureMeasureValue.ts","./src/app/entities/TypeHouseholdProduct.ts","./src/app/entities/MaterialExposureSurvey.ts","./src/app/entities/TypeExposureSurveyResponse.ts","./src/app/entities/TypeExposureSurveyStatus.ts","./src/app/entities/ExposureAdditionalMaterialSurvey.ts","./src/app/entities/ExposureSurveyMaterialMeasureCount.ts","./src/app/entities/ExposureSurveyMaterialMostRecent.ts","./src/app/entities/LabelingManualPublication.ts","./src/app/entities/MaterialCluster.ts","./src/app/entities/MaterialComponent.ts","./src/app/entities/TypeMaterialComponentClass.ts","./src/app/entities/MaterialComposition.ts","./src/app/entities/MaterialExposureSurveyIsomer.ts","./src/app/entities/NationalToxicologyProgram.ts","./src/app/entities/TypeNTPStatus.ts","./src/app/entities/RIFMProductLicense.ts","./src/app/entities/RIFMProduct.ts","./src/app/entities/RIFMReport.ts","./src/app/entities/StaffWorkflowReport.ts","./src/app/entities/SuperClusterPath.ts","./src/app/entities/SuperCluster.ts","./src/app/entities/SurveyAndCompany.ts","./src/app/entities/SurveyReportedUse.ts","./src/app/entities/SynonymWebVersion.ts","./src/app/entities/TypeAlertConcLevelScore.ts","./src/app/entities/TypeAlertVolumeScore.ts","./src/app/entities/TypeChangeReportFrequency.ts","./src/app/entities/TypeChangeReportTopic.ts","./src/app/entities/TypeComplianceGuideline.ts","./src/app/entities/TypeSearch.ts","./src/app/entities/TypeStudyDesignation.ts","./src/app/entities/TypeWorkflowActionTransition.ts","./src/app/entities/UserAcknowledgement.ts","./src/app/entities/UserChangeReportAuthor.ts","./src/app/entities/UserChangeReport.ts","./src/app/entities/UserChangeReportMaterial.ts","./src/app/entities/UserChangeReportStudy.ts","./src/app/entities/UserChangeReportTopic.ts","./src/app/entities/UserSessionToken.ts","./src/app/entities/SurveyUsesByMaterialAndYear.ts","./src/app/entities/SurveyUsesByCompanyAndMaterialAndYear.ts","./src/app/entities/SurveyWhoUsedMostMaterial.ts","./src/app/entities/WorkflowPendingAction.ts","./src/app/entities/WorkflowReferenceAssignment.ts","./src/app/entities/RIFMDocument.ts","./src/app/entities/RIFMDocumentArchive.ts","./src/app/entities/RIFMDocumentFolder.ts","./src/app/entities/TypeRIFMDocument.ts","./src/app/entities/MaterialExposureCustomSurveyMeasure.ts","./src/app/entities/MaterialMonograph.ts","./src/app/entities/RIFMDownloadableFile.ts","./src/app/services/error-logger.ts","./src/environments/environment.prod.ts","./src/app/services/configuration.ts","./src/app/services/entity-manager-provider.ts","./src/app/entities/_RegistrationHelper.ts","./src/app/services/user-manager.ts","./src/app/services/unit-of-work.ts","./src/app/services/state-map.ts","./src/app/services/mol-image.service.ts","./src/app/services/search.ts","./src/app/services/editor.service.ts","./src/app/services/provide-parent.ts","./src/app/services/workflow-state.ts","./src/app/services/workflow-service.ts","./src/app/services/reference-finished-service.ts","./src/app/services/workflow-deletion-service.ts","./src/app/services/reference-state.ts","./src/app/services/workflow-email-service.ts","./src/app/services/auth-guard.service.ts","./src/app/services/auth-guard-allow-authorized.service.ts","./src/app/services/can-deactivate.service.ts","./src/app/components/material/material.resolver.ts","./src/app/components/reference/reference.resolver.ts","./src/app/entities/JournalReserve.ts","./src/app/entities/JournalSubscription.ts","./src/app/entities/ReportingOrganization.ts","./src/app/controls/modal-dialog.ts","./src/app/controls/column-sorter.ts","./src/app/controls/column-sorter.directive.ts","./src/app/controls/html-greek-translator.ts","./src/app/controls/html-greek.directive.ts","./src/app/controls/tab-container/tab-pane.directive.ts","./src/app/controls/tab-container/tab-container-horz.component.ts","./src/app/controls/edit-prop.component.ts","./src/app/components/home/user-acknowledgement.component.ts","./src/app/components/home/user-acknowledgement.html","./src/app/components/home/whats-new.html","./src/app/components/home/whats-new.component.ts","./src/app/components/home/home-page.html","./src/app/components/home/home-page.component.ts","./src/app/components/home/intro.component.ts","./src/app/components/home/intro.html","./src/app/controls/page-status.control.ts","./src/app/components/material/material-results.html","./src/app/components/material/material-results.component.ts","./src/app/controls/ng2-pagination/pagination-service.ts","./src/app/components/reference/reference-results.html","./src/app/components/reference/reference-results.component.ts","./src/app/components/home/search-results.html","./src/app/components/home/search-results.component.ts","./src/app/components/home/search-authors.html","./src/app/components/home/search-authors.component.ts","./src/app/components/home/search-synonyms.html","./src/app/components/home/search-synonyms.component.ts","./src/app/controls/default-table.component.ts","./src/app/components/home/marvin-search.html","./src/app/components/home/marvin-search.component.ts","./src/app/components/home/material-groups.html","./src/app/components/home/material-groups.component.ts","./src/app/controls/ng2-pagination/paginate-pipe.ts","./src/app/components/home/safety-assessments.html","./src/app/components/home/safety-assessments.component.ts","./src/app/components/home/ifra-attachments.html","./src/app/components/home/ifra-attachments.component.ts","./src/app/components/home/tools-and-model.html","./src/app/components/home/tools-and-model.component.ts","./src/app/components/home/tools-and-models-license.component.ts","./src/app/components/home/tools-and-models-license.html","./src/app/controls/editor-header.html","./src/app/controls/editor-header.component.ts","./src/app/components/home/tools-and-models.html","./src/app/components/home/tools-and-models.component.ts","./src/app/components/material/material-selector.html","./src/app/components/material/material-selector.component.ts","./src/app/components/reference/author-selector.html","./src/app/components/reference/author-selector.component.ts","./src/app/components/home/report-database-changes.html","./src/app/components/home/report-database-changes.component.ts","./src/app/components/home/system-requirements.component.ts","./src/app/components/home/system-requirements.html","./src/app/components/home/ifra-survey-use.component.ts","./src/app/components/home/ifra-survey-use.html","./src/app/components/home/database-subscription.html","./src/app/components/home/database-subscription.component.ts","./src/app/entities/projections/SelectableEntity.ts","./src/app/components/home/cluster-help-video.component.ts","./src/app/components/home/cluster-help-video.html","./src/app/components/home/clusterpath-filter.html","./src/app/components/home/clusterpath-filter.component.ts","./src/app/components/home/clusterpath-selector.html","./src/app/components/home/clusterpath-selector.component.ts","./src/app/components/home/cytoscape-graph.component.ts","./src/app/components/home/cytoscape-graph.html","./src/app/components/home/material-clusters.html","./src/app/components/home/material-clusters.component.ts","./src/app/components/home/environmental-data.html","./src/app/components/home/home.routes.ts","./src/app/components/home/environmental-data.component.ts","./src/app/components/home/home.component.ts","./src/app/components/material/synonym.html","./src/app/components/material/synonym.component.ts","./src/app/components/material/synonyms.html","./src/app/components/material/synonyms.component.ts","./src/app/components/material/structure-identity.html","./src/app/components/material/structure-identity.component.ts","./src/app/components/reference/reference-selector.html","./src/app/components/reference/reference-selector.component.ts","./src/app/components/docmanagement/pdf-editor.html","./src/app/components/docmanagement/pdf-editor.component.ts","./src/app/components/docmanagement/show-and-download-pdf.html","./src/app/components/docmanagement/show-and-download-pdf.component.ts","./src/app/components/material/analytical-result.html","./src/app/components/material/analytical-result.component.ts","./src/app/services/material-workflow-service.ts","./src/app/components/material/analytical-results.html","./src/app/components/material/analytical-results.component.ts","./src/app/components/material/toxic-data.html","./src/app/components/material/toxic-data.component.ts","./src/app/components/material/flavor.html","./src/app/components/material/flavor.component.ts","./src/app/components/main/print-to-pdf-doc.component.ts","./src/app/components/main/print-to-pdf-doc.html","./src/app/controls/chem-formula.directive.ts","./src/app/components/material/synopsis-report.html","./src/app/components/material/synopsis-report.component.ts","./src/app/components/material/synopsis.html","./src/app/components/material/synopsis.component.ts","./src/app/components/material/naturals.html","./src/app/components/material/naturals.component.ts","./src/app/components/material/status-root.html","./src/app/components/material/status-root.component.ts","./src/app/components/material/fragrance-use.html","./src/app/components/material/fragrance-use.component.ts","./src/app/components/material/predictions.html","./src/app/components/material/predictions.component.ts","./src/app/components/material/relations.html","./src/app/components/material/relations.component.ts","./src/app/components/material/reach-registration.html","./src/app/components/material/reach-registration.component.ts","./src/app/components/material/reach-registrations.html","./src/app/components/material/reach-registrations.component.ts","./src/app/components/material/house-status.component.ts","./src/app/components/material/house-status.html","./src/app/components/material/house-statuses.html","./src/app/components/material/house-statuses.component.ts","./src/app/components/material/material-file-editor.html","./src/app/components/material/material-file-editor.component.ts","./src/app/components/material/material-file-manager.html","./src/app/components/material/material-file-manager.component.ts","./src/app/components/material/publications.html","./src/app/components/material/publications.component.ts","./src/app/components/material/safety-assessment.html","./src/app/components/material/safety-assessment.component.ts","./src/app/components/material/material-consumptions.html","./src/app/components/material/material-consumptions.component.ts","./src/app/entities/projections/MeasureSurveyCategoryGroup.ts","./src/app/entities/projections/MeasuresByCategory.ts","./src/app/entities/projections/CustomSurveyMeasuresByCategory.ts","./src/app/entities/projections/MeasureCustomSurveyCategoryGroup.ts","./src/app/components/material/material-exposure.html","./src/app/components/material/material-exposure.component.ts","./src/app/components/material/material.routes.ts","./src/app/components/material/material-additional-identifiers.html","./src/app/components/material/material-additional-identifiers.component.ts","./src/app/components/material/material-header.html","./src/app/components/material/material-header.component.ts","./src/app/components/material/material.html","./src/app/components/material/material.component.ts","./src/app/components/staff/workflow-history.html","./src/app/components/staff/workflow-history.component.ts","./src/app/components/reference/reference-details.html","./src/app/components/reference/reference-details.component.ts","./src/app/components/reference/reference-data-report.html","./src/app/components/reference/reference-data-report.component.ts","./src/app/components/reference/reference-data.html","./src/app/components/reference/reference-data.component.ts","./src/app/components/reference/reference-relations.html","./src/app/components/reference/reference.routes.ts","./src/app/components/reference/reference-relations.component.ts","./src/app/components/reference/reference-header.html","./src/app/components/reference/reference-header.component.ts","./src/app/components/reference/reference.html","./src/app/components/reference/reference.component.ts","./src/app/components/staff/material-editor-base.html","./src/app/components/staff/material-editor-base.component.ts","./src/app/components/staff/prediction-cramer-editor.html","./src/app/components/staff/prediction-cramer-editor.component.ts","./src/app/components/staff/predictions-cramer-editor.html","./src/app/components/staff/predictions-cramer-editor.component.ts","./src/app/components/staff/material-workflow-history.html","./src/app/components/staff/material-workflow-history.component.ts","./src/app/services/busy.service.ts","./src/app/components/staff/services/material-loader.ts","./src/app/components/staff/material-editor.html","./src/app/components/staff/material-editor.component.ts","./src/app/components/staff/journal-search.html","./src/app/components/staff/journal-search.component.ts","./src/app/components/staff/journal-selector.html","./src/app/components/staff/journal-selector.component.ts","./src/app/components/staff/confirm-finish-override.html","./src/app/components/staff/confirm-finish-override.component.ts","./src/app/components/staff/reference-editor-base.html","./src/app/components/staff/reference-editor-base.component.ts","./src/app/components/staff/workflow-reference-assignments.html","./src/app/components/staff/workflow-reference-assignments.component.ts","./src/app/components/staff/reference-editor.html","./src/app/components/staff/reference-editor.component.ts","./src/app/components/material/material-summary.html","./src/app/components/material/material-summary.component.ts","./src/app/components/staff/exp-material-editor.html","./src/app/components/staff/exp-material-editor.component.ts","./src/app/components/staff/protocol-material-selector.html","./src/app/components/staff/protocol-material-selector.component.ts","./src/app/components/staff/exp-material-from-template.html","./src/app/components/staff/exp-material-from-template.component.ts","./src/app/components/staff/services/reference-loader.ts","./src/app/components/staff/protocol-editor.html","./src/app/components/staff/protocol-editor.component.ts","./src/app/components/staff/journal-editor.html","./src/app/components/staff/journal-editor.component.ts","./src/app/components/staff/journals.html","./src/app/components/staff/journals.component.ts","./src/app/components/staff/project-selector.html","./src/app/components/staff/project-selector.component.ts","./src/app/components/staff/project-editor.html","./src/app/components/staff/project-editor.component.ts","./src/app/components/staff/fsag-selector.html","./src/app/components/staff/fsag-selector.component.ts","./src/app/components/staff/fsag-editor.html","./src/app/components/staff/fsag-editor.component.ts","./src/app/components/staff/type-reference-relation-selector.html","./src/app/components/staff/type-reference-relation-selector.component.ts","./src/app/components/staff/type-reference-relation-editor.html","./src/app/components/staff/type-reference-relation-editor.component.ts","./src/app/components/staff/whats-new-selector.html","./src/app/components/staff/whats-new-selector.component.ts","./src/app/components/staff/whats-new-editor.html","./src/app/components/staff/whats-new-editor.component.ts","./src/app/controls/date-picker-dummy.directive.ts","./src/app/components/staff/workflow-activity-report.html","./src/app/components/staff/workflow-activity-report.component.ts","./src/app/components/staff/reference-workflow-stats.html","./src/app/components/staff/reference-workflow-stats.component.ts","./src/app/components/staff/reference-audit.html","./src/app/components/staff/reference-audit.component.ts","./src/app/components/staff/survey-whousedmost.html","./src/app/components/staff/survey-whousedmost.component.ts","./src/app/components/staff/survey-reported-use.html","./src/app/components/staff/survey-reported-use.component.ts","./src/app/components/staff/safety-assessment-category-editor.html","./src/app/components/staff/safety-assessment-category-editor.component.ts","./src/app/components/staff/type-prediction-editor-base.html","./src/app/components/staff/type-prediction-editor-base.component.ts","./src/app/components/staff/material-reported-use-editor.html","./src/app/components/staff/material-reported-use-editor.component.ts","./src/app/components/staff/reporting-organization-editor.html","./src/app/components/staff/reporting-organization-editor.component.ts","./src/app/components/staff/material-reported-uses.html","./src/app/components/staff/material-reported-uses.component.ts","./src/app/components/staff/staff.routes.ts","./src/app/components/staff/staff-editing.html","./src/app/components/staff/staff-editing.component.ts","./src/app/components/exposure/exposure-survey-editor.html","./src/app/components/exposure/exposure-survey-editor.component.ts","./src/app/components/exposure/exposure-surveys.html","./src/app/components/exposure/exposure-surveys.component.ts","./src/app/components/exposure/material-exposure-survey-editor.html","./src/app/components/exposure/material-exposure-survey-editor.component.ts","./src/app/components/exposure/material-exposure-surveys.html","./src/app/components/exposure/material-exposure-surveys.component.ts","./src/app/components/exposure/exposure-survey-lists.html","./src/app/components/exposure/exposure-survey-lists.component.ts","./src/app/components/exposure/exposure-additional-material-editor.html","./src/app/components/exposure/exposure-additional-material-editor.component.ts","./src/app/components/exposure/exposure-additional-materials.html","./src/app/components/exposure/exposure-additional-materials.component.ts","./src/app/components/exposure/exposure-additional-material-survey-measure-editor.html","./src/app/components/exposure/exposure-additional-material-survey-measure-editor.component.ts","./src/app/components/exposure/exposure-additional-material-survey-measures.html","./src/app/components/exposure/exposure-additional-material-survey-measures.component.ts","./src/app/components/exposure/material-exposure-survey-measure-editor.html","./src/app/components/exposure/material-exposure-survey-measure-editor.component.ts","./src/app/components/exposure/material-exposure-survey-measures.html","./src/app/components/exposure/material-exposure-survey-measures.component.ts","./src/app/components/exposure/record-exposure-survey-measures.html","./src/app/components/exposure/record-exposure-survey-measures.component.ts","./src/app/components/exposure/exposure-survey-last-report.html","./src/app/components/exposure/exposure-survey-last-report.component.ts","./src/app/components/exposure/exposure-survey-reports.html","./src/app/components/exposure/exposure-survey-reports.component.ts","./src/app/components/exposure/type-creme-version-editor.html","./src/app/components/exposure/type-creme-version-editor.component.ts","./src/app/components/exposure/type-creme-versions.html","./src/app/components/exposure/exposure.routes.ts","./src/app/components/exposure/type-creme-versions.component.ts","./src/app/components/exposure/exposure.html","./src/app/components/exposure/exposure.component.ts","./src/app/components/docmanagement/quick-document-upload.html","./src/app/components/docmanagement/quick-document-upload.component.ts","./src/app/components/docmanagement/archived-document-selector.html","./src/app/components/docmanagement/archived-document-selector.component.ts","./src/app/components/docmanagement/rifm-archived-documents.html","./src/app/components/docmanagement/rifm-archived-documents.component.ts","./src/app/components/docmanagement/document-selector.html","./src/app/components/docmanagement/document-selector.component.ts","./src/app/components/docmanagement/rifm-documents.html","./src/app/components/docmanagement/rifm-documents.component.ts","./src/app/components/docmanagement/document-management-reports.html","./src/app/components/docmanagement/document-management.routes.ts","./src/app/components/docmanagement/document-management-reports.component.ts","./src/app/components/docmanagement/document-management.html","./src/app/components/routes.ts","./src/app/components/docmanagement/document-management.component.ts","./src/app/route-provider.ts","./src/app/services/service-registration.ts","./src/app/services/custom-exception-handler-provider.ts","./src/app/components/main/yes-no.html","./src/app/components/main/yes-no.component.ts","./src/app/components/main/exception-dialog.component.ts","./src/app/components/main/exception-dialog.html","./src/app/components/main/toolbar.html","./src/app/components/main/toolbar.component.ts","./src/app/components/main/app.component.ts","./src/app/components/main/app.html","./src/app/components/main/login.component.ts","./src/app/components/main/login.html","./src/app/components/exposure/exposure-additional-material-survey-editor.html","./src/app/components/exposure/exposure-additional-material-survey-editor.component.ts","./src/app/components/exposure/exposure-additional-material-surveys.html","./src/app/components/exposure/exposure-additional-material-surveys.component.ts","./src/app/components/exposure/material-exposure-custom-survey-measure-editor.html","./src/app/components/exposure/material-exposure-custom-survey-measure-editor.component.ts","./src/app/components/exposure/material-exposure-custom-survey-measures.html","./src/app/components/exposure/material-exposure-custom-survey-measures.component.ts","./src/app/components/exposure/material-exposure-survey-isomer-measures.html","./src/app/components/exposure/material-exposure-survey-isomer-measures.component.ts","./src/app/components/material/regulatory-status.html","./src/app/components/material/regulatory-status.component.ts","./src/app/components/material/flavor-statuses.html","./src/app/components/material/flavor-statuses.component.ts","./src/app/components/material/flavor-uses-item.html","./src/app/components/material/flavor-uses-item.component.ts","./src/app/components/material/flavor-uses.html","./src/app/components/material/flavor-uses.component.ts","./src/app/components/material/flavor-volumes.html","./src/app/components/material/flavor-volumes.component.ts","./src/app/components/material/fragrance.html","./src/app/components/material/fragrance.component.ts","./src/app/components/material/human-health.html","./src/app/components/material/human-health.component.ts","./src/app/components/material/material-composition.html","./src/app/components/material/material-composition.component.ts","./src/app/components/material/material-partof-compounds.html","./src/app/components/material/material-partof-compounds.component.ts","./src/app/components/material/natural-occurrence.component.ts","./src/app/components/material/natural-occurrence.html","./src/app/components/material/natural-occurrences.html","./src/app/components/material/natural-occurrences.component.ts","./src/app/components/material/prediction-environmental.html","./src/app/components/material/prediction-environmental.component.ts","./src/app/components/material/prediction-hh-alert.html","./src/app/components/material/prediction-hh-alert.component.ts","./src/app/components/material/prediction-hh-cramer.html","./src/app/components/material/prediction-hh-cramer.component.ts","./src/app/components/material/prediction-hh-ttc.component.ts","./src/app/components/material/prediction-hh-ttc.html","./src/app/components/material/prediction-human-health.html","./src/app/components/material/prediction-human-health.component.ts","./src/app/components/material/regulatory-statuses.html","./src/app/components/material/regulatory-statuses.component.ts","./src/app/components/material/relations-group.html","./src/app/components/material/relations-group.component.ts","./src/app/components/material/tox-data-other.html","./src/app/components/material/tox-data-other.component.ts","./src/app/components/material/relations-groups.html","./src/app/components/material/relations-groups.component.ts","./src/app/components/material/relations-material.html","./src/app/components/material/relations-material.component.ts","./src/app/components/material/relations-materials.html","./src/app/components/material/relations-materials.component.ts","./src/app/components/material/status-ntp.html","./src/app/components/material/status-ntp.component.ts","./src/app/components/material/status-ntps.html","./src/app/components/material/status-ntps.component.ts","./src/app/components/material/structure.html","./src/app/components/material/structure.component.ts","./src/app/components/staff/journal-reserves.html","./src/app/components/staff/journal-reserves.component.ts","./src/app/components/staff/journal-reserve-editor.html","./src/app/components/staff/journal-reserve-editor.component.ts","./src/app/components/staff/journal-names.html","./src/app/components/staff/journal-names.component.ts","./src/app/components/staff/journal-reassign.html","./src/app/components/staff/journal-reassign.component.ts","./src/app/components/staff/journal-subscription-editor.html","./src/app/components/staff/journal-subscription-editor.component.ts","./src/app/components/staff/journal-subscriptions.html","./src/app/components/staff/journal-subscriptions.component.ts","./src/app/components/staff/compliance-selector.html","./src/app/components/staff/compliance-selector.component.ts","./src/app/components/staff/protocol-editor-biodata.html","./src/app/components/staff/protocol-editor-biodata.component.ts","./src/app/components/staff/protocol-editor-substudies.html","./src/app/components/staff/protocol-editor-substudies.component.ts","./src/app/components/staff/reference-analytical-results.html","./src/app/components/staff/reference-analytical-results.component.ts","./src/app/components/staff/author-editor.html","./src/app/components/staff/author-editor.component.ts","./src/app/components/staff/reference-editor-author.html","./src/app/components/staff/reference-editor-author.component.ts","./src/app/components/staff/reference-editor-relations.html","./src/app/components/staff/reference-editor-relations.component.ts","./src/app/components/staff/special-link-editor.html","./src/app/components/staff/special-link-editor.component.ts","./src/app/components/staff/reference-editor-special.html","./src/app/components/staff/reference-editor-special.component.ts","./src/app/components/staff/type-prediction-class-editor.html","./src/app/components/staff/type-prediction-class-editor.component.ts","./src/app/components/staff/type-prediction-classes.html","./src/app/components/staff/type-prediction-classes.component.ts","./src/app/components/staff/type-prediction-editor.html","./src/app/components/staff/type-prediction-editor.component.ts","./src/app/components/staff/type-predictions.html","./src/app/components/staff/type-predictions.component.ts","./src/app/components/docmanagement/add-reference-document.html","./src/app/components/docmanagement/add-reference-document.component.ts","./src/app/components/docmanagement/edit-pdf-pages.html","./src/app/components/docmanagement/edit-pdf-pages.component.ts","./src/app/components/docmanagement/replace-reference-document.html","./src/app/components/docmanagement/replace-reference-document.component.ts","./src/app/services/auth-http-interceptor.ts","./src/app/app.module.ts","./src/app/utils/app-config.ts","./src/app/utils/logging.ts","./src/main.ts","./node_modules/moment/locale/ sync ^\\.\\/.*$"],"sourcesContent":["import { Entity, EntityManager, EntityQuery, EntityType, FetchStrategy } from 'breeze-client';\r\nimport { EntityManagerProvider } from './entity-manager-provider';\r\nimport { ErrorLogger } from './error-logger';\r\n\r\nexport interface IRepository {\r\n withId(key: any): Promise;\r\n\r\n where(predicate: any, orderBy?: string): Promise;\r\n\r\n wherePaged(predicate: any, orderBy: string, pageNumber: number, pageSize: number): Promise;\r\n\r\n whereWithParams(params: {}): Promise;\r\n\r\n whereInCache(predicate: any): T[];\r\n\r\n all(): Promise;\r\n}\r\n\r\nexport class Repository implements IRepository {\r\n\r\n protected _defaultFetchStrategy: FetchStrategy;\r\n _cachedManager: EntityManager;\r\n protected _errorLogger: ErrorLogger;\r\n\r\n constructor(\r\n protected _emProvider: EntityManagerProvider,\r\n protected _entityTypeName: string,\r\n protected _expand: string,\r\n protected _resourceName: string,\r\n protected _isCachedBundle: boolean = false) {\r\n\r\n if (!this._entityTypeName) {\r\n throw new Error('Repository must be created with an entity name specified');\r\n }\r\n this._errorLogger = _emProvider.errorLogger;\r\n this._defaultFetchStrategy = _isCachedBundle ? FetchStrategy.FromLocalCache : FetchStrategy.FromServer;\r\n }\r\n\r\n\r\n protected get manager(): EntityManager {\r\n const entityManager = this._emProvider.manager();\r\n if (entityManager == this._cachedManager) {\r\n return entityManager;\r\n }\r\n this._cachedManager = entityManager;\r\n const metadataStore = entityManager.metadataStore;\r\n\r\n const entityType = metadataStore.getEntityType(this._entityTypeName);\r\n if (entityType) {\r\n entityType.setProperties({defaultResourceName: this.localResourceName});\r\n metadataStore.setEntityTypeForResourceName(this.localResourceName, entityType);\r\n } else {\r\n throw new Error(this._entityTypeName + ' does not exist! Repository must be created for an existing entity type!');\r\n }\r\n\r\n return entityManager;\r\n }\r\n\r\n protected get localResourceName() {\r\n return this._isCachedBundle ? this._entityTypeName : this._resourceName;\r\n }\r\n\r\n withId(key: any, fromCache: boolean = false): Promise {\r\n const p = >this.manager.fetchEntityByKey(this._entityTypeName, key, fromCache);\r\n return p.then(data => {\r\n if (!data.entity) {\r\n return null;\r\n }\r\n return data.entity;\r\n });\r\n }\r\n\r\n // TODO: need to fix Predicate typing to accept json object.\r\n where(predicate: any, orderBy?: string): Promise {\r\n let query = this.baseQueryWithExpand()\r\n .where(predicate);\r\n if (orderBy) {\r\n query = query.orderBy(orderBy);\r\n }\r\n\r\n return this.executeQuery(query);\r\n }\r\n\r\n wherePaged(predicate: any, orderBy: string, pageNumber: number, pageSize: number): Promise {\r\n const query = this.baseQueryWithExpand()\r\n .where(predicate)\r\n .orderBy(orderBy)\r\n .skip((pageNumber - 1) * pageSize)\r\n .take(pageSize);\r\n\r\n return this.executeQuery(query);\r\n }\r\n\r\n whereWithParams(queryParameters: {}): Promise {\r\n const query = this.baseQuery()\r\n .withParameters(queryParameters);\r\n\r\n return this.executeQuery(query);\r\n }\r\n\r\n whereInCache(predicate: any): T[] {\r\n const query = this.baseQuery()\r\n .where(predicate);\r\n\r\n return this.executeCacheQuery(query);\r\n }\r\n\r\n all(): Promise {\r\n const query = this.baseQueryWithExpand();\r\n\r\n return this.executeQuery(query).then(r => {\r\n if (!this._isCachedBundle || r.length > 0) {\r\n return r;\r\n }\r\n // go back to server if local cache is empty.\r\n const remoteQuery = query.from(this._resourceName);\r\n return this.executeQuery(remoteQuery, FetchStrategy.FromServer)\r\n .then(() => {\r\n // repeat the initial query now that the cache is populated.\r\n return this.executeQuery(query);\r\n });\r\n });\r\n\r\n }\r\n\r\n protected baseQuery(): EntityQuery {\r\n return EntityQuery.from(this.localResourceName);\r\n }\r\n\r\n protected baseQueryWithExpand(): EntityQuery {\r\n let q = this.baseQuery();\r\n if (this._expand && this._expand.length) {\r\n q = q.expand(this._expand);\r\n }\r\n return q;\r\n }\r\n\r\n protected executeQuery(query: any, fetchStrategy?: FetchStrategy): Promise {\r\n const q = query.using(fetchStrategy || this._defaultFetchStrategy);\r\n const p = >this.manager.executeQuery(q);\r\n return p.then(data => {\r\n return data.results;\r\n }).catch(e => {\r\n this._errorLogger.log(e);\r\n throw e;\r\n });\r\n }\r\n\r\n protected executeCacheQuery(query: any) {\r\n return this.manager.executeQueryLocally(query);\r\n }\r\n}\r\n","import { EntityType, EntityQuery } from 'breeze-client';\r\nimport {IRepository, Repository} from './repository';\r\nimport {Reference} from '../entities/EntityModels';\r\nimport {EntityManagerProvider} from './entity-manager-provider';\r\n\r\n\r\n\r\nexport class ReferenceRepository extends Repository {\r\n constructor(\r\n protected emProvider: EntityManagerProvider,\r\n protected entityTypeName: string,\r\n protected expand: string,\r\n protected resourceName: string) {\r\n super(emProvider, entityTypeName, expand, resourceName);\r\n }\r\n\r\n populateBiologicalData(reference: Reference) {\r\n const et = this.manager.metadataStore.getEntityType('BiologicalData');\r\n et.setProperties( {\r\n defaultResourceName: 'BiologicalDatas/get'\r\n });\r\n let navQuery = ( EntityQuery).fromEntityNavigation(reference, 'biologicalDatas');\r\n // No longer need to expand 'type' tables since they are already down.\r\n // navQuery =navQuery.expand(['typeRoute', 'typeStudy', 'typeSpecies'\r\n // , 'experimentalMaterials.material.synonyms.synonymWebVersion'\r\n // , 'experimentalMaterials.experimentalResults.typeUnit'\r\n // , 'experimentalMaterials.experimentalResults.experimentalToxicEffects.typeToxicEffect'\r\n // ] );\r\n navQuery = navQuery.expand([\r\n 'experimentalMaterials.material.synonyms',\r\n 'experimentalMaterials.experimentalResults.experimentalToxicEffects',\r\n 'bioDataStudySubTypes'\r\n ]);\r\n\r\n return this.executeQuery(navQuery);\r\n\r\n // similar to ( but with expands)\r\n // return reference.entityAspect.loadNavigationProperty(\"biologicalDatas\");\r\n }\r\n\r\n populateToxData(reference: Reference) {\r\n var et = this.manager.metadataStore.getEntityType('BiologicalData');\r\n et.setProperties({\r\n defaultResourceName: 'BiologicalDatas/get'\r\n });\r\n var navQuery = (EntityQuery).fromEntityNavigation(reference, 'biologicalDatas');\r\n navQuery = navQuery.expand([\r\n 'experimentalMaterials.experimentalResults'\r\n ]);\r\n\r\n return this.executeQuery(navQuery);\r\n }\r\n\r\n populateAnalyticalResultData(reference: Reference) {\r\n var et = this.manager.metadataStore.getEntityType('AnalyticalResult');\r\n et.setProperties({\r\n defaultResourceName: 'AnalyticalResult/get'\r\n });\r\n var navQuery = (EntityQuery).fromEntityNavigation(reference, 'analyticalResults');\r\n\r\n return this.executeQuery(navQuery);\r\n }\r\n\r\n populateSpecialLinkData(reference: Reference) {\r\n var et = this.manager.metadataStore.getEntityType('SpecialLink');\r\n et.setProperties({\r\n defaultResourceName: 'SpecialLink/get'\r\n });\r\n var navQuery = (EntityQuery).fromEntityNavigation(reference, 'specialLinks');\r\n\r\n return this.executeQuery(navQuery);\r\n }\r\n\r\n populateWorkflowData(reference: Reference) {\r\n var et = this.manager.metadataStore.getEntityType('WorkflowRecordedAction');\r\n et.setProperties({\r\n defaultResourceName: 'WorkflowRecordedAction/get'\r\n });\r\n var navQuery = (EntityQuery).fromEntityNavigation(reference, 'workflowRecordedActions');\r\n\r\n return this.executeQuery(navQuery);\r\n }\r\n}","import { EntityAspect, EntityType } from 'breeze-client';\r\n\r\nexport class EntityBase {\r\n entityAspect: EntityAspect;\r\n entityType: EntityType;\r\n\r\n getErrorFor(prop: string): string {\r\n if (prop && prop.length) {\r\n return this.entityAspect.getValidationErrors(prop).map(ve => ve.errorMessage).join('. ');\r\n } else {\r\n return this.entityAspect.getValidationErrors().filter(ve => ve.property == null)\r\n .map(ve => ve.errorMessage).join(\". \");\r\n }\r\n }\r\n\r\n // may be overriden in subclasses.\r\n cascadeDelete() {\r\n this.cascadeDeleteCore();\r\n }\r\n\r\n cascadeDeleteCore() {\r\n if (this.entityAspect.entityState.isAdded()) {\r\n this.entityAspect.rejectChanges();\r\n } else {\r\n this.entityAspect.rejectChanges();\r\n this.entityAspect.setDeleted();\r\n }\r\n }\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { Reference } from './Reference';\r\nimport { TypeAnalyticalProcedure } from './TypeAnalyticalProcedure';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class AnalyticalResult extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public get uvsFileList(): string[] {\r\n\r\n const data: string[] = [];\r\n\r\n if (this.typeAnalyticalProcedureID != 'UVS') {\r\n return data;\r\n }\r\n\r\n if (this.observedResult == null || this.observedResult.length == 0) {\r\n return data;\r\n }\r\n\r\n if (this.containsFileName(this.observedResult) == false) {\r\n data.push(this.observedResult);\r\n return data;\r\n }\r\n\r\n return (this.splitUVFileList(this.observedResult));\r\n }\r\n\r\n public containsFileName(uvObservedResult: string): boolean {\r\n if (uvObservedResult == null) { return false; }\r\n return (uvObservedResult.indexOf('.gif') > -1 || uvObservedResult.indexOf('.pdf') > -1 || uvObservedResult.indexOf('.tif') > -1);\r\n }\r\n\r\n private splitUVFileList(uvFiles: string): string[] {\r\n return (uvFiles.split(','));\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n analyticalResultId: number;\r\n materialID: number;\r\n typeAnalyticalProcedureID: string;\r\n referenceId: number;\r\n analyticalSource: string;\r\n observedResult: string;\r\n observedMaximum: string;\r\n testMethod: string;\r\n analyticalFactor: number;\r\n analyticalSample: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n reference: Reference;\r\n typeAnalyticalProcedure: TypeAnalyticalProcedure;\r\n}\r\n\r\n","import { IModalDialog } from '../controls/modal-dialog';\r\nimport * as _ from 'lodash';\r\nimport * as moment from 'moment';\r\n\r\ndeclare const $: any;\r\n// declare var moment: any;\r\n\r\n// for detectBrowser function\r\ndeclare var opr: any;\r\ndeclare var InstallTrigger: {};\r\n\r\nexport interface UrlParts {\r\n base: string;\r\n paramHash: IDictionary;\r\n queryHash: IDictionary;\r\n}\r\n\r\ninterface IDictionary {\r\n [key: string]: string;\r\n}\r\n\r\nexport interface IBrowser {\r\n isOpera: boolean;\r\n isFirefox: boolean;\r\n isSafari: boolean;\r\n isIE: boolean;\r\n isEdge: boolean;\r\n isChrome: boolean;\r\n isBlink: boolean;\r\n}\r\n\r\nexport interface HashMap {\r\n [key: string]: T;\r\n}\r\n\r\nexport class UtilFns {\r\n\r\n static sort(collection: T[], isAscending: boolean = true, fn: (a: T) => string) {\r\n return collection.sort((a, b) => {\r\n return (fn(a) || '').localeCompare(fn(b) || '') * (isAscending ? 1 : -1);\r\n\r\n });\r\n }\r\n\r\n static sortNumeric(collection: T[], isAscending: boolean = true, fn: (a: T) => number) {\r\n return collection.sort((a, b) => {\r\n return (fn(a) - fn(b)) * (isAscending ? 1 : -1);\r\n\r\n });\r\n }\r\n\r\n static detectBrowser() {\r\n let r: IBrowser;\r\n const wnd: any = window;\r\n const doc: any = document;\r\n r = {};\r\n // Opera 8.0+\r\n // r.isOpera = (!!wnd.opr && !!opr.addons) || !!wnd.opera || navigator.userAgent.indexOf(' OPR/') >= 0;\r\n r.isOpera = (!!wnd.opr && !!opr.addons) || !!wnd.opera || navigator.userAgent.indexOf(' OPR/') >= 0;\r\n // Firefox 1.0+\r\n r.isFirefox = typeof InstallTrigger !== 'undefined';\r\n // At least Safari 3+: \"[object HTMLElementConstructor]\"\r\n r.isSafari = Object.prototype.toString.call(wnd.HTMLElement).indexOf('Constructor') > 0;\r\n // Internet Explorer 6-11\r\n r.isIE = /*@cc_on!@*/!!doc.documentMode;\r\n // Edge 20+\r\n r.isEdge = !r.isIE && !!wnd.StyleMedia;\r\n // Chrome 1+\r\n r.isChrome = !!wnd.chrome && !!wnd.chrome.webstore;\r\n // Blink engine detection\r\n r.isBlink = (r.isChrome || r.isOpera) && !!wnd.CSS;\r\n return r;\r\n }\r\n\r\n static selectDOMElement(el: any) {\r\n const body = document.body;\r\n let range: any;\r\n let sel: any;\r\n if (document.createRange && window.getSelection) {\r\n range = document.createRange();\r\n sel = window.getSelection();\r\n sel.removeAllRanges();\r\n try {\r\n range.selectNodeContents(el);\r\n sel.addRange(range);\r\n } catch (e) {\r\n range.selectNode(el);\r\n sel.addRange(range);\r\n }\r\n } else if ((body).createTextRange) {\r\n range = (body).createTextRange();\r\n range.moveToElementText(el);\r\n range.select();\r\n }\r\n return range;\r\n\r\n }\r\n\r\n\r\n static formatDate(dt: Date, format: string = 'L') {\r\n if (!dt) {\r\n return '';\r\n }\r\n return moment(dt).format(format);\r\n }\r\n\r\n static formatNumber(num: number, width: number = 0, decimalDigits = 2) {\r\n if (num == null) {\r\n return '';\r\n }\r\n const parts = num.toFixed(decimalDigits).split('.');\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ','); // ',' is the thousands sep.\r\n const r = parts.join('.');\r\n if (width) {\r\n return _.padStart(r, width);\r\n } else {\r\n return r;\r\n }\r\n }\r\n\r\n static extend(obj1: Object, obj2: Object) {\r\n if (obj2 == null) {\r\n return obj1;\r\n }\r\n const obj3 = {};\r\n // tslint:disable-next-line:forin\r\n for (const attrname in obj1) {\r\n obj3[attrname] = obj1[attrname];\r\n }\r\n // tslint:disable-next-line:forin\r\n for (const attrname in obj2) {\r\n obj3[attrname] = obj2[attrname];\r\n }\r\n return obj3;\r\n }\r\n\r\n static scaleNumber(num: number, divisor: number, width: number = 0, decimalDigits = 2): string {\r\n if (num == null || divisor == null || divisor == 0) {\r\n return '';\r\n }\r\n\r\n const scaledNumber: number = (num / divisor);\r\n\r\n return UtilFns.formatNumber(scaledNumber, width, decimalDigits);\r\n }\r\n\r\n static getClassName(instance: {}) {\r\n const funcNameRegex = /function (.{1,})\\(/;\r\n const results = (funcNameRegex).exec((instance).constructor.toString());\r\n return (results && results.length > 1) ? results[1] : '';\r\n }\r\n\r\n static parseUrl(url: string): UrlParts {\r\n const parts = url.split('?');\r\n let base: string;\r\n let paramHash: IDictionary;\r\n const ix = parts[0].indexOf(';');\r\n if (ix == -1) {\r\n base = parts[0];\r\n paramHash = {};\r\n } else {\r\n base = parts[0].substr(0, ix);\r\n paramHash = this.stringToHash(parts[0].substr(ix + 1), ';');\r\n }\r\n\r\n const queryHash = (parts.length > 1) ? this.stringToHash(parts[1], '&') : {};\r\n return {\r\n base: base,\r\n paramHash: paramHash,\r\n queryHash: queryHash\r\n };\r\n }\r\n\r\n static formatUrl(urlParts: UrlParts) {\r\n let paramString = '';\r\n let queryString = '';\r\n if (!_.isEmpty(urlParts.paramHash)) {\r\n _.map(urlParts.paramHash);\r\n paramString = ';' + _.map(urlParts.paramHash, (v: any, k: any) => k + '=' + v).join(';');\r\n }\r\n if (!_.isEmpty(urlParts.queryHash)) {\r\n _.map(urlParts.queryHash);\r\n queryString = '?' + _.map(urlParts.queryHash, (v: any, k: any) => k + '=' + v).join('&');\r\n }\r\n\r\n return urlParts.base + paramString + queryString;\r\n }\r\n\r\n\r\n static stringToHash(qs: string, delimiter: string): IDictionary {\r\n if (!qs) {\r\n return {};\r\n }\r\n const parts = qs.split(delimiter);\r\n if (parts.length == 0) {\r\n return {};\r\n }\r\n const r: IDictionary = {};\r\n for (let i = 0; i < parts.length; ++i) {\r\n const p = parts[i].split('=', 2);\r\n if (p.length == 1) {\r\n r[p[0]] = '';\r\n } else {\r\n r[p[0]] = decodeURIComponent(p[1].replace(/\\+/g, ' '));\r\n }\r\n }\r\n return r;\r\n }\r\n\r\n static asRouterParts(...parts: any[]) {\r\n return parts.map(part => {\r\n if (part == null) {\r\n return '';\r\n }\r\n if (part.path && part.component) {\r\n // extract just the text before the '/' in the part.path\r\n return part.path.split('/')[0];\r\n } else {\r\n return part;\r\n }\r\n });\r\n }\r\n\r\n // Hack because of Angular2 bug\r\n static encodeRouterPart(str: string) {\r\n if (str == null) {\r\n return str;\r\n }\r\n if (!str.replace) {\r\n return str;\r\n } // not a string\r\n // this works but can cause an exception:\r\n // 'The request filtering module is configured to deny a request that contains a double escape sequence.''\r\n // var r = str.replace(/[!'()*]/g, function (c) {\r\n // return '%' + c.charCodeAt(0).toString(16);\r\n // });\r\n // so we use something simpler\r\n\r\n str = str.replace(/\\(/g, '~~1~').replace(/\\)/g, '~~2~');\r\n return encodeURIComponent(str);\r\n }\r\n\r\n static decodeRouterPart(str: string) {\r\n if (!str) {\r\n return str;\r\n }\r\n return str.replace('~~1~', '(').replace('~~2~', ')');\r\n }\r\n\r\n static encodeHackForAnd(str: string) {\r\n // replace spaces in any 'and' expression i.e. ' and ' ( case insensitive ) with '~|~'\r\n // 'a and b aNd g AND f' =>\r\n // => 'a~|~and~|~b~|~aNd~|~g~|~AND~|~f'\r\n return str.replace(/ (and) /gi, '~|~$1~|~');\r\n\r\n }\r\n\r\n static printElement(ele: any) {\r\n const eleClone = ele.cloneNode(true);\r\n // create or find a element with an id of 'printSection'\r\n // printSection is styled in the css to print properly.\r\n let printSelectEle = document.getElementById('printSection');\r\n if (!printSelectEle) {\r\n printSelectEle = document.createElement('div');\r\n printSelectEle.id = 'printSection';\r\n document.body.appendChild(printSelectEle);\r\n }\r\n try {\r\n // dump the cloned node into the printSection.\r\n printSelectEle.innerHTML = '';\r\n printSelectEle.appendChild(eleClone);\r\n window.print();\r\n\r\n } finally {\r\n // remove it when done\r\n if (printSelectEle.parentElement) {\r\n printSelectEle.parentElement.removeChild(printSelectEle);\r\n }\r\n }\r\n }\r\n\r\n static showModal(component: IModalDialog, parent: any, validateFn?: (x: any) => string): Promise {\r\n const ele = component.elementRef.nativeElement.firstElementChild;\r\n const modalEle = $(ele);\r\n component.modalParent = parent;\r\n component.validationMessage = null;\r\n if (validateFn) {\r\n component.validationFn = validateFn.bind(parent);\r\n }\r\n const p = new Promise((resolve) => {\r\n modalEle.modal({backdrop: 'static', keyboard: false}).on('hidden.bs.modal', () => {\r\n resolve(component.modalResult);\r\n });\r\n });\r\n return p;\r\n }\r\n\r\n static returnModal(component: IModalDialog, result: T) {\r\n if (result != null && component.validationFn) {\r\n component.validationMessage = component.validationFn(result);\r\n if (component.validationMessage != null) {\r\n return;\r\n }\r\n }\r\n component.modalResult = result;\r\n UtilFns.hideModal(component);\r\n }\r\n\r\n static hideModal(component: IModalDialog) {\r\n const ele = component.elementRef.nativeElement.firstElementChild;\r\n const modalEle = $(ele);\r\n modalEle.modal('hide');\r\n }\r\n}\r\n","import { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport { StateMap } from '../services/common';\r\nimport { UtilFns } from './util-fns';\r\nimport { PageState } from '../controls/common';\r\n\r\nexport class LocationFns {\r\n\r\n static getTab(location: Location, partIx: number = 0) {\r\n const tab = this.getParamValue(location, 'tab');\r\n if (tab) {\r\n const tabs = tab.split('.');\r\n const tabNum = parseInt(tabs[partIx]);\r\n if (!isNaN(tabNum)) {\r\n return tabNum;\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n static setTab(location: Location, tab: number | string) {\r\n setTimeout(() => {\r\n this.setParamValue(location, 'tab', tab.toString(), true);\r\n });\r\n }\r\n\r\n static getParamValue(location: Location, key: string) {\r\n const parts = UtilFns.parseUrl(location.path());\r\n const value = parts.paramHash[key];\r\n return value || null;\r\n }\r\n\r\n static setParamValue(location: Location, key: string, value: string, canReplace?: boolean) {\r\n const parts = UtilFns.parseUrl(location.path());\r\n if (parts.paramHash[key] == value) {\r\n return;\r\n }\r\n let shouldReplace: boolean;\r\n if (canReplace) {\r\n shouldReplace = parts.paramHash[key] == null;\r\n } else {\r\n shouldReplace = false;\r\n }\r\n\r\n parts.paramHash[key] = value;\r\n if (shouldReplace) {\r\n location.replaceState(UtilFns.formatUrl(parts));\r\n } else {\r\n location.go(UtilFns.formatUrl(parts));\r\n }\r\n }\r\n\r\n static updatePageState(location: Location, stateMap: StateMap, currentState: PageState, updateFn?: (savedState: PageState) => void) {\r\n\r\n return LocationFns.updateState(location, stateMap, currentState, (savedState: PageState) => {\r\n _.forEach(savedState, (v, k) => {\r\n const pd = Object.getOwnPropertyDescriptor(currentState, k);\r\n // if a normal property or a simple writable property or has a setter then go for it.\r\n if ((!pd) || ((pd.value !== undefined) && pd.writable) || pd.set) {\r\n currentState[k] = v;\r\n }\r\n });\r\n if (updateFn) {\r\n updateFn(savedState);\r\n }\r\n });\r\n\r\n }\r\n\r\n // returns true if retrieved an existing state\r\n static updateState(location: Location, stateMap: StateMap, currentState: {}, updateFn: (savedState: {}) => void) {\r\n\r\n const parts = UtilFns.parseUrl(location.path());\r\n const retKey = parts.paramHash['ret'];\r\n let retIx: number;\r\n if (retKey) {\r\n retIx = parseInt(retKey);\r\n const savedState = stateMap.getRetState(retIx);\r\n // if a savedState AND a matching savedState.\r\n if (savedState && savedState['displayName'] == currentState['displayName']) {\r\n updateFn(savedState);\r\n stateMap.storeRetState(currentState, retIx);\r\n return true;\r\n }\r\n }\r\n retIx = stateMap.storeRetState(currentState);\r\n // move 'ret' to the end.\r\n delete parts.paramHash['ret'];\r\n parts.paramHash['ret'] = retIx.toString();\r\n\r\n location.replaceState(UtilFns.formatUrl(parts));\r\n return false;\r\n }\r\n\r\n\r\n}\r\n","import { ColumnSorter, SortColumn, SortMap } from './column-sorter';\r\nimport * as pluralize from 'pluralize';\r\n\r\nexport enum PageLoadStatus {\r\n IsLoading,\r\n IsLoaded,\r\n IsLoadedWithNoData\r\n}\r\n\r\nexport class PageState {\r\n sortColumn: SortColumn;\r\n loadStatus: PageLoadStatus;\r\n loadStatusMsg: string;\r\n pageNumber: number;\r\n pageSize: number;\r\n itemCount: number;\r\n tabNumber: number;\r\n canShowMessage: boolean;\r\n\r\n _maxItemCount: number;\r\n\r\n constructor(public displayName: string) {\r\n this.pageNumber = 1;\r\n this.pageSize = 200;\r\n this.canShowMessage = true;\r\n }\r\n\r\n\r\n get isLoading() {\r\n return this.loadStatus == PageLoadStatus.IsLoading;\r\n }\r\n set isLoading(value: boolean) {\r\n if (value) {\r\n this.loadStatus = PageLoadStatus.IsLoading;\r\n } else {\r\n this.loadStatus = PageLoadStatus.IsLoaded;\r\n }\r\n }\r\n\r\n get isLoaded() {\r\n return this.loadStatus == PageLoadStatus.IsLoaded;\r\n }\r\n set isLoaded(value: boolean | Array) {\r\n if (value == null) {\r\n this.loadStatus = PageLoadStatus.IsLoadedWithNoData;\r\n } else if (typeof (value) == 'boolean') {\r\n if (value) {\r\n this.loadStatus = PageLoadStatus.IsLoaded;\r\n } else {\r\n this.loadStatus = PageLoadStatus.IsLoadedWithNoData;\r\n }\r\n } else {\r\n this.loadStatus = ((>value).length > 0) ? PageLoadStatus.IsLoaded : PageLoadStatus.IsLoadedWithNoData;\r\n }\r\n this.updateLoadStatusMsg();\r\n }\r\n\r\n get isLoadedWithNoData() {\r\n return this.loadStatus == PageLoadStatus.IsLoadedWithNoData;\r\n }\r\n set isLoadedWithNoData(value: boolean) {\r\n if (value) {\r\n this.loadStatus = PageLoadStatus.IsLoadedWithNoData;\r\n } else {\r\n this.loadStatus = PageLoadStatus.IsLoaded;\r\n }\r\n this.updateLoadStatusMsg();\r\n }\r\n\r\n get hasMessage() {\r\n const result = this.canShowMessage && (this.isLoadedWithNoData || (this.isLoaded && this.itemCount != null));\r\n return result;\r\n }\r\n\r\n loadStatusClass() {\r\n return 'bold';\r\n }\r\n\r\n getPaginationInfo() {\r\n return {\r\n currentPage: this.pageNumber,\r\n itemsPerPage: this.pageSize,\r\n totalItems: this.itemCountEstimate\r\n };\r\n }\r\n\r\n resetPaging() {\r\n this.pageNumber = 1;\r\n this.itemCount = null;\r\n this._maxItemCount = null;\r\n }\r\n\r\n get hasMoreThanOnePage() {\r\n return this.itemCount == null || this.itemCount > this.pageSize;\r\n }\r\n\r\n // best guess as to the total number of items\r\n get itemCountEstimate(): number {\r\n return this.itemCount != null ? this.itemCount : Number.MAX_VALUE;\r\n }\r\n\r\n updateEstimate(currentPageLength: number) {\r\n if (!this.itemCount) {\r\n if (currentPageLength < this.pageSize) {\r\n if ((currentPageLength == 0) && (this.pageNumber > 1)) {\r\n this._maxItemCount = ((this.pageNumber - 1) * this.pageSize);\r\n } else {\r\n this.itemCount = ((this.pageNumber - 1) * this.pageSize) + currentPageLength;\r\n }\r\n } else {\r\n this.itemCount = ((this.pageNumber - 1) * this.pageSize) + currentPageLength;\r\n this._maxItemCount = Math.max(this._maxItemCount, (this.pageNumber + 1) * this.pageSize);\r\n }\r\n }\r\n\r\n return this.itemCountEstimate;\r\n }\r\n\r\n updateLoadStatusMsg() {\r\n let r: string;\r\n if (this.loadStatus == PageLoadStatus.IsLoading) {\r\n r = 'Loading . . .';\r\n } else if (this.loadStatus == PageLoadStatus.IsLoadedWithNoData) {\r\n r = 'No matching ' + this.displayName + ' data found.';\r\n } else {\r\n const count = this.itemCount;\r\n if (count) {\r\n const wasWere = count > 1 ? ' were ' : ' was ';\r\n r = 'There ' + wasWere + this.itemCount + ' matching ' + pluralize(this.displayName, count) + ' found.';\r\n } else {\r\n r = '';\r\n }\r\n }\r\n this.loadStatusMsg = r;\r\n }\r\n\r\n}\r\n\r\n\r\n\r\n\r\n","import { Entity, EntityError, EntityType } from 'breeze-client';\r\n\r\nimport { StateMap, UnitOfWork } from '../services/common';\r\nimport { PageState } from '../controls/page-state';\r\nimport * as _ from 'lodash';\r\nimport { OnInit, Directive } from '@angular/core';\r\n\r\nexport interface IEditHost {\r\n canAdd?: () => boolean;\r\n onAdd?: () => void;\r\n onAddPromise?: () => Promise;\r\n canDelete?: () => boolean;\r\n onDelete?: () => void;\r\n canSave?: () => boolean;\r\n onSave?: () => void;\r\n\r\n onApply?: () => boolean;\r\n onCancel?: () => void;\r\n}\r\n\r\n@Directive()\r\nexport class EditManager implements OnInit {\r\n\r\n public entities: T[];\r\n\r\n public editing: boolean;\r\n public errorMessages: string[];\r\n public femaRestricted = false;\r\n\r\n public pageState: PageState;\r\n public singleEntityOnly = false;\r\n _currentIx = 0;\r\n private _entityType: EntityType;\r\n status = {};\r\n\r\n constructor(protected _host: IEditHost, public uow: UnitOfWork, public stateMap: StateMap, public pageName: string) {\r\n this.pageState = new PageState(pageName);\r\n this.errorMessages = [];\r\n }\r\n\r\n ngOnInit() {\r\n\r\n }\r\n\r\n set onlyEntity(value: T) {\r\n this.entities = [value];\r\n this.singleEntityOnly = true;\r\n }\r\n\r\n get currentEntity() {\r\n const entities = this.entities;\r\n if ((!entities) || entities.length == 0) {\r\n return null;\r\n } else if (this._currentIx < 0) {\r\n this._currentIx = 0;\r\n } else if (this._currentIx >= entities.length) {\r\n this._currentIx = entities.length - 1;\r\n }\r\n return entities[this._currentIx];\r\n }\r\n\r\n set currentEntity(e: T) {\r\n const entities = this.entities;\r\n if (entities) {\r\n this._currentIx = entities.indexOf(e);\r\n }\r\n }\r\n\r\n movePrev() {\r\n this._currentIx--;\r\n return this.currentEntity;\r\n }\r\n\r\n moveNext() {\r\n this._currentIx++;\r\n return this.currentEntity;\r\n }\r\n\r\n isStaff() {\r\n if (this.stateMap.currentUser.isStaff == false) {\r\n return false;\r\n }\r\n\r\n if (this.femaRestricted != null && this.femaRestricted == true) {\r\n return !this.stateMap.currentUser.isInRole('fema'); // FEMA staff can't edit any Material data\r\n }\r\n\r\n return this.stateMap.currentUser.isStaff;\r\n }\r\n\r\n hasEntities() {\r\n return !!(this.entities && this.entities.length > 0);\r\n }\r\n\r\n hasEdits() {\r\n return this.uow.hasChanges();\r\n }\r\n\r\n hasErrors() {\r\n return this.errorMessages.length > 0;\r\n }\r\n\r\n addError(message: string) {\r\n // only allow one copy of each error.\r\n if (this.errorMessages.indexOf(message) >= 0) {\r\n return;\r\n }\r\n this.errorMessages.push(message);\r\n }\r\n\r\n clearErrors() {\r\n this.errorMessages.length = 0;\r\n this.status = null;\r\n }\r\n\r\n onSelect(e: T) {\r\n if (!this.isStaff()) {\r\n return;\r\n }\r\n this.currentEntity = e;\r\n this.editing = true;\r\n }\r\n\r\n onEdit() {\r\n this.editing = !this.editing;\r\n }\r\n\r\n canAdd() {\r\n if (this._host.canAdd) {\r\n return this._host.canAdd();\r\n } else {\r\n return this.canAddCore();\r\n }\r\n }\r\n\r\n canAddCore() {\r\n if (this.editing) {\r\n return !this.currentEntity.entityAspect.hasValidationErrors;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n onAdd() {\r\n let p: Promise;\r\n if (this._host.onAddPromise) {\r\n p = this._host.onAddPromise();\r\n } else {\r\n p = Promise.resolve(this._host.onAdd());\r\n }\r\n p.then(() => {\r\n if (!this.currentEntity.entityAspect.entityState.isAdded()) {\r\n this.setStatus({ message: 'Add failed - validation error on current entity', classes: 'label-danger', isTemp: true });\r\n }\r\n });\r\n }\r\n\r\n canDelete() {\r\n return this._host.canDelete ? this._host.canDelete() : this.canDeleteCore();\r\n }\r\n\r\n canDeleteCore() {\r\n return this.hasEntities();\r\n }\r\n\r\n onDelete() {\r\n this.captureEntityType();\r\n return this._host.onDelete ? this._host.onDelete() : this.onDeleteCore();\r\n }\r\n\r\n onDeleteCore() {\r\n const s = this.currentEntity;\r\n if (s.entityAspect.entityState.isAdded()) {\r\n s.entityAspect.rejectChanges();\r\n } else {\r\n s.entityAspect.setDeleted();\r\n }\r\n _.remove(this.entities, this.currentEntity);\r\n this.updatePageState();\r\n this.editing = false;\r\n }\r\n\r\n canApply() {\r\n const ea = this.currentEntity.entityAspect;\r\n return (!ea.entityState.isUnchanged()) && (!ea.hasValidationErrors);\r\n }\r\n\r\n onApply(): boolean {\r\n return this._host.onApply ? this._host.onApply() : this.onApplyCore();\r\n }\r\n\r\n onApplyCore(): boolean {\r\n if (!this.validateCurrent()) {\r\n return false;\r\n }\r\n\r\n this.editing = false;\r\n this.updatePageState();\r\n return true;\r\n }\r\n\r\n canCancel() {\r\n if (this.editing) {\r\n return true;\r\n } else {\r\n return this.hasEdits();\r\n }\r\n }\r\n\r\n canShowBack() {\r\n return this.editing && this.currentEntity.entityAspect.entityState.isUnchanged();\r\n }\r\n\r\n onBack() {\r\n this.editing = false;\r\n }\r\n\r\n onCancel() {\r\n return this._host.onCancel ? this._host.onCancel() : this.onCancelCore();\r\n }\r\n\r\n onCancelCore() {\r\n if (this.entities && this.entities.length) {\r\n if (this.editing) {\r\n const ea = this.currentEntity.entityAspect;\r\n const es = ea.entityState;\r\n if (es.isUnchanged()) {\r\n this.editing = false;\r\n } else if (es.isModified()) {\r\n ea.rejectChanges();\r\n } else if (es.isDetached()) {\r\n this.editing = false;\r\n } else {\r\n ea.rejectChanges();\r\n this.editing = false;\r\n }\r\n } else {\r\n this.restoreDeleted();\r\n this.uow.rollback();\r\n\r\n }\r\n // remove any added then rolled back items.\r\n _.remove(this.entities, fs => fs.entityAspect.entityState.isDetached());\r\n }\r\n if (this.uow.hasChanges() && !this.editing) {\r\n this.restoreDeleted();\r\n this.uow.rollback();\r\n } else {\r\n this.editing = false;\r\n }\r\n this.updatePageState();\r\n this.clearErrors();\r\n }\r\n\r\n captureEntityType() {\r\n if (this._entityType) {\r\n return;\r\n }\r\n this._entityType = this.currentEntity.entityType;\r\n }\r\n\r\n restoreDeleted() {\r\n if (!this._entityType) {\r\n return;\r\n }\r\n const deletedEntities = this.uow.getChanges(this._entityType).filter(e => e.entityAspect.entityState.isDeleted());\r\n this.entities.push(...deletedEntities);\r\n }\r\n\r\n canSave() {\r\n return this._host.canSave ? this._host.canSave() : this.canSaveCore();\r\n }\r\n\r\n canSaveCore() {\r\n // TODO: think about requiring validation... ( may be expensive)\r\n return this.hasEdits();\r\n }\r\n\r\n onSave() {\r\n return this._host.onSave ? this._host.onSave() : this.onSaveCore();\r\n }\r\n\r\n onSaveCore() {\r\n if (!this.validateBeforeSave()) {\r\n return Promise.resolve();\r\n }\r\n this.pageState.isLoading = true;\r\n return this.commitSave().then(() => {\r\n this.pageState.isLoaded = true;\r\n }).catch(() => {\r\n this.pageState.isLoaded = false;\r\n });\r\n }\r\n\r\n updatePageState() {\r\n if (this.pageState) {\r\n this.pageState.isLoaded = this.entities;\r\n }\r\n }\r\n\r\n validateCurrent() {\r\n if (this.editing) {\r\n return this.currentEntity.entityAspect.validateEntity();\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n validateBeforeSave() {\r\n const areAllValid = this.entities.filter(e => !e.entityAspect.entityState.isUnchanged())\r\n .every(s => {\r\n const ok = s.entityAspect.validateEntity();\r\n if (!ok) {\r\n this.onSelect(s);\r\n }\r\n return ok;\r\n });\r\n\r\n return areAllValid;\r\n }\r\n\r\n commitSave() {\r\n return this.uow.commit().then(() => {\r\n this.setSavedStatus();\r\n }).catch(e => {\r\n this.handleSaveError(e);\r\n });\r\n }\r\n\r\n handleSaveError(e: any) {\r\n if (e.entityErrors) {\r\n // TODO: type EntityErrors in d.ts\r\n e.entityErrors.forEach((err: EntityError) => this.addError(\r\n err.errorMessage));\r\n }\r\n\r\n if (e.message && e.message.startsWith('The DELETE statement')) {\r\n this.setSaveFailedStatus('Save failed: Cannot perform delete because of existing relations / references.');\r\n throw e;\r\n } else {\r\n this.setSaveFailedStatus();\r\n throw e;\r\n }\r\n }\r\n\r\n setSavedStatus(message?: string) {\r\n this.setStatus({ message: message || 'Saved', classes: 'label-success', isTemp: true });\r\n }\r\n\r\n setSaveFailedStatus(message?: string) {\r\n this.setStatus({ message: message || 'Save failed', classes: 'label-danger', isTemp: false });\r\n }\r\n\r\n setStatus(status: { message: string, classes: string, isTemp: boolean }) {\r\n status.classes = 'label ' + status.classes;\r\n this.status = status;\r\n if (status.isTemp) {\r\n setTimeout(() => {\r\n this.status = null;\r\n }, 2000);\r\n }\r\n }\r\n\r\n}\r\n\r\n","import { Validator } from 'breeze-client';\r\n\r\nexport class EntityTypeAnnotation {\r\n validators: Validator[];\r\n propertyAnnotations: EntityPropertyAnnotation[];\r\n \r\n constructor(arg: { validators: Validator[], propertyAnnotations: EntityPropertyAnnotation[] }) {\r\n this.validators = arg.validators\r\n this.propertyAnnotations = arg.propertyAnnotations;\r\n } \r\n}\r\n\r\nexport class EntityPropertyAnnotation {\r\n displayName: string;\r\n validators: Validator[];\r\n constructor(public propertyName: string, config: {\r\n displayName: string,\r\n validators: Validator[], \r\n }) {\r\n this.displayName = config.displayName;\r\n this.validators = config.validators;\r\n } \r\n\r\n}","import { EntityBase } from './EntityBase';\r\nimport { AnalyticalResult } from './AnalyticalResult';\r\nimport { DermalExposure } from './DermalExposure';\r\nimport { EPIData } from './EPIData';\r\nimport { EPISuite } from './EPISuite';\r\nimport { ExperimentalMaterial } from './ExperimentalMaterial';\r\nimport { SpecialLink } from './SpecialLink';\r\nimport { WorkflowMaterialRecordedAction } from './WorkflowMaterialRecordedAction';\r\nimport { FoodStatus } from './FoodStatus';\r\nimport { HouseStatus } from './HouseStatus';\r\nimport { MaterialAdditionalIdentifier } from './MaterialAdditionalIdentifier';\r\nimport { MaterialAlertRule } from './MaterialAlertRule';\r\nimport { MaterialAssessmentCategory } from './MaterialAssessmentCategory';\r\nimport { MaterialConsumption } from './MaterialConsumption';\r\nimport { MaterialExpertPanelSummary } from './MaterialExpertPanelSummary';\r\nimport { MaterialFSAG } from './MaterialFSAG';\r\nimport { MaterialHazardCode } from './MaterialHazardCode';\r\nimport { MaterialMonograph } from './MaterialMonograph';\r\nimport { MaterialPrecautionCode } from './MaterialPrecautionCode';\r\nimport { MaterialRelation } from './MaterialRelation';\r\nimport { MaterialTransparencyList } from './MaterialTransparencyList';\r\nimport { MaterialUNTransport } from './MaterialUNTransport';\r\nimport { NaturalOccurrenceDescriptor } from './NaturalOccurrenceDescriptor';\r\nimport { Prediction } from './Prediction';\r\nimport { REACHRegistration } from './REACHRegistration';\r\nimport { RegulatoryStatus } from './RegulatoryStatus';\r\nimport { SafetyAssessmentMaterial } from './SafetyAssessmentMaterial';\r\nimport { SafetyComment } from './SafetyComment';\r\nimport { SafetyEUComment } from './SafetyEUComment';\r\nimport { Synonym } from './Synonym';\r\nimport { TypeBotanicalSubdivision } from './TypeBotanicalSubdivision';\r\nimport { TypeEssentialOil } from './TypeEssentialOil';\r\nimport { TypeNarrativeSummary } from './TypeNarrativeSummary';\r\nimport { TypeNaturalOccurrence } from './TypeNaturalOccurrence';\r\nimport { TypeTSCAClass } from './TypeTSCAClass';\r\nimport { MaterialUses } from './MaterialUses';\r\nimport { TypeMaterialUnit } from './TypeMaterialUnit';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\nimport { UtilFns } from '../utils/common';\r\nimport { EntityTypeAnnotation, EntityPropertyAnnotation} from './EntityTypeAnnotation';\r\n/// \r\n\r\nexport class Material extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n static getEntityTypeAnnotation(): EntityTypeAnnotation {\r\n const numberDashValidator = new Validator(\r\n 'numberDash',\r\n (value: string) => !value || !!(value && value.match(/^[0-9-]*$/)),\r\n { messageTemplate: 'The %displayName% must contain only numbers and dashes. '});\r\n\r\n const atLeastOneDashValidator = new Validator(\r\n 'oneDash',\r\n (value: string) => !value || !!(value && value.indexOf('-') >= 0),\r\n { messageTemplate: 'The %displayName% must contain at least one dash. ' });\r\n\r\n const nonZeroCodeValidator = new Validator(\r\n 'NonZeroCodeValidator',\r\n (value: any) => value != 0,\r\n { messageTemplate: 'You must specify a %displayName%. ' });\r\n\r\n const casLengthValidator = new Validator(\r\n 'casLength',\r\n (value: string) => !value || (value.length >= 3 && value.length <= 50),\r\n { messageTemplate: 'The %displayName% length must be between 3 and 50. ' });\r\n\r\n const propAnnotations = [\r\n new EntityPropertyAnnotation('realCASNumber', {\r\n displayName: 'CAS Number',\r\n validators: [casLengthValidator, numberDashValidator, atLeastOneDashValidator]\r\n }),\r\n new EntityPropertyAnnotation('typeTSCAClassId', {\r\n displayName: 'Generic Class',\r\n validators: [nonZeroCodeValidator]\r\n }),\r\n ];\r\n\r\n return new EntityTypeAnnotation({\r\n validators: [],\r\n propertyAnnotations: propAnnotations\r\n });\r\n }\r\n\r\n // will be calculated later.\r\n base32SmileUrl: string;\r\n\r\n public eINECSELINCS() {\r\n let eiec: string = null;\r\n if (this.eINECSNumber) {\r\n eiec = this.eINECSNumber;\r\n }\r\n if (this.eCNNumber) {\r\n if (eiec) {\r\n eiec += '/' + this.eCNNumber;\r\n } else {\r\n eiec = this.eCNNumber;\r\n }\r\n }\r\n return eiec;\r\n }\r\n\r\n public mETIENCS() {\r\n return (this.typeTscaClass && this.typeTscaClass.genericClass == 'Essential Oils and Resins')\r\n ? 'Exempt' : this.mETI;\r\n }\r\n\r\n public eCInventoryEINECSELINCSNumbers() {\r\n\r\n const ecinventory: string = (this.eCInventoryNumber) ? 'EC# ' + this.eCInventoryNumber : '-';\r\n const einecs: string = (this.eINECSNumber) ? this.eINECSNumber : '-';\r\n const elincs: string = (this.eCNNumber) ? this.eCNNumber : '-';\r\n\r\n return (ecinventory + ' / ' + einecs + ' / ' + elincs);\r\n }\r\n\r\n public isCaptive() {\r\n // Modified per GitHub issue #448\r\n // return this.captiveCompany != null;\r\n return this.confidential;\r\n }\r\n\r\n public getCaptiveText() {\r\n\r\n return this.isCaptive() ? 'Captive - ' + this.captiveCompany : '';\r\n }\r\n\r\n public functionalUseExt() {\r\n return (this.functionalUse && this.functionalUse.length) ? this.functionalUse : 'None reported';\r\n }\r\n\r\n public naturalOccurrence() {\r\n const occurrence = (this.typeNaturalOccurrence && this.typeNaturalOccurrence.occurrenceDetail) || '';\r\n\r\n if (occurrence.indexOf('None') > -1) {\r\n return occurrence;\r\n } else {\r\n const pSynonym = this.principalSynonym();\r\n return (pSynonym ? pSynonym.synonymWordOrWebVersion() + ' ' : '') + occurrence;\r\n }\r\n }\r\n\r\n public addedToTransparencyListDate() {\r\n if (this.materialTransparencyLists == null || (this.materialTransparencyLists.length == 0)) {\r\n return null;\r\n }\r\n let lists = this.materialTransparencyLists.filter(m => m.removedFromList == null);\r\n lists = UtilFns.sort(lists, true, m => m.addedToList ? 'a_' : 'z_');\r\n return lists[0].addedToList;\r\n }\r\n\r\n public hasRegistration() {\r\n return this.eINECSRegistration || this.dSLRegistration || this.nDSLRegistration || this.tSCARegistration || this.reachRegistration;\r\n }\r\n\r\n public registrationText() {\r\n const text = `${this.dSLRegistration ? 'DSL' : ''} ${this.eCNRegistration ? 'ECN' : ''} ${this.eINECSRegistration ? 'EINECS' : ''} ${this.nDSLRegistration ? 'NDSL' : ''} ${this.reachRegistration ? 'REACH' : ''} ${this.tSCARegistration ? 'TSCA' : ''}`;\r\n return text.trim();\r\n }\r\n\r\n public get formattedRIFMId() {\r\n let result = this.monographNumber ? this.monographNumber.toString() : '-';\r\n const naturalsId = (this.typeBotanicalSubdivisionId || '') + (this.typeEssentialOilId || '');\r\n if (naturalsId) {\r\n result += '-' + naturalsId;\r\n }\r\n return result;\r\n }\r\n\r\n public get molecularWeightWithUnit() {\r\n const tmu = (this.typeMaterialUnitId != null) ? this.typeMaterialUnitId : '';\r\n return (this.molecularWeight != null) ? this.molecularWeight + ' ' + tmu : '';\r\n }\r\n\r\n public principalSynonym() {\r\n return this.synonyms ? this.synonyms.find(s => s.principal) : null;\r\n }\r\n\r\n public principalSynonymText() {\r\n const ps = this.principalSynonym();\r\n return (ps ? ps.synonymWordOrWebVersion() : '');\r\n }\r\n\r\n public principalNameSizeFactor(): number {\r\n\r\n const factor: number = (this.principalSynonymText() == null ? 1 : (70 / this.principalSynonymText().length));\r\n if (factor >= 1.0) {\r\n return 1;\r\n }\r\n\r\n return (factor < 0.70) ? 0.70 : factor;\r\n }\r\n\r\n public summaryDescription() {\r\n return this.principalSynonymText()\r\n + ` CAS No.: ${this.realCASNumber || ''} RIFM ID: ${this.formattedRIFMId} FEMA No.: ${this.fEMANumber}`;\r\n }\r\n\r\n constructor() {\r\n super();\r\n this.cASNumber = '';\r\n this.realCASNumber = '';\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n cASNumber: string;\r\n fEMANumber: number;\r\n realCASNumber: string;\r\n numericalCASNumber: number;\r\n alternateCASNumber: string;\r\n monographNumber: number;\r\n eINECSNumber: string;\r\n eCB: string;\r\n eCNNumber: string;\r\n structure: string;\r\n formula: string;\r\n molecularWeight: number;\r\n eINECSRegistration: boolean;\r\n dSLRegistration: boolean;\r\n nDSLRegistration: boolean;\r\n tSCARegistration: boolean;\r\n eCNRegistration: boolean;\r\n typeTSCAClassId: number;\r\n yearOfPublication: number;\r\n monographReference: string;\r\n typeNaturalOccurrenceId: number;\r\n occurrenceReference: string;\r\n firstUsed: number;\r\n typeNarrativeSummaryId: string;\r\n preparationReference: string;\r\n smiles: string;\r\n confidential: boolean;\r\n toxDataProhibited: boolean;\r\n captiveCompany: string;\r\n fFIDSFile: string;\r\n mETI: string;\r\n eCL: string;\r\n functionalUse: string;\r\n materialDescription: string;\r\n candidate: string;\r\n attv: boolean;\r\n lVE: boolean;\r\n solelyFunctional: boolean;\r\n materialNotes: string;\r\n preparation: string;\r\n componentSubstances: string;\r\n internalMaterialNotes: string;\r\n typeEssentialOilId: string;\r\n typeBotanicalSubdivisionId: string;\r\n speciesCAS: string;\r\n genericCAS: string;\r\n assessmentReportName: string;\r\n assessmentReportNameModified: Date;\r\n noSampleAvail: string;\r\n noConcSurvAvail: string;\r\n hasDraft: boolean;\r\n elsevierReportName: string;\r\n elsevierReportNameModified: Date;\r\n reachRegistration: boolean;\r\n sACategoryComment: string;\r\n eCInventoryNumber: string;\r\n typeMaterialUnitId: string;\r\n secondRoundNCS: boolean;\r\n secondRoundNCSComment: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n analyticalResults: AnalyticalResult[];\r\n dermalExposures: DermalExposure[];\r\n epiData: EPIData;\r\n ePISuites: EPISuite[];\r\n experimentalMaterials: ExperimentalMaterial[];\r\n foodStatuses: FoodStatus[];\r\n houseStatuses: HouseStatus[];\r\n materialAdditionalIdentifiers: MaterialAdditionalIdentifier[];\r\n materialAlertRules: MaterialAlertRule[];\r\n materialAssessmentCategories: MaterialAssessmentCategory[];\r\n materialConsumptions: MaterialConsumption[];\r\n materialExpertPanelSummaries: MaterialExpertPanelSummary[];\r\n materialFSAGs: MaterialFSAG[];\r\n materialHazardCodes: MaterialHazardCode[];\r\n materialMonographs: MaterialMonograph[];\r\n materialPrecautionCodes: MaterialPrecautionCode[];\r\n materialRelations: MaterialRelation[];\r\n materialTransparencyLists: MaterialTransparencyList[];\r\n materialUnTransport: MaterialUNTransport;\r\n naturalOccurrenceDescriptors: NaturalOccurrenceDescriptor[];\r\n predictions: Prediction[];\r\n rEACHRegistrations: REACHRegistration[];\r\n regulatoryStatuses: RegulatoryStatus[];\r\n relatedToMaterials: MaterialRelation[];\r\n safetyAssessmentAdditionalMaterials: SafetyAssessmentMaterial[];\r\n safetyAssessmentMaterials: SafetyAssessmentMaterial[];\r\n safetyComments: SafetyComment[];\r\n safetyEUComments: SafetyEUComment[];\r\n specialLinks: SpecialLink[];\r\n synonyms: Synonym[];\r\n typeBotanicalSubdivision: TypeBotanicalSubdivision;\r\n typeEssentialOil: TypeEssentialOil;\r\n typeNarrativeSummary: TypeNarrativeSummary;\r\n typeNaturalOccurrence: TypeNaturalOccurrence;\r\n typeTscaClass: TypeTSCAClass;\r\n typeMaterialUnit: TypeMaterialUnit;\r\n uses: MaterialUses[];\r\n workflowMaterialRecordedActions: WorkflowMaterialRecordedAction[];\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class DermalExposure extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n dermalExposureId: number;\r\n materialId: number;\r\n ingredientPercent: number;\r\n evaluator: string;\r\n exposure: number;\r\n percentile: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ECOSARToxicEffect extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n eCOSARToxicEffectId: number;\r\n materialId: number;\r\n fish_96hr_LC50_Class: string;\r\n fish_96hr_LC50_mg_L_ppm: string;\r\n daphnid_48hr_LC50_Class: string;\r\n daphnid_48hr_LC50_mg_L_ppm: string;\r\n greenAlgae_96hr_EC50_Class: string;\r\n greenAlgae_96hr_EC50_mg_L_ppm: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n}\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class EPIData extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n logKow: number;\r\n bP: number;\r\n mP: number;\r\n vP: number;\r\n vPPa: number;\r\n waterSol: number;\r\n henrys: number;\r\n mW: number;\r\n bCF: number;\r\n bIOWIN1: number;\r\n bIOWIN2: number;\r\n bIOWIN3: number;\r\n bIOWIN3T: string;\r\n bIOWIN6: number;\r\n wATERNTFragWSEstimate: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeEPISuiteParameter } from './TypeEPISuiteParameter';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class EPISuite extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n ePISuiteId: number;\r\n materialId: number;\r\n typeColumnLabelId: string;\r\n ePIValue: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeEpiSuiteParameter: TypeEPISuiteParameter;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeEPISuiteCategory } from './TypeEPISuiteCategory';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeEPISuiteParameter extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeColumnLabelId: string;\r\n typeCategoryId: number;\r\n ePISuiteParameter: string;\r\n ePISuiteUnit: string;\r\n ePISuiteSortOrder: number;\r\n rowVersion: number;\r\n typeEpiSuiteCategory: TypeEPISuiteCategory;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeEPISuiteCategory extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeCategoryId: number;\r\n categoryName: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { BiologicalData } from './BiologicalData';\r\nimport { ExperimentalResult } from './ExperimentalResult';\r\nimport { TypeToxicEffect } from './TypeToxicEffect';\r\nimport { TypeExperimentVehicle } from './TypeExperimentVehicle';\r\nimport { TypeStudyMixture } from './TypeStudyMixture';\r\n\r\nimport { Entity, Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\nimport { BioDataStudySubType } from './BioDataStudySubType';\r\n\r\nconst nullBiologicalData = {\r\n typeStudy: {studyLong: '-'},\r\n typeSpecies: {speciesLong: '-'},\r\n typeRoute: {routeLong: '-'},\r\n reference: {\r\n briefReference: '-',\r\n // briefReferenceTrimmed: '-',\r\n briefRef: (isStaff: boolean) => '-',\r\n restrictedDistribution: '-',\r\n rIFMAsAuthor: '-',\r\n sponsoringCompany: '-'\r\n },\r\n subReference: '-',\r\n typeStudyId: '-',\r\n typeRouteId: '-',\r\n typeSpeciesId: '-',\r\n referenceId: -999,\r\n bioDataStudySubTypes: []\r\n};\r\n\r\nfunction isNullOrEmpty(inputString: string): boolean {\r\n if (inputString === null || inputString.length === 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}\r\n\r\nconst _monthNames = [\r\n 'January', 'February', 'March',\r\n 'April', 'May', 'June', 'July',\r\n 'August', 'September', 'October',\r\n 'November', 'December'\r\n].map(n => n.substr(0, 3));\r\n\r\n// formats a date in dd-MMM-yyyy format\r\nfunction formatDate(date: Date) {\r\n const day = date.getDate();\r\n const monthIndex = date.getMonth();\r\n const year = date.getFullYear().toString().substr(2);\r\n return day + '-' + _monthNames[monthIndex] + '-' + year;\r\n}\r\n\r\n/// \r\n\r\nexport class ExperimentalMaterial extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public getBiologicalData() {\r\n return this.biologicalData || nullBiologicalData;\r\n }\r\n\r\n public typeStudyId() {\r\n return this.getBiologicalData().typeStudyId;\r\n }\r\n\r\n public typeRouteId() {\r\n return this.getBiologicalData().typeRouteId;\r\n }\r\n\r\n public typeSpeciesId() {\r\n return this.getBiologicalData().typeSpeciesId;\r\n }\r\n\r\n // was Location\r\n public referenceId() {\r\n return this.getBiologicalData().referenceId;\r\n }\r\n\r\n // was Study\r\n public studyLong() {\r\n return this.getBiologicalData().typeStudy.studyLong;\r\n }\r\n\r\n // was Route\r\n public routeLong() {\r\n return this.getBiologicalData().typeRoute.routeLong;\r\n }\r\n\r\n // was Species\r\n public speciesLong() {\r\n return this.getBiologicalData().typeSpecies.speciesLong;\r\n }\r\n\r\n public studySubTypeDescriptions() {\r\n return this.getBiologicalData().bioDataStudySubTypes\r\n .map(x => x.typeStudySubType.subTypeDescription);\r\n }\r\n\r\n public studySubTypeIds() {\r\n return this.getBiologicalData().bioDataStudySubTypes\r\n .map(x => x.studySubTypeId);\r\n }\r\n\r\n // was File\r\n public get subReference() {\r\n return this.getBiologicalData().subReference;\r\n }\r\n\r\n // was Reference\r\n public briefReference() {\r\n return this.getBiologicalData().reference.briefReference;\r\n }\r\n\r\n public briefRef(isStaff: boolean) {\r\n return this.getBiologicalData().reference.briefRef(isStaff);\r\n }\r\n\r\n // was Date\r\n public modifiedOn() {\r\n return formatDate(this.modified);\r\n }\r\n\r\n public modifiedAsISO() {\r\n return this.modified.toISOString();\r\n }\r\n\r\n // was Sponsor\r\n public sponsoringCompany() {\r\n return this.getBiologicalData().reference.sponsoringCompany;\r\n }\r\n\r\n public M() {\r\n return this.getBiologicalData().reference.restrictedDistribution ? 'M' : '';\r\n }\r\n\r\n public R() {\r\n return this.getBiologicalData().reference.rIFMAsAuthor ? 'R' : '';\r\n }\r\n\r\n public fFDS() {\r\n if ((!isNullOrEmpty(this.fFDSShortVersion)) && this.fFDSShortVersion.substring(0, 1) == 'x') {\r\n return 'X';\r\n }\r\n if ((isNullOrEmpty(this.fFDSStatement)) && isNullOrEmpty(this.fFDSShortVersion)) {\r\n return null;\r\n }\r\n const ffdsString = this.material.materialHazardCodes.length > 0 ? 'Y ' : 'N ';\r\n return ffdsString + (this.fFDSModified != null ? formatDate(this.fFDSModified) : '');\r\n }\r\n\r\n public activateTheLink() {\r\n if ((!isNullOrEmpty(this.fFDSShortVersion)) && this.fFDSShortVersion.substr(0, 1) == 'x') {\r\n return false;\r\n }\r\n if (isNullOrEmpty(this.fFDSStatement) && isNullOrEmpty(this.fFDSShortVersion)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public unfinishedReference() {\r\n return this.biologicalData.reference.finished ? 'Finished' : 'Tox Date Entry In Progress';\r\n }\r\n\r\n cascadeDelete() {\r\n if (this.experimentalResults) {\r\n this.experimentalResults.map(er => er).forEach(er => er.cascadeDelete());\r\n }\r\n this.cascadeDeleteCore();\r\n }\r\n\r\n _deleted: Entity[] = [];\r\n\r\n addDeletedChild(e: Entity) {\r\n if (e.entityAspect.entityState.isAdded()) {\r\n return;\r\n }\r\n this._deleted.push(e);\r\n }\r\n\r\n getDeletedChildren() {\r\n return this._deleted;\r\n }\r\n\r\n clearDeletedChildren() {\r\n this._deleted.length = 0;\r\n }\r\n\r\n // Only show Experimental Material Vehicle if there are no Vehicles set for Experimental Results\r\n public showExperimentalMaterialVehicle(): boolean {\r\n\r\n if (this.experimentalResults == null) {\r\n return true;\r\n }\r\n\r\n const vehicles = this.experimentalResults.filter(v => v.typeExperimentVehicleId != 'NONE');\r\n\r\n if (vehicles != null && vehicles.length > 0) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public get calculatedResultTypeAndValue(): string {\r\n const typeToxicEffect = (this.typeToxicEffect) ? this.typeToxicEffect.toxicEffectDescription : '-';\r\n return (typeToxicEffect) + ' ' + (this.calculatedResult || '');\r\n }\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n experimentalMaterialId: number;\r\n biologicalDataId: number;\r\n materialId: number;\r\n sampleText: string;\r\n typeToxicEffectId: string;\r\n calculatedResult: string;\r\n fFDSShortVersion: string;\r\n fFDSSequenceNo: number;\r\n fFDSModified: Date;\r\n experimentalDetails: string;\r\n experimentalSummary: string;\r\n fFDSStatement: string;\r\n typeStudyMixtureId: string;\r\n typeExperimentVehicleId: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n biologicalData: BiologicalData;\r\n experimentalResults: ExperimentalResult[];\r\n material: Material;\r\n typeExperimentVehicle: TypeExperimentVehicle;\r\n typeStudyMixture: TypeStudyMixture;\r\n typeToxicEffect: TypeToxicEffect;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { AnalyticalResult } from './AnalyticalResult';\r\nimport { BiologicalData } from './BiologicalData';\r\nimport { Abstract } from './Abstract';\r\nimport { Journal } from './Journal';\r\nimport { Project } from './Project';\r\nimport { ReferenceAuthor } from './ReferenceAuthor';\r\nimport { ReferenceRelation } from './ReferenceRelation';\r\nimport { SpecialLink } from './SpecialLink';\r\nimport { TypeKlimisch } from './TypeKlimisch';\r\nimport { TypePublication } from './TypePublication';\r\nimport { TypeSearchService } from './TypeSearchService';\r\nimport { WorkflowRecordedAction } from './WorkflowRecordedAction';\r\n\r\nimport { Validator } from 'breeze-client';\r\n/// Place custom imports between tags\r\nimport { EntityPropertyAnnotation, EntityTypeAnnotation } from './EntityTypeAnnotation';\r\nimport * as _ from 'lodash';\r\n\r\nexport interface IBriefReferenceParts {\r\n author?: string;\r\n year?: string;\r\n suffix?: string;\r\n br: string;\r\n search: string;\r\n}\r\n\r\n/// \r\n\r\nexport class Reference extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n static getEntityTypeAnnotation(): EntityTypeAnnotation {\r\n const nonZeroCodeValidator = new Validator(\r\n 'NonZeroCodeValidator',\r\n (value: any) => value != 0,\r\n {messageTemplate: 'You must specify a %displayName%. '});\r\n\r\n const briefReferenceValidator = new Validator(\r\n 'BriefRefValidator',\r\n (value: any) => {\r\n const parts = Reference.extractBriefRefParts(value);\r\n if (!parts.year) {\r\n return false;\r\n }\r\n const year = parseInt(parts.year);\r\n return !isNaN(year);\r\n },\r\n {messageTemplate: 'A Brief Reference must contain a valid year component.'}\r\n );\r\n\r\n const propAnnotations = [\r\n new EntityPropertyAnnotation('journalId', {\r\n displayName: 'Journal',\r\n validators: [nonZeroCodeValidator]\r\n }),\r\n new EntityPropertyAnnotation('briefReference', {\r\n displayName: 'Brief Reference',\r\n validators: [briefReferenceValidator]\r\n })\r\n ];\r\n\r\n return new EntityTypeAnnotation({\r\n validators: [],\r\n propertyAnnotations: propAnnotations\r\n });\r\n }\r\n\r\n // // a property instead of a method because it is also exposed as a property under Null experimentalMaterial.\r\n // public get briefReferenceTrimmed() {\r\n // var parts = Reference.extractBriefRefParts(this.briefReference)\r\n // return parts.author ? parts.author + \",\" + parts.year : '';\r\n // }\r\n\r\n public briefRef(isStaff: boolean) {\r\n return Reference.formatBriefReference(this.briefReference, isStaff);\r\n }\r\n\r\n public static formatBriefReference(br: string, isStaff: boolean) {\r\n if (isStaff) {\r\n return br || '';\r\n }\r\n const parts = Reference.extractBriefRefParts(br);\r\n return parts.author ? parts.author + ',' + parts.year : '';\r\n }\r\n\r\n public description(isStaff: boolean) {\r\n return this.briefRef(isStaff) + ' - Reference No. ' + (this.referenceId || '');\r\n }\r\n\r\n public captiveText() {\r\n return this.captivePaper ? 'Captive' : '';\r\n }\r\n\r\n public finishedText() {\r\n return this.finished ? '' : 'Tox Data Entry In Progress';\r\n }\r\n\r\n public captiveFinishedText() {\r\n return this.captiveText() + ((this.captivePaper && this.finished == false) ? ' - ' : '') + this.finishedText();\r\n }\r\n\r\n public authorDisplay() {\r\n if (!this.referenceAuthors) {\r\n return '-';\r\n }\r\n // We used to sort by 'initials' - removed per issue #404\r\n // var authors = _.sortBy( this.referenceAuthors.map(ra => ra.author), a => a.initials);\r\n // now sorted by counter.\r\n const authors = _.sortBy(this.referenceAuthors, a => a.counter).map(a => a.author);\r\n return authors.map(a => {\r\n const inits = (a.initials != null) ? a.initials + ' ' : '';\r\n return inits + a.authorName;\r\n }).join('; ');\r\n }\r\n\r\n public get abstractText() {\r\n return (this.abstract) ? this.abstract.text : '';\r\n }\r\n\r\n public set abstractText(value: string) {\r\n this.abstract.text = value;\r\n }\r\n\r\n // public get rIFMPublications() {\r\n // return (this.typePublication) ? this.typePublication.publicationType : '';\r\n // }\r\n\r\n // assumes 'referenceAuthors' property has been fetched;\r\n public citationText(isStaff: boolean) {\r\n const authors = _.sortBy(this.referenceAuthors, a => a.counter).map(a => a.author);\r\n const authorNames = authors.map(a => {\r\n const initials = a.initials && a.initials.trim();\r\n return initials ? `${a.authorName.trim()} ${initials}` : a.authorName.trim();\r\n });\r\n const authorList = authorNames.join('; ');\r\n const brParts = Reference.extractBriefRefParts(this.briefReference);\r\n const annotatedYear = brParts.year ? brParts.year + (isStaff ? brParts.suffix : '') : '';\r\n let citation: string;\r\n if (this.rIFMAsAuthor) {\r\n const refPart1 = `Research Institute for Fragrance Materials ${this.yearOfPublication} ${this.title}`;\r\n let refPart2: string;\r\n if (this.restrictedDistribution) {\r\n refPart2 = `RIFM report number ${this.referenceId}`;\r\n } else {\r\n refPart2 = `Unpublished report ${this.referenceId} from ${authorList}`;\r\n }\r\n citation = `${Reference.formatBriefReference(this.briefReference, isStaff)} ${refPart1} ${refPart2}`;\r\n } else {\r\n citation = `${authorList} ${annotatedYear} ${this.title} ${this.journal.journalName} ${this.journalDetail} Ref# ${this.referenceId}`;\r\n }\r\n return citation;\r\n }\r\n\r\n public setYearOfPublicationFromBriefReference() {\r\n const parts = Reference.extractBriefRefParts(this.briefReference);\r\n if (!parts.year) {\r\n this.yearOfPublication = 0;\r\n } else {\r\n this.yearOfPublication = parseInt(parts.year);\r\n }\r\n }\r\n\r\n\r\n public static extractBriefRefParts(br: string): IBriefReferenceParts {\r\n\r\n const rx = /(.*),\\s*(\\d*)(.*)/;\r\n const parts = rx.exec(br);\r\n if (!parts) {\r\n return {br: br, search: br};\r\n } else {\r\n return {\r\n author: parts[1],\r\n year: parts[2],\r\n suffix: parts[3] ? parts[3].trim().toLocaleLowerCase() : '',\r\n br: br,\r\n search: parts[1] + ',' + parts[2]\r\n };\r\n }\r\n }\r\n\r\n public static partsToBriefRef(parts: IBriefReferenceParts) {\r\n if (!parts.author) {\r\n return parts.br;\r\n } else {\r\n return parts.author + ',' + parts.year + parts.suffix;\r\n }\r\n }\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n referenceId: number;\r\n journalId: number;\r\n publicationTypeId: number;\r\n briefReference: string;\r\n title: string;\r\n yearOfPublication: number;\r\n abstractOnly: boolean;\r\n precedence: number;\r\n linkable: boolean;\r\n complete: boolean;\r\n rIFMArticle: boolean;\r\n fEMAArticle: boolean;\r\n journalDetail: string;\r\n privateCommunication: boolean;\r\n restrictedDistribution: boolean;\r\n sponsoringCompany: string;\r\n finished: boolean;\r\n rIFMAsAuthor: boolean;\r\n projectId: number;\r\n contractorId: string;\r\n litSearch: boolean;\r\n captivePaper: boolean;\r\n testingInProgress: boolean;\r\n typeKlimischId: string;\r\n klimNote: string;\r\n govSponsors: string;\r\n govDocNumbers: string;\r\n captiveCompany: string;\r\n staffComments: string;\r\n typeSearchServiceId: string;\r\n abstractNumber: string;\r\n publicationWebReference: string;\r\n meetingDetails: string;\r\n posterAttached: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n abstract: Abstract;\r\n analyticalResults: AnalyticalResult[];\r\n biologicalDatas: BiologicalData[];\r\n journal: Journal;\r\n project: Project;\r\n referenceAuthors: ReferenceAuthor[];\r\n referenceRelations: ReferenceRelation[];\r\n specialLinks: SpecialLink[];\r\n typeKlimisch: TypeKlimisch;\r\n typePublication: TypePublication;\r\n typeSearchService: TypeSearchService;\r\n inLifePortion: string;\r\n workflowRecordedActions: WorkflowRecordedAction[];\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { ExperimentalMaterial } from './ExperimentalMaterial';\r\nimport { BioDataStudySubType } from './BioDataStudySubType';\r\nimport { Reference } from './Reference';\r\nimport { TypeRoute } from './TypeRoute';\r\nimport { TypeSpecies } from './TypeSpecies';\r\nimport { TypeStudy } from './TypeStudy';\r\nimport { TypeTimeUnit } from './TypeTimeUnit';\r\nimport { TypeUsefulness } from './TypeUsefulness';\r\n\r\nimport { Validator } from 'breeze-client';\r\n/// Place custom imports between tags\r\nimport { EntityPropertyAnnotation, EntityTypeAnnotation } from './EntityTypeAnnotation';\r\nimport * as _ from 'lodash';\r\n\r\n/// \r\n\r\nexport class BiologicalData extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n // non persisted client side only temporary subReference\r\n // for when an actual subreference does not exist;\r\n _tempSubReference: number;\r\n\r\n static getEntityTypeAnnotation(): EntityTypeAnnotation {\r\n const propAnnotations = [\r\n new EntityPropertyAnnotation('typeStudyId', {\r\n displayName: 'Study',\r\n validators: [Validator.required()]\r\n }),\r\n new EntityPropertyAnnotation('typeSpeciesId', {\r\n displayName: 'Species',\r\n validators: []\r\n }),\r\n new EntityPropertyAnnotation('typeRouteId', {\r\n displayName: 'Route',\r\n validators: [Validator.required()]\r\n }),\r\n new EntityPropertyAnnotation('typeTimeUnitId', {\r\n displayName: 'Time Unit',\r\n validators: []\r\n }),\r\n new EntityPropertyAnnotation('typeUsefulnessId', {\r\n displayName: 'Usefulness',\r\n validators: []\r\n }),\r\n ];\r\n\r\n return new EntityTypeAnnotation({\r\n validators: [],\r\n propertyAnnotations: propAnnotations\r\n });\r\n }\r\n\r\n\r\n public anySubjects() {\r\n return (this.subjectsMale > 0) ||\r\n (this.subjectsFemale > 0) ||\r\n (this.subjectsUnspecifiedSex > 0);\r\n }\r\n\r\n public get subReference() {\r\n return (this.fileReference && this.fileReference.trim().length > 0) ?\r\n this.fileReference :\r\n (this._tempSubReference || '').toString();\r\n }\r\n\r\n public studySubTypeDescriptions() {\r\n return this.bioDataStudySubTypes\r\n .map(x => x.typeStudySubType.subTypeDescription);\r\n }\r\n\r\n public getMethodologyBriefRefs() {\r\n if (this.methodologyReference == null || this.methodologyReference.length == 0) {\r\n return [];\r\n }\r\n // split along ';'\r\n const briefRefs = this.methodologyReference.split(';');\r\n const normalizedRefs: string[] = [];\r\n briefRefs.forEach(br => {\r\n const brParts = Reference.extractBriefRefParts(br.trim());\r\n // some refs are written as 'a and b,1965'\r\n if (brParts.author) {\r\n const authors = brParts.author.split(' and ');\r\n if (authors.length > 1) {\r\n authors.forEach(author => {\r\n const tempBrParts = _.cloneDeep(brParts);\r\n tempBrParts.author = author.trim();\r\n const tempBr = Reference.partsToBriefRef(tempBrParts);\r\n normalizedRefs.push(tempBr);\r\n });\r\n } else {\r\n normalizedRefs.push(Reference.partsToBriefRef(brParts));\r\n }\r\n } else {\r\n normalizedRefs.push(br);\r\n }\r\n });\r\n return normalizedRefs;\r\n }\r\n\r\n cascadeDelete() {\r\n // need to keep a copy of related entities and cascade delete them after\r\n // deleting the parent. Otherwise the deletion of the parent sets the fk of the\r\n // children to 0 which causes problems when the server when tries to delete them.\r\n const expMats = this.experimentalMaterials.map(x => x);\r\n this.cascadeDeleteCore();\r\n expMats.forEach(ed => ed.cascadeDelete());\r\n }\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n biologicalDataId: number;\r\n referenceId: number;\r\n fileReference: string;\r\n typeStudyId: string;\r\n typeRouteId: string;\r\n typeSpeciesId: string;\r\n confidential: boolean;\r\n methodologyReference: string;\r\n humanHealthData: boolean;\r\n environmentalData: boolean;\r\n subjectsMale: number;\r\n subjectsFemale: number;\r\n subjectsUnspecifiedSex: number;\r\n studyLength: number;\r\n typeTimeUnitId: string;\r\n typeUsefulnessId: string;\r\n gLP: boolean;\r\n protocol: string;\r\n comment: string;\r\n compliance: string;\r\n safetyAssessmentSummary: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n bioDataStudySubTypes: BioDataStudySubType[];\r\n experimentalMaterials: ExperimentalMaterial[];\r\n reference: Reference;\r\n typeRoute: TypeRoute;\r\n typeSpecies: TypeSpecies;\r\n typeStudy: TypeStudy;\r\n typeTimeUnit: TypeTimeUnit;\r\n typeUsefulness: TypeUsefulness;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { BiologicalData } from './BiologicalData';\r\nimport { TypeStudySubType } from './TypeStudySubType';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class BioDataStudySubType extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n biologicalDataId: number;\r\n typeStudyId: string;\r\n studySubTypeId: string;\r\n rowVersion: number;\r\n biologicalData: BiologicalData;\r\n typeStudySubType: TypeStudySubType;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeStudySubType extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeStudyId: string;\r\n studySubTypeId: string;\r\n subTypeDescription: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Reference } from './Reference';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class Abstract extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n referenceId: number;\r\n text: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n reference: Reference;\r\n}\r\n\r\n","export class JournalReserveItem {\r\n journalReserveId: number;\r\n journalName: string;\r\n journalYear: number;\r\n volume: string;\r\n issue: string;\r\n pages: string;\r\n notes: string;\r\n\r\n\r\n constructor(id: number, name: string, year: number, vol: string, issue: string, pages: string, notes: string) {\r\n this.journalReserveId\t= id;\r\n this.journalName\t\t= name;\r\n this.journalYear\t\t= year;\r\n this.volume \t\t\t= vol;\r\n this.issue\t\t\t\t= issue;\r\n this.pages\t\t\t\t= pages;\r\n this.notes\t\t\t\t= notes;\r\n }\r\n}\r\n","const _monthFullNames = [\r\n 'January', 'February', 'March',\r\n 'April', 'May', 'June', 'July',\r\n 'August', 'September', 'October',\r\n 'November', 'December'\r\n];\r\n\r\nexport class JournalSubscriptionItem {\r\n journalSubscriptionId: number;\r\n journalName: string;\r\n subscriptionDescription: string;\r\n subscriptionStartMonth: number;\r\n subscriptionStartYear: number;\r\n subscriptionEndMonth: number;\r\n subscriptionEndYear: number;\r\n issuesPerYear: string;\r\n department: string;\r\n notes: string;\r\n publisher: string;\r\n\r\n // tslint:disable-next-line:max-line-length\r\n constructor(id: number, name: string, subDesc: string, subStartMonth: number, subStartYear: number, subEndMonth: number, subEndYear: number, issuesPerYear: string, dept: string, publisher: string, notes: string) {\r\n this.journalSubscriptionId = id;\r\n this.journalName = name;\r\n this.subscriptionDescription = subDesc;\r\n this.subscriptionStartMonth = subStartMonth;\r\n this.subscriptionStartYear = subStartYear;\r\n this.subscriptionEndMonth = subEndMonth;\r\n this.subscriptionEndYear = subEndYear;\r\n this.issuesPerYear = issuesPerYear;\r\n this.department = dept;\r\n this.publisher = publisher;\r\n this.notes = notes;\r\n }\r\n\r\n public get subscriptionStartYearAndMonth(): string {\r\n if (this.subscriptionStartYear == null) {\r\n return '';\r\n }\r\n\r\n const month = (this.subscriptionStartMonth == null) ? '' : ', ' + _monthFullNames[this.subscriptionStartMonth - 1];\r\n\r\n return (this.subscriptionStartYear + month);\r\n }\r\n\r\n public get subscriptionEndYearAndMonth(): string {\r\n if (this.subscriptionEndYear == null) {\r\n return '';\r\n }\r\n\r\n const month = (this.subscriptionEndMonth == null) ? '' : ', ' + _monthFullNames[this.subscriptionEndMonth - 1];\r\n\r\n return (this.subscriptionEndYear + month);\r\n }\r\n\r\n public get subscriptionStartDateForSort(): Date {\r\n if (this.subscriptionStartYear == null) {\r\n return null;\r\n }\r\n\r\n const m = (this.subscriptionStartMonth != null) ? this.subscriptionStartMonth : 1;\r\n\r\n return (this.formatDate(m, this.subscriptionStartYear));\r\n }\r\n\r\n public get journalSubscriptionEndDateForSort(): Date {\r\n if (this.subscriptionEndYear == null) {\r\n return null;\r\n }\r\n\r\n const m = (this.subscriptionEndMonth != null) ? this.subscriptionEndMonth : 1;\r\n\r\n return (this.formatDate(m, this.subscriptionEndYear));\r\n }\r\n\r\n formatDate(month: number, year: number): Date {\r\n const s = '';\r\n const d = s.concat('' + month, '/', '01', '/', '' + year);\r\n return new Date(d);\r\n }\r\n\r\n public static compareJournalSubscriptionItems = function (a: JournalSubscriptionItem, b: JournalSubscriptionItem) {\r\n\r\n if (a.subscriptionStartDateForSort != null && b.subscriptionStartDateForSort != null) {\r\n if ( a.subscriptionStartDateForSort > b.subscriptionStartDateForSort) {\r\n return -1;\r\n } else if ( a.subscriptionStartDateForSort < b.subscriptionStartDateForSort) {\r\n return 1;\r\n }\r\n }\r\n return 0;\r\n };\r\n}\r\n","import { EntityBase } from './EntityBase';\r\nimport { Reference } from './Reference';\r\nimport { JournalReserve } from './JournalReserve';\r\nimport { JournalSubscription } from './JournalSubscription';\r\n\r\nimport {JournalReserveItem} from './projections/JournalReserveItem';\r\nimport {JournalSubscriptionItem} from './projections/JournalSubscriptionItem';\r\n\r\n/// Place custom imports between tags\r\n\r\n\r\n/// \r\n\r\nconst _monthFullNames = [\r\n 'January', 'February', 'March',\r\n 'April', 'May', 'June', 'July',\r\n 'August', 'September', 'October',\r\n 'November', 'December'\r\n];\r\n\r\nexport class Journal extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n _reserves: JournalReserveItem[] = [];\r\n _subscriptions: JournalSubscriptionItem[] = [];\r\n\r\n public get journalReserveItems(): JournalReserveItem[] {\r\n return this._reserves;\r\n }\r\n\r\n public get journalSubscriptionItems(): JournalSubscriptionItem[] {\r\n return this._subscriptions;\r\n }\r\n\r\n public get journalNameStartYearAndMonth(): string {\r\n if (this.journalNameStartYear == null) {\r\n return '';\r\n }\r\n\r\n const month = (this.journalNameStartMonth == null) ? '' : ', ' + _monthFullNames[this.journalNameStartMonth - 1];\r\n\r\n return (this.journalNameStartYear + month);\r\n }\r\n\r\n public get journalNameEndYearAndMonth(): string {\r\n if (this.journalNameEndYear == null) {\r\n return '';\r\n }\r\n\r\n const month = (this.journalNameEndMonth == null) ? '' : ', ' + _monthFullNames[this.journalNameEndMonth - 1];\r\n\r\n return (this.journalNameEndYear + month);\r\n }\r\n\r\n public get journalNameStartDateForSort(): Date {\r\n if (this.journalNameStartYear == null) {\r\n return null;\r\n }\r\n\r\n const m = (this.journalNameStartMonth != null) ? this.journalNameStartMonth : 1;\r\n\r\n return (this.formatDate(m, this.journalNameStartYear));\r\n }\r\n\r\n public get journalNameEndDateForSort(): Date {\r\n if (this.journalNameEndYear == null) {\r\n return null;\r\n }\r\n\r\n const m = (this.journalNameEndMonth != null) ? this.journalNameEndMonth : 1;\r\n\r\n return (this.formatDate(m, this.journalNameEndYear));\r\n }\r\n\r\n formatDate(month: number, year: number): Date {\r\n const s = '';\r\n const d = s.concat('' + month, '/', '01', '/', '' + year);\r\n return new Date(d);\r\n }\r\n\r\n prepareJournalData() {\r\n this._reserves = [];\r\n this._subscriptions = [];\r\n\r\n if (this.journalReserves != null) {\r\n this.journalReserves.forEach(reserve => {\r\n this._reserves.push(new JournalReserveItem(reserve.journalReserveId, this.journalName, reserve.journalYear, reserve.volume, reserve.issue, reserve.pages, reserve.notes));\r\n });\r\n }\r\n\r\n if (this.journalSubscriptions != null) {\r\n this.journalSubscriptions .forEach(sub => {\r\n // tslint:disable-next-line:max-line-length\r\n this._subscriptions.push(new JournalSubscriptionItem(sub.journalSubscriptionId, this.journalName, sub.typeJournalSubscription.description, sub.subscriptionStartMonth, sub.subscriptionStartYear, sub.subscriptionEndMonth, sub.subscriptionEndYear, sub.issuesPerYear, sub.department, sub.publisher, sub.notes));\r\n });\r\n }\r\n }\r\n\r\n public static compareJournalNames = function (a: Journal, b: Journal) {\r\n\r\n if (a.journalNameStartDateForSort != null && b.journalNameStartDateForSort != null) {\r\n if ( a.journalNameStartDateForSort > b.journalNameStartDateForSort) {\r\n return -1;\r\n } else if ( a.journalNameStartDateForSort < b.journalNameStartDateForSort) {\r\n return 1;\r\n }\r\n }\r\n\r\n if (a.journalName < b.journalName) {\r\n return -1;\r\n }\r\n if (a.journalName > b.journalName) {\r\n return 1;\r\n }\r\n return 0;\r\n };\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n journalId: number;\r\n journalName: string;\r\n inHouse: boolean;\r\n notes: string;\r\n journalNameStartMonth: number;\r\n journalNameStartYear: number;\r\n journalNameEndMonth: number;\r\n journalNameEndYear: number;\r\n rootJournalId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n references: Reference[];\r\n journalReserves: JournalReserve[];\r\n journalSubscriptions: JournalSubscription[];\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class Project extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n projectId: number;\r\n projectName: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Reference } from './Reference';\r\nimport { Author } from './Author';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ReferenceAuthor extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public get authorInitials() {\r\n return this.author.initials;\r\n }\r\n\r\n public get authorName() {\r\n return this.author.authorName;\r\n }\r\n\r\n public get referenceYearOfPublication() {\r\n return this.reference.yearOfPublication;\r\n }\r\n\r\n public get referenceTitle() {\r\n return this.reference.title;\r\n }\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n referenceId: number;\r\n authorId: number;\r\n counter: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n author: Author;\r\n reference: Reference;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class Author extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n authorId: number;\r\n authorName: string;\r\n initials: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Reference } from './Reference';\r\nimport { TypeReferenceRelation } from './TypeReferenceRelation';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ReferenceRelation extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n referenceId: number;\r\n relatedReferenceId: number;\r\n typeReferenceRelationId: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n reference: Reference;\r\n relatedReference: Reference;\r\n typeReferenceRelation: TypeReferenceRelation;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeReferenceRelation extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeReferenceRelationId: string;\r\n label: string;\r\n inverseTypeReferenceRelationId: string;\r\n description: string;\r\n rowVersion: number;\r\n inverseTypeReferenceRelation: TypeReferenceRelation;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { Reference } from './Reference';\r\nimport { TypeKeyword } from './TypeKeyword';\r\n\r\nimport { Validator } from 'breeze-client';\r\n/// Place custom imports between tags\r\nimport { EntityPropertyAnnotation, EntityTypeAnnotation } from './EntityTypeAnnotation';\r\nimport * as _ from 'lodash';\r\n/// \r\n\r\nexport class SpecialLink extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n static getEntityTypeAnnotation(): EntityTypeAnnotation {\r\n const nonZeroCodeValidator = new Validator(\r\n 'NonZeroCodeValidator',\r\n (value: any) => value != 0,\r\n {messageTemplate: 'You must specify a %displayName%. '});\r\n\r\n const sentinalStringValidator = new Validator(\r\n 'SentinalStringValidator',\r\n (value: string) => value != 'ZZZ',\r\n {messageTemplate: 'You must specify a %displayName%. '});\r\n\r\n const propAnnotations = [\r\n new EntityPropertyAnnotation('materialId', {\r\n displayName: 'Material',\r\n validators: [nonZeroCodeValidator]\r\n }),\r\n new EntityPropertyAnnotation('keyword', {\r\n displayName: 'Category',\r\n validators: [sentinalStringValidator]\r\n }),\r\n ];\r\n\r\n return new EntityTypeAnnotation({\r\n validators: [],\r\n propertyAnnotations: propAnnotations\r\n });\r\n }\r\n\r\n description() {\r\n // return (this.reason && this.reason.length > 0) ? this.reason : this.reference.title;\r\n return (this.reason && this.reason.length > 0) ? this.reason : _.get(this, 'reference.title', '');\r\n }\r\n\r\n explanation() {\r\n const r = this.typeKeywords && this.typeKeywords.explanation;\r\n return (r != null) ? r : '';\r\n }\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n keyword: string;\r\n referenceId: number;\r\n materialId: number;\r\n reason: string;\r\n humanHealthData: boolean;\r\n environmentalData: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n reference: Reference;\r\n typeKeywords: TypeKeyword;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeKeyword extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n keyword: string;\r\n explanation: string;\r\n linksEnabled: boolean;\r\n environmental: boolean;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeKlimisch extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeKlimischId: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypePublication extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n publicationTypeId: number;\r\n publicationType: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeSearchService extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeSearchServiceId: string;\r\n description: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Reference } from './Reference';\r\nimport { TypeWorkflowAction } from './TypeWorkflowAction';\r\nimport { TypeWorkflowContact } from './TypeWorkflowContact';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class WorkflowRecordedAction extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n workflowRecordedActionId: number;\r\n typeWorkflowActionId: string;\r\n entityName: string;\r\n propertyName: string;\r\n referenceId: number;\r\n materialId: number;\r\n actionObjectId: string;\r\n completedWorkflowActionId: string;\r\n actionCompletedDate: Date;\r\n completedUser: string;\r\n sentToContactId: number;\r\n notes: string;\r\n createdWorkflowContactId: number;\r\n completedWorkflowContactId: number;\r\n holdReason: string;\r\n sequenceNumber: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n completedTypeWorkflowAction: TypeWorkflowAction;\r\n completedTypeWorkflowContact: TypeWorkflowContact;\r\n createdTypeWorkflowContact: TypeWorkflowContact;\r\n reference: Reference;\r\n sentToTypeWorkflowContact: TypeWorkflowContact;\r\n typeWorkflowAction: TypeWorkflowAction;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeWorkflowAction extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeWorkflowActionId: string;\r\n description: string;\r\n toCompleteDescription: string;\r\n includeInStaffReport: boolean;\r\n canDeleteFromWorkflowHistory: boolean;\r\n completedOnlyType: boolean;\r\n coreData: boolean;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeWorkflowContact extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n workflowContactId: number;\r\n firstName: string;\r\n lastName: string;\r\n emailAddress: string;\r\n notifyOnAddReference: boolean;\r\n consultant: boolean;\r\n workflowStaff: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeRoute extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeRouteId: string;\r\n routeLong: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeSpecies extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeSpeciesId: string;\r\n speciesLong: string;\r\n environmentalStudy: boolean;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeTitle } from './TypeTitle';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeStudy extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeStudyId: string;\r\n typeTitleId: number;\r\n studyLong: string;\r\n environmentalStudy: boolean;\r\n effectsRequired: boolean;\r\n rowVersion: number;\r\n typeTitle: TypeTitle;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeTitle extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeTitleId: number;\r\n theTitle: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeTimeUnit extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeTimeUnitId: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeUsefulness extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeUsefulnessId: string;\r\n description: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { ExperimentalMaterial } from './ExperimentalMaterial';\r\nimport { ExperimentalToxicEffect } from './ExperimentalToxicEffect';\r\nimport { TypeExperimentVehicle } from './TypeExperimentVehicle';\r\nimport { TypeUnit } from './TypeUnit';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ExperimentalResult extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public formattedDose() {\r\n var op = (this.compOp == '0') ? '' : this.compOp;\r\n return op + this.dose + ' ' + this.getTypeUnitDescription()\r\n }\r\n\r\n public formattedDoseAndEffects() {\r\n return this.formattedDose() + ' ' + this.toxicEffects();\r\n }\r\n \r\n public toxicEffects() {\r\n if (this.experimentalToxicEffects==null || this.experimentalToxicEffects.length == 0) return ''; \r\n return this.experimentalToxicEffects.map(x => x.typeToxicEffect.toxicEffectDescription).join(\"; \");\r\n }\r\n \r\n getTypeUnitDescription() {\r\n if (!this.typeUnit) return '';\r\n return this.typeUnit.unitDescription;\r\n }\r\n \r\n cascadeDelete() {\r\n if (this.experimentalToxicEffects) {\r\n this.experimentalToxicEffects.map(et =>et).forEach(et => et.cascadeDelete());\r\n }\r\n this.cascadeDeleteCore(); \r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n experimentalResultId: number;\r\n experimentalMaterialId: number;\r\n typeUnitId: string;\r\n compOp: string;\r\n dose: number;\r\n dPMperLymphNode: number;\r\n stimulationIndex: number;\r\n resultNote: string;\r\n typeExperimentVehicleId: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n experimentalMaterial: ExperimentalMaterial;\r\n experimentalToxicEffects: ExperimentalToxicEffect[];\r\n typeExperimentVehicle: TypeExperimentVehicle;\r\n typeUnit: TypeUnit;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { ExperimentalResult } from './ExperimentalResult';\r\nimport { TypeToxicEffect } from './TypeToxicEffect';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ExperimentalToxicEffect extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n experimentalResultId: number;\r\n typeToxicEffectId: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n experimentalResult: ExperimentalResult;\r\n typeToxicEffect: TypeToxicEffect;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeToxicEffect extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeToxicEffectId: string;\r\n toxicEffectDescription: string;\r\n calculated: boolean;\r\n sortDescription: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeExperimentVehicle extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeExperimentVehicleId: string;\r\n vehicle: string;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeUnit extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeUnitId: string;\r\n unitDescription: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeStudyMixture extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeStudyMixtureId: string;\r\n description: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { Reference } from './Reference';\r\nimport { JECFAMonograph } from './JECFAMonograph';\r\nimport { TypeFoodStatus } from './TypeFoodStatus';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class FoodStatus extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n // These methods allow RegulatoryStatus and FoodStatus to share the same interface.\r\n\r\n evaluatingAgency() {\r\n return this.typeFoodStatus.foodAgencyLabel;\r\n }\r\n\r\n agencyTitle() {\r\n return this.typeFoodStatus.foodStatusTitle;\r\n }\r\n\r\n regulatoryStatement() {\r\n return this.typeFoodStatus.foodStatusStmnt ;\r\n }\r\n\r\n prefixedDetermination() {\r\n return this.regulatoryStatement() ? this.regulatoryStatement() + ' ' + this.determination : this.determination;\r\n }\r\n\r\n webReferenceExt() {\r\n if (this.monographID != null) {\r\n return this.jECFAMonograph.monographAddress;\r\n } else {\r\n return this.webReference;\r\n }\r\n }\r\n\r\n linkDisplayExt() {\r\n if (this.webReference == null) {\r\n return null;\r\n }\r\n\r\n return (this.webReference.indexOf('http') == 0) ? 'Link here' : 'Download here';\r\n }\r\n\r\n regulatoryTypeForCompare() {\r\n return ((this.regulatoryType != null) ? this.regulatoryType : '');\r\n }\r\n\r\n public get numberFlavis_JECFA(): string {\r\n if (this.foodAgencyId.toLowerCase() == 'flavis') {\r\n return this.fL_No;\r\n } else if (this.foodAgencyId.toLowerCase() == 'jecfa') {\r\n return this.jECFA_No;\r\n }\r\n return '';\r\n }\r\n\r\n /// \r\n\r\n\r\n // Generated code. Do not place code below this line.\r\n foodStatusId: number;\r\n materialId: number;\r\n monographID: number;\r\n foodAgencyId: string;\r\n evaluatorId: string;\r\n referenceID: number;\r\n regulatoryType: string;\r\n determination: string;\r\n webReference: string;\r\n note: string;\r\n fL_No: string;\r\n jECFA_No: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n jECFAMonograph: JECFAMonograph;\r\n material: Material;\r\n reference: Reference;\r\n typeFoodStatus: TypeFoodStatus;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class JECFAMonograph extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n monographId: number;\r\n monographTitle: string;\r\n monographAddress: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeFoodStatus extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n foodAgencyID: string;\r\n foodStatusTitle: string;\r\n foodStatusStmnt: string;\r\n foodAgencyLabel: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class HouseStatus extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n topic: string;\r\n determination: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeMaterialIdentifier } from './TypeMaterialIdentifier';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialAdditionalIdentifier extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n constructor();\r\n constructor(obj: MaterialAdditionalIdentifier);\r\n\r\n constructor(obj?: MaterialAdditionalIdentifier) {\r\n super();\r\n\r\n this.materialAdditionalIdentifierId = obj && obj.materialAdditionalIdentifierId || 0;\r\n this.materialId = obj && obj.materialId || 0;\r\n this.cASNumber = obj && obj.cASNumber || null;\r\n this.eCL = obj && obj.eCL || null;\r\n this.eINECSNumber = obj && obj.eINECSNumber || null;\r\n this.eCNNumber = obj && obj.eCNNumber || null;\r\n this.dSLRegistration = obj && obj.dSLRegistration || false;\r\n this.eCNRegistration = obj && obj.eCNRegistration || false;\r\n this.eINECSRegistration = obj && obj.eINECSRegistration || false;\r\n this.eCInventoryNumber = obj && obj.eCInventoryNumber || null;\r\n this.nDSLRegistration = obj && obj.nDSLRegistration || false;\r\n this.reachRegistration = obj && obj.reachRegistration || false;\r\n this.tSCARegistration = obj && obj.tSCARegistration || false;\r\n this.typeMaterialIdentifierId = obj && obj.typeMaterialIdentifierId || null;\r\n this.created = obj && obj.created || null;\r\n this.createdUser = obj && obj.createdUser || null;\r\n this.modified = obj && obj.modified || null;\r\n this.modifyUser = obj && obj.modifyUser || null;\r\n }\r\n\r\n hasChanges(obj: MaterialAdditionalIdentifier) : boolean {\r\n if (obj == null) {return true;}\r\n\r\n if (this.materialAdditionalIdentifierId != obj.materialAdditionalIdentifierId) {return true;}\r\n if (this.materialId != obj.materialId) { return true; }\r\n if (this.cASNumber != obj.cASNumber) { return true; }\r\n if (this.eCL != obj.eCL) { return true; }\r\n if (this.eINECSNumber != obj.eINECSNumber) { return true; }\r\n if (this.eCNNumber != obj.eCNNumber) { return true; }\r\n if (this.eCInventoryNumber != obj.eCInventoryNumber) { return true; }\r\n if (this.dSLRegistration != obj.dSLRegistration) { return true; }\r\n if (this.eCNRegistration != obj.eCNRegistration) { return true; }\r\n if (this.eINECSRegistration != obj.eINECSRegistration) { return true; }\r\n if (this.nDSLRegistration != obj.nDSLRegistration) { return true; }\r\n if (this.reachRegistration != obj.reachRegistration) { return true; }\r\n if (this.tSCARegistration != obj.tSCARegistration) { return true; }\r\n if (this.typeMaterialIdentifierId != obj.typeMaterialIdentifierId) { return true; }\r\n\r\n return false;\r\n }\r\n\r\n public hasRegistration() {\r\n return this.eINECSRegistration || this.dSLRegistration || this.nDSLRegistration || this.tSCARegistration || this.reachRegistration;\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialAdditionalIdentifierId: number;\r\n materialId: number;\r\n cASNumber: string;\r\n eINECSNumber: string;\r\n eCNNumber: string;\r\n eCL: string;\r\n dSLRegistration: boolean;\r\n eINECSRegistration: boolean;\r\n eCNRegistration: boolean;\r\n nDSLRegistration: boolean;\r\n reachRegistration: boolean;\r\n tSCARegistration: boolean;\r\n typeMaterialIdentifierId: string;\r\n eCInventoryNumber: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeMaterialIdentifier: TypeMaterialIdentifier;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeMaterialIdentifier extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeMaterialIdentifierId: string;\r\n description: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeAlertRule } from './TypeAlertRule';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialAlertRule extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n rule: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n typeAlertRule: TypeAlertRule;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeAlertRule extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n rule: number;\r\n description: string;\r\n gIF: string;\r\n topicalEffects: number;\r\n systemicEffects: number;\r\n carcinogenicEffects: number;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { AssessmentCategory } from './AssessmentCategory';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialAssessmentCategory extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n assessmentCategoryId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n assessmentCategory: AssessmentCategory;\r\n material: Material;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { MaterialAssessmentCategory } from './MaterialAssessmentCategory';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class AssessmentCategory extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n assessmentCategoryId: number;\r\n name: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n materialAssessmentCategories: MaterialAssessmentCategory[];\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { Survey } from './Survey';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialConsumption extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n get geographicalArea() {\r\n var type = this.survey && this.survey.typeGeographicalArea;\r\n return type ? type.geographicalArea : '-';\r\n }\r\n \r\n get surveyYear() {\r\n return this.survey ? this.survey.surveyYear : '-';\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialConsumptionId: number;\r\n materialId: number;\r\n surveyId: number;\r\n kilogramsConsumed: number;\r\n subType: string;\r\n pecPnecRatio: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n survey: Survey;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeGeographicalArea } from './TypeGeographicalArea';\r\nimport { TypeSponsor } from './TypeSponsor';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class Survey extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n surveyId: number;\r\n surveyYear: string;\r\n typeSponsorId: number;\r\n flavor: boolean;\r\n typeGeographicalAreaId: number;\r\n numericalSurveyYear: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n typeGeographicalArea: TypeGeographicalArea;\r\n typeSponsor: TypeSponsor;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeGeographicalArea extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeGeographicalAreaId: number;\r\n geographicalArea: string;\r\n surveyYears: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeSponsor extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeSponsorId: number;\r\n sponsorName: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { ExpertPanelSummary } from './ExpertPanelSummary';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialExpertPanelSummary extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n expertPanelID: number;\r\n review: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n expertPanelSummary: ExpertPanelSummary;\r\n material: Material;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Reference } from './Reference';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ExpertPanelSummary extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n expertPanelID: number;\r\n narrativeTitle: string;\r\n narrativeLink: string;\r\n publication: string;\r\n referenceId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n reference: Reference;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { FSAG } from './FSAG';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialFSAG extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n sAGID: number;\r\n materialId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n fSAG: FSAG;\r\n material: Material;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class FSAG extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n get normNote() {\r\n return (this.note || '').toLowerCase();\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n sAGID: number;\r\n sAG: string;\r\n parent: number;\r\n sibling: number;\r\n child: number;\r\n note: string;\r\n priority: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeHazardCode } from './TypeHazardCode';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialHazardCode extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialHazardCodeId: number;\r\n materialId: number;\r\n typeHazardCodeId: string;\r\n comment: string;\r\n approved: boolean;\r\n deletedDate: Date;\r\n deletedBy: string;\r\n lMApprovedDate: Date;\r\n lMApprovedBy: string;\r\n deleteNextLM: boolean;\r\n hazardStatement: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeHazardCode: TypeHazardCode;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeHazardCode extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeHazardCodeId: string;\r\n hSCode: string;\r\n hazardStatement: string;\r\n signalWord: string;\r\n sortNo: number;\r\n pict: string;\r\n pictCode: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypePrecautionStatement } from './TypePrecautionStatement';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialPrecautionCode extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialPrecautionCodeId: number;\r\n materialId: number;\r\n typePrecautionStatementId: string;\r\n pCount: number;\r\n aCount: number;\r\n deleteNextLM: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typePrecautionStatement: TypePrecautionStatement;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypePrecautionStatement extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typePrecautionStatementId: string;\r\n precautionaryStatement: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeMaterialRelation } from './TypeMaterialRelation';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\nimport { EntityTypeAnnotation, EntityPropertyAnnotation} from './EntityTypeAnnotation'\r\n/// \r\n\r\nexport class MaterialRelation extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n static getEntityTypeAnnotation(): EntityTypeAnnotation {\r\n var propAnnotations = [\r\n new EntityPropertyAnnotation('relatedMaterialId', {\r\n displayName: 'Related Material',\r\n validators: [Validator.required()]\r\n }),\r\n ];\r\n\r\n return new EntityTypeAnnotation({\r\n validators: [],\r\n propertyAnnotations: propAnnotations\r\n })\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n relatedMaterialId: number;\r\n typeMaterialRelationId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n relatedMaterial: Material;\r\n typeMaterialRelation: TypeMaterialRelation;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeMaterialRelation extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeMaterialRelationId: number;\r\n relationType: string;\r\n reciprocalRelationType: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialTransparencyList extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialTransparencyListId: number;\r\n materialId: number;\r\n addedToList: Date;\r\n removedFromList: Date;\r\n note: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { MaterialUNTransportCode } from './MaterialUNTransportCode';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialUNTransport extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n labelApproved: boolean;\r\n labelAdded: Date;\r\n labelAddedBy: string;\r\n labelUpdated: Date;\r\n labelUpdatedBy: string;\r\n labelDeleted: Date;\r\n labelDeletedBy: string;\r\n classification: string;\r\n concentrationLimits: string;\r\n concLimChanged: Date;\r\n deleted: Date;\r\n deletedBy: string;\r\n rSComment: string;\r\n rSCommentChanged: Date;\r\n labelDeleteNextLM: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n materialUNTransportCodes: MaterialUNTransportCode[];\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { MaterialUNTransport } from './MaterialUNTransport';\r\nimport { TypeHazardousSymbol } from './TypeHazardousSymbol';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialUNTransportCode extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n hazardCodeId: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n materialUnTransport: MaterialUNTransport;\r\n typeHazardousSymbol: TypeHazardousSymbol;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeHazardousSymbol extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n hazardCodeId: string;\r\n signalWord: string;\r\n symbolName: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class NaturalOccurrenceDescriptor extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n product: string;\r\n category: boolean;\r\n productCAS: string;\r\n lessThan: boolean;\r\n trace: boolean;\r\n qualitative: boolean;\r\n rangeMin: number;\r\n rangeMax: number;\r\n unit: string;\r\n comment: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypePrediction } from './TypePrediction';\r\nimport { TypePredictionClass } from './TypePredictionClass';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class Prediction extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n predictionId: number;\r\n materialId: number;\r\n typePredictionId: number;\r\n predictionClass: string;\r\n comment: string;\r\n enabled: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typePrediction: TypePrediction;\r\n typePredictionClass: TypePredictionClass;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypePrediction extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typePredictionId: number;\r\n predictionName: string;\r\n primaryJudgment: boolean;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypePredictionClass extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n predictionClass: string;\r\n predictionClassDescription: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeREACHTonnageBand } from './TypeREACHTonnageBand';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class REACHRegistration extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n rEACHRegistrationId: number;\r\n materialId: number;\r\n eCListNumber: string;\r\n registrationCASNumber: string;\r\n registrationName: string;\r\n registrationType: string;\r\n submissionType: string;\r\n typeREACHTonnageBandId: number;\r\n dossierId: string;\r\n dossierWebLink: string;\r\n registrationReportDate: Date;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeREACHTonnageBand: TypeREACHTonnageBand;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeREACHTonnageBand extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeREACHTonnageBandId: number;\r\n totalTonnageBand: string;\r\n lowerLimit: number;\r\n upperLimit: number;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeRegulatoryStatus } from './TypeRegulatoryStatus';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class RegulatoryStatus extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n // These methods allow RegulatoryStatus and FoodStatus to share the same interface.\r\n evaluatingAgency() {\r\n return (this.typeRegulatoryStatus != null) ? this.typeRegulatoryStatus.evaluatingAgencyLabel : null;\r\n }\r\n\r\n agencyTitle() {\r\n return this.typeRegulatoryStatus && this.typeRegulatoryStatus.agencyTitle;\r\n }\r\n\r\n regulatoryStatement() {\r\n return this.typeRegulatoryStatus && this.typeRegulatoryStatus.regulatoryStatement;\r\n }\r\n\r\n prefixedDetermination() {\r\n return this.regulatoryStatement() ? this.regulatoryStatement() + ' ' + this.determination : this.determination;\r\n }\r\n\r\n webReferenceExt() {\r\n return this.webReference;\r\n }\r\n\r\n linkDisplayExt() {\r\n return (this.linkDisplay);\r\n }\r\n\r\n static getEvaluatingAgenciesFor(statusType: string) {\r\n statusType = statusType.toLowerCase();\r\n if (statusType == \"general\") {\r\n return [\"ATSDR\", \"CERHR\", \"CIR\", \"CITES\", \"CMR\", \"CSCA\", \"DHC\", \"EC\", \"ECB\", \"EPA\", \"HPV\", \"IARC\", \"ISO\", \"IUCLID\",\r\n \"MAK\", \"NTP\", \"OECD\", \"PROP65\", \"REXPAN\", \"SCCP\", \"SCCS\", \"SCHER\", \"SCTEE\", \"UNTCC\", \"VKM\", \"WHO\"];\r\n } else if (statusType == \"occupational\") {\r\n return [\"OSHA\", \"ACGIH\", \"ISHL\", \"UNTC\"];\r\n } else if (statusType == \"ifra\") {\r\n return [\"IFRA\", \"IFRAIL\"]\r\n } else if (statusType == \"flavor\") {\r\n return [\"COE\", \"FDA\", \"FEMA\", \"GRAS\", \"GRASA\", \"GRASQ\", \"JECFA\", \"VKM\"]\r\n } else {\r\n throw new Error(\"Unable to locate a statusType of: \" + statusType);\r\n }\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n regulatoryStatusId: number;\r\n materialId: number;\r\n evaluatingAgencyId: string;\r\n evaluatorId: string;\r\n reference: string;\r\n determination: string;\r\n webReference: string;\r\n linkDisplay: string;\r\n note: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeRegulatoryStatus: TypeRegulatoryStatus;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeRegulatoryStatus extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n evaluatingAgencyId: string;\r\n agencyTitle: string;\r\n regulatoryStatement: string;\r\n evaluatingAgencyLabel: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SafetyAssessmentMaterial extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n safetyAssessmentId: number;\r\n materialId: number;\r\n additionalMaterialId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n additionalMaterial: Material;\r\n material: Material;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeSafety } from './TypeSafety';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SafetyComment extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n safetyCommentId: number;\r\n materialId: number;\r\n typeSafetyId: string;\r\n author: string;\r\n comment: string;\r\n approved: boolean;\r\n qualifiers: string;\r\n deletedDate: Date;\r\n deletedBy: string;\r\n lMApprovedDate: Date;\r\n lMApprovedBy: string;\r\n deleteNextLM: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeSafety: TypeSafety;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeSafety extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeSafetyId: string;\r\n safetyDescription: string;\r\n sortOrder: number;\r\n safetyTitle: string;\r\n standardComment: string;\r\n notesOnUse: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeSafetyEU } from './TypeSafetyEU';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SafetyEUComment extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n safetyEUCommentId: number;\r\n materialId: number;\r\n typeSafetyEUId: string;\r\n author: string;\r\n comment: string;\r\n approved: boolean;\r\n qualifiers: string;\r\n deletedDate: Date;\r\n deletedBy: string;\r\n lMApprovedDate: Date;\r\n lMApprovedBy: string;\r\n deleteNextLM: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeSafetyEu: TypeSafetyEU;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeSafetyEU extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeSafetyEUId: string;\r\n safetyStatement: string;\r\n hazardCode: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Synonym } from './Synonym';\r\nimport { TypeSynonymUse } from './TypeSynonymUse';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SynonymNamer extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n synonymId: number;\r\n typeSynonymUseId: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n synonym: Synonym;\r\n typeSynonymUse: TypeSynonymUse;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { SynonymNamer } from './SynonymNamer';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\nimport { EntityTypeAnnotation, EntityPropertyAnnotation} from './EntityTypeAnnotation';\r\n/// \r\n\r\nexport class Synonym extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n static getEntityTypeAnnotation(): EntityTypeAnnotation {\r\n const propAnnotations = [\r\n new EntityPropertyAnnotation('synonymWord', {\r\n displayName: 'Synonym',\r\n validators: [Validator.stringLength({minLength: 3, maxLength: 400})]\r\n }),\r\n new EntityPropertyAnnotation('rootWord', {\r\n displayName: 'Alphabetic version',\r\n validators: [Validator.stringLength({minLength: 3, maxLength: 400})]\r\n })\r\n ];\r\n return new EntityTypeAnnotation( {\r\n validators: [],\r\n propertyAnnotations: propAnnotations\r\n } )\r\n }\r\n\r\n static rootWordFromSynonymWord(synonymWord: string) {\r\n // algorithm here is to uppercase the string and then\r\n // extract all non-word char 'groups' from string and move them to the end separated by '/'\r\n const r = synonymWord.toLocaleUpperCase();\r\n let root = '';\r\n let suffix = '';\r\n const rx = /([(A-z]*)([^A-Z]*)(.*)/;\r\n let matches = rx.exec(r);\r\n while ( matches ) {\r\n root = root + matches[1];\r\n if (matches[2]) {\r\n suffix = suffix + '/' + matches[2];\r\n }\r\n if (matches[3] == '') {\r\n matches = null;\r\n } else {\r\n matches = rx.exec(matches[3]);\r\n }\r\n }\r\n return root + suffix;\r\n }\r\n\r\n formatSynonymWebVersion(): string {\r\n\r\n let syn = this.synonymWord;\r\n\r\n const positions = ['alpha', 'beta', 'gamma', 'delta', 'epsilon', 'omega'];\r\n positions.forEach(p => {\r\n syn = this.escapeNoCase(syn, p);\r\n });\r\n\r\n const isoandsubs = ['cis', 'trans', 'endo', 'exo', 'sec', 'tert', 'ortho', 'meta', 'para'];\r\n isoandsubs.forEach(i => {\r\n const expr = i + \"([^a-z]|$)\";\r\n syn = this.italicizeTerm(syn, expr, i);\r\n });\r\n\r\n const abbrevs = ['n', 'm', 'o', 'p', 't', 'd', 'dl', 'l'];\r\n let lpart: string, rpart: string;\r\n\r\n abbrevs.forEach(a => {\r\n const expr = \"(^|[^a-z])\" + a + \"-\";\r\n syn = this.italicizeAbbreviations(syn, expr, a);\r\n });\r\n\r\n return syn;\r\n }\r\n\r\n escapeNoCase(value: string, findterm: string) {\r\n const expr = new RegExp(\"(\" + findterm + \")\", \"gi\"); //Case insensitive, potential for multiple occurrences\r\n return value.replace(expr, \"&\" + findterm + \";\");\r\n }\r\n\r\n italicizeTerm(value: string, findterm: string, term: string) : string {\r\n var lpart: string, rpart: string;\r\n\r\n var rx = new RegExp(\"(\" + findterm + \")\", \"i\");\r\n var matches = rx.exec(value);\r\n\r\n if (matches) {\r\n if (matches.index > 0) {\r\n lpart = value.substring(0, matches.index);\r\n rpart = value.substring(matches.index + term.length, value.length);\r\n }\r\n else {\r\n lpart = \"\";\r\n rpart = value.substring(matches.index + term.length, value.length);\r\n }\r\n\r\n value = lpart + \"\" + term + \"\" + rpart;\r\n }\r\n\r\n return value;\r\n }\r\n\r\n italicizeAbbreviations(value: string, findterm: string, term: string) : string {\r\n let lpart: string, rpart: string;\r\n\r\n const rx = new RegExp(\"(\" + findterm + \")\"); // Case sensitive\r\n const matches = rx.exec(value);\r\n\r\n if (matches) {\r\n if (matches.index > 0) {\r\n lpart = value.substring(0, matches.index + 1);\r\n rpart = value.substring(matches.index + 1 + term.length, value.length);\r\n } else {\r\n lpart = '';\r\n rpart = value.substring(matches.index + term.length, value.length);\r\n }\r\n\r\n value = lpart + '' + term + '' + rpart;\r\n }\r\n\r\n return value;\r\n }\r\n\r\n public synonymWordOrWebVersion() {\r\n return (this.webVersion) ? this.webVersion : this.synonymWord;\r\n }\r\n\r\n public get useList() {\r\n return this.synonymNamers && this.synonymNamers.map(sn => sn.typeSynonymUse.synonymUseLong).sort().join(\", \");\r\n }\r\n\r\n public get useLongNames() {\r\n return this.synonymNamers && this.synonymNamers.map(sn => sn.typeSynonymUse.synonymUseLong);\r\n }\r\n\r\n public removeSynonymNamer(typeSynonymUseId: string) {\r\n const ix = this.synonymNamers.map(sn => sn.typeSynonymUseId).indexOf(typeSynonymUseId);\r\n if (ix != -1) {\r\n this.synonymNamers[ix].entityAspect.setDeleted();\r\n }\r\n }\r\n\r\n public addSynonymNamer(typeSynonymUseId: string) {\r\n const ix = this.synonymNamers.map(sn => sn.typeSynonymUseId).indexOf(typeSynonymUseId);\r\n if (ix == -1) {\r\n const namer = new SynonymNamer();\r\n namer.synonymId = this.synonymId;\r\n namer.typeSynonymUseId = typeSynonymUseId;\r\n this.entityAspect.entityManager.addEntity(namer);\r\n }\r\n }\r\n\r\n public get materialCASNumber() {\r\n if (this.material == null) { return ''; }\r\n\r\n return (this.material.realCASNumber != '') ? this.material.realCASNumber : '(No CAS#)';\r\n }\r\n\r\n public get materialFormattedRIFMId() {\r\n return (this.material == null) ? '' : this.material.formattedRIFMId;\r\n }\r\n\r\n public get materialFEMANumber() {\r\n return (this.material == null) ? '' : this.material.fEMANumber;\r\n }\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n synonymId: number;\r\n materialId: number;\r\n rootWord: string;\r\n synonymWord: string;\r\n principal: boolean;\r\n webVersion: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n synonymNamers: SynonymNamer[];\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeSynonymUse extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeSynonymUseId: string;\r\n synonymUseLong: string;\r\n sortOrder: number;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeBotanicalSubdivision extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeBotanicalSubdivisionId: string;\r\n botanicalSource: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeEssentialOil extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeEssentialOilId: string;\r\n essentialOilTerm: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeNarrativeSummary extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeNarrativeSummaryId: string;\r\n narrativeTitle: string;\r\n narrativeLink: string;\r\n sponsor: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeNaturalOccurrence extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeNaturalOccurrenceId: number;\r\n occurrenceCode: string;\r\n occurrenceDetail: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeTSCAClass extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeTSCAClassId: number;\r\n genericClass: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeFoodCategory } from './TypeFoodCategory';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialUses extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialUseId: number;\r\n materialId: number;\r\n typeFoodCategoryId: number;\r\n averageUsual: number;\r\n averageMaximum: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeFoodCategory: TypeFoodCategory;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeFoodCategory extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeFoodCategoryId: number;\r\n foodDescription: string;\r\n meanDailyConsumption: number;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeAnalyticalProcedure extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeAnalyticalProcedureId: string;\r\n analyticalProcedure: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeLinkTarget } from './TypeLinkTarget';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class AnnouncementDetail extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n announcementDetailId: number;\r\n detailDescription: string;\r\n detailLink: string;\r\n announcementId: number;\r\n enabled: boolean;\r\n linkTargetType: string;\r\n tabOrdinal: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n typeLinkTarget: TypeLinkTarget;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeLinkTarget extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n linkTargetType: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { AnnouncementDetail } from './AnnouncementDetail';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class Announcement extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n announcementId: number;\r\n title: string;\r\n content: string;\r\n imageLink: string;\r\n webLink: string;\r\n webLinkDescription: string;\r\n enabled: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n announcementDetails: AnnouncementDetail[];\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ApplicationConfigurationSetting extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n applicationConfigurationSettingId: number;\r\n applicationName: string;\r\n configName: string;\r\n configValue: string;\r\n enabled: number;\r\n configType: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ClusterGroup extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n clusterGroupId: number;\r\n clusterGroupName: string;\r\n notes: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ClusterNodeAndEdge extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n id: number;\r\n clusterGroupId: number;\r\n clusterPathId: number;\r\n precedence: number;\r\n clusterPartNode: string;\r\n clusterPartLabel: string;\r\n parentNode: string;\r\n colorCode: string;\r\n shapeType: string;\r\n isMaterial: boolean;\r\n clusterRelevance: number;\r\n confidential: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { ClusterPath } from './ClusterPath';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ClusterPart extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n clusterPartId: number;\r\n clusterPartName: string;\r\n clusterPartLabel: string;\r\n clusterPathId: number;\r\n description: string;\r\n precedence: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n clusterPath: ClusterPath;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { ClusterGroup } from './ClusterGroup';\r\nimport { ClusterPart } from './ClusterPart';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ClusterPath extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n clusterPathId: number;\r\n clusterPathName: string;\r\n clusterGroupId: number;\r\n notes: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n clusterGroup: ClusterGroup;\r\n clusterParts: ClusterPart[];\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ClusterPartWithParent extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n id: number;\r\n clusterGroupId: number;\r\n clusterPathId: number;\r\n clusterPathName: string;\r\n clusterPartLabel: string;\r\n clusterPartName: string;\r\n clusterPartNode: string;\r\n precedence: number;\r\n parentNode: string;\r\n superClusterId: number;\r\n colorCode: string;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ExposureAdditionalMaterial extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n exposureAdditionalMaterialId: number;\r\n cASNumber: string;\r\n materialName: string;\r\n memberCompany: string;\r\n purpose: string;\r\n notes: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { ExposureAdditionalMaterial } from './ExposureAdditionalMaterial';\r\nimport { ExposureSurvey } from './ExposureSurvey';\r\nimport { TypeCremeVersion } from './TypeCremeVersion';\r\nimport { TypeExposureMeasure } from './TypeExposureMeasure';\r\nimport { TypeExposureMeasureValue } from './TypeExposureMeasureValue';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ExposureAdditionalMaterialSurveyMeasure extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n exposureAdditionalMaterialSurveyMeasureId: number;\r\n exposureAdditionalMaterialId: number;\r\n exposureSurveyId: number;\r\n typeExposureMeasureId: number;\r\n typeExposureMeasureValueId: number;\r\n measureQualitativeResult: string;\r\n measureQuantitativeResult: number;\r\n measureNotes: string;\r\n originalSurveyId: number;\r\n typeCremeVersionId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n exposureAdditionalMaterial: ExposureAdditionalMaterial;\r\n exposureSurvey: ExposureSurvey;\r\n typeCremeVersion: TypeCremeVersion;\r\n typeExposureMeasure: TypeExposureMeasure;\r\n typeExposureMeasureValue: TypeExposureMeasureValue;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { ExposureAdditionalMaterialSurveyMeasure } from './ExposureAdditionalMaterialSurveyMeasure';\r\nimport { MaterialExposureSurveyMeasure } from './MaterialExposureSurveyMeasure';\r\nimport { TypeCremeVersion } from './TypeCremeVersion';\r\nimport { MaterialExposureSurvey } from './MaterialExposureSurvey';\r\nimport { TypeExposureSurveyStatus } from './TypeExposureSurveyStatus';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\nvar _monthFullNames = [\r\n \"January\", \"February\", \"March\",\r\n \"April\", \"May\", \"June\", \"July\",\r\n \"August\", \"September\", \"October\",\r\n \"November\", \"December\"\r\n];\r\n/// \r\n\r\nexport class ExposureSurvey extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public get exposureSurveyMonthYear() {\r\n\r\n if (this.exposureSurveyDate == null) {\r\n return '';\r\n }\r\n var month = _monthFullNames[this.exposureSurveyDate.getUTCMonth()];\r\n var year = this.exposureSurveyDate.getUTCFullYear().toString();\r\n\r\n return month + ', ' + year;\r\n }\r\n\r\n public get exposureSurveyMonthYearNumber() {\r\n\r\n if (this.exposureSurveyDate == null) {\r\n return '';\r\n }\r\n \r\n return this.exposureSurveyMonthYear + ': ' + this.exposureSurveyNumber;\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n exposureSurveyId: number;\r\n exposureSurveyDate: Date;\r\n exposureSurveyNumber: number;\r\n description: string;\r\n typeExposureSurveyStatusId: string;\r\n typeCremeVersionId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n exposureAdditionalMaterialSurveyMeasures: ExposureAdditionalMaterialSurveyMeasure[];\r\n materialExposureSurveyMeasures: MaterialExposureSurveyMeasure[];\r\n materialExposureSurveys: MaterialExposureSurvey[];\r\n typeCremeVersion: TypeCremeVersion;\r\n typeExposureSurveyStatus: TypeExposureSurveyStatus;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { ExposureSurvey } from './ExposureSurvey';\r\nimport { TypeCremeVersion } from './TypeCremeVersion';\r\nimport { TypeExposureMeasure } from './TypeExposureMeasure';\r\nimport { TypeExposureMeasureValue } from './TypeExposureMeasureValue';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialExposureSurveyMeasure extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public hasQualitativeValue(): boolean {\r\n return (this.typeExposureMeasureValue.measureValueType == 'Qualitative');\r\n }\r\n\r\n public hasQuantitativeValue(): boolean {\r\n return (this.typeExposureMeasureValue.measureValueType == 'Quantitative' || this.typeExposureMeasureValue.measureValueType == 'Percentage');\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialExposureSurveyMeasureId: number;\r\n materialId: number;\r\n exposureSurveyId: number;\r\n typeExposureMeasureId: number;\r\n typeExposureMeasureValueId: number;\r\n measureQualitativeResult: string;\r\n measureQuantitativeResult: number;\r\n measureNotes: string;\r\n originalSurveyId: number;\r\n typeCremeVersionId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n exposureSurvey: ExposureSurvey;\r\n material: Material;\r\n typeCremeVersion: TypeCremeVersion;\r\n typeExposureMeasure: TypeExposureMeasure;\r\n typeExposureMeasureValue: TypeExposureMeasureValue;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeCremeVersion extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeCremeVersionId: number;\r\n cremeVersion: string;\r\n description: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeExposureMeasureValue } from './TypeExposureMeasureValue';\r\nimport { TypeHouseholdProduct } from './TypeHouseholdProduct';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeExposureMeasure extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeExposureMeasureId: number;\r\n measureName: string;\r\n measureDescription: string;\r\n typeHouseholdProductId: number;\r\n typeExposureMeasureValueId: number;\r\n sortOrder: number;\r\n displayCategory: string;\r\n rowVersion: number;\r\n typeExposureMeasureValue: TypeExposureMeasureValue;\r\n typeHouseholdProduct: TypeHouseholdProduct;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeExposureMeasureValue extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeExposureMeasureValueId: number;\r\n measureValueType: string;\r\n description: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeHouseholdProduct extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeHouseholdProductId: number;\r\n householdProduct: string;\r\n description: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { ExposureSurvey } from './ExposureSurvey';\r\nimport { TypeExposureSurveyResponse } from './TypeExposureSurveyResponse';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialExposureSurvey extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n isomers: string;\r\n\r\n public get bannedMaterialCaption(): string {\r\n return (this.bannedMaterial) ? 'Banned' : '';\r\n }\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialExposureSurveyId: number;\r\n exposureSurveyId: number;\r\n materialId: number;\r\n notes: string;\r\n expectedSACompletion: string;\r\n bannedMaterial: boolean;\r\n typeExposureSurveyResponseId: number;\r\n originalSurveyId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n exposureSurvey: ExposureSurvey;\r\n material: Material;\r\n typeExposureSurveyResponse: TypeExposureSurveyResponse;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeExposureSurveyResponse extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeExposureSurveyResponseId: number;\r\n responseType: string;\r\n description: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeExposureSurveyStatus extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeExposureSurveyStatusId: string;\r\n description: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { ExposureAdditionalMaterial } from './ExposureAdditionalMaterial';\r\nimport { ExposureSurvey } from './ExposureSurvey';\r\nimport { TypeExposureSurveyResponse } from './TypeExposureSurveyResponse';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ExposureAdditionalMaterialSurvey extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public get bannedMaterialCaption(): string {\r\n return (this.bannedMaterial) ? 'Banned' : '';\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n exposureAdditionalMaterialSurveyId: number;\r\n exposureSurveyId: number;\r\n exposureAdditionalMaterialId: number;\r\n notes: string;\r\n bannedMaterial: boolean;\r\n typeExposureSurveyResponseId: number;\r\n originalSurveyId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n exposureAdditionalMaterial: ExposureAdditionalMaterial;\r\n exposureSurvey: ExposureSurvey;\r\n typeExposureSurveyResponse: TypeExposureSurveyResponse;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ExposureSurveyMaterialMeasureCount extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n exposureSurveyId: number;\r\n exposureSurveyDate: Date;\r\n exposureSurveyNumber: number;\r\n exposureSurveyMeasureCount: number;\r\n exposureSurveyRowNumber: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ExposureSurveyMaterialMostRecent extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n realCASNumber: string;\r\n rIFMId: string;\r\n synonymWord: string;\r\n exposureSurveyId: number;\r\n exposureSurveyDate: Date;\r\n exposureSurveyNumber: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class LabelingManualPublication extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n labelingManualPublicationId: number;\r\n attachmentName: string;\r\n fileName: string;\r\n description: string;\r\n publicationYear: string;\r\n active: boolean;\r\n displayOrder: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { ClusterPath } from './ClusterPath';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialCluster extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialId: number;\r\n clusterPathId: number;\r\n molecularFormula: string;\r\n clusterRelevance: number;\r\n notes: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n clusterPath: ClusterPath;\r\n material: Material;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeMaterialComponentClass } from './TypeMaterialComponentClass';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialComponent extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public isMaterial(): boolean {\r\n return (this.materialId != null);\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialComponentId: number;\r\n materialId: number;\r\n cASNumber: string;\r\n componentName: string;\r\n componentNameFromLiterature: string;\r\n typeMaterialComponentClassId: number;\r\n dB1: string;\r\n dB5: string;\r\n wax20M: string;\r\n cECode: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeMaterialComponentClass: TypeMaterialComponentClass;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeMaterialComponentClass extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeMaterialComponentClassId: number;\r\n class: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { MaterialComponent } from './MaterialComponent';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialComposition extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialCompositionId: number;\r\n materialId: number;\r\n materialComponentId: number;\r\n componentAmount: number;\r\n componentValue: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n materialComponent: MaterialComponent;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { MaterialExposureSurvey } from './MaterialExposureSurvey';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialExposureSurveyIsomer extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialExposureSurveyIsomerId: number;\r\n materialId: number;\r\n materialExposureSurveyId: number;\r\n notes: string;\r\n originalSurveyId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n materialExposureSurvey: MaterialExposureSurvey;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeRoute } from './TypeRoute';\r\nimport { TypeSpecies } from './TypeSpecies';\r\nimport { TypeStudy } from './TypeStudy';\r\nimport { TypeNTPStatus } from './TypeNTPStatus';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class NationalToxicologyProgram extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialNTPId: number;\r\n materialId: number;\r\n sponsor: string;\r\n contractor: string;\r\n typeStudyId: string;\r\n typeRouteId: string;\r\n typeSpeciesId: string;\r\n typeNTPStatusId: string;\r\n comments: string;\r\n protocol: string;\r\n results: string;\r\n reference: string;\r\n lastReviewDate: Date;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeNTPStatus: TypeNTPStatus;\r\n typeRoute: TypeRoute;\r\n typeSpecies: TypeSpecies;\r\n typeStudy: TypeStudy;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeNTPStatus extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeNTPStatusId: string;\r\n description: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { RIFMProduct } from './RIFMProduct';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class RIFMProductLicense extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n productLicenseId: number;\r\n productId: number;\r\n userId: string;\r\n licenseAcceptDate: Date;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n rIFMProduct: RIFMProduct;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeLinkTarget } from './TypeLinkTarget';\r\nimport { RIFMProductLicense } from './RIFMProductLicense';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class RIFMProduct extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n productId: number;\r\n productName: string;\r\n productDescription: string;\r\n productVersion: string;\r\n productLink: string;\r\n linkTargetType: string;\r\n enabled: boolean;\r\n contentType: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n rIFMProductLicenses: RIFMProductLicense[];\r\n typeLinkTarget: TypeLinkTarget;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class RIFMReport extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n rIFMReportId: number;\r\n reportTopic: string;\r\n applicationComponent: string;\r\n reportFileName: string;\r\n reportTitle: string;\r\n reportDescription: string;\r\n reportWebLink: string;\r\n enabled: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class StaffWorkflowReport extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n id: number;\r\n workflowContactId: number;\r\n typeworkflowActionId: string;\r\n firstName: string;\r\n created: Date;\r\n bothArticleType: boolean;\r\n rIFMArticleType: boolean;\r\n fEMAArticleType: boolean;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { ClusterPath } from './ClusterPath';\r\nimport { SuperCluster } from './SuperCluster';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SuperClusterPath extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n superClusterPathId: number;\r\n superClusterId: number;\r\n clusterPathId: number;\r\n notes: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n clusterPath: ClusterPath;\r\n superCluster: SuperCluster;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { ClusterGroup } from './ClusterGroup';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SuperCluster extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n superClusterId: number;\r\n superClusterName: string;\r\n clusterGroupId: number;\r\n notes: string;\r\n colorCode: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n clusterGroup: ClusterGroup;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Survey } from './Survey';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SurveyAndCompany extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n surveyAndCompanyId: number;\r\n surveyId: number;\r\n companyName: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n survey: Survey;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { ReportingOrganization } from './ReportingOrganization';\r\nimport { Survey } from './Survey';\r\nimport { SurveyAndCompany } from './SurveyAndCompany';\r\n\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SurveyReportedUse extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n surveyReportedUseId: number;\r\n surveyAndCompanyId: number;\r\n materialId: number;\r\n reportedCASNumber: string;\r\n submitter: string;\r\n kilogramsConsumed: number;\r\n unmapped: boolean;\r\n unmappedReason: string;\r\n mappingNotes: string;\r\n notes: string;\r\n surveyId: number;\r\n reportingOrganizationId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n reportingOrganization: ReportingOrganization;\r\n survey: Survey;\r\n surveyAndCompany: SurveyAndCompany;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Synonym } from './Synonym';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SynonymWebVersion extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n synonymId: number;\r\n version: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n synonym: Synonym;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeAlertConcLevelScore extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n score: number;\r\n minVal: number;\r\n maxVal: number;\r\n defaultRow: boolean;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeAlertVolumeScore extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n score: number;\r\n minVal: number;\r\n maxVal: number;\r\n defaultRow: boolean;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeChangeReportFrequency extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeChangeReportFrequencyId: string;\r\n frequencyInterval: number;\r\n enabled: boolean;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeChangeReportTopic extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeChangeReportTopicId: string;\r\n changeReportTopicDesc: string;\r\n topicDisplayOrder: number;\r\n enabled: boolean;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeComplianceGuideline extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeComplianceGuidelineId: number;\r\n studies: string;\r\n guideline: string;\r\n explanation: string;\r\n fullDetails: string;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeSearch extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n radioOptionId: string;\r\n radioOptionText: string;\r\n staffOnlyOption: boolean;\r\n defaultOption: boolean;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeSpecies } from './TypeSpecies';\r\nimport { TypeStudy } from './TypeStudy';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeStudyDesignation extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeStudyDesignationId: number;\r\n typeStudyId: string;\r\n typeSpeciesId: string;\r\n designation: string;\r\n typeSpecies: TypeSpecies;\r\n typeStudy: TypeStudy;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeWorkflowActionTransition extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeWorkflowActionTransitionId: number;\r\n typeWorkflowActionId: string;\r\n entityName: string;\r\n propertyName: string;\r\n entityState: string;\r\n completedWorkflowActionId: string;\r\n markComplete: boolean;\r\n doNotComplete: boolean;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class UserAcknowledgement extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n userAcknowledgementId: number;\r\n userEmail: string;\r\n userAcknowledgementDate: Date;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Author } from './Author';\r\nimport { UserChangeReport } from './UserChangeReport';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class UserChangeReportAuthor extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n userChangeReportAuthorId: number;\r\n userChangeReportId: number;\r\n authorId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n author: Author;\r\n userChangeReport: UserChangeReport;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeChangeReportFrequency } from './TypeChangeReportFrequency';\r\nimport { UserChangeReportAuthor } from './UserChangeReportAuthor';\r\nimport { UserChangeReportMaterial } from './UserChangeReportMaterial';\r\nimport { UserChangeReportStudy } from './UserChangeReportStudy';\r\nimport { UserChangeReportTopic } from './UserChangeReportTopic';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class UserChangeReport extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n userChangeReportId: number;\r\n userId: string;\r\n typeChangeReportFrequencyId: string;\r\n allFlavors: boolean;\r\n allFragrances: boolean;\r\n allNaturals: boolean;\r\n referenceAuthors: boolean;\r\n staffReport: boolean;\r\n lastReportDate: Date;\r\n enabled: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n typeChangeReportFrequency: TypeChangeReportFrequency;\r\n userChangeReportAuthors: UserChangeReportAuthor[];\r\n userChangeReportMaterials: UserChangeReportMaterial[];\r\n userChangeReportStudies: UserChangeReportStudy[];\r\n userChangeReportTopics: UserChangeReportTopic[];\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { UserChangeReport } from './UserChangeReport';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class UserChangeReportMaterial extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n userChangeReportMaterialId: number;\r\n userChangeReportId: number;\r\n materialId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n userChangeReport: UserChangeReport;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeStudy } from './TypeStudy';\r\nimport { UserChangeReport } from './UserChangeReport';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class UserChangeReportStudy extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n userChangeReportStudyId: number;\r\n userChangeReportId: number;\r\n typeStudyId: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n typeStudy: TypeStudy;\r\n userChangeReport: UserChangeReport;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeChangeReportTopic } from './TypeChangeReportTopic';\r\nimport { UserChangeReport } from './UserChangeReport';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class UserChangeReportTopic extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n userChangeReportTopicId: number;\r\n userChangeReportId: number;\r\n typeChangeReportTopicId: string;\r\n enabled: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n typeChangeReportTopic: TypeChangeReportTopic;\r\n userChangeReport: UserChangeReport;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class UserSessionToken extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n userSessionTokenId: number;\r\n userEmail: string;\r\n userLoginToken: string;\r\n active: boolean;\r\n rIFMStaff: boolean;\r\n databaseSubscriber: boolean;\r\n fEMAMember: boolean;\r\n rIFMMember: boolean;\r\n organizationName: string;\r\n authorizedDownloadUser: boolean;\r\n fEMAStaff: boolean;\r\n rIFMConsultant: boolean;\r\n rIFMDBAdmin: boolean;\r\n iFRAStaff: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SurveyUsesByMaterialAndYear extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n id: number;\r\n surveyYear: string;\r\n materialId: number;\r\n realCASNumber: string;\r\n displayCAS: string;\r\n rIFMId: string;\r\n china: number;\r\n asiaPacific: number;\r\n eEC: number;\r\n europe: number;\r\n japan: number;\r\n northAmerica: number;\r\n other: number;\r\n southAmerica: number;\r\n uSA: number;\r\n world: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SurveyUsesByCompanyAndMaterialAndYear extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n id: number;\r\n surveyYear: string;\r\n organizationName: string;\r\n materialId: number;\r\n realCASNumber: string;\r\n displayCAS: string;\r\n rIFMId: string;\r\n china: number;\r\n asiaPacific: number;\r\n eEC: number;\r\n europe: number;\r\n japan: number;\r\n northAmerica: number;\r\n other: number;\r\n southAmerica: number;\r\n uSA: number;\r\n world: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class SurveyWhoUsedMostMaterial extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n id: number;\r\n surveyYear: string;\r\n displayCAS: string;\r\n materialId: number;\r\n organizationName: string;\r\n materialUseKgs: number;\r\n useOrder: number;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class WorkflowPendingAction extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public abbreviatedTitle() {\r\n if (this.title != null && this.title.length > 51) {\r\n return (this.title.substring(0, 50) + '...');\r\n }\r\n\r\n return this.title;\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n workflowRecordedActionId: number;\r\n typeWorkflowActionId: string;\r\n completedWorkflowActionId: string;\r\n toCompleteDescription: string;\r\n actionCompletedDate: Date;\r\n completedUser: string;\r\n sentToContactId: number;\r\n workflowContactFirstName: string;\r\n workflowContactEmailAddress: string;\r\n createdWorkflowContactId: number;\r\n createdContactFirstName: string;\r\n createdContactEmailAddress: string;\r\n referenceId: number;\r\n briefReference: string;\r\n title: string;\r\n precedence: number;\r\n rIFMArticle: boolean;\r\n fEMAArticle: boolean;\r\n articleType: string;\r\n rIFMAsAuthor: boolean;\r\n restrictedDistribution: boolean;\r\n created: Date;\r\n createdUser: string;\r\n holdReason: string;\r\n onHoldStatus: string;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class WorkflowReferenceAssignment extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n \r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n referenceId: number;\r\n briefReference: string;\r\n title: string;\r\n precedence: number;\r\n articleType: string;\r\n rIFMAsAuthor: boolean;\r\n restrictedDistribution: boolean;\r\n assignedContactId: number;\r\n assignedContactFirstName: string;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeLinkTarget } from './TypeLinkTarget';\r\nimport { RIFMDocumentFolder } from './RIFMDocumentFolder';\r\nimport { TypeRIFMDocument } from './TypeRIFMDocument';\r\nimport { Reference } from './Reference';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class RIFMDocument extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public get assignedReference() {\r\n if (this.reference == null) { return ''; }\r\n return this.reference.referenceId + ', ' + this.reference.briefReference;\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n rIFMDocumentId: number;\r\n typeRIFMDocumentId: string;\r\n rIFMDocumentFolderId: number;\r\n referenceId: number;\r\n fileName: string;\r\n notes: string;\r\n changeHistory: string;\r\n enabled: boolean;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n rIFMDocumentFolder: RIFMDocumentFolder;\r\n typeRIFMDocument: TypeRIFMDocument;\r\n reference: Reference;\r\n}\r\n","import { EntityBase } from './EntityBase';\r\nimport { TypeLinkTarget } from './TypeLinkTarget';\r\nimport { RIFMDocumentFolder } from './RIFMDocumentFolder';\r\nimport { TypeRIFMDocument } from './TypeRIFMDocument';\r\nimport { Reference } from './Reference';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class RIFMDocumentArchive extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n rIFMDocumentArchiveId: number;\r\n typeRIFMDocumentId: string;\r\n rIFMDocumentFolderId: number;\r\n referenceId: number;\r\n fileName: string;\r\n originalFileName: string;\r\n notes: string;\r\n changeHistory: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n rIFMDocumentFolder: RIFMDocumentFolder;\r\n typeRIFMDocument: TypeRIFMDocument;\r\n reference: Reference;\r\n}\r\n","import { EntityBase } from './EntityBase';\r\nimport { RIFMDocument } from './RIFMDocument';\r\nimport { TypeLinkTarget } from './TypeLinkTarget';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class RIFMDocumentFolder extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n rIFMDocumentFolderId: number;\r\n folderName: string;\r\n archiveFolder: boolean;\r\n notes: string;\r\n startReferenceId: number;\r\n endReferenceId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n rIFMDocuments: RIFMDocument[];\r\n}\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class TypeRIFMDocument extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n typeRIFMDocumentId: string;\r\n name: string;\r\n rowVersion: number;\r\n}\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { TypeCremeVersion } from './TypeCremeVersion';\r\nimport { TypeExposureMeasure } from './TypeExposureMeasure';\r\nimport { TypeExposureMeasureValue } from './TypeExposureMeasureValue';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n/// \r\n\r\nexport class MaterialExposureCustomSurveyMeasure extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n public hasQualitativeValue(): boolean {\r\n return (this.typeExposureMeasureValue.measureValueType == 'Qualitative');\r\n }\r\n\r\n public hasQuantitativeValue(): boolean {\r\n return (this.typeExposureMeasureValue.measureValueType == 'Quantitative' || this.typeExposureMeasureValue.measureValueType == 'Percentage');\r\n }\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialExposureCustomSurveyMeasureId: number;\r\n materialId: number;\r\n customSurveyDate: Date;\r\n typeExposureMeasureId: number;\r\n typeExposureMeasureValueId: number;\r\n measureQualitativeResult: string;\r\n measureQuantitativeResult: number;\r\n measureNotes: string;\r\n typeCremeVersionId: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n typeCremeVersion: TypeCremeVersion;\r\n typeExposureMeasure: TypeExposureMeasure;\r\n typeExposureMeasureValue: TypeExposureMeasureValue;\r\n}\r\n","import { EntityBase } from './EntityBase';\r\nimport { Material } from './Material';\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class MaterialMonograph extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n materialMonographId: number;\r\n materialId: number;\r\n fileName: string;\r\n fileLabel: string;\r\n notes: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n material: Material;\r\n}\r\n","import { EntityBase } from './EntityBase';\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class RIFMDownloadableFile extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n rifmDownloadableFileId: number;\r\n fileCategory: string;\r\n fileIdentifier: string;\r\n fileSubFolder: string;\r\n fileName: string;\r\n fileLabel: string;\r\n fileDescription: string;\r\n notes: string;\r\n enabled: boolean;\r\n sortOrder: number;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n","import { Injectable} from '@angular/core';\r\n\r\nexport class ErrorEntry {\r\n constructor(public error: any, public errorLevel: string) {\r\n \r\n }\r\n \r\n formatError() {\r\n this.error.message || this.error.toString(); \r\n }\r\n}\r\n\r\n@Injectable()\r\nexport class ErrorLogger {\r\n constructor( ) {\r\n \r\n }\r\n \r\n _errors: ErrorEntry[] = [];\r\n \r\n log(e: string | any, errorLevel?: string ) {\r\n console.log(e);\r\n var ee = new ErrorEntry(e, errorLevel);\r\n this._errors.push(ee); \r\n }\r\n \r\n getErrors() {\r\n return this._errors;\r\n }\r\n} ","export const environment = {\r\n production: true,\r\n assetsUrl: 'https://rifmdatabase.rifm.org/rifmweb/',\r\n appUrl: 'https://rifmdatabase.rifm.org/rifmweb',\r\n apiUrl: 'https://rifmdatabase.rifm.org/rifmweb/api'\r\n};\r\n","import { Injectable } from '@angular/core';\r\nimport { environment } from '../../environments/environment';\r\n\r\n@Injectable()\r\nexport class Configuration {\r\n public serviceBase = `${environment.appUrl}/breeze`;\r\n public bringMetadataFromServer = true;\r\n\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\nimport { config, EntityManager, EntityQuery, EntityType, MetadataStore, NamingConvention } from 'breeze-client';\r\n// import 'breeze-client/adapters/adapter-data-service-webapi.umd';\r\n// import 'breeze-client/adapters/adapter-model-library-backing-store.umd';\r\n// import 'breeze-client/adapters/adapter-uri-builder-odata.umd';\r\n\r\nimport { ErrorLogger } from './error-logger';\r\nimport { Configuration } from './configuration';\r\nimport { _RegistrationHelper } from '../entities/_RegistrationHelper';\r\nimport { EntityTypeAnnotation } from '../entities/EntityTypeAnnotation';\r\n\r\n@Injectable()\r\nexport class EntityManagerProvider {\r\n\r\n _masterManager: EntityManager;\r\n _uowManager: EntityManager;\r\n _preparePromise: Promise;\r\n\r\n constructor(public errorLogger: ErrorLogger, private configuration: Configuration) {\r\n \r\n }\r\n\r\n // Fetches metadata and lookups - neither of which requires authorization.\r\n prepare(): Promise {\r\n if (!this._preparePromise) {\r\n NamingConvention.camelCase.setAsDefault();\r\n config.initializeAdapterInstance('dataService', 'webApi');\r\n config.initializeAdapterInstance('uriBuilder', 'odata');\r\n\r\n \r\n this._masterManager = new EntityManager(this.configuration.serviceBase);\r\n this._preparePromise = >this._masterManager.fetchMetadata()\r\n .then(() => {\r\n _RegistrationHelper.register(this._masterManager.metadataStore);\r\n this.registerAnnotations(this._masterManager.metadataStore);\r\n\r\n return this._masterManager.executeQuery(EntityQuery.from('lookups'))\r\n .catch(e => {\r\n this.errorLogger.log(e);\r\n throw e;\r\n });\r\n })\r\n .catch(err => {\r\n console.log(err);\r\n });\r\n }\r\n return this._preparePromise;\r\n }\r\n\r\n\r\n manager(): EntityManager {\r\n return this._uowManager || this.newManager();\r\n }\r\n\r\n newManager(): EntityManager {\r\n this._uowManager = this._masterManager.createEmptyCopy();\r\n this._uowManager.importEntities(this._masterManager.exportEntities(null, false));\r\n this._uowManager.hasChangesChanged.subscribe((...args: any[]) => {\r\n\r\n });\r\n return this._uowManager;\r\n }\r\n\r\n registerAnnotations(metadataStore: MetadataStore) {\r\n metadataStore.getEntityTypes()\r\n .forEach(t => {\r\n const et = t;\r\n const ctor = et.getCtor();\r\n if (ctor && ctor.getEntityTypeAnnotation) {\r\n const etAnnotation = ctor.getEntityTypeAnnotation();\r\n et.validators.push(...etAnnotation.validators);\r\n etAnnotation.propertyAnnotations.forEach((pa) => {\r\n const prop = et.getProperty(pa.propertyName);\r\n prop.validators.push(...pa.validators);\r\n // TODO: need to add EntityProperty.displayName to d.ts\r\n prop.displayName = pa.displayName;\r\n });\r\n }\r\n });\r\n }\r\n}\r\n\r\n","import { AnalyticalResult } from './AnalyticalResult';\r\nimport { Material } from './Material';\r\nimport { DermalExposure } from './DermalExposure';\r\nimport { ECOSARToxicEffect } from './ECOSARToxicEffect';\r\nimport { EPIData } from './EPIData';\r\nimport { EPISuite } from './EPISuite';\r\nimport { TypeEPISuiteParameter } from './TypeEPISuiteParameter';\r\nimport { TypeEPISuiteCategory } from './TypeEPISuiteCategory';\r\nimport { ExperimentalMaterial } from './ExperimentalMaterial';\r\nimport { BiologicalData } from './BiologicalData';\r\nimport { BioDataStudySubType } from './BioDataStudySubType';\r\nimport { TypeStudySubType } from './TypeStudySubType';\r\nimport { Reference } from './Reference';\r\nimport { Abstract } from './Abstract';\r\nimport { Journal } from './Journal';\r\nimport { Project } from './Project';\r\nimport { ReferenceAuthor } from './ReferenceAuthor';\r\nimport { Author } from './Author';\r\nimport { ReferenceRelation } from './ReferenceRelation';\r\nimport { TypeReferenceRelation } from './TypeReferenceRelation';\r\nimport { SpecialLink } from './SpecialLink';\r\nimport { TypeKeyword } from './TypeKeyword';\r\nimport { TypeKlimisch } from './TypeKlimisch';\r\nimport { TypePublication } from './TypePublication';\r\nimport { TypeSearchService } from './TypeSearchService';\r\nimport { WorkflowRecordedAction } from './WorkflowRecordedAction';\r\nimport { TypeWorkflowAction } from './TypeWorkflowAction';\r\nimport { TypeWorkflowContact } from './TypeWorkflowContact';\r\nimport { TypeRoute } from './TypeRoute';\r\nimport { TypeSpecies } from './TypeSpecies';\r\nimport { TypeStudy } from './TypeStudy';\r\nimport { TypeTitle } from './TypeTitle';\r\nimport { TypeTimeUnit } from './TypeTimeUnit';\r\nimport { TypeUsefulness } from './TypeUsefulness';\r\nimport { ExperimentalResult } from './ExperimentalResult';\r\nimport { ExperimentalToxicEffect } from './ExperimentalToxicEffect';\r\nimport { TypeToxicEffect } from './TypeToxicEffect';\r\nimport { TypeExperimentVehicle } from './TypeExperimentVehicle';\r\nimport { TypeUnit } from './TypeUnit';\r\nimport { TypeStudyMixture } from './TypeStudyMixture';\r\nimport { FoodStatus } from './FoodStatus';\r\nimport { JECFAMonograph } from './JECFAMonograph';\r\nimport { TypeFoodStatus } from './TypeFoodStatus';\r\nimport { HouseStatus } from './HouseStatus';\r\nimport { MaterialAdditionalIdentifier } from './MaterialAdditionalIdentifier';\r\nimport { TypeMaterialIdentifier } from './TypeMaterialIdentifier';\r\nimport { MaterialAlertRule } from './MaterialAlertRule';\r\nimport { TypeAlertRule } from './TypeAlertRule';\r\nimport { MaterialAssessmentCategory } from './MaterialAssessmentCategory';\r\nimport { AssessmentCategory } from './AssessmentCategory';\r\nimport { MaterialConsumption } from './MaterialConsumption';\r\nimport { Survey } from './Survey';\r\nimport { TypeGeographicalArea } from './TypeGeographicalArea';\r\nimport { TypeSponsor } from './TypeSponsor';\r\nimport { MaterialExpertPanelSummary } from './MaterialExpertPanelSummary';\r\nimport { ExpertPanelSummary } from './ExpertPanelSummary';\r\nimport { MaterialFSAG } from './MaterialFSAG';\r\nimport { FSAG } from './FSAG';\r\nimport { MaterialHazardCode } from './MaterialHazardCode';\r\nimport { TypeHazardCode } from './TypeHazardCode';\r\nimport { MaterialPrecautionCode } from './MaterialPrecautionCode';\r\nimport { TypePrecautionStatement } from './TypePrecautionStatement';\r\nimport { MaterialRelation } from './MaterialRelation';\r\nimport { TypeMaterialRelation } from './TypeMaterialRelation';\r\nimport { MaterialTransparencyList } from './MaterialTransparencyList';\r\nimport { MaterialUNTransport } from './MaterialUNTransport';\r\nimport { MaterialUNTransportCode } from './MaterialUNTransportCode';\r\nimport { TypeHazardousSymbol } from './TypeHazardousSymbol';\r\nimport { NaturalOccurrenceDescriptor } from './NaturalOccurrenceDescriptor';\r\nimport { Prediction } from './Prediction';\r\nimport { TypePrediction } from './TypePrediction';\r\nimport { TypePredictionClass } from './TypePredictionClass';\r\nimport { REACHRegistration } from './REACHRegistration';\r\nimport { TypeREACHTonnageBand } from './TypeREACHTonnageBand';\r\nimport { RegulatoryStatus } from './RegulatoryStatus';\r\nimport { TypeRegulatoryStatus } from './TypeRegulatoryStatus';\r\nimport { SafetyAssessmentMaterial } from './SafetyAssessmentMaterial';\r\nimport { SafetyComment } from './SafetyComment';\r\nimport { TypeSafety } from './TypeSafety';\r\nimport { SafetyEUComment } from './SafetyEUComment';\r\nimport { TypeSafetyEU } from './TypeSafetyEU';\r\nimport { Synonym } from './Synonym';\r\nimport { SynonymNamer } from './SynonymNamer';\r\nimport { TypeSynonymUse } from './TypeSynonymUse';\r\nimport { TypeBotanicalSubdivision } from './TypeBotanicalSubdivision';\r\nimport { TypeEssentialOil } from './TypeEssentialOil';\r\nimport { TypeNarrativeSummary } from './TypeNarrativeSummary';\r\nimport { TypeNaturalOccurrence } from './TypeNaturalOccurrence';\r\nimport { TypeTSCAClass } from './TypeTSCAClass';\r\nimport { MaterialUses } from './MaterialUses';\r\nimport { TypeFoodCategory } from './TypeFoodCategory';\r\nimport { TypeAnalyticalProcedure } from './TypeAnalyticalProcedure';\r\nimport { AnnouncementDetail } from './AnnouncementDetail';\r\nimport { TypeLinkTarget } from './TypeLinkTarget';\r\nimport { Announcement } from './Announcement';\r\nimport { ApplicationConfigurationSetting } from './ApplicationConfigurationSetting';\r\nimport { ClusterGroup } from './ClusterGroup';\r\nimport { ClusterNodeAndEdge } from './ClusterNodeAndEdge';\r\nimport { ClusterPart } from './ClusterPart';\r\nimport { ClusterPath } from './ClusterPath';\r\nimport { ClusterPartWithParent } from './ClusterPartWithParent';\r\nimport { DocUniqReference } from './DocUniqReference';\r\nimport { ExposureAdditionalMaterial } from './ExposureAdditionalMaterial';\r\nimport { ExposureAdditionalMaterialSurveyMeasure } from './ExposureAdditionalMaterialSurveyMeasure';\r\nimport { ExposureSurvey } from './ExposureSurvey';\r\nimport { MaterialExposureSurveyMeasure } from './MaterialExposureSurveyMeasure';\r\nimport { MissingReferenceDocument } from './MissingReferenceDocument';\r\nimport { TypeCremeVersion } from './TypeCremeVersion';\r\nimport { TypeExposureMeasure } from './TypeExposureMeasure';\r\nimport { TypeExposureMeasureValue } from './TypeExposureMeasureValue';\r\nimport { TypeHouseholdProduct } from './TypeHouseholdProduct';\r\nimport { MaterialExposureSurvey } from './MaterialExposureSurvey';\r\nimport { TypeExposureSurveyResponse } from './TypeExposureSurveyResponse';\r\nimport { TypeExposureSurveyStatus } from './TypeExposureSurveyStatus';\r\nimport { ExposureAdditionalMaterialSurvey } from './ExposureAdditionalMaterialSurvey';\r\nimport { ExposureSurveyMaterialMeasureCount } from './ExposureSurveyMaterialMeasureCount';\r\nimport { ExposureSurveyMaterialMostRecent } from './ExposureSurveyMaterialMostRecent';\r\nimport { LabelingManualPublication } from './LabelingManualPublication';\r\nimport { MaterialCluster } from './MaterialCluster';\r\nimport { MaterialComponent } from './MaterialComponent';\r\nimport { TypeMaterialComponentClass } from './TypeMaterialComponentClass';\r\nimport { MaterialComposition } from './MaterialComposition';\r\nimport { MaterialExposureSurveyIsomer } from './MaterialExposureSurveyIsomer';\r\nimport { NationalToxicologyProgram } from './NationalToxicologyProgram';\r\nimport { TypeNTPStatus } from './TypeNTPStatus';\r\nimport { RIFMProductLicense } from './RIFMProductLicense';\r\nimport { RIFMProduct } from './RIFMProduct';\r\nimport { RIFMReport } from './RIFMReport';\r\nimport { StaffWorkflowReport } from './StaffWorkflowReport';\r\nimport { SuperClusterPath } from './SuperClusterPath';\r\nimport { SuperCluster } from './SuperCluster';\r\nimport { SurveyAndCompany } from './SurveyAndCompany';\r\nimport { SurveyReportedUse } from './SurveyReportedUse';\r\nimport { SynonymWebVersion } from './SynonymWebVersion';\r\nimport { TypeAlertConcLevelScore } from './TypeAlertConcLevelScore';\r\nimport { TypeAlertVolumeScore } from './TypeAlertVolumeScore';\r\nimport { TypeChangeReportFrequency } from './TypeChangeReportFrequency';\r\nimport { TypeChangeReportTopic } from './TypeChangeReportTopic';\r\nimport { TypeComplianceGuideline } from './TypeComplianceGuideline';\r\nimport { TypeSearch } from './TypeSearch';\r\nimport { TypeStudyDesignation } from './TypeStudyDesignation';\r\nimport { TypeWorkflowActionTransition } from './TypeWorkflowActionTransition';\r\nimport { UserAcknowledgement } from './UserAcknowledgement';\r\nimport { UserChangeReportAuthor } from './UserChangeReportAuthor';\r\nimport { UserChangeReport } from './UserChangeReport';\r\nimport { UserChangeReportMaterial } from './UserChangeReportMaterial';\r\nimport { UserChangeReportStudy } from './UserChangeReportStudy';\r\nimport { UserChangeReportTopic } from './UserChangeReportTopic';\r\nimport { UserSessionToken } from './UserSessionToken';\r\nimport { SurveyUsesByMaterialAndYear } from './SurveyUsesByMaterialAndYear';\r\nimport { SurveyUsesByCompanyAndMaterialAndYear } from './SurveyUsesByCompanyAndMaterialAndYear';\r\nimport { SurveyWhoUsedMostMaterial } from './SurveyWhoUsedMostMaterial';\r\nimport { WorkflowPendingAction } from './WorkflowPendingAction';\r\nimport { WorkflowReferenceAssignment } from './WorkflowReferenceAssignment';\r\nimport { RIFMDocument } from './RIFMDocument';\r\nimport { RIFMDocumentArchive } from './RIFMDocumentArchive';\r\nimport { RIFMDocumentFolder } from './RIFMDocumentFolder';\r\nimport { TypeRIFMDocument } from './TypeRIFMDocument';\r\nimport { MaterialExposureCustomSurveyMeasure } from './MaterialExposureCustomSurveyMeasure';\r\nimport { MaterialMonograph } from './MaterialMonograph';\r\nimport {RIFMDownloadableFile} from './RIFMDownloadableFile';\r\n\r\nimport { MetadataStore } from 'breeze-client';\r\n\r\nexport class _RegistrationHelper {\r\n\r\n static register(metadataStore: MetadataStore) {\r\n metadataStore.registerEntityTypeCtor('AnalyticalResult', AnalyticalResult);\r\n metadataStore.registerEntityTypeCtor('Material', Material);\r\n metadataStore.registerEntityTypeCtor('DermalExposure', DermalExposure);\r\n metadataStore.registerEntityTypeCtor('EPIData', EPIData);\r\n metadataStore.registerEntityTypeCtor('EPISuite', EPISuite);\r\n metadataStore.registerEntityTypeCtor('TypeEPISuiteParameter', TypeEPISuiteParameter);\r\n metadataStore.registerEntityTypeCtor('TypeEPISuiteCategory', TypeEPISuiteCategory);\r\n metadataStore.registerEntityTypeCtor('ExperimentalMaterial', ExperimentalMaterial);\r\n metadataStore.registerEntityTypeCtor('BiologicalData', BiologicalData);\r\n metadataStore.registerEntityTypeCtor('BioDataStudySubType', BioDataStudySubType);\r\n metadataStore.registerEntityTypeCtor('TypeStudySubType', TypeStudySubType);\r\n metadataStore.registerEntityTypeCtor('Reference', Reference);\r\n metadataStore.registerEntityTypeCtor('Abstract', Abstract);\r\n metadataStore.registerEntityTypeCtor('Journal', Journal);\r\n metadataStore.registerEntityTypeCtor('Project', Project);\r\n metadataStore.registerEntityTypeCtor('ReferenceAuthor', ReferenceAuthor);\r\n metadataStore.registerEntityTypeCtor('Author', Author);\r\n metadataStore.registerEntityTypeCtor('ReferenceRelation', ReferenceRelation);\r\n metadataStore.registerEntityTypeCtor('TypeReferenceRelation', TypeReferenceRelation);\r\n metadataStore.registerEntityTypeCtor('SpecialLink', SpecialLink);\r\n metadataStore.registerEntityTypeCtor('TypeKeyword', TypeKeyword);\r\n metadataStore.registerEntityTypeCtor('TypeKlimisch', TypeKlimisch);\r\n metadataStore.registerEntityTypeCtor('TypePublication', TypePublication);\r\n metadataStore.registerEntityTypeCtor('TypeSearchService', TypeSearchService);\r\n metadataStore.registerEntityTypeCtor('WorkflowRecordedAction', WorkflowRecordedAction);\r\n metadataStore.registerEntityTypeCtor('TypeWorkflowAction', TypeWorkflowAction);\r\n metadataStore.registerEntityTypeCtor('TypeWorkflowContact', TypeWorkflowContact);\r\n metadataStore.registerEntityTypeCtor('TypeRoute', TypeRoute);\r\n metadataStore.registerEntityTypeCtor('TypeSpecies', TypeSpecies);\r\n metadataStore.registerEntityTypeCtor('TypeStudy', TypeStudy);\r\n metadataStore.registerEntityTypeCtor('TypeTitle', TypeTitle);\r\n metadataStore.registerEntityTypeCtor('TypeTimeUnit', TypeTimeUnit);\r\n metadataStore.registerEntityTypeCtor('TypeUsefulness', TypeUsefulness);\r\n metadataStore.registerEntityTypeCtor('ExperimentalResult', ExperimentalResult);\r\n metadataStore.registerEntityTypeCtor('ExperimentalToxicEffect', ExperimentalToxicEffect);\r\n metadataStore.registerEntityTypeCtor('TypeToxicEffect', TypeToxicEffect);\r\n metadataStore.registerEntityTypeCtor('TypeExperimentVehicle', TypeExperimentVehicle);\r\n metadataStore.registerEntityTypeCtor('TypeUnit', TypeUnit);\r\n metadataStore.registerEntityTypeCtor('TypeStudyMixture', TypeStudyMixture);\r\n metadataStore.registerEntityTypeCtor('FoodStatus', FoodStatus);\r\n metadataStore.registerEntityTypeCtor('JECFAMonograph', JECFAMonograph);\r\n metadataStore.registerEntityTypeCtor('TypeFoodStatus', TypeFoodStatus);\r\n metadataStore.registerEntityTypeCtor('HouseStatus', HouseStatus);\r\n metadataStore.registerEntityTypeCtor('MaterialAdditionalIdentifier', MaterialAdditionalIdentifier);\r\n metadataStore.registerEntityTypeCtor('TypeMaterialIdentifier', TypeMaterialIdentifier);\r\n metadataStore.registerEntityTypeCtor('MaterialAlertRule', MaterialAlertRule);\r\n metadataStore.registerEntityTypeCtor('TypeAlertRule', TypeAlertRule);\r\n metadataStore.registerEntityTypeCtor('MaterialAssessmentCategory', MaterialAssessmentCategory);\r\n metadataStore.registerEntityTypeCtor('AssessmentCategory', AssessmentCategory);\r\n metadataStore.registerEntityTypeCtor('MaterialConsumption', MaterialConsumption);\r\n metadataStore.registerEntityTypeCtor('Survey', Survey);\r\n metadataStore.registerEntityTypeCtor('TypeGeographicalArea', TypeGeographicalArea);\r\n metadataStore.registerEntityTypeCtor('TypeSponsor', TypeSponsor);\r\n metadataStore.registerEntityTypeCtor('MaterialExpertPanelSummary', MaterialExpertPanelSummary);\r\n metadataStore.registerEntityTypeCtor('ExpertPanelSummary', ExpertPanelSummary);\r\n metadataStore.registerEntityTypeCtor('MaterialFSAG', MaterialFSAG);\r\n metadataStore.registerEntityTypeCtor('FSAG', FSAG);\r\n metadataStore.registerEntityTypeCtor('MaterialHazardCode', MaterialHazardCode);\r\n metadataStore.registerEntityTypeCtor('TypeHazardCode', TypeHazardCode);\r\n metadataStore.registerEntityTypeCtor('MaterialPrecautionCode', MaterialPrecautionCode);\r\n metadataStore.registerEntityTypeCtor('TypePrecautionStatement', TypePrecautionStatement);\r\n metadataStore.registerEntityTypeCtor('MaterialRelation', MaterialRelation);\r\n metadataStore.registerEntityTypeCtor('TypeMaterialRelation', TypeMaterialRelation);\r\n metadataStore.registerEntityTypeCtor('MaterialTransparencyList', MaterialTransparencyList);\r\n metadataStore.registerEntityTypeCtor('MaterialUNTransport', MaterialUNTransport);\r\n metadataStore.registerEntityTypeCtor('MaterialUNTransportCode', MaterialUNTransportCode);\r\n metadataStore.registerEntityTypeCtor('TypeHazardousSymbol', TypeHazardousSymbol);\r\n metadataStore.registerEntityTypeCtor('NaturalOccurrenceDescriptor', NaturalOccurrenceDescriptor);\r\n metadataStore.registerEntityTypeCtor('Prediction', Prediction);\r\n metadataStore.registerEntityTypeCtor('TypePrediction', TypePrediction);\r\n metadataStore.registerEntityTypeCtor('TypePredictionClass', TypePredictionClass);\r\n metadataStore.registerEntityTypeCtor('REACHRegistration', REACHRegistration);\r\n metadataStore.registerEntityTypeCtor('TypeREACHTonnageBand', TypeREACHTonnageBand);\r\n metadataStore.registerEntityTypeCtor('RegulatoryStatus', RegulatoryStatus);\r\n metadataStore.registerEntityTypeCtor('TypeRegulatoryStatus', TypeRegulatoryStatus);\r\n metadataStore.registerEntityTypeCtor('SafetyAssessmentMaterial', SafetyAssessmentMaterial);\r\n metadataStore.registerEntityTypeCtor('SafetyComment', SafetyComment);\r\n metadataStore.registerEntityTypeCtor('TypeSafety', TypeSafety);\r\n metadataStore.registerEntityTypeCtor('SafetyEUComment', SafetyEUComment);\r\n metadataStore.registerEntityTypeCtor('TypeSafetyEU', TypeSafetyEU);\r\n metadataStore.registerEntityTypeCtor('Synonym', Synonym);\r\n metadataStore.registerEntityTypeCtor('SynonymNamer', SynonymNamer);\r\n metadataStore.registerEntityTypeCtor('TypeSynonymUse', TypeSynonymUse);\r\n metadataStore.registerEntityTypeCtor('TypeBotanicalSubdivision', TypeBotanicalSubdivision);\r\n metadataStore.registerEntityTypeCtor('TypeEssentialOil', TypeEssentialOil);\r\n metadataStore.registerEntityTypeCtor('TypeNarrativeSummary', TypeNarrativeSummary);\r\n metadataStore.registerEntityTypeCtor('TypeNaturalOccurrence', TypeNaturalOccurrence);\r\n metadataStore.registerEntityTypeCtor('TypeTSCAClass', TypeTSCAClass);\r\n metadataStore.registerEntityTypeCtor('MaterialUses', MaterialUses);\r\n metadataStore.registerEntityTypeCtor('TypeFoodCategory', TypeFoodCategory);\r\n metadataStore.registerEntityTypeCtor('TypeAnalyticalProcedure', TypeAnalyticalProcedure);\r\n metadataStore.registerEntityTypeCtor('AnnouncementDetail', AnnouncementDetail);\r\n metadataStore.registerEntityTypeCtor('TypeLinkTarget', TypeLinkTarget);\r\n metadataStore.registerEntityTypeCtor('Announcement', Announcement);\r\n metadataStore.registerEntityTypeCtor('ApplicationConfigurationSetting', ApplicationConfigurationSetting);\r\n metadataStore.registerEntityTypeCtor('ClusterGroup', ClusterGroup);\r\n metadataStore.registerEntityTypeCtor('ClusterNodeAndEdge', ClusterNodeAndEdge);\r\n metadataStore.registerEntityTypeCtor('ClusterPart', ClusterPart);\r\n metadataStore.registerEntityTypeCtor('ClusterPath', ClusterPath);\r\n metadataStore.registerEntityTypeCtor('ClusterPartWithParent', ClusterPartWithParent);\r\n metadataStore.registerEntityTypeCtor('ExposureAdditionalMaterial', ExposureAdditionalMaterial);\r\n metadataStore.registerEntityTypeCtor('ExposureAdditionalMaterialSurveyMeasure', ExposureAdditionalMaterialSurveyMeasure);\r\n metadataStore.registerEntityTypeCtor('ExposureSurvey', ExposureSurvey);\r\n metadataStore.registerEntityTypeCtor('MaterialExposureSurveyMeasure', MaterialExposureSurveyMeasure);\r\n metadataStore.registerEntityTypeCtor('TypeCremeVersion', TypeCremeVersion);\r\n metadataStore.registerEntityTypeCtor('TypeExposureMeasure', TypeExposureMeasure);\r\n metadataStore.registerEntityTypeCtor('TypeExposureMeasureValue', TypeExposureMeasureValue);\r\n metadataStore.registerEntityTypeCtor('TypeHouseholdProduct', TypeHouseholdProduct);\r\n metadataStore.registerEntityTypeCtor('MaterialExposureSurvey', MaterialExposureSurvey);\r\n metadataStore.registerEntityTypeCtor('TypeExposureSurveyResponse', TypeExposureSurveyResponse);\r\n metadataStore.registerEntityTypeCtor('TypeExposureSurveyStatus', TypeExposureSurveyStatus);\r\n metadataStore.registerEntityTypeCtor('ExposureAdditionalMaterialSurvey', ExposureAdditionalMaterialSurvey);\r\n metadataStore.registerEntityTypeCtor('ExposureSurveyMaterialMeasureCount', ExposureSurveyMaterialMeasureCount);\r\n metadataStore.registerEntityTypeCtor('ExposureSurveyMaterialMostRecent', ExposureSurveyMaterialMostRecent);\r\n metadataStore.registerEntityTypeCtor('LabelingManualPublication', LabelingManualPublication);\r\n metadataStore.registerEntityTypeCtor('MaterialCluster', MaterialCluster);\r\n metadataStore.registerEntityTypeCtor('MaterialComponent', MaterialComponent);\r\n metadataStore.registerEntityTypeCtor('TypeMaterialComponentClass', TypeMaterialComponentClass);\r\n metadataStore.registerEntityTypeCtor('MaterialComposition', MaterialComposition);\r\n metadataStore.registerEntityTypeCtor('MaterialExposureSurveyIsomer', MaterialExposureSurveyIsomer);\r\n metadataStore.registerEntityTypeCtor('NationalToxicologyProgram', NationalToxicologyProgram);\r\n metadataStore.registerEntityTypeCtor('TypeNTPStatus', TypeNTPStatus);\r\n metadataStore.registerEntityTypeCtor('RIFMProductLicense', RIFMProductLicense);\r\n metadataStore.registerEntityTypeCtor('RIFMProduct', RIFMProduct);\r\n metadataStore.registerEntityTypeCtor('RIFMReport', RIFMReport);\r\n metadataStore.registerEntityTypeCtor('StaffWorkflowReport', StaffWorkflowReport);\r\n metadataStore.registerEntityTypeCtor('SuperClusterPath', SuperClusterPath);\r\n metadataStore.registerEntityTypeCtor('SuperCluster', SuperCluster);\r\n metadataStore.registerEntityTypeCtor('SurveyAndCompany', SurveyAndCompany);\r\n metadataStore.registerEntityTypeCtor('SurveyReportedUse', SurveyReportedUse);\r\n metadataStore.registerEntityTypeCtor('SynonymWebVersion', SynonymWebVersion);\r\n metadataStore.registerEntityTypeCtor('TypeAlertConcLevelScore', TypeAlertConcLevelScore);\r\n metadataStore.registerEntityTypeCtor('TypeAlertVolumeScore', TypeAlertVolumeScore);\r\n metadataStore.registerEntityTypeCtor('TypeChangeReportFrequency', TypeChangeReportFrequency);\r\n metadataStore.registerEntityTypeCtor('TypeChangeReportTopic', TypeChangeReportTopic);\r\n metadataStore.registerEntityTypeCtor('TypeComplianceGuideline', TypeComplianceGuideline);\r\n metadataStore.registerEntityTypeCtor('TypeSearch', TypeSearch);\r\n metadataStore.registerEntityTypeCtor('TypeStudyDesignation', TypeStudyDesignation);\r\n metadataStore.registerEntityTypeCtor('TypeWorkflowActionTransition', TypeWorkflowActionTransition);\r\n metadataStore.registerEntityTypeCtor('UserAcknowledgement', UserAcknowledgement);\r\n metadataStore.registerEntityTypeCtor('UserChangeReportAuthor', UserChangeReportAuthor);\r\n metadataStore.registerEntityTypeCtor('UserChangeReport', UserChangeReport);\r\n metadataStore.registerEntityTypeCtor('UserChangeReportMaterial', UserChangeReportMaterial);\r\n metadataStore.registerEntityTypeCtor('UserChangeReportStudy', UserChangeReportStudy);\r\n metadataStore.registerEntityTypeCtor('UserChangeReportTopic', UserChangeReportTopic);\r\n metadataStore.registerEntityTypeCtor('UserSessionToken', UserSessionToken);\r\n metadataStore.registerEntityTypeCtor('SurveyUsesByMaterialAndYear', SurveyUsesByMaterialAndYear);\r\n metadataStore.registerEntityTypeCtor('SurveyUsesByCompanyAndMaterialAndYear', SurveyUsesByCompanyAndMaterialAndYear);\r\n metadataStore.registerEntityTypeCtor('SurveyWhoUsedMostMaterial', SurveyWhoUsedMostMaterial);\r\n metadataStore.registerEntityTypeCtor('WorkflowPendingAction', WorkflowPendingAction);\r\n metadataStore.registerEntityTypeCtor('WorkflowReferenceAssignment', WorkflowReferenceAssignment);\r\n metadataStore.registerEntityTypeCtor('RIFMDocument', RIFMDocument);\r\n metadataStore.registerEntityTypeCtor('RIFMDocumentArchive', RIFMDocumentArchive);\r\n metadataStore.registerEntityTypeCtor('RIFMDocumentFolder', RIFMDocumentFolder);\r\n metadataStore.registerEntityTypeCtor('TypeRIFMDocument', TypeRIFMDocument);\r\n metadataStore.registerEntityTypeCtor('RIFMDownloadableFile', RIFMDownloadableFile);\r\n metadataStore.registerEntityTypeCtor('ECOSARToxicEffect', ECOSARToxicEffect);\r\n metadataStore.registerEntityTypeCtor('MaterialExposureCustomSurveyMeasure', MaterialExposureCustomSurveyMeasure);\r\n metadataStore.registerEntityTypeCtor( 'MaterialMonograph', MaterialMonograph );\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { EntityManagerProvider } from './entity-manager-provider';\r\n\r\nimport * as Raven from 'raven-js';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { environment } from '../../environments/environment';\r\nimport { Router, UrlTree } from '@angular/router';\r\n\r\ndeclare const $: any;\r\ndeclare var ga: Function; // Google analytics\r\n\r\n@Injectable()\r\nexport class UserManager {\r\n private _fileServiceURL: string;\r\n private _oauthRedirectURL: string;\r\n\r\n _currentUser: User = User.nullUser;\r\n _loginHandle: any;\r\n _loginErrorMessage: string;\r\n _userAcknowledgmentDurationDays: number;\r\n\r\n sessionDurationMinutes: number;\r\n\r\n public static versionNo = '2.0.7.15';\r\n\r\n constructor(public _http: HttpClient, private _emProvider: EntityManagerProvider, private _location: Location, private _router: Router) {\r\n }\r\n\r\n public get currentUser() {\r\n return this._currentUser;\r\n }\r\n\r\n public get accessToken() {\r\n return sessionStorage.getItem('accessToken');\r\n }\r\n\r\n public set accessToken(value: string) {\r\n if (value && value.length > 20) {\r\n sessionStorage.setItem('accessToken', value);\r\n } else {\r\n sessionStorage.removeItem('accessToken');\r\n }\r\n }\r\n\r\n public get destUrl() {\r\n return sessionStorage.getItem('destUrl');\r\n }\r\n\r\n public set destUrl(value: string) {\r\n if (value && value.length > 4) {\r\n sessionStorage.setItem('destUrl', value);\r\n } else {\r\n sessionStorage.removeItem('destUrl');\r\n }\r\n }\r\n\r\n public logout() {\r\n this._currentUser = User.nullUser;\r\n return this._http.get(`${environment.appUrl}/breeze/logout`)\r\n .toPromise()\r\n .then(() => {\r\n Raven.setUserContext();\r\n this.accessToken = null;\r\n }).catch(() => {\r\n console.log('Unable to logout.');\r\n });\r\n }\r\n\r\n public async checkIfLoggedInOAuth(): Promise {\r\n\r\n this.checkSessionTimeout();\r\n\r\n if (!this._currentUser.isNullUser) {\r\n // December 2020: Prevent users assigned role of \"AuthorizedDownloadUser\"\r\n if (this._currentUser.isAuthorizedDownloadUser) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n // Make sure the user hasn't logged out from a different tab\r\n const isUserLoggedInPromise = this._http.get(`${environment.appUrl}/breeze/TestIfLoggedIn`).toPromise();\r\n const res = await this.handleAuthResponse(isUserLoggedInPromise, true);\r\n if (res) {\r\n return res;\r\n }\r\n }\r\n\r\n const loc = window.location.href;\r\n\r\n if (loc.toLowerCase().indexOf('logout') > -1) {\r\n return this.showLogin().then(() => false);\r\n }\r\n\r\n if (!loc.includes('after-login')) {\r\n // remember url so we can return to it after login\r\n this.destUrl = this._location.path();\r\n }\r\n\r\n // Get user from the server if current accessToken or session is valid, so we don't need to login again\r\n const isLoggedInPromise = this._http.get(`${environment.appUrl}/breeze/TestIfLoggedIn`).toPromise();\r\n const result = await this.handleAuthResponse(isLoggedInPromise, false);\r\n if (result) { return result; }\r\n\r\n // Get the URL for YM login\r\n if (!this.isValidString(this._oauthRedirectURL)) {\r\n await this.queryOAuthRedirectURL().then(url => {\r\n if (this.isValidString(url)) {\r\n this._oauthRedirectURL = url;\r\n }\r\n });\r\n }\r\n\r\n if (loc.toLowerCase().indexOf('after-login') == -1) {\r\n // Not logged in and null User so redirect to YM OAuth site.\r\n window.location.href = this._oauthRedirectURL;\r\n return false;\r\n }\r\n\r\n let code: string;\r\n const params = loc.match(/code=([^&]*)/);\r\n if (params != null) {\r\n code = params[1];\r\n } else {\r\n this._loginErrorMessage = 'Error, missing OAuth code';\r\n return this.showLogin().then(() => false);\r\n }\r\n\r\n const headers = new HttpHeaders({ 'Content-Type': 'application/json' });\r\n const validateTokenPromise = this._http.post(`${environment.appUrl}/breeze/validateOAuthSessionToken`, JSON.stringify({code: code}), { headers: headers })\r\n .toPromise();\r\n return this.handleAuthResponse(validateTokenPromise);\r\n }\r\n\r\n /** Handle the response from the server for login or testIfLoggedIn. Sets the currentUser. */\r\n private handleAuthResponse(requestPromise: Promise, showLogin: boolean = true): Promise {\r\n return requestPromise.then(res => {\r\n this.initializeUserFromResponse(res);\r\n return this._http.get(`${environment.appUrl}/breeze/fileServiceURL`, {})\r\n .toPromise()\r\n .then((url: any) => {\r\n this._fileServiceURL = url;\r\n return this._emProvider.prepare();\r\n });\r\n })\r\n .then(() => {\r\n const allowed = !this._currentUser.isAuthorizedDownloadUser;\r\n if (allowed && window.location.href.toLowerCase().includes('after-login')) {\r\n const loc = this.destUrl;\r\n if (loc) {\r\n const tree = this._router.parseUrl(loc);\r\n this.destUrl = null;\r\n return tree;\r\n }\r\n }\r\n return allowed;\r\n })\r\n .catch(e => {\r\n // log error if not a 405 ( Method not allowed) error.\r\n if (e.status != 405) {\r\n console.log('login check received unknown error: ' + e.status);\r\n }\r\n this._loginErrorMessage = 'Error attempting to validate RIFM Database user.';\r\n if (showLogin) {\r\n return this.showLogin().then(() => false);\r\n } else {\r\n return false;\r\n }\r\n });\r\n\r\n }\r\n\r\n public checkSessionTimeout() {\r\n // force logout after sessionDurationMinutes - timer is reset each time a top level route is hit.\r\n if (!this.sessionDurationMinutes) {\r\n return;\r\n }\r\n\r\n if (this._loginHandle) {\r\n clearTimeout(this._loginHandle);\r\n }\r\n if (this.sessionDurationMinutes) {\r\n this._loginHandle = setTimeout(() => {\r\n return this.logout().then(() => {\r\n // doesn't seem to work with virtual dirs - but works fine locally\r\n // document.location.href='/home';\r\n this._location.replaceState('/home');\r\n document.location.reload();\r\n });\r\n }, this.sessionDurationMinutes * 60 * 1000);\r\n }\r\n }\r\n\r\n public getFileServiceFilePathUrl(filePath: string) {\r\n return this.getFileServiceUrl('GetFileByPath.aspx?filepath=' + filePath);\r\n }\r\n\r\n public getFFIDSUrl(materialId: number) {\r\n return `${this.fileServiceUrl}GetFFIDS.aspx?materialid=${materialId.toString()}&sessionid=${this.currentUser.authenticationToken}`;\r\n }\r\n\r\n public getMonographUrl(monographNumber: number) {\r\n return `${this.fileServiceUrl}GetMonograph.aspx?fname=${monographNumber.toString()}.pdf&sessionid=${this.currentUser.authenticationToken}`;\r\n }\r\n\r\n public getExpertPanelSummaryUrl(narrativeLink: string) {\r\n return `${this.fileServiceUrl}GetExpertPanelSummary.aspx?fname=${narrativeLink}&sessionid=${this.currentUser.authenticationToken}`;\r\n }\r\n\r\n public getFileServiceUrl(paramString: string) {\r\n return this.fileServiceUrl + paramString + '&sessionid=' + this.currentUser.authenticationToken;\r\n }\r\n\r\n public getReportUrl(params: { key: string, value: string }[]) {\r\n let url = `${this.fileServiceUrl}GetReport.aspx?&sessionid=${this.currentUser.authenticationToken}`;\r\n\r\n params.forEach(function (el) {\r\n url = url + '&' + el.key + '=' + el.value;\r\n });\r\n\r\n return url;\r\n }\r\n\r\n public getSearchServiceReportUrl() {\r\n return `${this.fileServiceUrl}GetSearchServiceReferences.aspx?&sessionid=${this.currentUser.authenticationToken}`;\r\n }\r\n\r\n public getUVUrl(fileName: string) {\r\n return `${this.fileServiceUrl}GetUV.aspx?fname=${fileName}&sessionid=${this.currentUser.authenticationToken}`;\r\n }\r\n\r\n public get UserAcknowledgementDuration(): number {\r\n return this._userAcknowledgmentDurationDays;\r\n }\r\n\r\n showLogin(): Promise {\r\n return new Promise((resolve) => {\r\n const ele = $('#login-modal');\r\n ele.modal({ backdrop: 'static', keyboard: false })\r\n .on('hidden.bs.modal', () => {\r\n resolve(true);\r\n });\r\n });\r\n }\r\n\r\n initializeUserFromResponse(data: any) {\r\n this._currentUser = new User(data.UserName, data.AuthenticationToken, data.Roles, new Date(data.SessionStartTime), data.SessionDuration, data.IsAuthorizedDownloadUser);\r\n\r\n if (data.AccessToken) {\r\n this.accessToken = data.AccessToken;\r\n }\r\n\r\n this._userAcknowledgmentDurationDays = Number(data.UserAcknowledgementDuration);\r\n this.sessionDurationMinutes = data.SessionDuration || 6 * 60;\r\n // Set user context for logging purposes\r\n Raven.setUserContext({\r\n id: data.$id,\r\n email: data.UserName,\r\n username: data.UserName\r\n });\r\n // uncomment to test session timeout;\r\n // this.sessionDurationMinutes = .1;\r\n this.checkSessionTimeout();\r\n\r\n // initialize Google Analytics\r\n this.trackUser();\r\n\r\n }\r\n\r\n public get fileServiceUrl(): string {\r\n if (this._fileServiceURL == null) {\r\n this._http.get(`${environment.appUrl}/breeze/fileServiceURL`, {})\r\n .toPromise().then((url: any) => {\r\n this._fileServiceURL = url;\r\n return this._fileServiceURL;\r\n });\r\n } else {\r\n return this._fileServiceURL;\r\n }\r\n }\r\n\r\n public queryOAuthRedirectURL(): Promise {\r\n return this._http.get(`${environment.appUrl}/breeze/oAuthRedirectURL`, {})\r\n .toPromise()\r\n .then((url: any) => {\r\n return url;\r\n });\r\n }\r\n\r\n public get OAuthRedirectURL(): string {\r\n return this._oauthRedirectURL;\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n // Google Analytics\r\n trackUser() {\r\n if (this._currentUser == null) { return; }\r\n ga('set', {\r\n 'userId': this._currentUser.name,\r\n 'appVersion': UserManager.versionNo\r\n });\r\n }\r\n}\r\n\r\nexport class User {\r\n\r\n public static nullUser = new User('Null User', null, [], new Date(), 1E6, false);\r\n _roles: string[];\r\n _tempRoles: string[];\r\n _isAuthorizedDownloadUser = false;\r\n\r\n constructor(public _name: string, public _authenticationToken: string,\r\n roles: string[],\r\n public _sessionStartTime: Date,\r\n public _sessionDuration: number,\r\n public _dbAuthorizedDownloadUser: boolean) {\r\n this._roles = roles.map(r => r.toLowerCase());\r\n this._isAuthorizedDownloadUser = _dbAuthorizedDownloadUser;\r\n }\r\n\r\n public get name() {\r\n return this._name;\r\n }\r\n\r\n public get isNullUser() {\r\n return this === User.nullUser;\r\n }\r\n\r\n // used by staff or admin user to simulate regular user.\r\n public toggleRoles() {\r\n if (this._tempRoles) {\r\n this._tempRoles = null;\r\n } else {\r\n this._tempRoles = ['subscriber'];\r\n }\r\n }\r\n\r\n public get authenticationToken() {\r\n return this._authenticationToken;\r\n }\r\n\r\n public get isAuthorizedDownloadUser() {\r\n return this._isAuthorizedDownloadUser;\r\n }\r\n\r\n public set isAuthorizedDownloadUser(value) {\r\n this._isAuthorizedDownloadUser = value;\r\n }\r\n\r\n public get isAdmin() {\r\n return this.isInRole('admin');\r\n }\r\n\r\n public get isStaff() {\r\n return this.isInRole('staff') || this.isInRole('admin');\r\n }\r\n\r\n public get isReallyStaff() {\r\n return this.isInRole('staff', true) || this.isInRole('admin', true);\r\n }\r\n\r\n public isInRole(roleName: string, useRealRoles?: boolean): boolean {\r\n const roles = useRealRoles ? this._roles : this._tempRoles || this._roles;\r\n return roles.indexOf(roleName.toLowerCase()) >= 0;\r\n }\r\n\r\n public get sessionStartTime(): Date {\r\n return this._sessionStartTime;\r\n }\r\n\r\n public get sessionDuration(): number {\r\n return this._sessionDuration;\r\n }\r\n}\r\n\r\n\r\n\r\n","import { Injectable } from '@angular/core';\r\nimport { Entity, EntityManager, EntityQuery, FetchStrategy, SaveOptions } from 'breeze-client';\r\nimport { IRepository, Repository } from './repository';\r\nimport { UserManager } from './user-manager';\r\nimport { EntityManagerProvider } from './entity-manager-provider';\r\nimport { ErrorLogger } from './error-logger';\r\nimport { ReferenceRepository } from './reference-repository';\r\nimport { extend } from 'lodash';\r\n\r\nimport {\r\n Material, Reference, BioDataStudySubType, BiologicalData, ReferenceAuthor, Synonym, ExperimentalMaterial, AnalyticalResult,\r\n FSAG, MaterialFSAG, SpecialLink, RegulatoryStatus, FoodStatus, MaterialUses, MaterialConsumption,\r\n ReferenceRelation, NaturalOccurrenceDescriptor, MaterialAlertRule, Prediction, EPISuite, NationalToxicologyProgram,\r\n MaterialRelation, Project, REACHRegistration, HouseStatus, MaterialExpertPanelSummary, UserChangeReport, UserChangeReportMaterial,\r\n UserChangeReportTopic, UserChangeReportAuthor, RIFMProduct, RIFMProductLicense, Announcement, Author,\r\n Abstract, ExperimentalResult, ExperimentalToxicEffect, Journal,\r\n TypeSearch, TypeSynonymUse, TypePublication, TypeAnalyticalProcedure, TypeRegulatoryStatus,\r\n TypeFoodCategory, TypeGeographicalArea, TypeTSCAClass, TypeAlertRule, TypePrediction, TypePredictionClass,\r\n TypeEPISuiteParameter, TypeEPISuiteCategory, TypeNTPStatus, TypeStudy, TypeSpecies, TypeRoute,\r\n TypeMaterialRelation, TypeREACHTonnageBand, TypeChangeReportFrequency, TypeChangeReportTopic,\r\n TypeLinkTarget, TypeBotanicalSubdivision, TypeEssentialOil, TypeNaturalOccurrence, TypeKeyword,\r\n TypeKlimisch, TypeTimeUnit, TypeUnit, TypeToxicEffect, TypeExperimentVehicle, TypeUsefulness, TypeStudySubType,\r\n TypeWorkflowAction, TypeWorkflowActionTransition, TypeWorkflowContact, WorkflowRecordedAction, TypeComplianceGuideline,\r\n TypeReferenceRelation, TypeStudyDesignation, TypeStudyMixture, Survey, SurveyAndCompany, SurveyReportedUse, SurveyUsesByMaterialAndYear, SurveyWhoUsedMostMaterial,\r\n TypeSearchService, UserAcknowledgement, MaterialAdditionalIdentifier, TypeMaterialIdentifier, MaterialComponent, MaterialComposition, TypeMaterialComponentClass,\r\n UserChangeReportStudy, LabelingManualPublication, AssessmentCategory, MaterialAssessmentCategory,\r\n ExposureAdditionalMaterial, ExposureAdditionalMaterialSurvey, ExposureAdditionalMaterialSurveyMeasure, ExposureSurvey,\r\n MaterialExposureSurvey, MaterialExposureSurveyIsomer, MaterialExposureSurveyMeasure,\r\n TypeExposureMeasure, TypeExposureMeasureValue, TypeExposureSurveyResponse, TypeExposureSurveyStatus, ExposureSurveyMaterialMeasureCount,\r\n ExposureSurveyMaterialMostRecent, TypeCremeVersion, RIFMReport, ClusterGroup, ClusterNodeAndEdge, ClusterPart, ClusterPath, MaterialCluster,\r\n SuperCluster, SuperClusterPath, ClusterPartWithParent, DocUniqReference, JournalReserve, JournalSubscription, TypeJournalSubscription, RIFMProductRoleAuthorization,\r\n RIFMDocumentFolder, RIFMDocument, RIFMDocumentArchive, TypeRIFMDocument, TypeWorkflowMaterialAction, WorkflowMaterialRecordedAction, TypeWorkflowMaterialActionTransition,\r\n ReportingOrganization, ECOSARToxicEffect, TypeMaterialUnit, MaterialExposureCustomSurveyMeasure, MaterialMonograph\r\n} from '../entities/EntityModels';\r\n\r\n\r\nexport interface IEntityFactory {\r\n create(...params: any[]): T;\r\n}\r\n\r\nexport class EntityFactory implements IEntityFactory {\r\n\r\n constructor(public entityTypeName: string, public _emProvider: EntityManagerProvider) {\r\n }\r\n\r\n create(config?: {}): T {\r\n const inst = this._emProvider.manager().createEntity(this.entityTypeName, config);\r\n // OLD version - did not allow config.\r\n // var inst = new this.type();\r\n // this.entityManagerProvider.manager().addEntity(inst);\r\n return inst;\r\n }\r\n}\r\n\r\n@Injectable()\r\nexport class UnitOfWork {\r\n assessmentCategoryRepository: IRepository;\r\n analyticalResultRepository: IRepository;\r\n announcementRepository: IRepository;\r\n bioDataStudySubTypeRepository: IRepository;\r\n biologicalDataRepository: IRepository;\r\n clusterGroupRepository: IRepository;\r\n clusterNodeAndEdgeRepository: IRepository;\r\n clusterPartRepository: IRepository;\r\n clusterPartWithParentRepository: IRepository;\r\n clusterPathRepository: IRepository;\r\n docUniqReferenceRepository: IRepository;\r\n ecoSARToxicEffectRepository: IRepository;\r\n epiSuiteRepository: IRepository;\r\n experimentalMaterialRepository: IRepository;\r\n exposureAdditionalMaterialRepository: IRepository;\r\n exposureAdditionalMaterialSurveyRepository: IRepository;\r\n exposureAdditionalMaterialSurveyMeasureRepository: IRepository;\r\n exposureSurveyRepository: IRepository;\r\n exposureSurveyMaterialMeasureCountRepository: IRepository;\r\n exposureSurveyMaterialMostRecentRepository: IRepository;\r\n fSAGRepository: IRepository;\r\n foodStatusRepository: IRepository;\r\n houseStatusRepository: IRepository;\r\n journalRepository: IRepository;\r\n journalReserveRepository: IRepository;\r\n journalSubscriptionRepository: IRepository;\r\n labelingManualPublicationRepository: IRepository;\r\n materialAdditionalIdentifierRepository: IRepository;\r\n materialAlertRuleRepository: IRepository;\r\n materialClusterRepository: IRepository;\r\n materialComponentRepository: IRepository;\r\n materialCompositionRepository: IRepository;\r\n materialConsumptionRepository: IRepository;\r\n materialExpertPanelSummaryRepository: IRepository;\r\n materialExposureCustomSurveyMeasureRepository: IRepository;\r\n materialExposureSurveyRepository: IRepository;\r\n materialExposureSurveyIsomerRepository: IRepository;\r\n materialExposureSurveyMeasureRepository: IRepository;\r\n materialFSAGRepository: IRepository;\r\n materialRelationRepository: IRepository;\r\n materialMonographRepository: IRepository;\r\n materialReciprocalRelationRepository: IRepository;\r\n materialRepository: IRepository;\r\n materialUsesRepository: IRepository;\r\n materialAssessmentCategoriesRepository: IRepository;\r\n nationalToxicologyProgramRepository: IRepository;\r\n naturalOccurrenceDescriptorRepository: IRepository;\r\n predictionRepository: IRepository;\r\n projectRepository: IRepository;\r\n rEACHRegistrationRepository: IRepository;\r\n reportingOrganizationRepository: IRepository;\r\n rifmDocumentRepository: IRepository;\r\n rifmDocumentArchiveRepository: IRepository;\r\n rifmDocumentFolderRepository: IRepository;\r\n rIFMProductLicenseRepository: IRepository;\r\n rIFMProductRepository: IRepository;\r\n rIFMReportRepository: IRepository;\r\n referenceAuthorRepository: IRepository;\r\n referenceRelationRepository: IRepository;\r\n referenceRepository: ReferenceRepository;\r\n regulatoryStatusRepository: IRepository;\r\n specialLinkMaterialRepository: IRepository;\r\n specialLinkReferenceRepository: IRepository;\r\n superClusterPathRepository: IRepository;\r\n superClusterRepository: IRepository;\r\n surveyRepository: IRepository;\r\n surveyAndCompanyRepository: IRepository;\r\n surveyReportedUseRepository: IRepository;\r\n surveyUsesByMaterialAndYearRepository: IRepository;\r\n surveyWhoUsedMostRepository: IRepository;\r\n synonymRepository: IRepository;\r\n userChangeReportRepository: IRepository;\r\n userAcknowledgementRepository: IRepository;\r\n workflowRecordedActionRepository: IRepository;\r\n workflowMaterialRecordedActionRepository: IRepository;\r\n\r\n typeAlertRuleRepository: IRepository;\r\n typeAnalyticalProcedureRepository: IRepository;\r\n typeBotanicalSubdivisionRepository: IRepository;\r\n typeChangeReportFrequencyRespository: IRepository;\r\n typeChangeReportTopicRepository: IRepository;\r\n typeComplianceGuidelineRepository: IRepository;\r\n typeCremeVersionRepository: IRepository;\r\n typeEPISuiteCategoryRepository: IRepository;\r\n typeEPISuiteParameterRepository: IRepository;\r\n typeEssentialOilRepository: IRepository;\r\n typeExposureMeasureRepository: IRepository;\r\n typeExposureMeasureValueRepository: IRepository;\r\n typeExposureSurveyResponseRepository: IRepository;\r\n typeExposureSurveyStatusRepository: IRepository;\r\n typeExperimentVehicleRepository: IRepository;\r\n typeFoodCategoryRepository: IRepository;\r\n typeGeographicalAreaRepository: IRepository;\r\n typeJournalSubscriptionRepository: IRepository;\r\n typeKeywordRepository: IRepository;\r\n typeKlimischRepository: IRepository;\r\n typeLinkTargetRepository: IRepository;\r\n typeMaterialComponentClassRepository: IRepository;\r\n typeMaterialRelationRepository: IRepository;\r\n typeMaterialIdentifierRepository: IRepository;\r\n typeMaterialUnitRepository: IRepository;\r\n typeNaturalOccurrenceRepository: IRepository;\r\n typeNTPStatusRepository: IRepository;\r\n typePredictionClassRepository: IRepository;\r\n typePredictionRepository: IRepository;\r\n typePublicationRepository: IRepository;\r\n typeREACHTonnageBandRepository: IRepository;\r\n typeReferenceRelationRepository: IRepository;\r\n typeRegulatoryStatusRepository: IRepository;\r\n typeRIFMDocumentRepository: IRepository;\r\n typeRouteRepository: IRepository;\r\n typeSearchRepository: IRepository;\r\n typeSearchServiceRepository: IRepository;\r\n typeSpeciesRepository: IRepository;\r\n typeStudyRepository: IRepository;\r\n typeStudyMixtureRepository: IRepository;\r\n typeStudyDesignationRepository: IRepository;\r\n typeStudyMixture: IRepository;\r\n typeStudySubTypeRepository: IRepository;\r\n typeSynonymUseRepository: IRepository;\r\n typeTimeUnitRepository: IRepository;\r\n typeToxicEffectRepository: IRepository;\r\n typeTSCAClassRepository: IRepository;\r\n typeUnitRepository: IRepository;\r\n typeUsefulnessRepository: IRepository;\r\n typeWorkflowActionRepository: IRepository;\r\n typeWorkflowActionTransitionRepository: IRepository;\r\n typeWorkflowContactRepository: IRepository;\r\n typeWorkflowMaterialActionRepository: IRepository;\r\n typeWorkflowMaterialActionTransitionRepository: IRepository;\r\n\r\n abstractFactory: IEntityFactory;\r\n analyticalResultFactory: IEntityFactory;\r\n announcementFactory: IEntityFactory;\r\n assessmentCategoryFactory: IEntityFactory;\r\n authorFactory: IEntityFactory;\r\n bioDataStudySubTypeFactory: IEntityFactory;\r\n biologicalDataFactory: IEntityFactory;\r\n clusterGroupFactory: IEntityFactory;\r\n clusterPartFactory: IEntityFactory;\r\n clusterPathFactory: IEntityFactory;\r\n experimentalMaterialFactory: IEntityFactory;\r\n experimentalResultFactory: IEntityFactory;\r\n experimentalToxicEffectFactory: IEntityFactory;\r\n exposureAdditionalMaterialFactory: IEntityFactory;\r\n exposureAdditionalMaterialSurveyFactory: IEntityFactory;\r\n exposureAdditionalMaterialSurveyMeasureFactory: IEntityFactory;\r\n exposureSurveyFactory: IEntityFactory;\r\n foodStatusFactory: IEntityFactory;\r\n fSAGFactory: IEntityFactory;\r\n houseStatusFactory: IEntityFactory;\r\n journalFactory: IEntityFactory;\r\n journalReserveFactory: IEntityFactory;\r\n journalSubscriptionFactory: IEntityFactory;\r\n materialAdditionalIdentifierFactory: IEntityFactory;\r\n materialComponentFactory: IEntityFactory;\r\n materialCompositionFactory: IEntityFactory;\r\n materialConsumptionFactory: IEntityFactory;\r\n materialExposureCustomSurveyMeasureFactory: IEntityFactory;\r\n materialExposureSurveyFactory: IEntityFactory;\r\n materialExposureSurveyIsomerFactory: IEntityFactory;\r\n materialExposureSurveyMeasureFactory: IEntityFactory;\r\n materialFSAGFactory: IEntityFactory;\r\n materialFactory: IEntityFactory;\r\n materialMonographFactory: IEntityFactory;\r\n materialRelationFactory: IEntityFactory;\r\n materialUsesFactory: IEntityFactory;\r\n nationalToxicologyProgramFactory: IEntityFactory;\r\n naturalOccurrenceDescriptorFactory: IEntityFactory;\r\n predictionFactory: IEntityFactory;\r\n projectFactory: IEntityFactory;\r\n rEACHRegistrationFactory: IEntityFactory;\r\n referenceFactory: IEntityFactory;\r\n referenceAuthorFactory: IEntityFactory;\r\n referenceRelationFactory: IEntityFactory;\r\n regulatoryStatusFactory: IEntityFactory;\r\n reportingOrganizationFactory: IEntityFactory;\r\n rifmDocumentFactory: IEntityFactory;\r\n rifmDocumentFolderFactory: IEntityFactory;\r\n rIFMProductFactory: IEntityFactory;\r\n rIFMProductLicenseFactory: IEntityFactory;\r\n rIFMReportFactory: IEntityFactory;\r\n specialLinkFactory: IEntityFactory;\r\n surveyReportedUseFactory: IEntityFactory;\r\n synonymFactory: IEntityFactory;\r\n typeCremeVersionFactory: IEntityFactory;\r\n typeExperimentVehicleFactory: IEntityFactory;\r\n typePredictionFactory: IEntityFactory;\r\n typePredictionClassFactory: IEntityFactory;\r\n typeReferenceRelationFactory: IEntityFactory;\r\n userAcknowledgementFactory: IEntityFactory;\r\n userChangeReportAuthorFactory: IEntityFactory;\r\n userChangeReportFactory: IEntityFactory;\r\n userChangeReportMaterialFactory: IEntityFactory;\r\n userChangeReportStudyFactory: IEntityFactory;\r\n userChangeReportTopicFactory: IEntityFactory;\r\n workflowRecordedActionFactory: IEntityFactory;\r\n workflowMaterialRecordedActionFactory: IEntityFactory;\r\n\r\n constructor(public _emProvider: EntityManagerProvider, public _userManager: UserManager, public _errorLogger: ErrorLogger) {\r\n this.analyticalResultRepository = this.createRepository('AnalyticalResult', 'Materials/AnalyticalResults');\r\n this.assessmentCategoryRepository = this.createRepository('AssessmentCategory', 'Misc/AssessmentCategories');\r\n this.announcementRepository = this.createRepository('Announcement', 'Misc/Announcements');\r\n this.bioDataStudySubTypeRepository = this.createRepository('BioDataStudySubType', 'BiologicalDatas/GetBioDataStudySubTypes' );\r\n this.biologicalDataRepository = this.createRepository('BiologicalData', 'BiologicalDatas/get');\r\n this.clusterGroupRepository = this.createRepository('ClusterGroup', 'MaterialClusters/ClusterGroups');\r\n this.clusterPathRepository = this.createRepository('ClusterPath', 'MaterialClusters/ClusterPaths');\r\n this.docUniqReferenceRepository = this.createRepository('DocUniqReference', 'References/DocUniqReferences');\r\n this.ecoSARToxicEffectRepository = this.createRepository('ECOSARToxicEffect', 'Materials/ECOSARToxicEffects');\r\n this.epiSuiteRepository = this.createRepository('EPISuite', 'Materials/EPISuites');\r\n this.experimentalMaterialRepository = this.createRepository('ExperimentalMaterial', 'Materials/ExperimentalMaterials');\r\n this.exposureAdditionalMaterialRepository = this.createRepository('ExposureAdditionalMaterial', 'ExposureSurveys/ExposureAdditionalMaterials');\r\n this.exposureSurveyRepository = this.createRepository('ExposureSurvey', 'ExposureSurveys/ExposureSurveys');\r\n this.exposureSurveyMaterialMostRecentRepository = this.createRepository('ExposureSurveyMaterialMostRecent',\r\n 'ExposureSurveys/ExposureSurveyMaterialMostRecents');\r\n this.fSAGRepository = this.createRepository('FSAG', 'Materials/FSAGs');\r\n this.foodStatusRepository = this.createRepository('FoodStatus', 'Materials/FoodStatuses');\r\n this.houseStatusRepository = this.createRepository('HouseStatus', 'Materials/HouseStatuses');\r\n this.labelingManualPublicationRepository = this.createRepository('LabelingManualPublication', 'Misc/LabelingManualPublications');\r\n this.materialAdditionalIdentifierRepository = this.createRepository('MaterialAdditionalIdentifier', 'Materials/MaterialAdditionalIdentifier');\r\n this.materialAlertRuleRepository = this.createRepository('MaterialAlertRule', 'Materials/MaterialAlertRules');\r\n this.materialComponentRepository = this.createRepository('MaterialComponent', 'Materials/MaterialComponents');\r\n this.materialCompositionRepository = this.createRepository('MaterialComposition', 'Materials/MaterialCompositions');\r\n this.materialConsumptionRepository = this.createRepository('MaterialConsumption', 'Materials/MaterialConsumptions');\r\n this.materialExpertPanelSummaryRepository = this.createRepository('MaterialExpertPanelSummary', 'Materials/MaterialExpertPanelSummaries');\r\n this.materialExposureSurveyRepository = this.createRepository('MaterialExposureSurvey', 'ExposureSurveys/MaterialExposureSurveys');\r\n this.materialExposureCustomSurveyMeasureRepository = this.createRepository('MaterialExposureCustomSurveyMeasure', 'ExposureSurveys/MaterialExposureCustomSurveyMeasuresByMaterialId');\r\n this.materialExposureSurveyIsomerRepository = this.createRepository('MaterialExposureSurveyIsomer', 'ExposureSurveys/MaterialExposureSurveyIsomersByMaterialId');\r\n this.materialExposureSurveyMeasureRepository = this.createRepository('MaterialExposureSurveyMeasure', 'ExposureSurveys/MaterialExposureSurveyMeasures');\r\n this.materialFSAGRepository = this.createRepository('MaterialFSAG', 'Materials/MaterialFSAGs');\r\n this.materialMonographRepository = this.createRepository('MaterialMonograph', 'Materials/MaterialMonographs');\r\n this.materialRelationRepository = this.createRepository('MaterialRelation', 'Materials/MaterialRelations');\r\n this.materialReciprocalRelationRepository = this.createRepository('MaterialRelation', 'Materials/ReciprocalMaterialRelations');\r\n this.materialRepository = this.createRepository('Material', 'Materials/Materials');\r\n this.materialUsesRepository = this.createRepository('MaterialUses', 'Materials/MaterialUseses');\r\n this.materialAssessmentCategoriesRepository = this.createRepository('MaterialAssessmentCategory', 'Material/MaterialAssessmentCategories');\r\n this.nationalToxicologyProgramRepository = this.createRepository('NationalToxicologyProgram', 'Materials/NationalToxicologyPrograms');\r\n this.naturalOccurrenceDescriptorRepository = this.createRepository('NaturalOccurrenceDescriptor', 'Materials/NaturalOccurrenceDescriptors');\r\n this.predictionRepository = this.createRepository('Prediction', 'Materials/Predictions');\r\n this.projectRepository = this.createRepository('Project', 'References/Projects');\r\n this.rEACHRegistrationRepository = this.createRepository('REACHRegistration', 'Materials/REACHRegistrations');\r\n this.reportingOrganizationRepository = this.createRepository('ReportingOrganization', 'MaterialReportedUses/ReportingOrganizations');\r\n this.rIFMProductLicenseRepository = this.createRepository('RIFMProductLicense', 'Misc/RIFMProductLicenses');\r\n this.rIFMProductRepository = this.createRepository('RIFMProduct', 'Misc/RIFMProducts');\r\n this.rIFMReportRepository = this.createRepository('RIFMReport', 'Misc/RIFMReports');\r\n this.referenceAuthorRepository = this.createRepository('ReferenceAuthor', 'References/ReferenceAuthors', false, 'author,reference');\r\n this.referenceRelationRepository = this.createRepository('ReferenceRelation', 'References/ReferenceRelations');\r\n this.referenceRepository = new ReferenceRepository(this._emProvider, 'Reference', '', 'References/get');\r\n this.regulatoryStatusRepository = this.createRepository('RegulatoryStatus', 'Materials/RegulatoryStatuses');\r\n this.rifmDocumentRepository = this.createRepository('RIFMDocument', 'DocumentManagement/RIFMDocuments');\r\n this.rifmDocumentFolderRepository = this.createRepository('RIFMDocumentFolder', 'DocumentManagement/RIFMDocumentFolders');\r\n this.specialLinkMaterialRepository = this.createRepository('SpecialLink', 'Materials/SpecialLinks');\r\n this.specialLinkReferenceRepository = this.createRepository('SpecialLink', 'References/SpecialLinks');\r\n this.surveyRepository = this.createRepository('Survey', 'Misc/Surveys');\r\n this.surveyAndCompanyRepository = this.createRepository('Survey', 'MaterialReportedUses/SurveyAndCompanies');\r\n this.surveyReportedUseRepository = this.createRepository('SurveyReportedUse', 'Misc/SurveyReportedUses');\r\n this.surveyUsesByMaterialAndYearRepository = this.createRepository('SurveyUsesByMaterialAndYear', 'Misc/SurveyUsesByMaterialAndYear');\r\n this.surveyWhoUsedMostRepository = this.createRepository('SurveyWhoUsedMostMaterial', 'MaterialReportedUses/SurveyWhoUsedMostMaterials');\r\n this.synonymRepository = this.createRepository('Synonym', 'Materials/Synonyms');\r\n this.userChangeReportRepository = this.createRepository('UserChangeReport', 'Misc/UserChangeReports');\r\n this.userAcknowledgementRepository = this.createRepository('UserAcknowledgement', 'Misc/UserAcknowledgement');\r\n this.workflowRecordedActionRepository = this.createRepository('WorkflowRecordedAction', 'Misc/WorkflowRecordedAction');\r\n this.workflowMaterialRecordedActionRepository = this.createRepository('WorkflowMaterialRecordedAction', 'Misc/WorkflowMaterialRecordedAction');\r\n\r\n // Not all lookup tables have ( or need ) a Repository\r\n this.typeAlertRuleRepository = this.createRepository('TypeAlertRule', 'Lookups', true);\r\n this.typeAnalyticalProcedureRepository = this.createRepository('TypeAnalyticalProcedure', 'Lookups', true);\r\n this.typeBotanicalSubdivisionRepository = this.createRepository('TypeBotanicalSubdivision', 'Lookups', true);\r\n this.typeChangeReportFrequencyRespository = this.createRepository('TypeChangeReportFrequency', 'Lookups', true);\r\n this.typeChangeReportTopicRepository = this.createRepository('TypeChangeReportTopic', 'Lookups', true);\r\n this.typeComplianceGuidelineRepository = this.createRepository('TypeComplianceGuideline', 'Misc/TypeComplianceGuidelines');\r\n this.typeCremeVersionRepository = this.createRepository('TypeCremeVersion', 'Lookups', true);\r\n this.typeEPISuiteCategoryRepository = this.createRepository('TypeEPISuiteCategory', 'Lookups', true);\r\n this.typeEPISuiteParameterRepository = this.createRepository('TypeEPISuiteParameter', 'Lookups', true);\r\n this.typeEssentialOilRepository = this.createRepository('TypeEssentialOil', 'Lookups', true);\r\n this.typeExposureMeasureRepository = this.createRepository('TypeExposureMeasure', 'Lookups', true);\r\n this.typeExposureMeasureValueRepository = this.createRepository('TypeExposureMeasureValue', 'Lookups', true);\r\n this.typeExposureSurveyResponseRepository = this.createRepository('TypeExposureSurveyResponse', 'Lookups', true);\r\n this.typeExperimentVehicleRepository = this.createRepository('TypeExperimentVehicle', 'Lookups', true);\r\n this.typeExposureSurveyStatusRepository = this.createRepository('TypeExposureSurveyStatus', 'Lookups', true);\r\n this.typeFoodCategoryRepository = this.createRepository('TypeFoodCategory', 'Lookups', true);\r\n this.typeGeographicalAreaRepository = this.createRepository('TypeGeographicalArea', 'Lookups', true);\r\n this.typeJournalSubscriptionRepository = this.createRepository('TypeJournalSubscription', 'Misc/TypeJournalSubscriptions');\r\n this.typeKeywordRepository = this.createRepository('TypeKeyword', 'Lookups', true);\r\n this.typeKlimischRepository = this.createRepository('TypeKlimisch', 'Lookups', true);\r\n this.typeLinkTargetRepository = this.createRepository('TypeLinkTarget', 'Lookups', true);\r\n this.typeMaterialComponentClassRepository = this.createRepository('TypeMaterialComponentClass', 'Lookups', true);\r\n this.typeMaterialIdentifierRepository = this.createRepository('TypeMaterialIdentifier', 'Lookups', true);\r\n this.typeMaterialRelationRepository = this.createRepository('TypeMaterialRelation', 'Lookups', true);\r\n this.typeMaterialUnitRepository = this.createRepository('TypeMaterialUnit', 'Misc/TypeMaterialUnits');\r\n this.typeNTPStatusRepository = this.createRepository('TypeNTPStatus', 'Lookups', true);\r\n this.typeNaturalOccurrenceRepository = this.createRepository('TypeNaturalOccurrence', 'Lookups', true);\r\n this.typePredictionClassRepository = this.createRepository('TypePredictionClass', 'Lookups', true);\r\n this.typePredictionRepository = this.createRepository('TypePrediction', 'Lookups', true);\r\n this.typePublicationRepository = this.createRepository('TypePublication', 'Lookups', true);\r\n this.typeREACHTonnageBandRepository = this.createRepository('TypeREACHTonnageBand', 'Lookups', true);\r\n this.typeReferenceRelationRepository = this.createRepository('TypeReferenceRelation', 'Misc/TypeReferenceRelations');\r\n this.typeRegulatoryStatusRepository = this.createRepository('TypeRegulatoryStatus', 'Lookups', true);\r\n this.typeRIFMDocumentRepository = this.createRepository('TypeRIFMDocument', 'Lookups', true);\r\n this.typeRouteRepository = this.createRepository('TypeRoute', 'Lookups', true);\r\n this.typeSearchRepository = this.createRepository('TypeSearch', 'Lookups', true);\r\n this.typeSearchServiceRepository = this.createRepository('TypeSearchService', 'Lookups', true);\r\n this.typeSpeciesRepository = this.createRepository('TypeSpecies', 'Lookups', true);\r\n this.typeStudyRepository = this.createRepository('TypeStudy', 'Lookups', true);\r\n this.typeStudyMixtureRepository = this.createRepository('TypeStudyMixture', 'Lookups', true);\r\n this.typeStudyDesignationRepository = this.createRepository('TypeStudyDesignation', 'Misc/TypeStudyDesignations');\r\n this.typeStudySubTypeRepository = this.createRepository('TypeStudySubType', 'Lookups', true);\r\n this.typeSynonymUseRepository = this.createRepository('TypeSynonymUse', 'Lookups', true);\r\n this.typeTimeUnitRepository = this.createRepository('TypeTimeUnit', 'Lookups', true);\r\n this.typeToxicEffectRepository = this.createRepository('TypeToxicEffect', 'Lookups', true);\r\n this.typeTSCAClassRepository = this.createRepository('TypeTSCAClass', 'Lookups', true);\r\n this.typeUnitRepository = this.createRepository('TypeUnit', 'Lookups', true);\r\n this.typeUsefulnessRepository = this.createRepository('TypeUsefulness', 'Lookups', true);\r\n this.typeWorkflowActionRepository = this.createRepository('TypeWorkflowAction', 'Lookups', true);\r\n this.typeWorkflowActionTransitionRepository = this.createRepository('TypeWorkflowActionTransition', 'Lookups', true);\r\n this.typeWorkflowContactRepository = this.createRepository('TypeWorkflowContact', 'Lookups', true);\r\n this.typeWorkflowMaterialActionRepository = this.createRepository('TypeWorkflowMaterialAction', 'Lookups', true);\r\n this.typeWorkflowMaterialActionTransitionRepository = this.createRepository('TypeWorkflowMaterialActionTransition', 'Lookups', true);\r\n\r\n this.abstractFactory = this.createFactory('Abstract');\r\n this.analyticalResultFactory = this.createFactory('AnalyticalResult');\r\n this.announcementFactory = this.createFactory('Announcement');\r\n this.assessmentCategoryFactory = this.createFactory('AssessmentCategory');\r\n this.authorFactory = this.createFactory('Author');\r\n this.bioDataStudySubTypeFactory = this.createFactory('BioDataStudySubType');\r\n this.biologicalDataFactory = this.createFactory('BiologicalData');\r\n this.experimentalMaterialFactory = this.createFactory('ExperimentalMaterial');\r\n this.experimentalResultFactory = this.createFactory('ExperimentalResult');\r\n this.experimentalToxicEffectFactory = this.createFactory('ExperimentalToxicEffect');\r\n this.exposureAdditionalMaterialFactory = this.createFactory('ExposureAdditionalMaterial');\r\n this.exposureAdditionalMaterialSurveyFactory = this.createFactory('ExposureAdditionalMaterialSurvey');\r\n this.exposureAdditionalMaterialSurveyMeasureFactory = this.createFactory('ExposureAdditionalMaterialSurveyMeasure');\r\n this.exposureSurveyFactory = this.createFactory('ExposureSurvey');\r\n this.foodStatusFactory = this.createFactory('FoodStatus');\r\n this.fSAGFactory = this.createFactory('FSAG');\r\n this.houseStatusFactory = this.createFactory('HouseStatus');\r\n this.journalFactory = this.createFactory('Journal');\r\n this.journalReserveFactory = this.createFactory('JournalReserve');\r\n this.journalSubscriptionFactory = this.createFactory('JournalSubscription');\r\n this.materialAdditionalIdentifierFactory = this.createFactory('MaterialAdditionalIdentifier');\r\n this.materialFSAGFactory = this.createFactory('MaterialFSAG');\r\n this.materialFactory = this.createFactory('Material');\r\n this.materialComponentFactory = this.createFactory('MaterialComponent');\r\n this.materialCompositionFactory = this.createFactory('MaterialComposition');\r\n this.materialConsumptionFactory = this.createFactory('MaterialConsumption');\r\n this.materialMonographFactory = this.createFactory('MaterialMonograph');\r\n this.materialRelationFactory = this.createFactory('MaterialRelation');\r\n this.materialExposureCustomSurveyMeasureFactory = this.createFactory('MaterialExposureCustomSurveyMeasure');\r\n this.materialExposureSurveyFactory = this.createFactory('MaterialExposureSurvey');\r\n this.materialExposureSurveyIsomerFactory = this.createFactory('MaterialExposureSurveyIsomer');\r\n this.materialExposureSurveyMeasureFactory = this.createFactory('MaterialExposureSurveyMeasure');\r\n this.materialUsesFactory = this.createFactory('MaterialUses');\r\n this.nationalToxicologyProgramFactory = this.createFactory('NationalToxicologyProgram');\r\n this.naturalOccurrenceDescriptorFactory = this.createFactory('NaturalOccurrenceDescriptor');\r\n this.predictionFactory = this.createFactory('Prediction');\r\n this.projectFactory = this.createFactory('Project');\r\n this.rEACHRegistrationFactory = this.createFactory('REACHRegistration');\r\n this.referenceAuthorFactory = this.createFactory('ReferenceAuthor');\r\n this.reportingOrganizationFactory = this.createFactory('ReportingOrganization');\r\n this.rifmDocumentFactory = this.createFactory('RIFMDocument');\r\n this.rifmDocumentFolderFactory = this.createFactory('RIFMDocumentFolder');\r\n this.rIFMProductFactory = this.createFactory('RIFMProduct');\r\n this.rIFMProductLicenseFactory = this.createFactory('RIFMProductLicense');\r\n this.referenceFactory = this.createFactory('Reference');\r\n this.referenceRelationFactory = this.createFactory('ReferenceRelation');\r\n this.regulatoryStatusFactory = this.createFactory('RegulatoryStatus');\r\n this.specialLinkFactory = this.createFactory('SpecialLink');\r\n this.surveyReportedUseFactory = this.createFactory('SurveyReportedUse');\r\n this.synonymFactory = this.createFactory('Synonym');\r\n this.typeCremeVersionFactory = this.createFactory('TypeCremeVersion');\r\n this.typeExperimentVehicleFactory = this.createFactory('TypeExperimentVehicle');\r\n this.typePredictionFactory = this.createFactory('TypePrediction');\r\n this.typePredictionClassFactory = this.createFactory('TypePredictionClass');\r\n this.typeReferenceRelationFactory = this.createFactory('TypeReferenceRelation');\r\n this.userAcknowledgementFactory = this.createFactory('UserAcknowledgement');\r\n this.userChangeReportAuthorFactory = this.createFactory('UserChangeReportAuthor');\r\n this.userChangeReportFactory = this.createFactory('UserChangeReport');\r\n this.userChangeReportMaterialFactory = this.createFactory('UserChangeReportMaterial');\r\n this.userChangeReportTopicFactory = this.createFactory('UserChangeReportTopic');\r\n this.userChangeReportStudyFactory = this.createFactory('UserChangeReportStudy');\r\n this.workflowMaterialRecordedActionFactory = this.createFactory('WorkflowMaterialRecordedAction');\r\n this.workflowRecordedActionFactory = this.createFactory('WorkflowRecordedAction');\r\n\r\n }\r\n\r\n createRepository(entityTypeName: string, resourceName: string, isCached: boolean = false, expand: string = '') {\r\n return new Repository(this._emProvider, entityTypeName, expand, resourceName, isCached);\r\n }\r\n\r\n createFactory(entityTypeName: string) {\r\n return new EntityFactory(entityTypeName, this._emProvider);\r\n }\r\n\r\n clearEntityManager() {\r\n this._emProvider.newManager();\r\n }\r\n\r\n fetch(resourceName: string, params: {}): Promise {\r\n const manager = this._emProvider.manager();\r\n const query = EntityQuery\r\n .from(resourceName)\r\n .withParameters(params);\r\n const p = >manager.executeQuery(query.using(FetchStrategy.FromServer));\r\n return p.then(data => {\r\n return data.results;\r\n }).catch(e => {\r\n this._errorLogger.log(e, 'E');\r\n throw e;\r\n });\r\n }\r\n\r\n fetchTyped(resourceName: string, type: { new(): T; }, params: {}): Promise {\r\n return this.fetch(resourceName, params).then(r => {\r\n return r;\r\n });\r\n }\r\n\r\n hasChanges(): boolean {\r\n return this._emProvider.manager().hasChanges();\r\n }\r\n\r\n getChanges(args?: any) {\r\n return this._emProvider.manager().getChanges(args);\r\n }\r\n\r\n commit(): Promise {\r\n const saveOptions = new SaveOptions({ resourceName: 'savechanges' });\r\n\r\n this.processAuditFields();\r\n const p = >this._emProvider.manager().saveChanges(null, saveOptions);\r\n return p.then((saveResult) => {\r\n return saveResult;\r\n }).catch(e => {\r\n this._errorLogger.log(e, 'E');\r\n // rethrow...\r\n throw e;\r\n });\r\n }\r\n\r\n commitSelected(entities: Entity[]) {\r\n const saveOptions = new SaveOptions({ resourceName: 'savechanges' });\r\n\r\n this.processAuditFields(entities);\r\n\r\n return this._emProvider.manager().saveChanges(entities, saveOptions)\r\n .then((saveResult) => {\r\n\r\n }).catch(e => {\r\n this._errorLogger.log(e, 'E');\r\n // rethrow...\r\n throw e;\r\n });\r\n }\r\n\r\n processAuditFields(entities?: Entity[]) {\r\n const currentUserName = this._userManager.currentUser.name;\r\n const changedEntities = entities || this._emProvider.manager().getChanges();\r\n changedEntities.forEach(e => {\r\n const entityState = e.entityAspect.entityState;\r\n if (entityState.isAdded()) {\r\n e['created'] = new Date();\r\n e['createdUser'] = currentUserName;\r\n }\r\n if (entityState.isModified() || entityState.isAdded()) {\r\n e['modified'] = new Date();\r\n e['modifyUser'] = currentUserName;\r\n }\r\n // var rv = e['rowVersion'];\r\n // e['rowVersion'] = rv != null ? rv+1 : 0;\r\n });\r\n }\r\n\r\n rollback(): void {\r\n this._emProvider.manager().rejectChanges();\r\n }\r\n}\r\n\r\nexport class TypedQuery {\r\n private _query: EntityQuery;\r\n private _manager: EntityManager;\r\n\r\n constructor(\r\n protected _type: { new(): T; } = null,\r\n protected _resourceName: string = null,\r\n protected _uow: UnitOfWork = null\r\n ) {\r\n // for clone\r\n if (_type == null && _resourceName == null) {\r\n return;\r\n }\r\n this._manager = _uow._emProvider.manager();\r\n if (_type != null) {\r\n // const entityTypeName = _type.name;\r\n // const entityType = this._manager.metadataStore.getEntityType(entityTypeName);\r\n const entityType = _type.prototype.entityType;\r\n if (!entityType) {\r\n throw new Error(_type.name + ' does not exist! Query must be created for an existing entity type!');\r\n }\r\n if (!this._resourceName) {\r\n this._resourceName = entityType.defaultResourceName;\r\n }\r\n }\r\n this._query = EntityQuery.from(this._resourceName);\r\n }\r\n\r\n where(predicate: any): TypedQuery {\r\n const q = this.clone();\r\n q._query = q._query.where(predicate);\r\n return q;\r\n }\r\n\r\n withParameters(params: any): TypedQuery {\r\n const q = this.clone();\r\n params = extend(q._query.parameters, params);\r\n q._query = q._query.withParameters(params);\r\n return q;\r\n }\r\n\r\n expand(propertyPaths: any) {\r\n const q = this.clone();\r\n q._query = q._query.expand(propertyPaths);\r\n return q;\r\n }\r\n\r\n using(x: any) {\r\n const q = this.clone();\r\n q._query = q._query.using(x);\r\n return q;\r\n }\r\n\r\n executeRaw(): Promise {\r\n const p = >this._manager.executeQuery(this._query);\r\n return p.then(data => {\r\n return data;\r\n });\r\n }\r\n\r\n execute(): Promise {\r\n const p = >this._manager.executeQuery(this._query);\r\n return p.then(data => {\r\n return data.results;\r\n });\r\n }\r\n\r\n /** execute query to return only the count of entities */\r\n executeCount(): Promise {\r\n const cq = this._query.take(0).inlineCount(true);\r\n const p = >this._manager.executeQuery(cq);\r\n return p.then(data => {\r\n return data.inlineCount;\r\n });\r\n }\r\n\r\n skip(count: number) {\r\n const q = this.clone();\r\n q._query = q._query.skip(count);\r\n return q;\r\n }\r\n\r\n take(count: number) {\r\n const q = this.clone();\r\n q._query = q._query.take(count);\r\n return q;\r\n }\r\n\r\n inlineCount(enabled: boolean) {\r\n const q = this.clone();\r\n q._query = q._query.inlineCount(enabled);\r\n return q;\r\n }\r\n\r\n orderBy(prop: string, isDescending = false) {\r\n const q = this.clone();\r\n q._query = q._query.orderBy(prop, isDescending);\r\n return q;\r\n }\r\n\r\n orderByDesc(prop: string) {\r\n return this.orderBy(prop, true);\r\n }\r\n\r\n noTracking() {\r\n const q = this.clone();\r\n q._query = q._query.noTracking();\r\n return q;\r\n }\r\n\r\n private clone() {\r\n const q = new TypedQuery();\r\n q._query = this._query;\r\n q._manager = this._manager;\r\n q._type = this._type;\r\n q._resourceName = this._resourceName;\r\n q._uow = this._uow;\r\n return q;\r\n }\r\n}\r\n","import {Injectable, Component } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { Journal} from '../entities/Journal';\r\nimport { Material} from '../entities/Material';\r\nimport { Reference} from '../entities/Reference';\r\nimport { YesNoComponent } from '../components/main/yes-no.component';\r\nimport { ExceptionDialogComponent } from '../components/main/exception-dialog.component';\r\nimport { UserManager} from './user-manager';\r\nimport { UtilFns } from '../utils/util-fns';\r\n\r\n\r\n@Injectable()\r\nexport class StateMap {\r\n _currentJournal: Journal;\r\n _currentMaterial: Material;\r\n _currentReference: Reference;\r\n _currentRouteName: string;\r\n _journalDataMap: {} = {};\r\n _hasMaterialDataMap: {} = {};\r\n _hasReferenceDataMap: {} = {};\r\n\r\n _map: Object = {};\r\n\r\n _retMap: Object = {};\r\n errors: any[] = [];\r\n _nextRetId = 1;\r\n _firstRetId = 1;\r\n\r\n constructor(public _userManager: UserManager) {\r\n }\r\n\r\n get versionNo() {\r\n return (UserManager.versionNo);\r\n }\r\n\r\n get shortVersionNo() {\r\n return (UserManager.versionNo.split('.').slice(0, -1).join('.'));\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n get currentJournal() {\r\n return this._currentJournal;\r\n }\r\n set currentJournal(value: Journal) {\r\n this._currentJournal = value;\r\n this._journalDataMap = {};\r\n }\r\n\r\n get currentMaterial() {\r\n return this._currentMaterial;\r\n }\r\n set currentMaterial(value: Material) {\r\n this._currentMaterial = value;\r\n this._hasMaterialDataMap = {};\r\n }\r\n\r\n public documentManagementArchiveUrl: string;\r\n public documentManagementUrl: string;\r\n public documentManagementBaseUrl: string;\r\n public documentManagementReferenceId: number;\r\n\r\n public staffJournalId: number;\r\n public staffMaterialId: number;\r\n public staffReferenceId: number;\r\n\r\n get currentReference() {\r\n return this._currentReference;\r\n }\r\n set currentReference(value: Reference) {\r\n this._currentReference = value;\r\n this._hasReferenceDataMap = {};\r\n }\r\n\r\n public hasJournalDataFor(key: string) {\r\n const r = this._journalDataMap[key];\r\n return (r != undefined);\r\n }\r\n\r\n public hasMaterialDataFor(key: string) {\r\n const r = this._hasMaterialDataMap[key];\r\n if (r == undefined) {\r\n return true;\r\n } else {\r\n return r;\r\n }\r\n }\r\n\r\n public hasReferenceDataFor(key: string) {\r\n const r = this._hasReferenceDataMap[key];\r\n if (r == undefined) {\r\n return true;\r\n } else {\r\n return r;\r\n }\r\n }\r\n\r\n public getJournalDataFor(key: string) {\r\n return this._journalDataMap[key];\r\n }\r\n\r\n public setJournalDataFor(key: string, value: any) {\r\n this._journalDataMap[key] = value;\r\n }\r\n\r\n public setHasMaterialDataFor(key: string, value: boolean) {\r\n this._hasMaterialDataMap[key] = value;\r\n }\r\n\r\n public setHasReferenceDataFor(key: string, value: boolean) {\r\n this._hasReferenceDataMap[key] = value;\r\n }\r\n\r\n get currentUser() {\r\n return this._userManager && this._userManager.currentUser;\r\n }\r\n\r\n get(key: any) {\r\n const skey = this.keyToString(key);\r\n return this._map[skey];\r\n }\r\n\r\n set(key: Object, value: Object, altKey?: string) {\r\n const skey = this.keyToString(key);\r\n this._map[skey] = value;\r\n if (altKey) {\r\n this._map[this.keyToString(altKey)] = value;\r\n }\r\n }\r\n\r\n getLastRetId() {\r\n return this._nextRetId - 1;\r\n }\r\n\r\n keyToString(key: Object): string {\r\n let skey: string;\r\n if (typeof(key) == 'string') {\r\n skey = key;\r\n } else if (typeof(key) == 'object') {\r\n skey = JSON.stringify(key);\r\n } else {\r\n // can't get here...\r\n // skey = key.toString();\r\n }\r\n return skey;\r\n }\r\n\r\n public storeRetState(obj: any, id?: number): number {\r\n if (id) {\r\n this._retMap[id] = obj;\r\n return id;\r\n } else {\r\n this.checkRetMapSize();\r\n this._retMap[this._nextRetId] = obj;\r\n this._nextRetId++;\r\n return this._nextRetId - 1;\r\n }\r\n }\r\n\r\n checkRetMapSize() {\r\n if ((this._nextRetId - this._firstRetId) > 20) {\r\n delete this._retMap[this._firstRetId];\r\n this._firstRetId++;\r\n }\r\n }\r\n\r\n public getRetState(key: number): {} {\r\n return this._retMap[key];\r\n }\r\n\r\n\r\n public get currentRouteName() {\r\n return this._currentRouteName;\r\n }\r\n public set currentRouteName(r) {\r\n setTimeout( () => this._currentRouteName = r, 0);\r\n }\r\n public yesNoComponent: YesNoComponent;\r\n public exceptionDialog: ExceptionDialogComponent;\r\n\r\n\r\n}\r\n\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { environment } from '../../environments/environment';\r\n\r\n@Injectable()\r\nexport class MolImageService {\r\n\r\n constructor(public _http: HttpClient) {\r\n }\r\n\r\n\r\n public getMaterialImage(materialId: number): Promise {\r\n const url = this.getImageUrlForMaterial(materialId);\r\n return this._http.get(url)\r\n .toPromise()\r\n .catch(() => {\r\n });\r\n }\r\n\r\n public getBase32SmileUrl(materialId: number): Promise {\r\n const url = `${environment.appUrl}/breeze/MolImage/Base32SmileByMaterial?id=${materialId}`;\r\n return this._http.get(url)\r\n .toPromise()\r\n .then(r => {\r\n if (r) {\r\n return `${environment.appUrl}/cache/${r}.png`;\r\n }\r\n return null;\r\n })\r\n .catch(() => {\r\n });\r\n }\r\n\r\n public getImageUrlForMaterial(materialId: number) {\r\n return `${environment.appUrl}/breeze/MolImage/ByMaterial?id=${materialId}`;\r\n }\r\n\r\n public getImageUrlForSmile(smile: string) {\r\n return `${environment.appUrl}/breeze/MolImage/BySmile?smile=${smile}`;\r\n }\r\n\r\n public getMoleculeFromMaterial(materialId: number): Promise {\r\n const url = `${environment.appUrl}/breeze/MolImage/MoleculeFromMaterial?materialId=${materialId}`;\r\n return this._http.get(url)\r\n .toPromise()\r\n .catch(() => {\r\n });\r\n }\r\n\r\n public getBase32SmileUrlWithSize(materialId: number, size: string): Promise {\r\n const url = `${environment.appUrl}/breeze/MolImage/Base32SmileByMaterial?id=` + materialId + '&size=' + size;\r\n return this._http.get(url)\r\n .toPromise()\r\n .then(r => {\r\n if (r) {\r\n return `${environment.appUrl}/cache/${r}.png`;\r\n }\r\n return null;\r\n }).catch(er => { });\r\n }\r\n\r\n public getImageUrlForMaterialWithSize(materialId: number, imageSize: string) {\r\n return 'breeze/MolImage/ByMaterial?id=' + materialId + '&size=' + imageSize;\r\n }\r\n\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { UnitOfWork } from './unit-of-work';\r\nimport { UserManager } from './user-manager';\r\nimport { UtilFns } from '../utils/common';\r\n\r\nimport { MaterialListItem } from '../entities/projections/MaterialListItem';\r\nimport { ReferenceListItem } from '../entities/projections/ReferenceListItem';\r\n\r\nexport interface IMaterialSearchResult {\r\n searchType: string;\r\n searchTerm: string;\r\n searchDescription: string;\r\n materials: MaterialListItem[];\r\n relatedMonographNumbers: number[];\r\n totalCount: number;\r\n materialSearchCode: string;\r\n pageSize: number;\r\n pageNumber: number;\r\n}\r\n\r\nexport interface IReferenceSearchResult {\r\n searchType: string;\r\n searchTerm: string;\r\n searchDescription: string;\r\n references: ReferenceListItem[];\r\n totalCount: number;\r\n referenceSearchCode: string;\r\n pageSize: number;\r\n pageNumber: number;\r\n}\r\n\r\ninterface IMaterialSearchParams {\r\n searchTerm: string;\r\n searchType: string;\r\n pageNumber: number;\r\n pageSize: number;\r\n}\r\n\r\ninterface IReferenceSearchParams {\r\n searchTerm: string;\r\n searchType: string;\r\n pageNumber: number;\r\n pageSize: number;\r\n}\r\n\r\nenum FoundInCode {\r\n FEMA,\r\n RIFM_ID,\r\n Internal_Material_Notes,\r\n CAS,\r\n Matching_RIFM_ID,\r\n Alternate_CAS,\r\n EINECS,\r\n ECN,\r\n Synonym,\r\n Regulatory_Agency,\r\n Alternative_Identifier,\r\n ECNo,\r\n MaterialId,\r\n Second_Round_NCS\r\n}\r\n\r\nenum FoundInReferenceCode {\r\n Abstracts,\r\n Author,\r\n Brief_Reference,\r\n Compliance,\r\n Contractor_Id,\r\n Govt_Doc_Number,\r\n Govt_Sponsor,\r\n Journal,\r\n Journal_Detail,\r\n Protocols,\r\n Title,\r\n ReferenceId,\r\n SearchAll,\r\n Sponsoring_Company,\r\n Staff_Comments\r\n}\r\n\r\n@Injectable()\r\nexport class SearchService {\r\n\r\n _materialSearchCodeMap: {} = {\r\n SearchFEMAorMonograph: 'FEMA/Base RIFM ID',\r\n SearchRIFMId: 'RIFM ID',\r\n SearchCAS: 'CAS/EINECS/ECN/EC No. and associated materials with same RIFM ID',\r\n SearchSynonymsPlus: 'Synonym or Regulatory Agency',\r\n SearchSafetyAssessments: 'Safety Assessments',\r\n SearchFFIDS: 'FFIDS',\r\n SearchSynonyms: 'Synonym',\r\n SearchRegulatory: 'Regulatory Agency',\r\n SearchMaterialId: 'MaterialId',\r\n SearchInternalMaterialNotes: 'Internal Material Notes',\r\n SearchSecondRoundNCS: 'Second Round NCS'\r\n };\r\n\r\n _referenceSearchCodeMap: {} = {\r\n SearchAbstracts: 'Abstracts',\r\n SearchAuthors: 'Authors',\r\n SearchBriefReferences: 'Brief Reference',\r\n SearchCompliance: 'Compliance',\r\n SearchContractorId: 'Contractor Id',\r\n SearchGovDocNumber: 'Govt. Document #',\r\n SearchGovSponsor: 'Govt. Sponsor',\r\n SearchJournalDetail: 'Journal Detail',\r\n SearchJournals: 'Journals',\r\n SearchProtocols: 'Protocols',\r\n SearchSponsoringCompany: 'Sponsoring Company',\r\n SearchStaffComments: 'Staff Comments',\r\n SearchTitles: 'Title',\r\n SearchAll: 'All'\r\n };\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager) {\r\n\r\n }\r\n\r\n search(searchTerm: string, searchType: string, pageSize: number): Promise {\r\n const params = { searchTerm: UtilFns.encodeHackForAnd(searchTerm), searchType: searchType, pageSize: pageSize };\r\n return this._uow.fetch('search', params)\r\n .then(r => {\r\n const sr = r[0];\r\n sr.materialSearchResult = this.resolveMaterialSearchResult(sr.materialSearchResult);\r\n sr.referenceSearchResult = this.resolveReferenceSearchResult(sr.referenceSearchResult);\r\n return sr;\r\n });\r\n }\r\n\r\n fetchMaterialsPage(params: IMaterialSearchParams): Promise {\r\n if (params.searchTerm) {\r\n params.searchTerm = UtilFns.encodeHackForAnd(params.searchTerm);\r\n }\r\n return this._uow.fetch('fetchMaterialsPage', params).then(r => {\r\n return this.resolveMaterialSearchResult(r[0]);\r\n });\r\n }\r\n\r\n fetchReferencesPage(params: IReferenceSearchParams): Promise {\r\n if (params.searchTerm) {\r\n params.searchTerm = UtilFns.encodeHackForAnd(params.searchTerm);\r\n }\r\n return this._uow.fetch('fetchReferencesPage', params).then(r => {\r\n return this.resolveReferenceSearchResult(r[0]);\r\n });\r\n }\r\n\r\n // Try 136-G2-30 -> uses SearchRIFMId\r\n // or 34902-57-3 ( uses SearchCAS and returns a matching RIFM_ID )\r\n resolveMaterialSearchResult(sr: IMaterialSearchResult) {\r\n const user = this._userManager.currentUser;\r\n sr.searchDescription = this._materialSearchCodeMap[sr.materialSearchCode];\r\n\r\n const searchTerm = sr.searchTerm;\r\n const monographNumbers = sr.relatedMonographNumbers;\r\n sr.materials.forEach(m => {\r\n\r\n const locs: FoundInCode[] = [];\r\n if (sr.materialSearchCode == 'SearchFEMAorMonograph') {\r\n if ((m.fEMANumber || '').toString() == searchTerm) {\r\n locs.push(FoundInCode.FEMA);\r\n m.foundText = m.fEMANumber.toString();\r\n } else if ((m.monographNumber || '').toString() == searchTerm) {\r\n locs.push(FoundInCode.RIFM_ID);\r\n m.foundText = m.monographNumber.toString();\r\n } else if (locs.length == 0) {\r\n locs.push(FoundInCode.Internal_Material_Notes);\r\n m.foundText = '{not retrieved}';\r\n }\r\n } else if (sr.materialSearchCode == 'SearchCAS') {\r\n if ((m.realCASNumber || '').indexOf(searchTerm) >= 0) {\r\n locs.push(FoundInCode.CAS);\r\n m.foundText = m.realCASNumber;\r\n } else if ((m.alternateCASNumber || '').indexOf(searchTerm) != -1) {\r\n locs.push(FoundInCode.Alternate_CAS);\r\n m.foundText = m.alternateCASNumber;\r\n } else if ((m.eINECSNumber || '').indexOf(searchTerm) != -1) {\r\n locs.push(FoundInCode.EINECS);\r\n m.foundText = m.eINECSNumber;\r\n } else if ((m.eCNNumber || '').indexOf(searchTerm) != -1) {\r\n locs.push(FoundInCode.ECN);\r\n m.foundText = m.eCNNumber;\r\n } else if ((m.eCInventoryNumber || '').indexOf(searchTerm) != -1) {\r\n locs.push(FoundInCode.ECNo);\r\n m.foundText = m.eCInventoryNumber;\r\n } else if (m.alternativeIdFound) {\r\n locs.push(FoundInCode.Alternative_Identifier);\r\n m.foundText = searchTerm;\r\n } else if (user.isStaff && (m.internalMaterialNotes != null)) {\r\n if (m.internalMaterialNotes.toLowerCase().indexOf(searchTerm.toLowerCase()) != -1) {\r\n locs.push(FoundInCode.Internal_Material_Notes);\r\n m.foundText = '{not retrieved}';\r\n }\r\n } else if (locs.length == 0 && monographNumbers != null && monographNumbers.indexOf(m.monographNumber) != -1) {\r\n locs.push(FoundInCode.Matching_RIFM_ID);\r\n m.foundText = m.monographNumber.toString();\r\n }\r\n } else if (sr.materialSearchCode == 'SearchRIFMId') {\r\n if ((m.formattedRifmId || '').toLowerCase().indexOf(searchTerm.toLowerCase()) != -1) {\r\n locs.push(FoundInCode.RIFM_ID);\r\n m.foundText = m.formattedRifmId;\r\n } else if ((m.synonymFound || '').toLowerCase().indexOf(searchTerm.toLowerCase()) != -1) {\r\n locs.push(FoundInCode.Synonym);\r\n m.foundText = m.synonymFound;\r\n }\r\n } else if (sr.materialSearchCode == 'SearchSynonymsPlus') {\r\n if ((m.synonymFound || '').toLowerCase().indexOf(searchTerm.toLowerCase()) != -1) {\r\n locs.push(FoundInCode.Synonym);\r\n m.foundText = m.synonymFound;\r\n } else if (user.isStaff && (m.internalMaterialNotes != null) && (m.internalMaterialNotes.toLowerCase().indexOf(searchTerm.toLowerCase()) != -1)) {\r\n locs.push(FoundInCode.Internal_Material_Notes);\r\n m.foundText = '{not retrieved}';\r\n } else {\r\n locs.push(FoundInCode.Regulatory_Agency);\r\n m.foundText = '{not retrieved}';\r\n }\r\n } else if (sr.materialSearchCode == 'SearchSynonyms') {\r\n if ((m.synonymFound || '').toLowerCase().indexOf(searchTerm.toLowerCase()) != -1) {\r\n locs.push(FoundInCode.Synonym);\r\n m.foundText = m.synonymFound;\r\n }\r\n } else if (sr.materialSearchCode == 'SearchRegulatory') {\r\n locs.push(FoundInCode.Regulatory_Agency);\r\n m.foundText = '{not retrieved}';\r\n } else if (sr.materialSearchCode == 'SearchMaterialId') {\r\n locs.push(FoundInCode.MaterialId);\r\n m.foundText = m.materialId.toString();\r\n } else if (sr.materialSearchCode == 'SearchInternalMaterialNotes') {\r\n if (user.isStaff && (m.internalMaterialNotes != null)) {\r\n if (m.internalMaterialNotes.toLowerCase().indexOf(searchTerm.toLowerCase()) != -1) {\r\n locs.push(FoundInCode.Internal_Material_Notes);\r\n m.foundText = '{not retrieved}';\r\n }\r\n }\r\n } else if (sr.materialSearchCode == 'SearchSecondRoundNCS') {\r\n if (user.isStaff && (m.secondRoundNCS == true)) {\r\n locs.push(FoundInCode.Second_Round_NCS);\r\n m.foundText = 'Second Round NCS';\r\n }\r\n }\r\n const tmps = locs.map(l => _.replace(FoundInCode[l], new RegExp('_', 'g'), ' '));\r\n m.searchResolution = tmps.join(', ');\r\n });\r\n return sr;\r\n }\r\n\r\n public getMaterialSearchDescription() {\r\n // undefined is ok - means there is no relevant material search\r\n\r\n }\r\n\r\n resolveReferenceSearchResult(sr: IReferenceSearchResult) {\r\n const searchTerm = sr.searchTerm.toLowerCase();\r\n sr.searchDescription = this._referenceSearchCodeMap[sr.referenceSearchCode];\r\n const user = this._userManager.currentUser;\r\n\r\n sr.references.forEach(r => {\r\n const locs: FoundInReferenceCode[] = [];\r\n\r\n if (sr.referenceSearchCode == 'SearchAbstracts') {\r\n locs.push(FoundInReferenceCode.Abstracts);\r\n } else if (sr.referenceSearchCode == 'SearchAuthors') {\r\n locs.push(FoundInReferenceCode.Author);\r\n } else if (sr.referenceSearchCode == 'SearchBriefReferences') {\r\n locs.push(FoundInReferenceCode.Brief_Reference);\r\n } else if (sr.referenceSearchCode == 'SearchCompliance') {\r\n locs.push(FoundInReferenceCode.Compliance);\r\n } else if (sr.referenceSearchCode == 'SearchJournals') {\r\n locs.push(FoundInReferenceCode.Journal);\r\n } else if (sr.referenceSearchCode == 'SearchProtocols') {\r\n locs.push(FoundInReferenceCode.Protocols);\r\n } else if (sr.referenceSearchCode == 'SearchTitles') {\r\n locs.push(FoundInReferenceCode.Title);\r\n } else if (sr.referenceSearchCode == 'SearchReferenceId') {\r\n if (r.referenceId.toString() == searchTerm) {\r\n locs.push(FoundInReferenceCode.ReferenceId);\r\n } else if (r.contractorId != null && r.contractorId.toLowerCase().indexOf(searchTerm) != -1) {\r\n locs.push(FoundInReferenceCode.Contractor_Id);\r\n }\r\n } else if (sr.referenceSearchCode == 'SearchAll') {\r\n if (r.briefReference.toLowerCase().indexOf(searchTerm) != -1) {\r\n locs.push(FoundInReferenceCode.Brief_Reference);\r\n } else if (r.journal.toLowerCase().indexOf(searchTerm) != -1) {\r\n locs.push(FoundInReferenceCode.Journal);\r\n } else if (r.title.toLowerCase().indexOf(searchTerm) != -1) {\r\n locs.push(FoundInReferenceCode.Title);\r\n } else if (r.contractorId != null && r.contractorId.toLowerCase().indexOf(searchTerm) != -1) {\r\n locs.push(FoundInReferenceCode.Contractor_Id);\r\n } else if (user.isStaff && r.staffComments != null && r.staffComments.toLowerCase().indexOf(searchTerm.toLowerCase()) != -1) {\r\n locs.push(FoundInReferenceCode.Staff_Comments);\r\n } else if (r.allAuthorNames != null && r.allAuthorNames.toLowerCase().indexOf(searchTerm.toLowerCase()) != -1) {\r\n locs.push(FoundInReferenceCode.Author);\r\n }\r\n } else if (sr.referenceSearchCode == 'SearchJournalDetail') {\r\n locs.push(FoundInReferenceCode.Journal_Detail);\r\n } else if (sr.referenceSearchCode == 'SearchGovDocNumber') {\r\n locs.push(FoundInReferenceCode.Govt_Doc_Number);\r\n } else if (sr.referenceSearchCode == 'SearchGovSponsor') {\r\n locs.push(FoundInReferenceCode.Govt_Sponsor);\r\n } else if (sr.referenceSearchCode == 'SearchContractorId') {\r\n locs.push(FoundInReferenceCode.Contractor_Id);\r\n } else if (sr.referenceSearchCode == 'SearchSponsoringCompany') {\r\n locs.push(FoundInReferenceCode.Sponsoring_Company);\r\n } else if (sr.referenceSearchCode == 'SearchStaffComments') {\r\n locs.push(FoundInReferenceCode.Staff_Comments);\r\n }\r\n\r\n const tmps = locs.map(l => _.replace(FoundInReferenceCode[l], new RegExp('_', 'g'), ' '));\r\n r.searchResolution = tmps.join(', ');\r\n });\r\n\r\n return sr;\r\n }\r\n}\r\n","import { Entity } from 'breeze-client';\r\nimport { Injectable} from '@angular/core';\r\nimport { UnitOfWork} from './unit-of-work';\r\nimport { StateMap} from './state-map';\r\nimport { EditManager } from '../utils/edit-manager';\r\n\r\n@Injectable()\r\nexport class EditorService {\r\n constructor(public uow: UnitOfWork, public stateMap: StateMap ) {\r\n }\r\n\r\n createEditManager(component: any, displayName: string): EditManager {\r\n return new EditManager(component, this.uow, this.stateMap, displayName);\r\n }\r\n}\r\n","import { forwardRef } from '@angular/core';\r\n\r\n// In parent - add\r\n// providers: [provideParent(MyParentComponent)]\r\n\r\n// In child - get access to parent with\r\n// constructor(@SkipSelf() parent: Parent ) { }\r\n// or\r\n// constructor(parent: Parent ) { }\r\n\r\n// Use the first in child component is also a parentComponent\r\n\r\n// Marker class, used as interface\r\nexport abstract class Parent {\r\n}\r\n\r\n// Helper method provides forward reference to an instance of a Parent component\r\n// export const provideParent =\r\n// (component:any) => provide(Parent, { useExisting: forwardRef(() => component) });\r\n\r\n// export const provideParent =\r\n// (component:any, parentClassAsInterface?: any) => provide(parentClassAsInterface || Parent, { useExisting: forwardRef(() => component) });\r\n\r\nexport function provideParent(component: any, parentClassAsInterface?: any) {\r\n return { provide: parentClassAsInterface || Parent, useExisting: forwardRef(() => component) };\r\n}\r\n\r\n// Use by adding providers array to Parent component\r\n\r\n// In parent - add\r\n// providers: [provideParent(MyParentComponent)]\r\n\r\n// In child - get access to parent with\r\n// constructor(@SkipSelf() parent: Parent ) { }\r\n// or\r\n// constructor(parent: Parent ) { }\r\n\r\n// Use the first in child component is also a parentComponent\r\n","import {Injectable, Component } from '@angular/core';\r\n\r\nexport enum WorkflowEntityState {\r\n Added = 1,\r\n Modified,\r\n Deleted,\r\n Undefined\r\n}\r\n\r\nexport class WorkflowState {\r\n workflowReferenceId: number;\r\n workflowMaterialId: number;\r\n workflowObjectId: string;\r\n workflowEntityName: string;\r\n workflowPropertyName: string;\r\n workflowEntityState: WorkflowEntityState;\r\n workflowContactId: number;\r\n workflowContactEmail: string;\r\n workflowNotes: string;\r\n workflowHoldReason: string;\r\n workflowChangeValueNumber: number;\r\n workflowChangeValueString: string;\r\n workflowActionObjectId: number;\r\n workflowActionPropertyName: string;\r\n workflowUserNotes: string;\r\n\r\n // tslint:disable-next-line:max-line-length\r\n constructor(referenceId?: number, materialId?: number, entityName?: string, objectId?: string, propertyName?: string, entityState?: WorkflowEntityState, contactId?: number, contactEmail?: string, workflowHoldReason?: string) {\r\n\r\n this.workflowReferenceId = referenceId || null;\r\n this.workflowMaterialId = materialId || null;\r\n this.workflowObjectId = objectId || null;\r\n this.workflowEntityName = (entityName == null) ? null : entityName;\r\n this.workflowPropertyName = propertyName || null;\r\n this.workflowEntityState = entityState || WorkflowEntityState.Undefined;\r\n this.workflowContactId = contactId || null;\r\n this.workflowContactEmail = contactEmail || null;\r\n this.workflowHoldReason = workflowHoldReason || null;\r\n }\r\n\r\n public parsedEntityName(): string {\r\n return ((this.workflowEntityName == null) ? null : this.parseEntityName(this.workflowEntityName));\r\n }\r\n\r\n private parseEntityName(entityName: string): string {\r\n const idx = entityName.indexOf(':');\r\n if (idx > 0) {\r\n return entityName.substring(0, (idx));\r\n }\r\n\r\n return (entityName);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { Reference, TypeWorkflowActionTransition, WorkflowRecordedAction } from '../entities/EntityModels';\r\nimport { UserManager } from './user-manager';\r\nimport { UnitOfWork } from './unit-of-work';\r\nimport { WorkflowEntityState, WorkflowState } from './workflow-state';\r\n\r\n@Injectable()\r\nexport class WorkflowService {\r\n private _typeWorkflowActionTransitions: TypeWorkflowActionTransition[] = [];\r\n private _mappedActions: { actionCurrent: string, markCompleteOnly: boolean, actionNext: string, doNotComplete: boolean }[] = [];\r\n\r\n constructor(private _uow: UnitOfWork, private _userManager: UserManager) {\r\n\r\n this._uow.typeWorkflowActionTransitionRepository.all()\r\n .then(r => {\r\n this._typeWorkflowActionTransitions = r;\r\n });\r\n }\r\n\r\n addWorkflowEvent(workflowState: WorkflowState, reference: Reference): void {\r\n\r\n this.mapStateToAction(workflowState); // More than 1 action can be associated with an event\r\n\r\n if (this._mappedActions != null && this._mappedActions.length > 0) {\r\n\r\n this._mappedActions.forEach(a => {\r\n\r\n if (workflowState.workflowReferenceId != null && a.doNotComplete == false) {\r\n this.updatePendingWorkflowRecordedActionsForReference(workflowState, a.actionCurrent,\r\n reference, (a.markCompleteOnly) ? a.actionNext : null); // Mark Complete records can change the completed action id.\r\n }\r\n\r\n // When markComplete is set to true, the action is only a completion step of a pending action so the previous record(s) is updated and no new actions are inserted.\r\n if (a.markCompleteOnly == false) {\r\n this.createWorkflowRecordedAction(workflowState, a.actionCurrent, a.actionNext);\r\n }\r\n });\r\n }\r\n }\r\n\r\n ignoreThisProperty(propertyName: string): boolean {\r\n if (propertyName == 'created'\r\n || propertyName == 'createdUser'\r\n || propertyName == 'modified'\r\n || propertyName == 'modifyUser') {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private mapStateToAction(workflowState: WorkflowState) {\r\n const name = workflowState.parsedEntityName();\r\n const state = this.convertEntityStateToWorkflowActionState(workflowState.workflowEntityState);\r\n const prop = (workflowState.workflowPropertyName == null) ? null : workflowState.workflowPropertyName; // Can be null for ADDED entities\r\n\r\n this._mappedActions = [];\r\n\r\n try {\r\n if (this._typeWorkflowActionTransitions != null) {\r\n\r\n const actions = this._typeWorkflowActionTransitions\r\n .filter(w => w.entityName == name && w.entityState == state && ((w.propertyName == null && prop == null) || (w.propertyName == prop)));\r\n\r\n if (actions != null && actions.length > 0) {\r\n\r\n actions.forEach(a => {\r\n this._mappedActions.push({\r\n actionCurrent: a.typeWorkflowActionId,\r\n markCompleteOnly: a.markComplete,\r\n actionNext: a.completedWorkflowActionId,\r\n doNotComplete: a.doNotComplete\r\n });\r\n });\r\n\r\n return;\r\n }\r\n }\r\n } catch (e) {\r\n alert(e.message);\r\n }\r\n }\r\n\r\n private convertEntityStateToWorkflowActionState(entityState: WorkflowEntityState): string {\r\n switch (entityState) {\r\n case WorkflowEntityState.Added:\r\n return 'ADDED';\r\n case WorkflowEntityState.Modified:\r\n return 'MODIFIED';\r\n case WorkflowEntityState.Deleted:\r\n return 'DELETED';\r\n default:\r\n return 'UNKNOWN';\r\n }\r\n }\r\n\r\n private createWorkflowRecordedAction(wfs: WorkflowState, actionCurrent: string, actionNext?: string) {\r\n const params = { typeWorkflowActionId: actionCurrent };\r\n\r\n const workflowRecordedAction = this._uow.workflowRecordedActionFactory.create(params);\r\n\r\n if (wfs.parsedEntityName() != null) {\r\n workflowRecordedAction.entityName = wfs.parsedEntityName();\r\n }\r\n\r\n if (wfs.workflowPropertyName != null) {\r\n workflowRecordedAction.propertyName = wfs.workflowPropertyName;\r\n }\r\n\r\n // Record the Reference or Material Id of the entity event being recorded\r\n if (wfs.workflowReferenceId != null) {\r\n workflowRecordedAction.referenceId = wfs.workflowReferenceId;\r\n }\r\n\r\n if (wfs.workflowMaterialId != null) {\r\n workflowRecordedAction.materialId = wfs.workflowMaterialId;\r\n }\r\n\r\n if (wfs.workflowObjectId != null) {\r\n workflowRecordedAction.actionObjectId = wfs.workflowObjectId;\r\n }\r\n\r\n if (actionNext != null) {\r\n workflowRecordedAction.completedWorkflowActionId = actionNext;\r\n }\r\n\r\n if (wfs.workflowContactId != null) {\r\n workflowRecordedAction.sentToContactId = wfs.workflowContactId;\r\n }\r\n\r\n if (wfs.workflowNotes != null) {\r\n workflowRecordedAction.notes = wfs.workflowNotes;\r\n }\r\n\r\n if (wfs.workflowHoldReason != null) {\r\n workflowRecordedAction.holdReason = wfs.workflowHoldReason;\r\n }\r\n\r\n return this._uow.typeWorkflowContactRepository.all().then(r => {\r\n const contact = r.filter(c => c.emailAddress.toUpperCase() == this._userManager.currentUser.name.toUpperCase());\r\n\r\n if (contact != null && contact.length > 0) {\r\n workflowRecordedAction.createdWorkflowContactId = contact[0].workflowContactId;\r\n }\r\n });\r\n }\r\n\r\n // Mark related pending actions complete\r\n private updatePendingWorkflowRecordedActionsForReference(wfs: WorkflowState, actionCurrent: string, reference: Reference, actionChange?: string) {\r\n\r\n const currentUserName = this._userManager.currentUser.name;\r\n let workflowContactId = 0;\r\n\r\n this._uow.typeWorkflowContactRepository.all().then(r => {\r\n const contact = r.filter(c => c.emailAddress.toUpperCase() == this._userManager.currentUser.name.toUpperCase());\r\n\r\n if (contact != null && contact.length > 0) {\r\n workflowContactId = contact[0].workflowContactId;\r\n }\r\n\r\n if (reference.workflowRecordedActions != null && reference.workflowRecordedActions.length > 0) {\r\n\r\n const pending = reference.workflowRecordedActions.filter(a => a.completedWorkflowActionId == actionCurrent && a.actionCompletedDate == null);\r\n\r\n if (pending != null && pending.length > 0) {\r\n pending.forEach(p => {\r\n p['actionCompletedDate'] = new Date();\r\n if (workflowContactId > 0) {\r\n p['completedWorkflowContactId'] = workflowContactId;\r\n }\r\n p['completedUser'] = currentUserName;\r\n if (actionChange) {\r\n p['completedWorkflowActionId'] = actionChange;\r\n }\r\n });\r\n }\r\n }\r\n\r\n // New actions are created with the uow repository factory so check here since new actions are not committed and accessible via the Reference navigation list\r\n const changedEntities = this._uow._emProvider.manager().getChanges();\r\n\r\n if (changedEntities != null) {\r\n\r\n changedEntities.forEach(e => {\r\n\r\n if (e.entityType.name.indexOf('WorkflowRecordedAction') > -1) {\r\n\r\n if (e.entityAspect.entityState.isAdded()) {\r\n\r\n if (e['completedWorkflowActionId'] == actionCurrent && e['actionCompletedDate'] == null) {\r\n e['actionCompletedDate'] = new Date();\r\n if (workflowContactId > 0) {\r\n e['completedWorkflowContactId'] = workflowContactId;\r\n }\r\n e['completedUser'] = currentUserName;\r\n if (actionChange) {\r\n e['completedWorkflowActionId'] = actionChange;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n // This is primarily invoked when a SentTo is changed before commit\r\n rejectWorkflowRecordedNotification(workflowState: WorkflowState, reference: Reference) {\r\n\r\n this.mapStateToAction(workflowState);\r\n\r\n if (this._mappedActions == null || this._mappedActions.length == 0) {\r\n return;\r\n }\r\n\r\n this._mappedActions.forEach(map => {\r\n const notifications = reference.workflowRecordedActions\r\n .filter(a => a.typeWorkflowActionId == map.actionCurrent && a.sentToContactId == workflowState.workflowContactId);\r\n\r\n if (notifications == null || notifications.length == 0) {\r\n return;\r\n }\r\n\r\n notifications.forEach(n => {\r\n if (n.entityAspect.entityState.isAdded) {\r\n n.entityAspect.rejectChanges();\r\n }\r\n });\r\n });\r\n }\r\n\r\n referenceActions(reference: Reference, action: string): WorkflowRecordedAction[] {\r\n\r\n if (reference.workflowRecordedActions != null && reference.workflowRecordedActions.length > 0) {\r\n return reference.workflowRecordedActions.filter(a => a.typeWorkflowActionId == action);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n referenceActionsWithPendingRequiredAction(reference: Reference, action: string): WorkflowRecordedAction[] {\r\n\r\n if (reference.workflowRecordedActions != null && reference.workflowRecordedActions.length > 0) {\r\n return reference.workflowRecordedActions.filter(a => a.typeWorkflowActionId == action && a.completedWorkflowActionId != null && a.actionCompletedDate == null);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n referenceMostRecentPendingAction(reference: Reference, action: string): WorkflowRecordedAction {\r\n\r\n let mostrecentaction: WorkflowRecordedAction = null;\r\n\r\n if (reference.workflowRecordedActions != null && reference.workflowRecordedActions.length > 0) {\r\n\r\n const completed = reference.workflowRecordedActions.filter(a => a.completedWorkflowActionId == action && a.actionCompletedDate == null);\r\n\r\n if (completed != null && completed.length > 0) {\r\n const sorted = completed.sort(function (date1, date2) {\r\n return date2.created.getTime() - date1.created.getTime();\r\n });\r\n\r\n mostrecentaction = sorted[0];\r\n }\r\n }\r\n\r\n // New actions are created with the uow repository factory so check here since new actions are not committed and accessible via the Reference navigation list\r\n const changedEntities = this._uow._emProvider.manager().getChanges();\r\n\r\n if (changedEntities != null) {\r\n\r\n changedEntities.forEach(e => {\r\n\r\n if (e.entityType.name.indexOf('WorkflowRecordedAction') > -1) {\r\n\r\n if (e.entityAspect.entityState.isAdded()) {\r\n if (e['completedWorkflowActionId'] == action && e['actionCompletedDate'] == null) {\r\n if (mostrecentaction == null) {\r\n mostrecentaction = e.entityAspect.entity as WorkflowRecordedAction;\r\n } else if (e['created'] > mostrecentaction.created) {\r\n mostrecentaction = e.entityAspect.entity as WorkflowRecordedAction;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n return mostrecentaction;\r\n }\r\n\r\n referenceMostRecentCompletedAction(reference: Reference, action: string): WorkflowRecordedAction {\r\n\r\n let mostrecentaction: WorkflowRecordedAction = null;\r\n\r\n if (reference.workflowRecordedActions != null && reference.workflowRecordedActions.length > 0) {\r\n const completed = reference.workflowRecordedActions.filter(a => a.completedWorkflowActionId == action && a.actionCompletedDate != null);\r\n\r\n if (completed != null && completed.length > 0) {\r\n const sorted = completed.sort(function (date1, date2) {\r\n return date2.created.getTime() - date1.created.getTime();\r\n });\r\n\r\n mostrecentaction = sorted[0];\r\n }\r\n }\r\n\r\n // New actions are created with the uow repository factory so check here since new actions are not committed and accessible via the Reference navigation list\r\n const changedEntities = this._uow._emProvider.manager().getChanges();\r\n\r\n if (changedEntities != null) {\r\n\r\n changedEntities.forEach(e => {\r\n\r\n if (e.entityType.name.indexOf('WorkflowRecordedAction') > -1) {\r\n\r\n if (e.entityAspect.entityState.isAdded()) {\r\n\r\n if (e['completedWorkflowActionId'] == action && e['actionCompletedDate'] != null) {\r\n if (mostrecentaction == null) {\r\n mostrecentaction = e.entityAspect.entity as WorkflowRecordedAction;\r\n } else if (e['created'] > mostrecentaction.created) {\r\n mostrecentaction = e.entityAspect.entity as WorkflowRecordedAction;\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n return mostrecentaction;\r\n\r\n }\r\n\r\n cancelPendingWorkflowRecordedActionsForReference(reference: Reference, pendingAction: string, mostRecentOnly: boolean) {\r\n\r\n if (reference.workflowRecordedActions == null || reference.workflowRecordedActions.length == 0) {\r\n return;\r\n }\r\n\r\n const pending = reference.workflowRecordedActions.filter(a => a.completedWorkflowActionId == pendingAction && a.actionCompletedDate == null);\r\n\r\n if (pending == null || pending.length == 0) {\r\n return;\r\n }\r\n\r\n const currentUserName = this._userManager.currentUser.name;\r\n\r\n if (mostRecentOnly) {\r\n const sorted = _.sortBy(pending, p => p.created).reverse();\r\n sorted[0].actionCompletedDate = new Date();\r\n sorted[0].completedUser = currentUserName;\r\n sorted[0].completedWorkflowActionId = 'CANCELLED';\r\n } else {\r\n pending.forEach(p => {\r\n p['actionCompletedDate'] = new Date();\r\n p['completedUser'] = currentUserName;\r\n p['completedWorkflowActionId'] = 'CANCELLED';\r\n });\r\n }\r\n }\r\n\r\n deleteActionBeforeSave(reference: Reference, action: string) {\r\n\r\n if (reference.workflowRecordedActions == null || reference.workflowRecordedActions.length == 0) {\r\n return;\r\n }\r\n\r\n const todeletes = reference.workflowRecordedActions.filter(a => a.entityAspect.entityState.isAdded() && a.typeWorkflowActionId == action);\r\n\r\n if (todeletes == null || todeletes.length == 0) {\r\n return;\r\n }\r\n\r\n todeletes.forEach(d => {\r\n d.entityAspect.setDeleted();\r\n });\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { BiologicalData, ExperimentalMaterial, ExperimentalResult, Reference } from '../entities/EntityModels';\r\nimport { UnitOfWork } from './unit-of-work';\r\n\r\nexport enum ReferenceFinishState { MissingData, DataComplete, FinishOverride }\r\n\r\n@Injectable()\r\nexport class ReferenceFinishedService {\r\n\r\n private _unfinishedReasons: Array = new Array();\r\n\r\n constructor(private _uow: UnitOfWork) {\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Evaluate Reference to determine if it is in a Finished state\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public enumerateMissingData(reference: Reference): Promise {\r\n // Returns the number of ways in which the reference is missing data normally required to be considered finished\r\n return this._uow.referenceRepository.populateBiologicalData(reference).then(() => {\r\n\r\n this._unfinishedReasons = [];\r\n if (this.isReferenceAbstracted(reference) == false) {\r\n this._unfinishedReasons.push('Missing Abstract');\r\n }\r\n\r\n if (this.isReferenceProofed(reference) == false) {\r\n this._unfinishedReasons.push('Unproofed');\r\n }\r\n\r\n if (reference.rIFMArticle == false && reference.fEMAArticle == false) {\r\n this._unfinishedReasons.push('Has not been designated as a RIFM or FEMA article');\r\n }\r\n\r\n // Look for unfinished tasks recorded in the workflow table\r\n const incompletes = this.distinctPendingWorkflowActions(reference);\r\n\r\n if (incompletes != null && incompletes.length > 0) {\r\n incompletes.forEach(i => {\r\n this._unfinishedReasons.push(i);\r\n });\r\n }\r\n\r\n // ToDo: Check for undefined linkable state when ready\r\n if (reference.linkable) {\r\n if (this.hasLinks(reference) == false) {\r\n this._unfinishedReasons.push('Linkable with incomplete or missing linked data');\r\n }\r\n }\r\n\r\n const datacheck = (this.hasIncompleteProtocolData(reference));\r\n\r\n if (reference.precedence > 2 && reference.linkable && datacheck.missingBiologicalData) {\r\n this._unfinishedReasons.push('P3 Reference missing Study, Route, Species (Protocol) data');\r\n }\r\n\r\n if (datacheck.missingBiologicalData == false) { // Means there are Bio Data records created so now we check for linked materials and tox data (Exp Materials and Exp Results)\r\n if (datacheck.missingExperimentalMaterials) {\r\n this._unfinishedReasons.push('Protocol data without Linked Materials');\r\n }\r\n\r\n if (datacheck.missingExperimentalResults) {\r\n this._unfinishedReasons.push('Linked materials without Tox Data');\r\n }\r\n }\r\n\r\n return this._unfinishedReasons.length;\r\n\r\n });\r\n }\r\n\r\n public isReferenceFinished(reference: Reference): Promise {\r\n\r\n return this._uow.referenceRepository.populateToxData(reference).then(() => {\r\n\r\n if (this.isFinishedByOverride(reference)) {\r\n return ReferenceFinishState.FinishOverride;\r\n }\r\n\r\n const hasLinks = false;\r\n\r\n if (this.isReferenceProofed(reference) == false) {\r\n return ReferenceFinishState.MissingData;\r\n }\r\n\r\n if (reference.rIFMArticle == false && reference.fEMAArticle == false) {\r\n return ReferenceFinishState.MissingData;\r\n }\r\n\r\n const datacheck = (this.hasIncompleteProtocolData(reference));\r\n\r\n // If a reference has the precedence (priority) set to a value 3 or higher then it can be marked as finished if it has been abstracted and proofed with BioData.\r\n if (reference.precedence > 2) {\r\n if (reference.linkable) {\r\n if (datacheck.missingBiologicalData == false) {\r\n return ReferenceFinishState.DataComplete;\r\n } else {\r\n return ReferenceFinishState.MissingData;\r\n }\r\n } else {\r\n return ReferenceFinishState.DataComplete;\r\n }\r\n }\r\n\r\n // Look for unfinished tasks recorded in the workflow table\r\n if (this.allWorkflowActionsCompleted(reference) == false) {\r\n return ReferenceFinishState.MissingData;\r\n }\r\n\r\n // ToDo: Check for undefined linkable state when ready\r\n if (reference.linkable == false) {\r\n return ReferenceFinishState.DataComplete;\r\n }\r\n\r\n if (this.hasLinks(reference)) {\r\n if (datacheck.missingBiologicalData == true) {\r\n return ReferenceFinishState.DataComplete; // missingBiologicalData is true when there are no Bio Data records, in this case, there can't be missing linked materials or tox data.\r\n }\r\n } else {\r\n return ReferenceFinishState.MissingData; // Incomplete when linkable without linked data\r\n }\r\n\r\n\r\n if (datacheck.missingExperimentalMaterials == false && datacheck.missingExperimentalResults == false) {\r\n return ReferenceFinishState.DataComplete;\r\n }\r\n\r\n return ReferenceFinishState.MissingData;\r\n });\r\n }\r\n\r\n public get unfinishedReasons(): string[] {\r\n return this._unfinishedReasons.sort();\r\n }\r\n\r\n private isReferenceAbstracted(reference: Reference): boolean {\r\n const abstracted = reference.workflowRecordedActions.filter(a => a.typeWorkflowActionId == 'ABSTRACTED');\r\n\r\n return (abstracted != null && abstracted.length > 0);\r\n }\r\n\r\n private isReferenceProofed(reference: Reference) {\r\n return reference.complete;\r\n }\r\n\r\n // Linkable References should have AnalyticalResults or Special Links or Materials Linked in order to be considered Finished.\r\n private hasLinks(reference: Reference) {\r\n\r\n if (this.hasAnalyticalResultLinks(reference)) {\r\n return true;\r\n }\r\n\r\n if (this.hasSpecialLinks(reference)) {\r\n return true;\r\n }\r\n\r\n if (this.hasMaterialLinks(reference)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private hasAnalyticalResultLinks(reference: Reference) {\r\n return (reference.analyticalResults != null && reference.analyticalResults.length > 0);\r\n }\r\n\r\n private hasMaterialLinks(reference: Reference) {\r\n\r\n const bddata = reference.biologicalDatas.filter(b => b.experimentalMaterials.length > 0);\r\n\r\n if (bddata != null && bddata.length > 0) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private hasSpecialLinks(reference: Reference) {\r\n return (reference.specialLinks != null && reference.specialLinks.length > 0);\r\n }\r\n\r\n private allWorkflowActionsCompleted(reference: Reference) {\r\n\r\n const pending = reference.workflowRecordedActions.filter(a => a.completedWorkflowActionId != null && a.completedWorkflowActionId != 'FINISH DATA' && a.actionCompletedDate == null);\r\n\r\n if (pending == null || pending.length == 0) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private distinctPendingWorkflowActions(reference: Reference): string[] {\r\n\r\n const incompletes: Array = new Array();\r\n const pending = reference.workflowRecordedActions.filter(a => a.completedWorkflowActionId != null && a.completedWorkflowActionId != 'FINISH DATA'\r\n && a.actionCompletedDate == null && a.completedTypeWorkflowAction.includeInStaffReport\r\n && a.completedTypeWorkflowAction.coreData == false);\r\n\r\n if (pending == null || pending.length == 0) {\r\n return incompletes;\r\n }\r\n\r\n pending.forEach(p => {\r\n const exists = incompletes.filter(a => a == p.completedTypeWorkflowAction.toCompleteDescription);\r\n\r\n if (exists == null || exists.length == 0) {\r\n incompletes.push(p.completedTypeWorkflowAction.toCompleteDescription);\r\n }\r\n });\r\n\r\n return incompletes;\r\n }\r\n\r\n private isFinishedByOverride(reference: Reference) {\r\n\r\n const actions = reference.workflowRecordedActions.filter(a => a.typeWorkflowActionId == 'FINISHED OVERRIDE' && a.entityAspect.entityState.isAdded());\r\n return (actions != null && actions.length > 0);\r\n\r\n }\r\n\r\n public hasIncompleteProtocolData(reference: Reference) {\r\n\r\n let missingBioData = false;\r\n let missingExpMats = false;\r\n let missingExpResults = false;\r\n\r\n if (reference.biologicalDatas != null && reference.biologicalDatas.length > 0) {\r\n reference.biologicalDatas.forEach(bd => {\r\n if (this.missingExperimentalMaterial(bd)) {\r\n missingExpMats = true;\r\n }\r\n\r\n bd.experimentalMaterials.forEach(em => {\r\n if (this.missingExperimentalResults(em)) {\r\n missingExpResults = true;\r\n }\r\n });\r\n });\r\n } else {\r\n missingBioData = true;\r\n missingExpMats = true;\r\n missingExpResults = true;\r\n }\r\n\r\n return {\r\n missingBiologicalData: missingBioData,\r\n missingExperimentalMaterials: missingExpMats,\r\n missingExperimentalResults: missingExpResults\r\n };\r\n }\r\n\r\n public missingExperimentalMaterial(bd: BiologicalData): boolean {\r\n const hasexisting = (bd.experimentalMaterials != null && bd.experimentalMaterials.length > 0);\r\n let hasnew = false;\r\n\r\n // New actions are created with the uow repository factory so check here since new actions are not committed and accessible via the Reference navigation list\r\n const changedEntities = this._uow._emProvider.manager().getChanges();\r\n if (changedEntities != null) {\r\n\r\n changedEntities.forEach(e => {\r\n\r\n if (e.entityType.shortName == 'ExperimentalMaterial') {\r\n\r\n if (e.entityAspect.entityState.isAdded()) {\r\n if (e['biologicalDataId'] == bd.biologicalDataId) {\r\n hasnew = true;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n return (hasexisting == false && hasnew == false);\r\n }\r\n\r\n public missingExperimentalResults(em: ExperimentalMaterial): boolean {\r\n const hasexisting = (em.experimentalResults != null && em.experimentalResults.length > 0);\r\n let hasnew = false;\r\n\r\n // New actions are created with the uow repository factory so check here since new actions are not committed and accessible via the Reference navigation list\r\n const changedEntities = this._uow._emProvider.manager().getChanges();\r\n if (changedEntities != null) {\r\n\r\n changedEntities.forEach(e => {\r\n\r\n if (e.entityType.shortName == 'ExperimentalResult') {\r\n\r\n if (e.entityAspect.entityState.isAdded()) {\r\n if (e['experimentalMaterialId'] == em.experimentalMaterialId) {\r\n hasnew = true;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n return (hasexisting == false && hasnew == false);\r\n }\r\n}\r\n","// *******************************************************************************\r\n// Component to reconcile pending and completed tasks with deleted data.\r\n// *******************************************************************************\r\n\r\nimport { Injectable } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { AnalyticalResult, ExperimentalMaterial, ExperimentalResult, Reference, WorkflowRecordedAction } from '../entities/EntityModels';\r\nimport { WorkflowActivityCompletedItem } from '../entities/projections/WorkflowActivityCompletedItem';\r\nimport { UnitOfWork } from './unit-of-work';\r\nimport { WorkflowService } from './workflow-service';\r\nimport { ReferenceFinishedService } from './reference-finished-service';\r\nimport { WorkflowEntityState, WorkflowState } from './workflow-state';\r\n\r\n@Injectable()\r\nexport class WorkflowDeletionService {\r\n\r\n constructor(private _uow: UnitOfWork, private _workflowService: WorkflowService, private _referenceFinishedService: ReferenceFinishedService) {\r\n }\r\n\r\n // *******************************************************************************\r\n // Reference Linked Analytical Results Deletion Logic\r\n // *******************************************************************************\r\n public reconcileLinkedAnalyticalResultDeletesWithPendingActions(reference: Reference, analyticalResults?: AnalyticalResult[]) {\r\n\r\n if (this.arrayIsEmpty(reference.workflowRecordedActions)) {\r\n return;\r\n }\r\n\r\n if (this.arrayIsEmpty(analyticalResults)) {\r\n this._workflowService.cancelPendingWorkflowRecordedActionsForReference(reference, 'CHECK PHYSICAL PROPERTY', false);\r\n return;\r\n }\r\n\r\n const completed = this._workflowService.referenceMostRecentCompletedAction(reference, 'CHECK PHYSICAL PROPERTY');\r\n\r\n if (completed) {\r\n const lastmat = analyticalResults.sort(function (date1, date2) {\r\n return date2.created.getTime() - date1.created.getTime();\r\n });\r\n\r\n // Cancel actions relating to deleted analytical results records\r\n if (completed.created.getTime() > lastmat[0].created.getTime()) {\r\n // Then the remaining open 'CHECK PHYSICAL PROPERTY pending actions can be cancelled\r\n this._workflowService.cancelPendingWorkflowRecordedActionsForReference(reference, 'CHECK PHYSICAL PROPERTY', false);\r\n }\r\n }\r\n\r\n return;\r\n }\r\n\r\n private arrayIsEmpty(anyArray?: any[]): boolean {\r\n\r\n return (anyArray == null || anyArray.length == 0);\r\n\r\n }\r\n\r\n // *******************************************************************************\r\n // Protocol and Tox Data Deletion Logic\r\n // *******************************************************************************\r\n public hasBioDataDeletionsToProcess(reference: Reference): boolean {\r\n\r\n const deletes: string[] = ['MATERIAL UNLINKED', 'PROTOCOL DELETED', 'SPECIAL LINK DELETED', 'TOX DATA DELETED'];\r\n\r\n if (reference.workflowRecordedActions.some(d =>\r\n _.some(deletes, function (deleteaction) {\r\n return deleteaction === d.typeWorkflowActionId;\r\n }) && d.entityAspect.entityState.isAdded()\r\n )) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n // Close any pending actions that are dependent upon the deleted action.\r\n // Invoke a method that will add back in missing required actions to replace deleted action.\r\n public reconcileProtocolDeletesWithPendingActions(reference: Reference, expmats?: ExperimentalMaterial[]) {\r\n\r\n // PROTOCOL ADDED => MATERIAL LINKED => TOX DATA ADDED\r\n const missingMaterialLink = this.protocolsMissingMaterialLinks(reference);\r\n if (missingMaterialLink == false) {\r\n this._workflowService.cancelPendingWorkflowRecordedActionsForReference(reference, 'MATERIAL LINKED', false);\r\n }\r\n\r\n if (expmats == null || expmats.length == 0) {\r\n this._workflowService.cancelPendingWorkflowRecordedActionsForReference(reference, 'TOX DATA ADDED', false);\r\n this.reconcileToxDataDeletesWithPendingActions(reference, null);\r\n this.addBackRequiredActions(reference, 0);\r\n return;\r\n }\r\n\r\n this._workflowService.cancelPendingWorkflowRecordedActionsForReference(reference, 'TOX DATA ADDED', true);\r\n\r\n // Now loop through all the ExperimentalMaterials to gather Experimental Results\r\n const experimentalResults: ExperimentalResult[] = [];\r\n expmats.forEach(em => {\r\n if (em.experimentalResults && em.experimentalResults.length > 0) {\r\n em.experimentalResults.forEach(er => {\r\n experimentalResults.push(er);\r\n });\r\n }\r\n });\r\n\r\n this.reconcileToxDataDeletesWithPendingActions(reference, experimentalResults);\r\n\r\n this.addBackRequiredActions(reference, expmats.length);\r\n\r\n return;\r\n }\r\n\r\n public protocolsMissingMaterialLinks(reference: Reference): boolean {\r\n if (reference.biologicalDatas != null || reference.biologicalDatas.length > 0) {\r\n for (let idx = 0; idx < reference.biologicalDatas.length; idx++) {\r\n if (reference.biologicalDatas[idx].experimentalMaterials == null || reference.biologicalDatas[idx].experimentalMaterials.length == 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n public reconcileToxDataDeletesWithPendingActions(reference: Reference, expresults?: ExperimentalResult[]) {\r\n\r\n if (expresults == null || expresults.length == 0) {\r\n this._workflowService.cancelPendingWorkflowRecordedActionsForReference(reference, 'AUDIT TOX DATA', false);\r\n return;\r\n }\r\n\r\n // TOX DATA ADDED => AUDIT TOX DATA\r\n const completed = this._workflowService.referenceMostRecentCompletedAction(reference, 'AUDIT TOX DATA');\r\n\r\n if (completed == null) {\r\n return;\r\n }\r\n\r\n const lastresult = expresults.sort(function (date1, date2) {\r\n return date2.created.getTime() - date1.created.getTime();\r\n });\r\n\r\n // Invalidate actions relating to deleted experimental results records\r\n if (completed.created.getTime() > lastresult[0].created.getTime()) {\r\n // Then the remaining open TOX DATA ADDED pending actions can be cancelled\r\n this._workflowService.cancelPendingWorkflowRecordedActionsForReference(reference, 'AUDIT TOX DATA', false);\r\n }\r\n\r\n return;\r\n }\r\n\r\n public addBackRequiredActions(reference: Reference, expMatsCount: number) {\r\n\r\n if (reference.biologicalDatas == null || reference.biologicalDatas.length == 0) {\r\n return;\r\n }\r\n\r\n const dataCheck = this._referenceFinishedService.hasIncompleteProtocolData(reference);\r\n\r\n // If the reference is missing experimental material data and there's no longer a pending task for this, insert one\r\n if (dataCheck.missingExperimentalMaterials) {\r\n if (this._workflowService.referenceMostRecentPendingAction(reference, 'MATERIAL LINKED') == null) {\r\n const workflow = new WorkflowState();\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'BiologicalData';\r\n workflow.workflowEntityState = WorkflowEntityState.Added;\r\n workflow.workflowPropertyName = 'addback';\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n }\r\n\r\n if (expMatsCount == 0) {\r\n return;\r\n }\r\n\r\n if (dataCheck.missingExperimentalResults) {\r\n if (this._workflowService.referenceMostRecentPendingAction(reference, 'TOX DATA ADDED') == null) {\r\n const workflow = new WorkflowState();\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'ExperimentalMaterial';\r\n workflow.workflowEntityState = WorkflowEntityState.Added;\r\n workflow.workflowPropertyName = 'addback';\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n }\r\n }\r\n\r\n // ****************************************************************************************************\r\n // Workflow Actions removed/undone by Staff.\r\n // ****************************************************************************************************\r\n // The workflow pattern (with exceptions) is as follows:\r\n // A record with the preceding ACTION and a next ACTION to be Completed.\r\n\r\n // When data is added, the change is recorded twice, once as a completed\r\n // next step, and once as a preceding Action along with a new next step action\r\n // triggered by the completed action.\r\n\r\n // Both actions need to be reset when a staff member wants to undo an\r\n // action they took.\r\n\r\n // Only actions that are NOT generated by the state of the data can be handled this way.\r\n\r\n // There is other logic that handles actions generated by logic based on the state\r\n // of the reference or tox data.\r\n // ****************************************************************************************************\r\n public processDeleteWorkflowAction(reference: Reference, action: WorkflowActivityCompletedItem) {\r\n\r\n if (action.completedOnlyType) {\r\n this.deleteCompletedOnlyAction(reference, action.workflowRecordedActionId);\r\n } else {\r\n // Remove record by id\r\n this.deleteWorkflowAction(reference, action.workflowRecordedActionId);\r\n\r\n // Undo Action Completed Date\r\n // Exception: When a Reference is SENT multiple times, the completed action for previous assignments is marked as REASSIGN\r\n // and the action recorded is SENT AGAIN. However the required 'SENT TO' associated with the MADE LINKABLE\r\n // action still needs to be undone.\r\n const completedActionId = (action.typeWorkflowActionId == 'SENT AGAIN') ? 'SENT TO' : action.typeWorkflowActionId;\r\n const item: WorkflowRecordedAction = this._workflowService.referenceMostRecentCompletedAction(reference, completedActionId);\r\n if (item) {\r\n item.actionCompletedDate = null;\r\n item.completedUser = null;\r\n }\r\n\r\n if (action.typeWorkflowActionId == 'FINISHED OVERRIDE') {\r\n reference.finished = false;\r\n }\r\n\r\n }\r\n }\r\n\r\n public deleteWorkflowAction(reference: Reference, id: number): boolean {\r\n\r\n if (reference.workflowRecordedActions != null && reference.workflowRecordedActions.length > 0) {\r\n const actions = reference.workflowRecordedActions.filter(a => a.workflowRecordedActionId == id);\r\n\r\n if (actions != null && actions.length > 0) {\r\n actions[0].entityAspect.setDeleted();\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n public deleteCompletedOnlyAction(reference: Reference, id: number): boolean {\r\n if (reference.workflowRecordedActions != null && reference.workflowRecordedActions.length > 0) {\r\n const actions = reference.workflowRecordedActions.filter(a => a.workflowRecordedActionId == id);\r\n\r\n if (actions != null && actions.length > 0) {\r\n actions[0].actionCompletedDate = null;\r\n actions[0].completedUser = null;\r\n actions[0].completedWorkflowContactId = null;\r\n\r\n // When a Reference Abstract is Proofed by Staff, the Reference Completed Field is marked to true, this needs to be undone as well.\r\n if (actions[0].completedWorkflowActionId == 'PROOF ABSTRACT') {\r\n reference.complete = false;\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { Entity } from 'breeze-client';\r\nimport { AnalyticalResult, ExperimentalMaterial, ExperimentalResult, Reference } from '../entities/EntityModels';\r\nimport { WorkflowActivityCompletedItem } from '../entities/projections/WorkflowActivityCompletedItem';\r\n\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { ReferenceFinishedService, ReferenceFinishState } from './reference-finished-service';\r\nimport { WorkflowService } from './workflow-service';\r\nimport { WorkflowDeletionService } from './workflow-deletion-service';\r\nimport { UnitOfWork } from './unit-of-work';\r\nimport { WorkflowEntityState, WorkflowState } from './workflow-state';\r\n\r\n@Injectable()\r\nexport class ReferenceState {\r\n\r\n private _referenceFinishedService: ReferenceFinishedService;\r\n private _workflowService: WorkflowService;\r\n private _workflowDeletionService: WorkflowDeletionService;\r\n\r\n\r\n constructor(private _http: HttpClient, private _uow: UnitOfWork, referenceFinishedService: ReferenceFinishedService,\r\n workflowService: WorkflowService) {\r\n\r\n // const injector = appInjector();\r\n this._referenceFinishedService = referenceFinishedService;\r\n this._workflowService = workflowService;\r\n this._workflowDeletionService = new WorkflowDeletionService(this._uow, this._workflowService, this._referenceFinishedService);\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Logic for specific actions to insert that aren't recorded as entity or property changes.\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordReferenceFinishedStateChange(reference: Reference) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n workflow.workflowPropertyName = (reference.finished) ? 'finished=true' : 'finished=false';\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n\r\n }\r\n\r\n // Record an Action that the staff member has marked a Reference as Finished from the UI\r\n public finishOverride(reference: Reference) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n workflow.workflowPropertyName = 'finished=override';\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordAnalyticalResultAdd(reference: Reference, materialId: number) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n // workflow.workflowMaterialId = materialId; This is causing an issue with navigation of the entity\r\n workflow.workflowEntityName = 'AnalyticalResult';\r\n workflow.workflowEntityState = WorkflowEntityState.Added;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n\r\n this.recordLinkedAction(reference);\r\n }\r\n\r\n public recordAnalyticalResultDelete(reference: Reference, materialId: number) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n // workflow.workflowMaterialId = materialId; This is causing an issue with navigation of the entity\r\n workflow.workflowEntityName = 'AnalyticalResult';\r\n workflow.workflowEntityState = WorkflowEntityState.Deleted;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n\r\n this.recordLinkedAction(reference);\r\n }\r\n\r\n public recordAnalyticalResultsChecked(reference: Reference) {\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n workflow.workflowPropertyName = 'linkedAnalyticalResultsChecked';\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Protocol, Material Links and Tox Data\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordProtocolAdd(reference: Reference) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'BiologicalData';\r\n workflow.workflowEntityState = WorkflowEntityState.Added;\r\n\r\n const datacheck = (this._referenceFinishedService.hasIncompleteProtocolData(reference));\r\n const pending = this._workflowService.referenceActionsWithPendingRequiredAction(reference, 'PROTOCOL ADDED');\r\n\r\n if (datacheck.missingBiologicalData == false && (pending != null && pending.length > 0)) {\r\n workflow.workflowPropertyName = 'more';\r\n }\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordProtocolDelete(reference: Reference) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'BiologicalData';\r\n workflow.workflowEntityState = WorkflowEntityState.Deleted;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n // Add action to mark linked requirement for a Reference complete\r\n public recordLinkedAction(reference: Reference) {\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'Reference';\r\n workflow.workflowPropertyName = 'linkable';\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordMaterialLinkAdd(reference: Reference) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'ExperimentalMaterial';\r\n workflow.workflowEntityState = WorkflowEntityState.Added;\r\n\r\n const datacheck = (this._referenceFinishedService.hasIncompleteProtocolData(reference));\r\n // var pending = this._workflowService.referenceActionsWithPendingRequiredAction(reference, 'MATERIAL LINKED');\r\n\r\n // Each Protocol requires a Material Link (Exp Mat) so even though a Material Link may have been created, there may be more Protocols still missing a link\r\n if (datacheck.missingExperimentalMaterials) {\r\n workflow.workflowPropertyName = 'incomplete';\r\n } else {\r\n workflow.workflowPropertyName = 'more';\r\n }\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n\r\n this.recordLinkedAction(reference);\r\n }\r\n\r\n public recordMaterialLinkDelete(reference: Reference) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'ExperimentalMaterial';\r\n workflow.workflowEntityState = WorkflowEntityState.Deleted;\r\n\r\n const datacheck = (this._referenceFinishedService.hasIncompleteProtocolData(reference));\r\n\r\n if (datacheck.missingBiologicalData == false && datacheck.missingExperimentalMaterials == false && datacheck.missingExperimentalResults == false) {\r\n // The bio data could again have a full complement of data but trigger an audit request to make sure all changes are valid\r\n workflow.workflowPropertyName = 'addauditafterdelete';\r\n }\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n\r\n this.recordLinkedAction(reference);\r\n }\r\n\r\n public recordToxDataAdd(reference: Reference) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'ExperimentalResult';\r\n workflow.workflowEntityState = WorkflowEntityState.Added;\r\n\r\n const datacheck = (this._referenceFinishedService.hasIncompleteProtocolData(reference));\r\n\r\n // Each Experimental Material (Material Link) requires Tox Data (Exp Result) so even though Tox Data may have been created,\r\n // there may be more Experimental Materials still missing Tox Data\r\n if (datacheck.missingExperimentalResults) {\r\n workflow.workflowPropertyName = 'incomplete'; // Will not complete the Tox Data requirement or add a new pending task\r\n } else {\r\n workflow.workflowPropertyName = 'more';\r\n }\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordToxDataDelete(reference: Reference) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'ExperimentalResult';\r\n workflow.workflowEntityState = WorkflowEntityState.Deleted;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordToxAudit(reference: Reference) {\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n workflow.workflowPropertyName = 'toxDataAudited';\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordSpecialLinkAdd(reference: Reference) {\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'SpecialLink';\r\n workflow.workflowEntityState = WorkflowEntityState.Added;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n\r\n this.recordLinkedAction(reference);\r\n }\r\n\r\n public recordSpecialLinkDelete(reference: Reference) {\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = 'SpecialLink';\r\n workflow.workflowEntityState = WorkflowEntityState.Deleted;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Hold Actions\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordAddHold(reference: Reference, reason: string) {\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n workflow.workflowPropertyName = 'addHold';\r\n workflow.workflowHoldReason = reason;\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordRemoveHold(reference: Reference) {\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n workflow.workflowPropertyName = 'removeHold';\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public getHoldAction(reference: Reference): { isOnHold: boolean; holdReason: string } {\r\n\r\n if (reference.workflowRecordedActions == null || reference.workflowRecordedActions.length == 0) {\r\n return { isOnHold: false, holdReason: '' };\r\n }\r\n\r\n const pending = reference.workflowRecordedActions.filter(a => a.completedWorkflowActionId == 'REMOVE HOLD' && a.actionCompletedDate == null);\r\n\r\n if (pending == null || pending.length == 0) {\r\n return { isOnHold: false, holdReason: '' };\r\n }\r\n\r\n return { isOnHold: true, holdReason: pending[0].holdReason };\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Reference Document Management\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordRIFMDocument(reference: Reference, workflowEntityState: WorkflowEntityState, archived: boolean) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName \t= reference.entityType.shortName;\r\n workflow.workflowEntityState = workflowEntityState;\r\n workflow.workflowPropertyName = (archived) ? 'rIFMDocumentArchive' : 'rIFMDocument';\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordRIFMDocumentAdded(reference: Reference, workflowEntityState: WorkflowEntityState) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName \t= reference.entityType.shortName;\r\n workflow.workflowEntityState = workflowEntityState;\r\n workflow.workflowPropertyName = 'rIFMDocument';\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordRIFMDocumentArchive(reference: Reference, workflowEntityState: WorkflowEntityState) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName \t= reference.entityType.shortName;\r\n workflow.workflowEntityState = workflowEntityState;\r\n workflow.workflowPropertyName \t= 'archived';\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordRIFMDocumentFileModified(reference: Reference, workflowEntityState: WorkflowEntityState) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName \t= reference.entityType.shortName;\r\n workflow.workflowEntityState = workflowEntityState;\r\n workflow.workflowPropertyName = 'file';\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordRIFMDocumentFileDelete(reference: Reference, workflowEntityState: WorkflowEntityState) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName \t= reference.entityType.shortName;\r\n workflow.workflowEntityState = workflowEntityState; // Should be Modified\r\n workflow.workflowPropertyName \t= 'file deleted';\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordRIFMDocumentRemove(reference: Reference, workflowEntityState: WorkflowEntityState) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName \t= reference.entityType.shortName;\r\n workflow.workflowEntityState = workflowEntityState; // Should be Deleted\r\n workflow.workflowPropertyName \t= 'rIFMDocument';\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordRIFMDocumentReplace(reference: Reference, workflowEntityState: WorkflowEntityState) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName \t= reference.entityType.shortName;\r\n workflow.workflowEntityState = workflowEntityState;\r\n workflow.workflowPropertyName \t= 'replaced';\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordRIFMDocumentRestore(reference: Reference, workflowEntityState: WorkflowEntityState) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName \t= reference.entityType.shortName;\r\n workflow.workflowEntityState = workflowEntityState;\r\n workflow.workflowPropertyName \t= 'restored';\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n // ******************************************************************************************************\r\n // Update actions that can occur at the time the Reference is created\r\n // ******************************************************************************************************\r\n public recordLinkable(reference: Reference) {\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n workflow.workflowPropertyName = 'linkable=true';\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n public recordSearchService(reference: Reference) {\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n workflow.workflowPropertyName = 'typeSearchServiceId=' + reference.typeSearchServiceId;\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Evaluate Reference to determine if it has unaudited tox data\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public hasUnauditedToxData(reference: Reference) {\r\n\r\n if (reference.workflowRecordedActions == null || reference.workflowRecordedActions.length == 0) {\r\n return false;\r\n }\r\n\r\n const pending = reference.workflowRecordedActions.filter(a => a.completedWorkflowActionId == 'AUDIT TOX DATA' && a.actionCompletedDate == null);\r\n\r\n if (pending == null || pending.length == 0) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public hasAuditedToxData(reference: Reference) {\r\n\r\n if (reference.workflowRecordedActions == null || reference.workflowRecordedActions.length == 0) {\r\n return false;\r\n }\r\n\r\n // Make sure there aren't more recent pending actions\r\n const completed = this._workflowService.referenceMostRecentCompletedAction(reference, 'AUDIT TOX DATA');\r\n const pending = this._workflowService.referenceMostRecentPendingAction(reference, 'AUDIT TOX DATA');\r\n\r\n if (completed == null) {\r\n return false;\r\n }\r\n\r\n if (pending == null) { // Has completed action but no pending ones\r\n return true;\r\n }\r\n\r\n return false; // Has pending actions\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Evaluate Reference to determine if it has unchecked or checked AnalyticalResults\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public hasUncheckedAnalyticalResults(reference: Reference) {\r\n\r\n if (reference.workflowRecordedActions == null || reference.workflowRecordedActions.length == 0) {\r\n return false;\r\n }\r\n\r\n const pending = reference.workflowRecordedActions.filter(a => a.completedWorkflowActionId == 'CHECK PHYSICAL PROPERTY' && a.actionCompletedDate == null);\r\n\r\n if (pending == null || pending.length == 0) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public hasCheckedAnalyticalResults(reference: Reference) {\r\n\r\n if (reference.workflowRecordedActions == null || reference.workflowRecordedActions.length == 0) {\r\n return false;\r\n }\r\n\r\n // Make sure there aren't more recent pending actions\r\n const completed = this._workflowService.referenceMostRecentCompletedAction(reference, 'CHECK PHYSICAL PROPERTY');\r\n const pending = this._workflowService.referenceMostRecentPendingAction(reference, 'CHECK PHYSICAL PROPERTY');\r\n\r\n if (completed == null) {\r\n return false;\r\n }\r\n\r\n if (pending == null) { // Has completed action but no pending ones\r\n return true;\r\n }\r\n\r\n return false; // Has pending actions\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Evaluate list of entity/property changes\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordEntityChange(e: Entity, reference: Reference, relatedEntityKey?: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId; // Even though the update may have been on a related table, the event is associated with the Reference being edited.\r\n workflow.workflowEntityName = e.entityType.name;\r\n\r\n if (relatedEntityKey != null) { // The related object key is also stored.\r\n workflow.workflowObjectId = relatedEntityKey;\r\n }\r\n\r\n if (e.entityAspect.entityState.isAdded()) {\r\n\r\n workflow.workflowEntityState = WorkflowEntityState.Added;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n\r\n if (e.entityType.shortName == 'Reference' && reference.linkable) {\r\n this.recordLinkable(reference);\r\n }\r\n\r\n if (e.entityType.shortName == 'Reference' && reference.typeSearchServiceId != 'Not Sent') {\r\n this.recordSearchService(reference);\r\n }\r\n }\r\n\r\n if (e.entityAspect.entityState.isModified()) {\r\n\r\n const changedProperties = e.entityAspect.originalValues;\r\n for (const propName in changedProperties) {\r\n\r\n if (!this._workflowService.ignoreThisProperty(propName)) {\r\n\r\n if (this.appendValueToReferenceProperty(propName) && e.entityType.shortName == 'Reference') {\r\n workflow.workflowPropertyName = propName + '=' + e[propName].toString();\r\n } else {\r\n workflow.workflowPropertyName = propName;\r\n }\r\n\r\n const xtraPropertyInfo = this.specialProcessing(reference, propName, e[propName]);\r\n if (xtraPropertyInfo != '') {\r\n workflow.workflowPropertyName = workflow.workflowPropertyName.concat(xtraPropertyInfo);\r\n }\r\n\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private appendValueToReferenceProperty(propertyName: string): boolean {\r\n if (propertyName == 'complete' || propertyName == 'linkable' || propertyName == 'typeSearchServiceId') {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private specialProcessing(reference: Reference, propertyName: string, state: boolean): string {\r\n if (propertyName == 'linkable' && state == true) {\r\n const actions = this._workflowService.referenceActions(reference, 'SENT TO');\r\n if (actions != null && actions.length > 0) {\r\n return ',ignore sent';\r\n }\r\n }\r\n\r\n return '';\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Evaluate Pending Workflow when linked data has been deleted\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public reconcileLinkedAnalyticalResultDeletesWithPendingActions(reference: Reference, analyticalResults?: AnalyticalResult[]) {\r\n return (this._workflowDeletionService.reconcileLinkedAnalyticalResultDeletesWithPendingActions(reference, analyticalResults));\r\n }\r\n\r\n public hasBioDataDeletionsToProcess(reference: Reference): boolean {\r\n return (this._workflowDeletionService.hasBioDataDeletionsToProcess(reference));\r\n }\r\n\r\n // Close any pending actions that don't make sense when Protocol or Tox Data is Deleted\r\n public reconcileProtocolDeletesWithPendingActions(reference: Reference, expmats?: ExperimentalMaterial[]) {\r\n this._workflowDeletionService.reconcileProtocolDeletesWithPendingActions(reference, expmats);\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Reference Completed Tasks\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public getCompletedWorkflowActions(reference: Reference): WorkflowActivityCompletedItem[] {\r\n const completedActions: WorkflowActivityCompletedItem[] = [];\r\n\r\n if (reference.workflowRecordedActions == null || reference.workflowRecordedActions.length == 0) {\r\n return completedActions;\r\n }\r\n\r\n let count = 0;\r\n\r\n const actions = reference.workflowRecordedActions.filter(a => a.typeWorkflowAction.description != null);\r\n actions.forEach(a => {\r\n let sentToName: string;\r\n\r\n if (this.isSentToOrNotifyAction(a.typeWorkflowActionId)) {\r\n if (a.completedWorkflowActionId == 'REASSIGN') {\r\n sentToName = 'Reassigned from ' + ((a.sentToTypeWorkflowContact) ? a.sentToTypeWorkflowContact.firstName : '');\r\n } else {\r\n sentToName = ((a.sentToTypeWorkflowContact) ? a.sentToTypeWorkflowContact.firstName : '');\r\n }\r\n } else {\r\n sentToName = '';\r\n }\r\n\r\n const item: WorkflowActivityCompletedItem = {\r\n workflowActivityCompletedItemId: count++,\r\n workflowRecordedActionId: a.workflowRecordedActionId,\r\n workflowContactId: a.createdWorkflowContactId,\r\n staffFirstName: (a.createdTypeWorkflowContact) ? a.createdTypeWorkflowContact.firstName : a.createdUser,\r\n typeWorkflowActionId: a.typeWorkflowActionId,\r\n workflowActionDescription: a.typeWorkflowAction.description,\r\n created: a.created,\r\n actionData: sentToName,\r\n canDeleteFromWorkflowHistory: a.typeWorkflowAction.canDeleteFromWorkflowHistory,\r\n completedOnlyType: a.typeWorkflowAction.completedOnlyType\r\n };\r\n completedActions.push(item);\r\n });\r\n\r\n const completedNext = reference.workflowRecordedActions\r\n .filter(p => p.actionCompletedDate != null && p.completedTypeWorkflowAction.completedOnlyType && p.propertyName != 'incomplete');\r\n\r\n if (completedNext != null && completedNext.length > 0) {\r\n\r\n completedNext.forEach(c => {\r\n const item: WorkflowActivityCompletedItem = {\r\n workflowActivityCompletedItemId: count++,\r\n workflowRecordedActionId: c.workflowRecordedActionId,\r\n workflowContactId: c.completedWorkflowContactId,\r\n staffFirstName: (c.completedTypeWorkflowContact) ? c.completedTypeWorkflowContact.firstName : c.completedUser,\r\n typeWorkflowActionId: c.completedWorkflowActionId,\r\n workflowActionDescription: c.completedTypeWorkflowAction.description,\r\n created: c.actionCompletedDate,\r\n actionData: (c.sentToTypeWorkflowContact) ? c.sentToTypeWorkflowContact.firstName : '',\r\n canDeleteFromWorkflowHistory: c.completedTypeWorkflowAction.canDeleteFromWorkflowHistory,\r\n completedOnlyType: c.completedTypeWorkflowAction.completedOnlyType\r\n };\r\n completedActions.push(item);\r\n });\r\n }\r\n\r\n return _.sortBy(completedActions, c => c.created).reverse();\r\n }\r\n\r\n private isSentToOrNotifyAction(actionId: string): boolean {\r\n return (actionId == 'SENT TO' || actionId == 'SENT AGAIN' || actionId == 'NOTIFY');\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Reference Finished State proxy\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public isReferenceFinished(reference: Reference): Promise {\r\n return this._referenceFinishedService.isReferenceFinished(reference);\r\n }\r\n\r\n public get unfinishedReasons(): string[] {\r\n return this._referenceFinishedService.unfinishedReasons;\r\n }\r\n\r\n public enumerateMissingData(reference: Reference): Promise {\r\n return this._referenceFinishedService.enumerateMissingData(reference);\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Workflow Deletion Service proxy\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public processDeleteWorkflowAction(reference: Reference, action: WorkflowActivityCompletedItem) {\r\n this._workflowDeletionService.processDeleteWorkflowAction(reference, action);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { UserManager } from './user-manager';\r\nimport { Reference, TypeWorkflowContact } from '../entities/EntityModels';\r\nimport { WorkflowEntityState, WorkflowState } from './workflow-state';\r\nimport { UnitOfWork } from './unit-of-work';\r\nimport { WorkflowService } from './workflow-service';\r\n\r\n@Injectable()\r\nexport class WorkflowEmailService {\r\n\r\n private _workflowSendToEmails: Array = new Array();\r\n private _workflowNotifyEmails: Array = new Array();\r\n\r\n constructor(private _uow: UnitOfWork, private _workflowService: WorkflowService, private _userManager: UserManager) {\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Email Notifications for Sent To and Notify\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public addEmailToSendToList(contact: TypeWorkflowContact, reference: Reference, resend: boolean) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n\r\n if (resend) {\r\n workflow.workflowPropertyName = 'sentAgain';\r\n } else {\r\n workflow.workflowPropertyName = 'sentTo';\r\n }\r\n\r\n if (reference.finished) {\r\n workflow.workflowPropertyName = workflow.workflowPropertyName + 'Finished'; // Won't include the to complete task labeled 'Finish Data' if already finished\r\n }\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n workflow.workflowContactId = contact.workflowContactId;\r\n workflow.workflowContactEmail = contact.emailAddress;\r\n\r\n this._workflowSendToEmails.push(workflow);\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n\r\n }\r\n\r\n // Sent To is used to assign a Reference to a Staff member.\r\n // Only one Staff member should be assigned to a Reference at a time.\r\n public reassignPreviousSentTo(reference: Reference): Promise {\r\n\r\n const currentUserName = this._userManager.currentUser.name;\r\n let workflowContactId = 0;\r\n\r\n return this._uow.typeWorkflowContactRepository.all().then(r => {\r\n const contact = r.filter(c => c.emailAddress.toUpperCase() == this._userManager.currentUser.name.toUpperCase());\r\n\r\n if (contact != null && contact.length > 0) {\r\n workflowContactId = contact[0].workflowContactId;\r\n }\r\n\r\n if (reference.workflowRecordedActions != null && reference.workflowRecordedActions.length > 0) {\r\n\r\n const sentto = reference.workflowRecordedActions\r\n .filter(s => (s.typeWorkflowActionId == 'SENT TO' || s.typeWorkflowActionId == 'SENT AGAIN') && s.actionCompletedDate == null);\r\n\r\n if (sentto != null && sentto.length > 0) {\r\n sentto.forEach(s => {\r\n s['completedWorkflowActionId'] = 'REASSIGN';\r\n s['actionCompletedDate'] = new Date();\r\n s['completedUser'] = currentUserName;\r\n\r\n if (workflowContactId > 0) {\r\n s['completedWorkflowContactId'] = workflowContactId;\r\n }\r\n });\r\n }\r\n }\r\n\r\n return Promise.resolve(true);\r\n });\r\n }\r\n\r\n public removeEmailFromSendToList(contactId: number, reference: Reference) {\r\n\r\n if (this._workflowSendToEmails == null || this._workflowSendToEmails.length == 0) {\r\n return;\r\n }\r\n\r\n // Discard requested notifications\r\n const reject = this._workflowSendToEmails.filter(e => e.workflowContactId == contactId);\r\n if (reject != null) {\r\n\r\n reject.forEach(w => {\r\n this._workflowService.rejectWorkflowRecordedNotification(w, reference);\r\n });\r\n }\r\n\r\n // Save remaining notifications if they exists\r\n const save = this._workflowSendToEmails.filter(e => e.workflowContactId != contactId);\r\n this._workflowSendToEmails = save;\r\n\r\n }\r\n\r\n public addEmailToNotifyList(contact: TypeWorkflowContact, reference: Reference) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n workflow.workflowPropertyName = 'notify';\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n workflow.workflowContactId = contact.workflowContactId;\r\n workflow.workflowContactEmail = contact.emailAddress;\r\n\r\n this._workflowNotifyEmails.push(workflow);\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n\r\n }\r\n\r\n public removeEmailFromNotifyList(contactId: number, reference: Reference) {\r\n\r\n if (this._workflowNotifyEmails == null || this._workflowNotifyEmails.length == 0) {\r\n return;\r\n }\r\n\r\n // Discard requested notifications\r\n const reject = this._workflowNotifyEmails.filter(e => e.workflowContactId == contactId);\r\n if (reject != null) {\r\n reject.forEach(w => {\r\n this._workflowService.rejectWorkflowRecordedNotification(w, reference);\r\n });\r\n }\r\n\r\n // Save remaining notifications if they exists\r\n const save = this._workflowNotifyEmails.filter(e => e.workflowContactId != contactId);\r\n this._workflowNotifyEmails = save;\r\n\r\n }\r\n\r\n public sendEmails(reference: Reference) {\r\n\r\n // Ensure pending \"Sent To\" tasks are marked complete for the Reference\r\n // The action invoked from the settings below should be a \"finish only\" type of action\r\n if (this._workflowSendToEmails.length > 0) {\r\n const workflow = new WorkflowState();\r\n workflow.workflowReferenceId = reference.referenceId;\r\n workflow.workflowEntityName = reference.entityType.shortName;\r\n workflow.workflowPropertyName = 'sentTo=finished';\r\n workflow.workflowEntityState = WorkflowEntityState.Modified;\r\n this._workflowService.addWorkflowEvent(workflow, reference);\r\n }\r\n\r\n while (this._workflowSendToEmails.length) {\r\n\r\n const email = this._workflowSendToEmails.pop();\r\n\r\n this.sendSendToAssigmentEmail(reference, email.workflowContactEmail);\r\n }\r\n\r\n while (this._workflowNotifyEmails.length) {\r\n\r\n const email = this._workflowNotifyEmails.pop();\r\n\r\n this.sendNotifyEmail(reference, email.workflowContactEmail);\r\n }\r\n }\r\n\r\n public sendNotifyEmail(reference: Reference, emailAddress: string) {\r\n\r\n const params = {\r\n title: reference.title,\r\n briefReference: reference.briefReference,\r\n referenceId: reference.referenceId,\r\n emailAddress: emailAddress\r\n };\r\n\r\n this._uow.fetch('Workflow/NotifyStaff', params);\r\n return;\r\n }\r\n\r\n public sendSendToAssigmentEmail(reference: Reference, emailAddress: string) {\r\n const params = {\r\n title: reference.title,\r\n briefReference: reference.briefReference,\r\n referenceId: reference.referenceId,\r\n emailAddress: emailAddress\r\n };\r\n\r\n this._uow.fetch('Workflow/SendToStaff', params);\r\n return;\r\n }\r\n\r\n public isResend(reference: Reference) {\r\n if (reference.workflowRecordedActions == null || reference.workflowRecordedActions.length == 0) {\r\n return false;\r\n }\r\n\r\n const pending = reference.workflowRecordedActions\r\n .filter(a => (a.typeWorkflowActionId == 'SENT TO' || a.typeWorkflowActionId == 'SENT AGAIN') && a.actionCompletedDate == null);\r\n\r\n if (pending == null || pending.length == 0) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { CanActivate } from '@angular/router';\r\nimport { UserManager } from './user-manager';\r\n\r\nimport { from } from 'rxjs';\r\n\r\n@Injectable()\r\nexport class AuthGuard implements CanActivate {\r\n constructor(private _userManager: UserManager) {\r\n }\r\n\r\n canActivate() {\r\n return from (this._userManager.checkIfLoggedInOAuth());\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { CanActivate } from '@angular/router';\r\nimport { UserManager } from './user-manager';\r\n\r\nimport { from } from 'rxjs';\r\n\r\n@Injectable()\r\nexport class AuthGuardAllowAuthorized implements CanActivate {\r\n constructor(private _userManager: UserManager) {\r\n }\r\n\r\n canActivate() {\r\n return from (this._userManager.checkIfLoggedInOAuth());\r\n }\r\n}\r\n","import { CanDeactivate } from '@angular/router';\r\nimport { from, Observable } from 'rxjs';\r\nimport { Injectable } from \"@angular/core\";\r\n\r\nexport interface CanComponentDeactivate {\r\n canDeactivate: () => boolean | Promise | Observable;\r\n}\r\n\r\n@Injectable()\r\nexport class CanDeactivateGuard implements CanDeactivate {\r\n canDeactivate(component: CanComponentDeactivate): Observable | boolean {\r\n if (!component.canDeactivate) {\r\n return true;\r\n }\r\n const r = component.canDeactivate();\r\n if (r == undefined) {\r\n return r;\r\n }\r\n if (typeof r === 'boolean') {\r\n return r;\r\n }\r\n return r.then ? from(>r) : r;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot } from '@angular/router';\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { Material } from '../../entities/Material';\r\nimport { Observable, from } from 'rxjs';\r\n\r\n@Injectable()\r\nexport class MaterialResolver implements Resolve {\r\n private _url: string;\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _router: Router) {\r\n }\r\n\r\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable {\r\n this._url = this._router.url;\r\n const id = parseInt(route.params['id'], 10);\r\n return from(this.fetch(id));\r\n }\r\n\r\n fetch(materialId: number): Promise {\r\n const cm = this._stateMap.currentMaterial;\r\n if (cm && cm.materialId == materialId) {\r\n return Promise.resolve(cm);\r\n }\r\n this._uow.clearEntityManager();\r\n return this._uow.materialRepository.withId(materialId).then(m => {\r\n if (!m) {\r\n const p = this._stateMap.yesNoComponent.showModal('Material not available',\r\n 'This material does exist but is not currently available.', ['Ok']);\r\n return p.then(() => {\r\n // so we return to our original location.\r\n this._router.navigateByUrl(this._url);\r\n return m;\r\n });\r\n }\r\n this._stateMap.currentMaterial = m;\r\n this.fetchHasDataInfo(m); // fetch info about which tabs have data - lazily.\r\n return m;\r\n });\r\n\r\n }\r\n\r\n fetchHasDataInfo(material: Material) {\r\n\r\n const materialId = material.materialId;\r\n // determine which tabs have data\r\n\r\n // StructureIdentity - naturalOccurrences tab\r\n const p = {materialId: materialId};\r\n this._uow.naturalOccurrenceDescriptorRepository.whereWithParams(p).then(r => {\r\n this._stateMap.setHasMaterialDataFor('natural-occurrences', r.length > 0);\r\n });\r\n\r\n // Tox Data (Added 07/30/2024)\r\n this._uow.fetch('Materials/CountExperimentalMaterials', {materialId: materialId}).then(c => {\r\n this._stateMap.setHasMaterialDataFor('toxic-data', c > 0);\r\n });\r\n\r\n // Relations tab and subtabs.\r\n this._uow.fetch('Materials/MaterialRelationsBundle', p).then(r => {\r\n const obj = r[0];\r\n this._stateMap.setHasMaterialDataFor('relations-materials', (obj.items.length > 0) || (obj.naturalItems.length > 0));\r\n }).then(() => {\r\n return this._uow.materialFSAGRepository.whereWithParams({materialId: materialId, sagId: null}).then(r => {\r\n this._stateMap.setHasMaterialDataFor('relations-groups', r.length > 0);\r\n });\r\n }).then(() => {\r\n const hasRelationsData = this._stateMap.hasMaterialDataFor('relations-materials')\r\n || this._stateMap.hasMaterialDataFor('relations-groups');\r\n this._stateMap.setHasMaterialDataFor('relations', hasRelationsData);\r\n });\r\n\r\n // Flavor tabs and subtabs\r\n let rfs: any;\r\n this._uow.foodStatusRepository.whereWithParams(p).then(r => {\r\n rfs = r;\r\n const pFlavor = {materialId: materialId, statusType: 'flavor'};\r\n return this._uow.regulatoryStatusRepository.whereWithParams(pFlavor);\r\n }).then(r => {\r\n this._stateMap.setHasMaterialDataFor('flavor-statuses', rfs.length > 0 || r.length > 0);\r\n\r\n const pFlavor = {materialId: materialId};\r\n return this._uow.materialUsesRepository.whereWithParams(pFlavor);\r\n }).then(r => {\r\n this._stateMap.setHasMaterialDataFor('flavor-uses', r.length > 0);\r\n\r\n const pFlavor = {materialId: materialId, materialType: 'flavor'};\r\n return this._uow.materialConsumptionRepository.whereWithParams(pFlavor);\r\n }).then(r => {\r\n this._stateMap.setHasMaterialDataFor('flavor-volumes', r.length > 0);\r\n\r\n const hasFlavorsData = this._stateMap.hasMaterialDataFor('flavor-statuses')\r\n || this._stateMap.hasMaterialDataFor('flavor-uses')\r\n || this._stateMap.hasMaterialDataFor('flavor-volumes');\r\n this._stateMap.setHasMaterialDataFor('flavor', hasFlavorsData);\r\n });\r\n\r\n // Status tabs and subtabs\r\n\r\n this._uow.nationalToxicologyProgramRepository.whereWithParams(p).then(r => {\r\n this._stateMap.setHasMaterialDataFor('status-ntps', r.length > 0);\r\n\r\n const pStatus = {materialId: materialId, statusType: 'general'};\r\n return this._uow.regulatoryStatusRepository.whereWithParams(pStatus);\r\n }).then(r => {\r\n this._stateMap.setHasMaterialDataFor('regulatory-statuses-general', r.length > 0);\r\n\r\n const pStatus = {materialId: materialId, statusType: 'ifra'};\r\n return this._uow.regulatoryStatusRepository.whereWithParams(pStatus);\r\n }).then(r => {\r\n this._stateMap.setHasMaterialDataFor('regulatory-statuses-ifra', r.length > 0);\r\n\r\n const pStatus = {materialId: materialId, statusType: 'occupational'};\r\n return this._uow.regulatoryStatusRepository.whereWithParams(pStatus);\r\n }).then(r => {\r\n this._stateMap.setHasMaterialDataFor('regulatory-statuses-occupational', r.length > 0);\r\n\r\n const hasStatusData = this._stateMap.hasMaterialDataFor('status-ntps')\r\n || this._stateMap.hasMaterialDataFor('regulatory-statuses-general')\r\n || this._stateMap.hasMaterialDataFor('regulatory-statuses-ifra')\r\n || this._stateMap.hasMaterialDataFor('regulatory-statuses-occupational');\r\n this._stateMap.setHasMaterialDataFor('status', hasStatusData);\r\n });\r\n\r\n // Predictions / Cramer class\r\n this._uow.predictionRepository.whereWithParams(p).then(r => {\r\n this._stateMap.setHasMaterialDataFor('prediction-hh-cramer', r.length > 0);\r\n });\r\n\r\n const hasAssessment = (material.assessmentReportName != null) && (material.assessmentReportName.trim().length > 0);\r\n this._stateMap.setHasMaterialDataFor('safety-assessment', hasAssessment);\r\n\r\n // Publications\r\n this._uow.materialExpertPanelSummaryRepository.whereWithParams({materialId: materialId}).then(r => {\r\n const hasFFIDS = (material.fFIDSFile != null) && material.fFIDSFile.trim() !== '';\r\n const hasMonograph = (material.materialMonographs != null) && (material.materialMonographs.length > 0);\r\n const summariesLength = r.map(item => item.expertPanelSummary)\r\n .filter(s => s.narrativeLink != null && s.narrativeLink.trim() != '').length;\r\n this._stateMap.setHasMaterialDataFor('publications', summariesLength > 0 || hasFFIDS || hasMonograph);\r\n });\r\n\r\n // Reach\r\n this._uow.rEACHRegistrationRepository.whereWithParams({materialId: materialId}).then(r => {\r\n this._stateMap.setHasMaterialDataFor('reach', r.length > 0);\r\n });\r\n\r\n // Material Consumption\r\n this._uow.materialConsumptionRepository.whereWithParams({materialId: materialId}).then(mc => {\r\n const withuse = mc.filter(k => k.kilogramsConsumed > 0);\r\n this._stateMap.setHasMaterialDataFor('material-consumptions', withuse.length > 0);\r\n });\r\n\r\n let hasCompositionData = false;\r\n let isComponent = false;\r\n\r\n // Material Composition\r\n this._uow.materialCompositionRepository.whereWithParams({materialId: materialId}).then(mc => {\r\n hasCompositionData = (mc != null && mc.length > 0);\r\n this._stateMap.setHasMaterialDataFor('material-composition', hasCompositionData);\r\n if (hasCompositionData) {\r\n this._stateMap.setHasMaterialDataFor('naturals', true); // Naturals\r\n }\r\n });\r\n\r\n // Material Component\r\n this._uow.materialComponentRepository.whereWithParams({materialId: materialId}).then(c => {\r\n isComponent = (c != null && c.length > 0);\r\n this._stateMap.setHasMaterialDataFor('material-partof-compounds', isComponent);\r\n if (isComponent) {\r\n this._stateMap.setHasMaterialDataFor('naturals', true); // Naturals\r\n }\r\n });\r\n\r\n // Naturals: only set false once to avoid flicker\r\n if (hasCompositionData == false && isComponent == false) {\r\n this._stateMap.setHasMaterialDataFor('naturals', false);\r\n }\r\n\r\n // Material Exposure Data\r\n this._uow.materialExposureSurveyRepository.whereWithParams({materialId: materialId}).then(mes => {\r\n if (mes.length > 0) {\r\n this._stateMap.setHasMaterialDataFor('material-exposure', true);\r\n } else {\r\n this._uow.materialExposureSurveyIsomerRepository.whereWithParams({materialId: materialId}).then(mis => {\r\n if (mis.length > 0) {\r\n this._stateMap.setHasMaterialDataFor('material-exposure', true);\r\n } else {\r\n this._uow.materialExposureCustomSurveyMeasureRepository.whereWithParams({materialId: materialId}).then(cs => {\r\n this._stateMap.setHasMaterialDataFor('material-exposure', cs.length > 0);\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot } from '@angular/router';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { Reference } from '../../entities/Reference';\r\nimport { from, Observable } from 'rxjs';\r\n\r\n@Injectable()\r\nexport class ReferenceResolver implements Resolve {\r\n private _url: string;\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _router: Router) {\r\n }\r\n\r\n resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable {\r\n // save the original url where we are coming from.\r\n this._url = this._router.url;\r\n const id = parseInt(route.params['id'], 10);\r\n return from(this.fetch(id));\r\n }\r\n\r\n fetch(referenceId: number): Promise {\r\n const cr = this._stateMap.currentReference;\r\n if (cr && cr.referenceId == referenceId) {\r\n return Promise.resolve(cr);\r\n }\r\n\r\n this._uow.clearEntityManager();\r\n return this._uow.referenceRepository.withId(referenceId).then(r => {\r\n if (!r) {\r\n // this means that the reference is either not available for this login or has been deleted.\r\n const p = this._stateMap.yesNoComponent.showModal('Reference not available',\r\n 'Reference has been added to the RIFM Database and Toxicological Data entry is in progress', ['Ok']);\r\n return p.then(() => {\r\n // so we return to our original location.\r\n this._router.navigateByUrl(this._url);\r\n return r;\r\n });\r\n }\r\n this._stateMap.currentReference = r;\r\n this.fetchHasDataInfo(r); // fetch info about which tabs have data - lazily.\r\n return r;\r\n });\r\n\r\n }\r\n\r\n fetchHasDataInfo(reference: Reference) {\r\n\r\n const referenceId = reference.referenceId;\r\n // determine which tabs have data\r\n\r\n const q = { referenceId: referenceId };\r\n this._uow.referenceRelationRepository.whereWithParams(q).then(r => {\r\n this._stateMap.setHasReferenceDataFor('reference-relations', r.length > 0);\r\n });\r\n\r\n this._uow.referenceRepository.populateBiologicalData(reference).then(r => {\r\n this._stateMap.setHasReferenceDataFor('reference-data', r.length > 0);\r\n })\r\n }\r\n\r\n}\r\n","import { EntityBase } from './EntityBase';\r\nimport { Validator } from 'breeze-client';\r\nimport { Journal } from './Journal';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class JournalReserve extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n journalReserveId: number;\r\n journalId: number;\r\n journalYear: number;\r\n volume: string;\r\n issue: string;\r\n pages: string;\r\n notes: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n journal: Journal;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\nimport { Validator } from 'breeze-client';\r\nimport { Journal } from './Journal';\r\nimport { TypeJournalSubscription } from './TypeJournalSubscription';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\nexport class JournalSubscription extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n journalSubscriptionId: number;\r\n journalId: number;\r\n typeJournalSubscriptionId: string;\r\n subscriptionStartMonth: number;\r\n subscriptionStartYear: number;\r\n subscriptionEndMonth: number;\r\n subscriptionEndYear: number;\r\n issuesPerYear: string;\r\n department: string;\r\n subscriptionPayer: string;\r\n publisher: string;\r\n membershipSubscription: string;\r\n subscriptionAccountNumbers: string;\r\n subscriptionContact: string;\r\n paymentActivity: string;\r\n orderNumber: string;\r\n notes: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n journal: Journal;\r\n typeJournalSubscription: TypeJournalSubscription;\r\n}\r\n\r\n","import { EntityBase } from './EntityBase';\r\n\r\nimport { Validator } from 'breeze-client';\r\n\r\n/// Place custom imports between tags\r\n\r\n/// \r\n\r\nexport class ReportingOrganization extends EntityBase {\r\n\r\n /// Place custom code between tags\r\n\r\n /// \r\n\r\n // Generated code. Do not place code below this line.\r\n reportingOrganizationId: number;\r\n organizationName: string;\r\n surveyYearAdded: string;\r\n notes: string;\r\n created: Date;\r\n createdUser: string;\r\n modified: Date;\r\n modifyUser: string;\r\n rowVersion: number;\r\n}\r\n","import { ElementRef } from '@angular/core';\r\n\r\nexport interface IModalDialog {\r\n elementRef: ElementRef; // top level element in this component\r\n modalParent: any; // a component\r\n modalResult: T;\r\n validationFn?: (x: T) => string;\r\n validationMessage?: string;\r\n}\r\n\r\nexport abstract class ModalDialog implements IModalDialog {\r\n protected constructor(public elementRef: ElementRef) {\r\n }\r\n\r\n modalParent: any; // a component\r\n modalResult: T;\r\n validationFn: (x: T) => string;\r\n validationMessage: string;\r\n}\r\n","import { UtilFns } from '../utils/common';\r\nimport * as _ from 'lodash';\r\n\r\n// tslint:disable-next-line:class-name\r\ninterface entityValueFn {\r\n // tslint:disable-next-line:callable-types\r\n (entity: any): string;\r\n}\r\n\r\nexport interface SortMap {\r\n [K: string]: string | entityValueFn;\r\n}\r\n\r\nexport class SortColumn {\r\n constructor(public name: string, public up: boolean) {\r\n\r\n }\r\n}\r\n\r\nexport class ColumnSorter {\r\n\r\n _defaultSortColumn: SortColumn;\r\n _sortColumn: SortColumn;\r\n\r\n constructor(public _parentComponent: any, public _sortMap: SortMap, sortColumn?: SortColumn | string, public _sortColumnChanged?: (sc: SortColumn) => void) {\r\n if (sortColumn) {\r\n if (sortColumn instanceof SortColumn) {\r\n this._sortColumn = sortColumn;\r\n } else {\r\n this._sortColumn = new SortColumn(sortColumn, true);\r\n }\r\n } else {\r\n this._sortColumn = new SortColumn('', true);\r\n }\r\n this._defaultSortColumn = _.clone(this._sortColumn);\r\n if (!_sortColumnChanged) {\r\n this._sortColumnChanged = (sc) => undefined;\r\n }\r\n this._sortColumnChanged(this._sortColumn);\r\n }\r\n\r\n public iconMap: {} = {};\r\n\r\n public get sortColumn(): SortColumn {\r\n return this._sortColumn;\r\n }\r\n\r\n public set sortColumn(sc: SortColumn) {\r\n this.sortColumn.name = sc.name;\r\n this.sortColumn.up = sc.up;\r\n this._sortColumnChanged(this.sortColumn);\r\n }\r\n\r\n public reset() {\r\n this.sortColumn.name = this._defaultSortColumn.name;\r\n this.sortColumn.up = this._defaultSortColumn.up;\r\n this._sortColumnChanged(this.sortColumn);\r\n this.updateClasses();\r\n }\r\n\r\n private updateClasses() {\r\n _.forEach(this.iconMap, (iconChild, colName) => {\r\n (iconChild).className = this.getClasses(colName);\r\n });\r\n }\r\n\r\n public select(columnName: string) {\r\n if (this.sortColumn.name == columnName) {\r\n this.sortColumn.up = !this.sortColumn.up;\r\n } else {\r\n this.sortColumn.name = columnName;\r\n this.sortColumn.up = false;\r\n }\r\n this._sortColumnChanged(this.sortColumn);\r\n }\r\n\r\n public applySort(columnName: string) {\r\n this.select(columnName);\r\n this._parentComponent.sortWith(this);\r\n }\r\n\r\n public getClasses(columnName: string) {\r\n if (this.sortColumn.name == columnName) {\r\n return this.sortColumn.up ? 'fa fa-caret-up' : 'fa fa-caret-down';\r\n } else {\r\n return '';\r\n }\r\n }\r\n\r\n // used for client side sorting\r\n public sort(collection: T[]): T[] {\r\n if (this.sortColumn.name == null || this.sortColumn.name.length == 0) {\r\n return collection;\r\n }\r\n const sortFn = this._sortMap[this.sortColumn.name];\r\n return UtilFns.sort(collection, this.sortColumn.up, sortFn);\r\n }\r\n\r\n // used for server side sorting where sort criteria is passed in breeze orderBy clause from the parent\r\n // not needed if passing the column name to the server.\r\n public getOrderBy(): string {\r\n return this._sortMap[this.sortColumn.name] + (this.sortColumn.up ? '' : ' desc');\r\n }\r\n\r\n\r\n}\r\n\r\n","import { Directive, ElementRef, Input, OnInit } from '@angular/core';\r\nimport { ColumnSorter } from './column-sorter';\r\nimport * as _ from 'lodash';\r\n\r\n// Example:\r\n// Author \r\n@Directive({\r\n selector: '[colSorter]',\r\n // tslint:disable-next-line:use-host-property-decorator\r\n host: {\r\n '(click)': 'clickColumnHeader()',\r\n }\r\n\r\n})\r\nexport class ColumnSorterDirective implements OnInit {\r\n @Input() colSorter: ColumnSorter;\r\n\r\n _colName: string;\r\n _iconChild: HTMLElement;\r\n\r\n constructor(public _el: ElementRef) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n const ne = this._el.nativeElement;\r\n if (ne.className.indexOf('sort-column') == -1) {\r\n ne.className = ne.className + ' sort-column';\r\n }\r\n this._colName = ne.textContent.trim();\r\n const spans = ne.getElementsByTagName('span');\r\n if (spans.length == 0) {\r\n this._iconChild = document.createElement('span');\r\n ne.appendChild(this._iconChild);\r\n } else {\r\n this._iconChild = spans[0];\r\n }\r\n this.colSorter.iconMap[this._colName] = this._iconChild;\r\n this.updateClasses();\r\n }\r\n\r\n clickColumnHeader() {\r\n this.colSorter.applySort(this._colName);\r\n this.updateClasses();\r\n }\r\n\r\n updateClasses() {\r\n _.forEach(this.colSorter.iconMap, (iconChild, colName) => {\r\n (iconChild).className = this.colSorter.getClasses(colName);\r\n });\r\n }\r\n}\r\n","// exports a single instance of the class not the class itself\r\nclass HtmlGreekTranslator {\r\n _greekUnicodeMap: { [name: string]: string };\r\n // type is to allow possible filtering later - not yet used.\r\n _htmlTranslations: { tag: string, encTag: string, type: string} [] = [];\r\n\r\n constructor() {\r\n this.buildMaps();\r\n }\r\n\r\n safeEncode(str: any) {\r\n if (typeof(str) != \"string\") return str;\r\n let r=this.greekToUnicode(str);\r\n // idea is to encode all of the 'good' html sequences into something that escaping wont touch\r\n this._htmlTranslations.forEach(t => r = this.replaceAll(r, t.tag, t.encTag));\r\n // then to escape the remaining string\r\n r = this.escapeHtml(r);\r\n // and then revert the encoded 'good' html sequences back to html.\r\n this._htmlTranslations.forEach(t => r = this.replaceAll(r, t.encTag, t.tag)); \r\n return r;\r\n }\r\n \r\n greekToUnicode(greek: string) {\r\n var r = greek;\r\n var map = this._greekUnicodeMap;\r\n for (let key in map) {\r\n r = this.replaceAll(r, key, map[key]);\r\n }\r\n return r; \r\n }\r\n\r\n escapeHtml(str: string) {\r\n return str\r\n .replace(/&/g, \"&\")\r\n .replace(//g, \">\")\r\n .replace(/\"/g, \""\")\r\n .replace(/'/g, \"'\")\r\n .replace(/\\//g, \"/\")\r\n }\r\n \r\n replaceAll(str: string, search: string, repl: string) {\r\n if (!str) return '';\r\n return str.split(search).join(repl);\r\n }\r\n \r\n \r\n\r\n buildMaps() {\r\n // char sequences that are likely to be unique and will not be affected by html escaping. \r\n var subst = {\r\n \"': '~@]@',\r\n '/>': '!]!'\r\n };\r\n\r\n // type is to allow possible filtering later - not yet used.\r\n var allowedHtmlTags: any[] = [\r\n { key: 'b', type: 'emphasis' },\r\n { key: 'u', type: 'emphasis' },\r\n { key: 'i', type: 'emphasis' },\r\n { key: 'sup', type: 'size' },\r\n { key: 'sub', type: 'size' },\r\n { key: 'font size=\"-2\"', type: 'size', endKey: 'font' }, \r\n { key: \"font face='symbol'\", type: 'mod', endKey: '' }, \r\n { key: \"br\", type: 'solo', endKey: '' } \r\n ];\r\n \r\n allowedHtmlTags.forEach(t => {\r\n var cfg: { tag: string, encTag: string, type: string}\r\n if (t.type == 'solo') {\r\n cfg = {\r\n tag: \"<\" + t.key + \"/>\", \r\n encTag: subst['<'] + this.replaceAll(this.replaceAll(t.key, '\"','%'), \"'\",'^') + subst['/>'],\r\n type: t.type\r\n }\r\n } else {\r\n cfg = { \r\n tag: \"<\" + t.key + \">\", \r\n encTag: subst['<'] + this.replaceAll(this.replaceAll(t.key, '\"','%'), \"'\",'^') + subst['>'],\r\n type: t.type\r\n };\r\n }\r\n this._htmlTranslations.push( cfg);\r\n if (t.endKey !== '') {\r\n this._htmlTranslations.push( {\r\n tag: \"\",\r\n encTag: subst[''],\r\n type: t.type \r\n });\r\n }\r\n });\r\n \r\n this._greekUnicodeMap = {\r\n \"α\": \"\\u03B1\",\r\n \"β\": \"\\u03B2\",\r\n \"γ\": \"\\u03B3\",\r\n \"δ\": \"\\u03B4\",\r\n \"ε\": \"\\u03B5\",\r\n \"ζ\": \"\\u03B6\",\r\n \"η\": \"\\u03B7\",\r\n \"θ\": \"\\u03B8\",\r\n \"ι\": \"\\u03B9\",\r\n \"κ\": \"\\u03BA\",\r\n \"λ\": \"\\u03BB\",\r\n \"μ\": \"\\u03BC\",\r\n \"ν\": \"\\u03BD\",\r\n \"ξ\": \"\\u03BE\",\r\n \"ο\": \"\\u03BF\",\r\n \"π\": \"\\u03C0\",\r\n \"ρ\": \"\\u03C1\",\r\n \"ς\": \"\\u03C2\",\r\n \"σ\": \"\\u03C3\",\r\n \"τ\": \"\\u03C4\",\r\n \"υ\": \"\\u03C5\",\r\n \"φ\": \"\\u03C6\",\r\n \"χ\": \"\\u03C7\",\r\n \"ψ\": \"\\u03C8\",\r\n \"ω\": \"\\u03C9\"\r\n };\r\n }\r\n}\r\n\r\nvar htmlGreekTranslator = new HtmlGreekTranslator();\r\n\r\nexport default htmlGreekTranslator;\r\n \r\n// ","import { Directive, ElementRef, Input, OnChanges } from '@angular/core';\r\nimport HtmlGreekTranslator from './html-greek-translator';\r\n\r\n// Example:\r\n//
\r\n@Directive({\r\n selector: '[htmlGreek]',\r\n})\r\nexport class HtmlGreekDirective implements OnChanges {\r\n @Input() htmlGreek: string;\r\n\r\n constructor(public _el: ElementRef) {\r\n }\r\n\r\n ngOnChanges() {\r\n const newVal = HtmlGreekTranslator.safeEncode(this.htmlGreek);\r\n this._el.nativeElement.innerHTML = newVal;\r\n\r\n }\r\n}\r\n","import {Directive, Input, ViewContainerRef, TemplateRef, ContentChild} from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[tab-pane]'\r\n})\r\nexport class TabPane {\r\n @Input() title: string;\r\n @Input() hasData: boolean = true;\r\n @Input() canDeactivate: boolean = true;\r\n _active: boolean = false;\r\n \r\n // constructor(public viewContainer: ViewContainerRef, \r\n // public templateRef: TemplateRef) { }\r\n\r\n constructor(public viewContainer: ViewContainerRef, \r\n public templateRef: TemplateRef) { } \r\n\r\n // add a '#self' attribute to any TabPane to make it available here or within the TabContainer.\r\n @ContentChild('self') component:any; \r\n \r\n @Input() set active(active: boolean) {\r\n active = !!active; // insure its a boolean - if coming in from template it can be a string.\r\n if (active == this._active) return;\r\n this._active = active;\r\n if (active) {\r\n this.viewContainer.createEmbeddedView(this.templateRef);\r\n } else {\r\n this.viewContainer.remove(0);\r\n }\r\n }\r\n\r\n get active(): boolean {\r\n return this._active;\r\n }\r\n \r\n\r\n}\r\n","import {Component, ContentChildren, QueryList, EventEmitter, Output} from '@angular/core';\r\nimport {TabPane} from './tab-pane.directive';\r\n\r\n@Component({\r\n selector: 'tab-container',\r\n template: `\r\n
\r\n \r\n `\r\n})\r\nexport class TabContainer {\r\n \r\n // add next line to any component that hosts a TabContainer in order to make the tabContainer available internally\r\n // only needed if you actually need to access that tabContainer programatically.\r\n // @ViewChild(TabContainer) tabContainer: TabContainer;\r\n \r\n @ContentChildren(TabPane) panes: QueryList;\r\n @Output() tabChange = new EventEmitter();\r\n\r\n currentPane: TabPane;\r\n\r\n selectTab(pane: number) {\r\n\r\n var currentPane = this.getCurrentPane();\r\n\r\n if (currentPane) {\r\n var comp = currentPane.component;\r\n if (currentPane.canDeactivate === false) {\r\n return;\r\n }\r\n if (comp && comp.canDeactivate) {\r\n if (!comp.canDeactivate()) {\r\n return;\r\n }\r\n }\r\n if (comp && comp.onDeactivate) {\r\n comp.onDeactivate();\r\n }\r\n }\r\n \r\n // wait a tick for panes array update before setting active pane\r\n setTimeout(() => {\r\n this.currentPane = this.panes.toArray()[pane];\r\n this.panes.toArray()\r\n .forEach((p: TabPane, i: number) => p.active = i === pane);\r\n this.tabChange.emit(pane);\r\n }, 0);\r\n\r\n }\r\n\r\n getCurrentPane(): TabPane {\r\n if (!this.currentPane && this.panes.length > 0) {\r\n this.currentPane = this.panes.toArray()[0];\r\n }\r\n return this.currentPane;\r\n }\r\n\r\n getCurrentComponent(): T {\r\n var pane = this.getCurrentPane();\r\n return (pane && pane.component);\r\n }\r\n}\r\n\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nexport abstract class EditPropParent {\r\n // id is used to distinguish when the same prop occurs more than once on a parent. ( unusual case)\r\n abstract getError(propName: string, id?: string): string;\r\n}\r\n\r\n// For jQuery tooltip use\r\n// \r\n@Component({\r\n selector: 'edit-prop',\r\n template: `\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n `\r\n})\r\nexport class EditPropComponent implements OnInit {\r\n @Input() label: string; // property label\r\n @Input() prop: string; // name of the property - used by getError();\r\n @Input() szs: string; // ',' separated list of md col sizes for (label class, content class, error class)\r\n @Input() isChild: string;\r\n @Input() id: string;\r\n\r\n _cols: string[];\r\n\r\n constructor(public _parent: EditPropParent) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._cols = (this.szs || '').split(',').map(x => x.trim());\r\n if (this._cols.length == 0) {\r\n this._cols = ['3', '3'];\r\n } else if (this._cols.length == 1) {\r\n this._cols = [this._cols[0], '3'];\r\n }\r\n }\r\n\r\n\r\n hasError() {\r\n if (!this._parent.getError) { return false; }\r\n const e = this._parent.getError(this.prop);\r\n return e && e.length > 0;\r\n }\r\n\r\n getError() {\r\n if (this._parent.getError) {\r\n const e = this._parent.getError(this.prop, this.id);\r\n return e;\r\n }\r\n }\r\n\r\n topLevelClass() {\r\n const hasClass = this.getError() ? 'has-error ' : 'has-success ';\r\n if (this.isChild == null) {\r\n return 'form-group ' + hasClass;\r\n } else {\r\n return hasClass;\r\n }\r\n }\r\n\r\n labelClass() {\r\n return 'control-label col-md-' + this._cols[0];\r\n }\r\n\r\n contentClass() {\r\n return 'col-md-' + this._cols[1];\r\n }\r\n\r\n inputGroupVisibilityStyle() {\r\n if (this.getError()) {\r\n return 'visible';\r\n } else {\r\n return 'hidden';\r\n }\r\n }\r\n\r\n errorClass() {\r\n if (this.getError()) {\r\n return 'fa fa-warning';\r\n }\r\n // Instead of displaying a check mark just don't display anything if ok.\r\n // } else {\r\n // return 'fa fa-check';\r\n // }\r\n }\r\n\r\n\r\n}\r\n","import { Component, ElementRef } from '@angular/core';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog } from '../../controls/common';\r\n\r\n@Component({\r\n selector: 'user-acknowledgement',\r\n templateUrl: './user-acknowledgement.html',\r\n\r\n})\r\nexport class UserAcknowledgementComponent extends ModalDialog {\r\n constructor(public elementRef: ElementRef) {\r\n super(elementRef);\r\n }\r\n\r\n onAccept(accept: boolean) {\r\n UtilFns.returnModal(this, accept);\r\n }\r\n\r\n onCancel(cancel: boolean) {\r\n UtilFns.returnModal(this, cancel);\r\n }\r\n\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n

Annual Renewal Agreement for the RIFM Database

\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n

\r\n PLEASE SCROLL DOWN AND READ THE SUBSCRIPTION AGREEMENT. ACCESS TO THE RIFM DATABASE WILL BE GRANTED ONLY UPON AGREEMENT BY THE SUBSCRIBER TO THE TERMS AND CONDITIONS OF\r\n THE ONLINE DATABASE SUBSCRIPTION AGREEMENT BELOW.\r\n

\r\n

ONLINE DATABASE SUBSCRIPTION AGREEMENT

\r\n
\r\n
\r\n The Research Institute for Fragrance Materials, Inc. (“RIFM”), a New York corporation, has compiled a database of toxicology data, literature and general information on fragrance\r\n and flavor raw materials (the “RIFM Database”). The RIFM Database is available online under the terms and conditions set forth in this Online Database Subscription Agreement (“Agreement”)\r\n between RIFM and the undersigned subscriber (“Subscriber”).\r\n
\r\n
\r\n
\r\n 1. Scope of License Grant. \r\n RIFM hereby grants Subscriber, through its authorized users (“Authorized Users”), a non-exclusive, non-transferable license to access and search the RIFM Database,\r\n download search results and selectively copy portions of RIFM Database in connection with such search results pursuant to the terms and conditions of this Agreement\r\n (hereinafter “Subscription Services”). \r\n Authorized Users with access to Subscription Services must be employees of Subscriber. \r\n Subscriber agrees that (i) the number of Authorized Users shall not exceed the number set forth in Appendix A;\r\n (ii) the RIFM Database shall be used solely for Subscriber’s internal purposes; (iii) Subscriber shall not allow online access to the RIFM Database to anyone other than Authorized Users of the Subscriber, whether by data link or Internet connection or by permitting\r\n access through terminals or computers of Authorized Users, or by other similar means or arrangements; (iv) Subscriber shall use the RIFM Database solely for lawful purposes\r\n and in accordance with this Agreement; (v) Subscriber shall not directly or indirectly download or allow others to download the RIFM Database in a systematic fashion; (vi)\r\n Subscriber shall not recompile or incorporate all or any portion of the RIFM Database in any database, website or other medium, absent RIFM’s prior written approval; (viii)\r\n Subscriber shall not republish, resell, modify, create derivative works of, systematically reproduce, permit bulk reproduction or distribution, store in a searchable,\r\n machine-readable form, time-share, or provide fee-for-service use of the RIFM Database; and (ix) Subscriber shall not remove, obscure or modify any copyright, proprietary or\r\n other notice included in the RIFM Database or use the database in any manner that would infringe the copyright or proprietary rights therein.\r\n\r\n RIFM reserves the rights, and Subscriber has no rights, to reproduce and/or otherwise use the RIFM Database in any manner for purposes of training and/or populating\r\n artificial intelligence technologies, unless Subscriber obtains RIFM’s specific and express written permission to do so. Nor does Subscriber have the right to sublicense or\r\n allow others to reproduce and/or otherwise use the RIFM Database in any manner for purposes of training and/or populating artificial intelligence technologies without\r\n Subscriber’s specific and express written permission.\r\n
\r\n
\r\n
\r\n 2. Term. \r\n The Term of this Agreement shall be one (1) year. This Agreement shall renew for successive one (1) year periods so long as Subscriber pays the annual subscription\r\n fees for Subscription Services, subject to any new terms and/or conditions required by RIFM for which Subscriber has received notification prior to renewal. \r\n Subscriber will be required to acknowledge and consent to this Agreement each year prior to renewal.\r\n
\r\n
\r\n
\r\n 3. Fees. \r\n The annual fees for Subscription Services shall be the current fees established by RIFM from time to time, as set forth in subscription renewal forms sent to\r\n Subscriber. \r\n Subscriber warrants that all information provided by Subscriber is accurate and agrees to report to RIFM any changes that might affect\r\n Subscriber’s classification and associated subscription fees. \r\n The annual subscription fee may be raised by written or electronic notice to Subscriber one (1) month prior to the renewal date.\r\n
\r\n
\r\n
\r\n 4. Support. \r\n RIFM will provide Subscriber with email and/or telephone support in RIFM’s sole discretion during RIFM’s normal business hours (Monday – Friday, \r\n 9:00 a.m. – 5:00 p.m., Eastern Time).\r\n
\r\n
\r\n
\r\n 5. Copyright. \r\n Subscriber acknowledges that the RIFM Database contains proprietary material owned by RIFM and/or contributors to the RIFM Database and is protected by\r\n United States copyright laws and international treaties. \r\n Subscriber acknowledges that it has no claim of ownership to the RIFM Database by reason of\r\n Subscriber’s use of or access to the database. \r\n Subscriber further acknowledges that RIFM owns all intellectual property rights to the RIFM Database,\r\n including the compilation, selection, coordination and arrangement of the content in the RIFM Database, as well as the RIFM Database website.\r\n
\r\n
\r\n
\r\n 6. Suspension or Termination of Subscription Service. \r\n RIFM may, in its sole discretion, terminate or suspend Subscriber’s ability to access all or any part of the Subscription Services or the RIFM Database,\r\n with or without notice, for any reason or no reason, including breach of this Agreement. \r\n Any use of the RIFM Database beyond the scope of this Agreement or any fraudulent, abusive or otherwise illegal activities may be grounds for termination. \r\n In addition, activity that may burden RIFM’s server(s), such as computer programs that automatically download content, commonly known as robots, spiders,\r\n crawlers, wanderers or accelerators, is grounds for termination.\r\n
\r\n
\r\n
\r\n 7. Disclaimer of Warranties. \r\n THE RIFM DATABASE IS PROVIDED AS IS, WITHOUT ANY WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF\r\n (i) MERCHANTABILITY, (ii) FITNESS FOR A PARTICULAR PURPOSE, (iii) ACCURACY, (iv) DESIGN, (v) USAGE, (vi) QUALITY, (vii) PERFORMANCE, (viii) COMPATIBILITY,\r\n OR (ix) TITLE. RIFM DOES NOT WARRANT THAT THE SUBSCRIBER’S USE OF THE RIFM DATABASE WILL BE UNINTERRUPTED, ERROR FREE, OR THAT THE RESULTS OBTAINED WILL\r\n BE ACCURATE OR USEFUL OR WILL SATISFY SUBSCRIBER’S REQUIREMENTS. \r\n FURTHERMORE, SUBSCRIBER AGREES THAT ALL USE OF THE RIFM DATABASE IS AT SUBSCRIBER’S SOLE\r\n RISK AND THAT RIFM WILL HAVE NO LIABILITY TO ANY PERSON FOR ANY LOSS OR DAMAGE ARISING OUT OF THE USE OF OR INABILITY TO USE THE RIFM DATABASE, OR THE\r\n CONTENT OR LACK OF CONTENT OF THE RIFM DATABASE.\r\n
\r\n
\r\n
\r\n 8. Limitation of Liability. \r\n UNDER NO CIRCUMSTANCES SHALL RIFM, INCLUDING ITS OFFICERS, DIRECTORS AND EMPLOYEES, AS WELL AS RIFM’S THIRD-PARTY CONSULTANTS AND CONTRACTORS,\r\n BE LIABLE TO SUBSCRIBER OR ANY AUTHORIZED USERS, FOR SPECIAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT, PUNITIVE OR EXEMPLARY DAMAGES OF ANY KIND,\r\n INCLUDING LOST PROFITS, LOST SAVINGS OR LOST REVENUES, WHETHER OR NOT CHARACTERIZED IN NEGLIGENCE, TORT, CONTRACT OR OTHER THEORY OF LIABILITY,\r\n EVEN IF RIFM HAS BEEN ADVISED OF THE POSSIBLITY OF OR COULD HAVE FORESEEN SUCH DAMAGES AND IRRESPECTIVE OF ANY FAILURE OF ESSENTIAL PURPOSE OF A\r\n LIMITED REMEDY. \r\n RIFM’S MAXIMUM LIABILITY UNDER THIS AGREEMENT SHALL BE THE REFUND OF SUBSCRIPTION FEES PAID BY SUBSCRIBER FOR THE ONE (1) YEAR\r\n PERIOD PRIOR TO THE EVENT GIVING RISE TO SUCH LIABILITY. \r\n IF ANY APPLICABLE AUTHORITY HOLDS ANY PORTION OF THIS SECTION TO BE UNEFORCEABLE,\r\n THEN RIFM’S LIABILITY WILL BE LIMITED TO THE FULLEST POSSSIBLE EXTENT PERMITTED BY APPLICABLE LAW.\r\n
\r\n
\r\n
\r\n 9. Indemnification. \r\n Subscriber shall indemnify RIFM and hold it harmless from any loss, claim or damage, including attorneys’ fees and expenses,\r\n arising out of Subscriber’s breach of this Agreement or its use or misuse of the RIFM Database.\r\n
\r\n
\r\n
\r\n 10. Reserved Rights. \r\n RIFM reserves the right in its sole discretion (i) to monitor and review Subscriber’s use of the RIFM Database, and may use any\r\n information relating to Subscriber’s access to, communication with and use of the RIFM Database; and (ii) to change, suspend or\r\n discontinue any aspect of the RIFM Database at any time, including the availability of any feature or content, and to impose limits on\r\n certain features and services or restrict Subscriber’s access to all or part of the RIFM Database without notice or liability.\r\n
\r\n
\r\n
\r\n 11. General. \r\n This Agreement contains the final and entire agreement regarding Subscriber’s use of the Subscription Services and supersedes all previous and\r\n contemporaneous oral or written agreements with respect to the subject matter contained herein. This Agreement is personal to Subscriber, which\r\n means that Subscriber may not assign its rights or obligations under this Agreement to anyone. No third party is a beneficiary of this Agreement\r\n for Subscriber. Subscriber agrees that this Agreement, as well as any and all claims arising from this Agreement, will be governed by and construed\r\n in accordance with the laws of the State of New York, without regard to any conflict or choice of law principles. The sole jurisdiction and venue for\r\n any litigation arising out of this Agreement will be an appropriate federal or state court located in New York. This Agreement will not be governed\r\n by the United Nations Convention on Contracts for the International Sale of Goods. Except as provided herein, no waiver or modification of this Agreement\r\n shall be effective unless it is in writing and signed by the parties hereto.. \r\n Should any provision of this Agreement be deemed void or unenforceable, the remaining provisions shall remain in full force and effect.\r\n
\r\n
\r\n
\r\n Subscriber certifies that it has read, understood and agrees to abide by this Agreement and that the signatory below is authorized to sign this Agreement on behalf of Subscriber.\r\n
\r\n
\r\n Revised January 2024\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n","\r\n
\r\n
\r\n
\r\n
\r\n
{{e.title}}
\r\n
{{e.content}}
\r\n \r\n
\r\n
\r\n
\r\n
","import { Component, OnInit } from '@angular/core';\r\nimport * as _ from 'lodash';\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { Announcement } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'whats-new',\r\n templateUrl: './whats-new.html'\r\n})\r\nexport class WhatsNewComponent implements OnInit {\r\n\r\n _announcements: Announcement[];\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _userManager: UserManager) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.announcementRepository.all().then(r => {\r\n this._announcements = _.orderBy(r, a => a.created, 'desc');\r\n });\r\n\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n linkTo(e: Announcement) {\r\n let url: string;\r\n const webLink = e.webLink;\r\n if (webLink.startsWith('http')) {\r\n url = webLink;\r\n } else {\r\n url = this._userManager.getFileServiceFilePathUrl(webLink);\r\n }\r\n\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n}\r\n","
\r\n\t\r\n\t
\r\n\t\t
\r\n\t\t
\r\n\t
\r\n\t
\r\n\t\t\r\n\t
\r\n
\r\n
\r\n\t\r\n
\r\n
\r\n\t
\r\n\t\tVersion {{ _stateMap.shortVersionNo }}\r\n\t\t
© Copyright Research Institute for Fragrance Materials, Inc. (RIFM) All Rights Reserved. No part of the RIFM Fragrance\r\n\t\tand Flavor Database may be reproduced or transmitted in any form or by any means, electronic or mechanical, including\r\n\t\tphotocopy, recording or any information storage and retrieval system, except with written permission from RIFM or\r\n\t\tas authorized by license or subscription agreement.\r\n\t
\r\n
\r\n\r\n\r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { EntityManagerProvider } from '../../services/entity-manager-provider';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { UserAcknowledgement } from '../../entities/EntityModels';\r\nimport { UserAcknowledgementComponent } from './user-acknowledgement.component';\r\n\r\nimport { RIFMDownloadableFile } from '../../entities/EntityModels';\r\nimport {HttpClient, HttpHeaders, HTTP_INTERCEPTORS} from '@angular/common/http';\r\nimport {Observable} from 'rxjs';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { HOME_ROUTES } from './home.routes';\r\n\r\n@Component({\r\n selector: 'home',\r\n templateUrl: './home-page.html'\r\n})\r\nexport class HomePageComponent implements OnInit {\r\n @ViewChild(UserAcknowledgementComponent, { static: true }) _userAcknowledgementComponent: UserAcknowledgementComponent;\r\n\r\n _documentManagementUrl: string;\r\n _hasAcceptedUseAgreement = false;\r\n _isInitialized = false;\r\n _isLoading = false;\r\n _validationMessage: string;\r\n\r\n _currentEntity: UserAcknowledgement;\r\n\r\n constructor(private _emProvider: EntityManagerProvider, public _userManager: UserManager, public _router: Router, private _httpClient: HttpClient,\r\n private _route: ActivatedRoute, public _location: Location, public _stateMap: StateMap, public _uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._emProvider.prepare().then(() => {\r\n this._isInitialized = true;\r\n\r\n const params = { userEmail: this._userManager.currentUser.name };\r\n return this._uow.fetchTyped('Misc/UserAcknowledgementForUserEmail', UserAcknowledgement, params)\r\n .then(r => {\r\n if (r != null && r.length > 0) {\r\n const entities = _.sortBy(r, (a: any) => a.userAcknowledgementDate).reverse();\r\n this._currentEntity = entities[0];\r\n if (this.validateUserAcknowledgement(this._currentEntity)) {\r\n return;\r\n }\r\n }\r\n\r\n // Missing a user acknowledgement record or the last accept date has expired\r\n return this.showUserAcknowledgement()\r\n .then(a => {\r\n if (this._hasAcceptedUseAgreement == false) {\r\n this.logout();\r\n }\r\n return;\r\n });\r\n });\r\n });\r\n\r\n this.getDocumentManagementUrl().then(url => {\r\n this._documentManagementUrl = url + '/RIFMDownloadableFile';\r\n this._stateMap.documentManagementBaseUrl = url; // This is needed for the show-and-download-pdf.component to avoid a timing issue with the serviceUrl.\r\n });\r\n }\r\n\r\n private validateUserAcknowledgement(ack: UserAcknowledgement): boolean {\r\n\r\n const msDay = 24 * 60 * 60 * 1000; // Number of milliseconds in a day\r\n const today = new Date();\r\n\r\n const diffDays = Math.round(Math.abs(today.getTime() - ack.userAcknowledgementDate.getTime()) / (msDay));\r\n\r\n return (this._userManager.UserAcknowledgementDuration >= diffDays);\r\n }\r\n\r\n private navigateLocal(path: string) {\r\n this._router.navigate(['../' + path], { relativeTo: this._route });\r\n }\r\n\r\n isAuthorizedDownloadUser() {\r\n return this._userManager.currentUser.isInRole('authorizeddownloaduser');\r\n }\r\n\r\n isIFRA() {\r\n return this._userManager.currentUser.isInRole('ifra');\r\n }\r\n\r\n isStaff() {\r\n return this._userManager.currentUser.isStaff;\r\n }\r\n\r\n downloadRequestForm() {\r\n this._isLoading = true;\r\n this.exportDownloadableFile('RIFMReportRequestForm.docx', 'UserSupport');\r\n this._isLoading = false;\r\n }\r\n\r\n downloadIFRANCSDocument() {\r\n this._isLoading = true;\r\n this.exportDownloadableFile('IFRA NCS BOTANICAL DEFINITION AND PROCESSING METHOD.pdf', 'Whats New');\r\n this._isLoading = false;\r\n }\r\n\r\n goIntro() {\r\n this.navigateLocal(HOME_ROUTES.Introduction.path);\r\n }\r\n\r\n goDatabaseSubscription() {\r\n this.navigateLocal(HOME_ROUTES.DatabaseSubscription.path);\r\n }\r\n\r\n goIFRAAttachments() {\r\n this.navigateLocal(HOME_ROUTES.IFRAAttachments.path);\r\n }\r\n\r\n goSafetyAssessments() {\r\n this.navigateLocal(HOME_ROUTES.SafetyAssessments.path);\r\n }\r\n\r\n goMaterialGroups() {\r\n this.navigateLocal(HOME_ROUTES.MaterialGroups.path);\r\n }\r\n\r\n goSearchAuthors() {\r\n this.navigateLocal(HOME_ROUTES.SearchAuthors.path);\r\n }\r\n\r\n goSearchSynonyms() {\r\n this.navigateLocal(HOME_ROUTES.SearchSynonyms.path);\r\n }\r\n\r\n\r\n goSearchStructure() {\r\n this.navigateLocal(HOME_ROUTES.SearchStructure.path);\r\n }\r\n\r\n goToolsAndModels() {\r\n this.navigateLocal(HOME_ROUTES.ToolsAndModels.path);\r\n }\r\n\r\n goReportDatabaseChanges() {\r\n this.navigateLocal(HOME_ROUTES.ReportDatabaseChanges.path);\r\n }\r\n\r\n goSystemRequirements() {\r\n this.navigateLocal(HOME_ROUTES.SystemRequirements.path);\r\n }\r\n\r\n goStaffEditing() {\r\n if (this._userManager.currentUser.isInRole('fema') == false) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Staff)); // Currently defaults to Material Edit which is not available for FEMA Staff\r\n } else {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Staff, ROUTES.Staff.childRoutes.Reference));\r\n }\r\n }\r\n\r\n goIFRASurveyUses() {\r\n this.navigateLocal(HOME_ROUTES.IFRASurveyUse.path);\r\n }\r\n\r\n goMaterialClusters() {\r\n this.navigateLocal(HOME_ROUTES.MaterialClusters.path);\r\n }\r\n\r\n goExposureAdmin() {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Exposure, ROUTES.Exposure.childRoutes.ExposureSurveys));\r\n }\r\n\r\n goDocManagement() {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.DocumentManagement, ROUTES.DocumentManagement.childRoutes.RIFMDocuments));\r\n }\r\n\r\n goEnvironmentalData() {\r\n this.navigateLocal(HOME_ROUTES.EnvironmentalData.path);\r\n }\r\n\r\n showUserAcknowledgement() {\r\n return UtilFns.showModal(this._userAcknowledgementComponent, this).then((result) => {\r\n this.onUserAcknowledgementAccept(result);\r\n });\r\n }\r\n\r\n onUserAcknowledgementAccept(accept: boolean) {\r\n if (accept == null || accept == false) {\r\n this._hasAcceptedUseAgreement = false;\r\n return false;\r\n }\r\n\r\n if (this._currentEntity == null) { // Add a new record to the User Acknowledgement table\r\n const params = {\r\n userEmail: this._userManager.currentUser.name,\r\n userAcknowledgementDate: new Date()\r\n };\r\n\r\n const userAcknowledgement = this._uow.userAcknowledgementFactory.create(params);\r\n } else { // Update the license agreement with a new acceptance date\r\n this._currentEntity.userAcknowledgementDate = new Date();\r\n }\r\n\r\n this._uow.commit();\r\n this._hasAcceptedUseAgreement = true;\r\n return true;\r\n }\r\n\r\n canShowDocManagementAdmin() {\r\n\r\n if (this._stateMap.currentUser.isStaff) {\r\n if (this._stateMap.currentUser.isInRole('consultant') || this._stateMap.currentUser.isInRole('FEMA')) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n canShowExposureAdmin() {\r\n\r\n if (this._stateMap.currentUser.isStaff) {\r\n if (this._stateMap.currentUser.isInRole('consultant') || this._stateMap.currentUser.isInRole('FEMA')) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n logout() {\r\n return this._userManager.logout().then(() => {\r\n this._location.replaceState('/home');\r\n document.location.reload();\r\n });\r\n }\r\n\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url\r\n // ************************************************************************\r\n getDownloadFileURL(fileName: string, subFolder: string): Observable {\r\n let url: string;\r\n url = this._documentManagementUrl + '/GetFileBySubFolderAndName?fileName=' + fileName + '&subFolder=' + subFolder ;\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public exportDownloadableFile(fileName: string, subFolder: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getDownloadFileURL(fileName, subFolder)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = 'File download successful.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { UnitOfWork, StateMap } from '../../services/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\n@Component({\r\n templateUrl: './intro.html'\r\n})\r\nexport class IntroComponent implements OnInit {\r\n\r\n _pageState = new PageState(\"Introduction\");\r\n \r\n constructor(public _uow: UnitOfWork, public _location: Location, public _stateMap: StateMap) {\r\n }\r\n \r\n ngOnInit() {\r\n }\r\n}\r\n","
\r\n\r\n
Introduction to the Fragrance and Flavors Database\r\n - Version {{ _stateMap.versionNo }}\r\n
\r\n\r\n
\r\n \r\n \r\n\r\n
\r\n
\r\n
\r\n Welcome to the new RIFM Database! If you were unable to attend one of the webinars that RIFM offered, please take a few minutes\r\n to view the recorded Database demonstration to get familiar with navigating the new Database.\r\n
\r\n
\r\n
The RIFM Database is the most comprehensive, worldwide source of toxicology data, literature and general\r\n information on fragrance and flavor raw materials. It currently contains over 65,000 references, including\r\n over 100,000 individual human health and environmental studies. The Database contains basic material\r\n information on over 5,000 flavor and fragrance materials such as: CAS numbers, synonyms, structures,\r\n molecular formulas and weights, physical properties and material relationships such as isomers and metabolites.\r\n Regulatory information such as EINECS, TSCA and DSL registrations, C/M/R classifications, IARC status,\r\n FDA GRAS status and California/EPA listings are also included for many materials. IFRA Standards, UV\r\n spectra, RIFM published monographs and group summaries can also be downloaded from the material pages\r\n in the Database.
\r\n\r\n
\r\n
The Database can be searched in a variety of ways; by individual materials, or by material groups such as\r\n structure activity groups, e.g. 'Alcohols Terpene Cyclic'. Individual reports or published papers can\r\n also be found by searching an author's name. Subscribers can also download a material synopsis on individual\r\n materials in the database that summarizes physical data, labeling, and toxicological data for each material.
\r\n\r\n
\r\n
Sources of data include RIFM sponsored studies, member company sponsored studies, government reports, and\r\n current literature. The amount and type of data that are available for each material depends on the number\r\n of studies that have been conducted for each material and the number of papers that have been published\r\n for each material. RIFM staff monitors the literature, indexes and abstracts and summarizes the data,\r\n which are added to the Database. The Database is updated and maintained on a daily basis by RIFM staff.
\r\n\r\n
\r\n
If you have any questions on Database content for fragrances, please contact Christen Sachse-Vasquez, csachse-vasquez@rifm.org.\r\n For Database content for flavors please contact Ms. Christie Harman, charman@vertosolutions.net.
\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n","import { Component, Input } from '@angular/core';\r\nimport { PageState } from './page-state';\r\n\r\n@Component({\r\n selector: 'page-status',\r\n template: `\r\n \r\n
\r\n {{pageState.loadStatusMsg}}\r\n
\r\n `\r\n})\r\nexport class PageStatusComponent {\r\n @Input() pageState: PageState;\r\n}\r\n","\r\n\r\n
\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t\t\r\n\t\t\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\t{{ getCaptiveText(cell.data.confidential) }}\r\n\t\t
\r\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\t 0\">{{cell.data.alternativeCASNumbers?.join('; ')}}\r\n\t\t
\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\r\n\t\t\r\n\t\t\r\n\t
\r\n
\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\nimport { IMaterialSearchResult, SearchService, StateMap } from '../../services/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { MaterialListItem } from '../../entities/projections/MaterialListItem';\r\nimport DataSource from 'devextreme/data/data_source';\r\nimport CustomStore from 'devextreme/data/custom_store';\r\n\r\nexport interface IMaterialResultsParent {\r\n selectMaterial(mli: MaterialListItem): void;\r\n}\r\n\r\n@Component({\r\n selector: 'material-results',\r\n templateUrl: './material-results.html'\r\n})\r\nexport class MaterialResultsComponent implements OnInit {\r\n _parentComponent: any;\r\n _searchResult: IMaterialSearchResult;\r\n\r\n _pageState = new PageState('Material Results');\r\n\r\n dataSource: DataSource;\r\n\r\n constructor(public _searchService: SearchService, public _stateMap: StateMap) {\r\n }\r\n\r\n ngOnInit() {\r\n this.dataSource = new DataSource({\r\n store: new CustomStore({\r\n load: (loadOptions: any) => {\r\n if (!this._searchResult) {\r\n this._pageState.isLoading = false;\r\n this._pageState.itemCount = 0;\r\n this._pageState.isLoadedWithNoData = true;\r\n return Promise.resolve({ data: [], totalCount: 0 });\r\n }\r\n\r\n let sort = { name: 'relevance', isDesc: false };\r\n if (loadOptions.sort) {\r\n sort = {\r\n name: loadOptions.sort[0].selector,\r\n isDesc: !!loadOptions.sort[0].desc\r\n };\r\n }\r\n\r\n const skip = loadOptions.skip ? loadOptions.skip / loadOptions.take : 0;\r\n const params = {\r\n searchTerm: this._searchResult.searchTerm,\r\n searchType: this._searchResult.searchType,\r\n orderByProp: 'relevance',\r\n pageNumber: skip,\r\n pageSize: loadOptions.take || 20,\r\n clientOrderBy: sort.name + (sort.isDesc ? ' desc' : '')\r\n };\r\n\r\n this._pageState.isLoading = true;\r\n return this._searchService.fetchMaterialsPage(params)\r\n .then(data => {\r\n this._pageState.isLoading = false;\r\n this._pageState.itemCount = data.totalCount;\r\n this._pageState.isLoadedWithNoData = data.totalCount == 0;\r\n return {\r\n data: data.materials,\r\n totalCount: data.totalCount\r\n };\r\n });\r\n }\r\n })\r\n });\r\n }\r\n\r\n onSelectionChanged(evt: any) {\r\n const material: MaterialListItem = evt.selectedRowsData[0];\r\n this.selectMaterial(material);\r\n }\r\n\r\n loading(value: boolean) {\r\n setTimeout(() => {\r\n this._pageState.isLoading = value;\r\n });\r\n }\r\n\r\n public update(parentComponent: IMaterialResultsParent, searchResult: IMaterialSearchResult) {\r\n this._parentComponent = parentComponent;\r\n this._searchResult = searchResult;\r\n\r\n const promise = this.dataSource.reload();\r\n\r\n promise\r\n .then((data: any) => {\r\n console.log(data);\r\n })\r\n .catch((err: any) => {\r\n this.dataSource.reload();\r\n });\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n getCaptiveText(confidential: boolean): string {\r\n\r\n return confidential ? 'Captive' : '';\r\n }\r\n\r\n selectMaterial(material: MaterialListItem) {\r\n if (this._parentComponent) {\r\n this._parentComponent.selectMaterial(material);\r\n }\r\n }\r\n\r\n hasData() {\r\n const items = this.dataSource.items();\r\n return items && items.length > 0;\r\n }\r\n}\r\n\r\n\r\n","import { EventEmitter, Injectable } from '@angular/core';\r\n\r\nexport interface IPaginationInstance {\r\n /**\r\n * An optional ID for the pagination instance. Only useful if you wish to\r\n * have more than once instance at a time in a given component.\r\n */\r\n id?: string;\r\n /**\r\n * The number of items per paginated page.\r\n */\r\n itemsPerPage: number;\r\n /**\r\n * The current (active) page.\r\n */\r\n currentPage: number;\r\n /**\r\n * The total number of items in the collection. Only useful when\r\n * doing server-side paging, where the collection size is limited\r\n * to a single page returned by the server API.\r\n *\r\n * For in-memory paging, this property should not be set, as it\r\n * will be automatically set to the value of collection.length.\r\n */\r\n totalItems?: number;\r\n}\r\n\r\n@Injectable()\r\nexport class PaginationService {\r\n\r\n public change = new EventEmitter();\r\n\r\n instances: { [id: string]: IPaginationInstance } = {};\r\n DEFAULT_ID = 'DEFAULT_PAGINATION_ID';\r\n\r\n get defaultId() {\r\n return this.DEFAULT_ID;\r\n }\r\n\r\n\r\n // static template config\r\n static templateUrl: string;\r\n static template: string;\r\n\r\n public register(instance: IPaginationInstance) {\r\n if (!instance.id) {\r\n instance.id = this.DEFAULT_ID;\r\n }\r\n\r\n if (!this.instances[instance.id]) {\r\n this.instances[instance.id] = instance;\r\n this.change.emit(instance.id);\r\n } else {\r\n const changed = this.updateInstance(instance);\r\n if (changed) {\r\n this.change.emit(instance.id);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Check each property of the instance and update any that have changed. Return\r\n * true if any changes were made, else return false.\r\n */\r\n updateInstance(instance: IPaginationInstance): boolean {\r\n let changed = false;\r\n for (const prop in this.instances[instance.id]) {\r\n if (instance[prop] !== this.instances[instance.id][prop]) {\r\n this.instances[instance.id][prop] = instance[prop];\r\n changed = true;\r\n }\r\n }\r\n return changed;\r\n }\r\n\r\n /**\r\n * Returns the current page number.\r\n */\r\n public getCurrentPage(id: string): number {\r\n if (this.instances[id]) {\r\n return this.instances[id].currentPage;\r\n }\r\n }\r\n\r\n /**\r\n * Sets the current page number.\r\n */\r\n public setCurrentPage(id: string, page: number) {\r\n if (this.instances[id]) {\r\n const instance = this.instances[id];\r\n const maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage);\r\n if (page <= maxPage && 1 <= page) {\r\n this.instances[id].currentPage = page;\r\n this.change.emit(id);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Sets the value of instance.totalItems\r\n */\r\n public setTotalItems(id: string, totalItems: number) {\r\n if (this.instances[id] && 0 <= totalItems) {\r\n this.instances[id].totalItems = totalItems;\r\n this.change.emit(id);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the value of instance.itemsPerPage.\r\n */\r\n public setItemsPerPage(id: string, itemsPerPage: number) {\r\n if (this.instances[id]) {\r\n this.instances[id].itemsPerPage = itemsPerPage;\r\n this.change.emit(id);\r\n }\r\n }\r\n\r\n /**\r\n * Returns a clone of the pagination instance object matching the id. If no\r\n * id specified, returns the instance corresponding to the default id.\r\n */\r\n public getInstance(id: string = this.DEFAULT_ID): IPaginationInstance {\r\n if (this.instances[id]) {\r\n return this.clone(this.instances[id]);\r\n }\r\n }\r\n\r\n /**\r\n * Perform a shallow clone of an object.\r\n */\r\n clone(obj: any): any {\r\n const target = {};\r\n for (const i in obj) {\r\n if (obj.hasOwnProperty(i)) {\r\n target[i] = obj[i];\r\n }\r\n }\r\n return target;\r\n }\r\n\r\n}\r\n","\r\n\r\n
\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\t{{ formatBriefReference(cell.data.briefReference) }}\r\n\t\t
\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\r\n\t\t\r\n\r\n\t\t\r\n\t
\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { IReferenceSearchResult, SearchService, StateMap } from '../../services/common';\r\nimport { PageState } from '../../controls/common';\r\nimport { PaginationService } from '../../controls/ng2-pagination/ng2-pagination';\r\n\r\nimport { Reference } from '../../entities/Reference';\r\nimport { ReferenceListItem } from '../../entities/projections/ReferenceListItem';\r\n\r\nimport DataSource from 'devextreme/data/data_source';\r\nimport CustomStore from 'devextreme/data/custom_store';\r\nimport { DxDataGridComponent } from 'devextreme-angular';\r\nimport * as moment from 'moment';\r\n\r\nexport interface IReferenceResultsParent {\r\n selectReference(rli: ReferenceListItem): void;\r\n}\r\n\r\n@Component({\r\n selector: 'reference-results',\r\n templateUrl: './reference-results.html',\r\n providers: [PaginationService],\r\n})\r\nexport class ReferenceResultsComponent implements OnInit {\r\n\r\n @Input() showJournal: boolean;\r\n\r\n _parentComponent: any;\r\n _searchResult: IReferenceSearchResult;\r\n\r\n _pageState = new PageState('Reference Results');\r\n\r\n dataSource: DataSource;\r\n\r\n constructor(public _searchService: SearchService, public _stateMap: StateMap) {\r\n }\r\n\r\n ngOnInit() {\r\n this.dataSource = new DataSource({\r\n store: new CustomStore({\r\n load: (loadOptions: any) => {\r\n if (!this._searchResult) {\r\n this._pageState.isLoading = false;\r\n this._pageState.itemCount = 0;\r\n this._pageState.isLoadedWithNoData = true;\r\n return Promise.resolve({ data: [], totalCount: 0 });\r\n }\r\n\r\n let sort = { name: 'relevance', isDesc: false };\r\n if (loadOptions.sort) {\r\n sort = {\r\n name: loadOptions.sort[0].selector,\r\n isDesc: !!loadOptions.sort[0].desc\r\n };\r\n }\r\n\r\n const skip = loadOptions.skip ? loadOptions.skip / loadOptions.take : 0;\r\n const params = {\r\n searchTerm: this._searchResult.searchTerm,\r\n searchType: this._searchResult.searchType,\r\n orderByProp: 'relevance',\r\n pageNumber: skip,\r\n pageSize: loadOptions.take || 20,\r\n clientOrderBy: sort.name + (sort.isDesc ? ' desc' : '')\r\n };\r\n\r\n this._pageState.isLoading = true;\r\n return this._searchService.fetchReferencesPage(params)\r\n .then(data => {\r\n this._pageState.isLoading = false;\r\n this._pageState.itemCount = data.totalCount;\r\n this._pageState.isLoadedWithNoData = data.totalCount == 0;\r\n\r\n return {\r\n data: data.references,\r\n totalCount: data.totalCount\r\n };\r\n });\r\n }\r\n })\r\n });\r\n }\r\n\r\n onSelectionChanged(evt: any) {\r\n const material: ReferenceListItem = evt.selectedRowsData[0];\r\n this.selectReference(material);\r\n }\r\n\r\n public loading(value: boolean) {\r\n setTimeout(() => this._pageState.isLoading = value);\r\n }\r\n\r\n // needed because ReferenceListItem only has the briefReference (not the trimmed briefReference).\r\n formatBriefReference(br: string) {\r\n return Reference.formatBriefReference(br, this.isStaff());\r\n }\r\n\r\n public update(parentComponent: IReferenceResultsParent, searchResult: IReferenceSearchResult) {\r\n this._parentComponent = parentComponent;\r\n this._searchResult = searchResult;\r\n\r\n const promise = this.dataSource.reload();\r\n\r\n promise\r\n .then((data: any) => {\r\n console.log(data);\r\n })\r\n .catch((err: any) => {\r\n this.dataSource.reload();\r\n });\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n selectReference(reference: ReferenceListItem) {\r\n if (this._parentComponent && this._parentComponent.selectReference) {\r\n this._parentComponent.selectReference(reference);\r\n }\r\n }\r\n\r\n hasData() {\r\n const items = this.dataSource.items();\r\n return items && items.length > 0;\r\n }\r\n}\r\n","
\r\n
\r\n Material Results\r\n - Search by {{ _materialSearchResult.searchDescription }}\r\n
\r\n \r\n \r\n
\r\n Reference Results\r\n - Search by {{ _referenceSearchResult.searchDescription}}\r\n
\r\n \r\n
\r\n","import { AfterViewInit, Component, OnDestroy, ViewChild } from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport { StateMap, SearchService, IMaterialSearchResult, IReferenceSearchResult } from '../../services/common';\r\nimport { PageState } from '../../controls/common';\r\nimport { UtilFns } from '../../utils/common';\r\n\r\nimport { MaterialResultsComponent } from '../material/material-results.component';\r\nimport { ReferenceResultsComponent } from '../reference/reference-results.component';\r\n\r\nimport { MaterialListItem} from '../../entities/projections/MaterialListItem';\r\nimport { ReferenceListItem} from '../../entities/projections/ReferenceListItem';\r\nimport { ROUTES } from '../routes';\r\n\r\n@Component({\r\n selector: 'search-results',\r\n templateUrl: './search-results.html'\r\n})\r\nexport class SearchResultsComponent implements AfterViewInit, OnDestroy {\r\n _materialSearchResult: IMaterialSearchResult;\r\n _referenceSearchResult: IReferenceSearchResult;\r\n _sub: any;\r\n _pageState = new PageState('Search Results');\r\n _key: ISearchKey;\r\n _pageSize = 20;\r\n @ViewChild(MaterialResultsComponent, { static: true }) _materialResultsComponent: MaterialResultsComponent;\r\n @ViewChild(ReferenceResultsComponent, { static: true }) _referenceResultsComponent: ReferenceResultsComponent;\r\n\r\n _firstSearchedPerformed = false;\r\n\r\n constructor(public _searchService: SearchService, public _stateMap: StateMap,\r\n public _router: Router, public _route: ActivatedRoute ) {\r\n }\r\n\r\n ngAfterViewInit() {\r\n this._sub = this._route.params.subscribe(params => {\r\n const filter = params['filter'];\r\n const searchTerm = UtilFns.decodeRouterPart(params['term']);\r\n const key = this.makeKey(searchTerm, filter);\r\n // this._materialResultsComponent._colSorter.reset();\r\n // this._referenceResultsComponent._colSorter.reset();\r\n if (!this.restoreState(key)) {\r\n return this.search(key);\r\n }\r\n });\r\n }\r\n\r\n ngOnDestroy() {\r\n this._sub.unsubscribe();\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n makeKey(searchTerm: string, searchType: string): ISearchKey {\r\n if (searchTerm == null && searchType == null) {\r\n return null;\r\n } else {\r\n return {\r\n searchType: searchType,\r\n searchTerm: decodeURI(searchTerm) // decodeURI is needed if input has encoded chars from url\r\n };\r\n }\r\n }\r\n\r\n saveState(key: ISearchKey) {\r\n this._key = key;\r\n this._stateMap.set(this._pageState.displayName, {\r\n key: key,\r\n materialSearchResult: this._materialSearchResult,\r\n referenceSearchResult: this._referenceSearchResult\r\n });\r\n }\r\n\r\n restoreState(key: ISearchKey) {\r\n const val = this._stateMap.get(this._pageState.displayName);\r\n if (val == null) { return false; }\r\n\r\n if ((key == null) || (key.searchType == val.key.searchType && key.searchTerm == val.key.searchTerm)) {\r\n this._key = val.key;\r\n setTimeout( () => {\r\n this._materialSearchResult = val.materialSearchResult;\r\n this._referenceSearchResult = val.referenceSearchResult;\r\n this._materialResultsComponent.update(this, this._materialSearchResult);\r\n this._referenceResultsComponent.update(this, this._referenceSearchResult);\r\n });\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n search(key: ISearchKey): Promise {\r\n if (key == null) { return null; }\r\n\r\n this._pageState.isLoading = true;\r\n this._materialResultsComponent.loading(true);\r\n this._referenceResultsComponent.loading(true);\r\n\r\n return this._searchService.search(key.searchTerm, key.searchType, this._pageSize).then(result => {\r\n this._materialSearchResult = result.materialSearchResult;\r\n this._referenceSearchResult = result.referenceSearchResult;\r\n\r\n // the variable storing the reference to the DxDataGridComponent from the ViewChild decorator was always null so refreshing the grid page and sort settings this way.\r\n if (this._firstSearchedPerformed) {\r\n this._materialResultsComponent.ngOnInit();\r\n this._referenceResultsComponent.ngOnInit();\r\n }\r\n\r\n this._materialResultsComponent.update(this, this._materialSearchResult);\r\n this._referenceResultsComponent.update(this, this._referenceSearchResult);\r\n this.saveState(key);\r\n\r\n this._firstSearchedPerformed = true;\r\n\r\n }).catch(() => {\r\n this._materialResultsComponent.loading(false);\r\n this._referenceResultsComponent.loading(false);\r\n });\r\n }\r\n\r\n selectMaterial(material: MaterialListItem) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, material.materialId));\r\n }\r\n\r\n selectReference(reference: ReferenceListItem) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, reference.referenceId));\r\n }\r\n\r\n}\r\n\r\ninterface ISearchKey {\r\n searchType: string;\r\n searchTerm: string;\r\n\r\n}\r\n\r\n\r\n\r\n\r\n","
\r\n
\r\n

Author Name

\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
    \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
\r\n
\r\n\r\n
\r\n {{_pageStatusMessage}}\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n","import { Component, OnInit, AfterViewInit, Input, ViewChild} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport {UnitOfWork, StateMap } from '../../services/common';\r\nimport { UtilFns, LocationFns } from '../../utils/common';\r\nimport { PageState, ColumnSorter } from '../../controls/common';\r\n\r\nimport DataSource from 'devextreme/data/data_source';\r\nimport CustomStore from 'devextreme/data/custom_store';\r\nimport { DxDataGridComponent } from 'devextreme-angular';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { ReferenceAuthor } from '../../entities/EntityModels';\r\n\r\nclass PageStateExt extends PageState {\r\n operatorName: string;\r\n searchTerm: string;\r\n}\r\n\r\n@Component ({\r\n selector: 'search-authors',\r\n templateUrl: './search-authors.html'\r\n})\r\nexport class SearchAuthorsComponent implements OnInit, AfterViewInit {\r\n @ViewChild(DxDataGridComponent) dataGrid: DxDataGridComponent;\r\n\r\n _componentInitializing = true;\r\n _pageStatusMessage: string;\r\n _totalItemCount = 0;\r\n\r\n _operators = [\r\n { name: 'startsWith', title: 'StartingWith' },\r\n { name: 'contains', title: 'Containing' }\r\n ];\r\n\r\n _pageSize = 50;\r\n _pageState = new PageStateExt('Author References');\r\n\r\n dataSource: DataSource;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap,\r\n public _location: Location, public _router: Router ) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._pageState.operatorName = this._operators[0].name;\r\n\r\n // setTimeout needed because of Angular RC5 bug where Location is not set correctly until\r\n // after timeout resolves.\r\n // setTimeout(() => {\r\n // LocationFns.updatePageState(this._location, this._stateMap, this._pageState, (state: PageState) => {\r\n // this._colSorter.sortColumn = state.sortColumn;\r\n // this.search();\r\n // });\r\n // }, 0);\r\n\r\n this.defineGridCustomDataStore();\r\n }\r\n\r\n ngAfterViewInit() {\r\n if (this.dataGrid) {\r\n this.dataGrid.visible = false;\r\n }\r\n }\r\n\r\n opChange(event: any) {\r\n // avoid thrashing\r\n const opName = event.target.value;\r\n if (this._pageState.operatorName == opName) { return; }\r\n this._pageState.operatorName = opName;\r\n\r\n // if (this.isValidString(this._pageState.searchTerm)) {\r\n // this.newSearch();\r\n // }\r\n }\r\n\r\n newSearch() {\r\n this._pageStatusMessage = '';\r\n this._pageStatusMessage = '';\r\n\r\n this.dataGrid.visible = true;\r\n this.dataGrid.instance.pageIndex(0);\r\n this._pageState.resetPaging();\r\n\r\n this.getReferenceAuthorSearchTotalCount(this._pageState.searchTerm, this._pageState.operatorName).then(() => {\r\n this.dataGrid.instance.refresh();\r\n });\r\n }\r\n\r\n clear() {\r\n this._pageState.searchTerm = '';\r\n this._pageState.resetPaging();\r\n this._pageStatusMessage = '';\r\n\r\n if (this.dataGrid.visible) {\r\n this._componentInitializing = true;\r\n this.dataGrid.instance.pageIndex(0);\r\n this.dataGrid.instance.refresh();\r\n this.dataGrid.visible = false;\r\n }\r\n }\r\n\r\n public getReferenceAuthorSearchTotalCount(authorName: string, opType: string): Promise {\r\n\r\n const params = { authorName: authorName, opType: opType};\r\n return this._uow.fetch('References/FetchReferenceAuthorSearchCount', params).then( c => {\r\n if (c != null && c.length > 0) {\r\n this._totalItemCount = c[0];\r\n } else {\r\n this._totalItemCount = 0;\r\n }\r\n });\r\n }\r\n\r\n onSelectReferenceAuthor(evt: any) {\r\n const ra = evt.selectedRowsData[0];\r\n\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, ra.reference.referenceId));\r\n\r\n return false;\r\n }\r\n\r\n getGridElement(id: string): any {\r\n return jQuery('#' + id);\r\n }\r\n\r\n defineGridCustomDataStore() {\r\n this.dataSource = new DataSource({\r\n store: new CustomStore({\r\n load: (loadOptions: any) => {\r\n if (this._componentInitializing) {\r\n this._pageState.isLoading = false;\r\n this._pageState.itemCount = 0;\r\n this._pageState.isLoadedWithNoData = true;\r\n this._componentInitializing = false;\r\n return Promise.resolve({data: [], totalCount: 0});\r\n }\r\n\r\n let sort = {name: 'authorName', isDesc: false};\r\n if (loadOptions.sort) {\r\n sort = {\r\n name: loadOptions.sort[0].selector,\r\n isDesc: !!loadOptions.sort[0].desc\r\n };\r\n }\r\n\r\n const skip = loadOptions.skip ? loadOptions.skip / loadOptions.take : 0;\r\n\r\n this._pageState.isLoading = true;\r\n\r\n const opValue = {};\r\n const searchTerm = this._pageState.searchTerm.replace(/\\&/g, '%26');\r\n opValue[this._pageState.operatorName] = searchTerm;\r\n const pred = {'author.authorName': opValue};\r\n const orderBy = 'author.authorName';\r\n\r\n this._pageState.isLoading = true;\r\n return this._uow.referenceAuthorRepository.wherePaged(pred, orderBy, skip + 1, this._pageSize)\r\n .then( r => {\r\n if (r != null && r.length > 0) {\r\n this._pageState.itemCount = r.length;\r\n this._pageStatusMessage = this._totalItemCount + ' matching Author References found.';\r\n } else {\r\n this._pageState.itemCount = 0;\r\n this._pageState.isLoadedWithNoData = true;\r\n this._pageStatusMessage = 'No matching Author References found that match your search criteria';\r\n this.dataGrid.visible = false;\r\n }\r\n this._pageState.isLoading = false;\r\n return {\r\n data: r,\r\n totalCount: this._totalItemCount\r\n };\r\n });\r\n }\r\n })\r\n });\r\n }\r\n\r\n hasStatusMessage(): boolean {\r\n return this.isValidString(this._pageStatusMessage);\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n}\r\n","
\r\n
\r\n

Synonym

\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
    \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
\r\n
\r\n\r\n
\r\n {{_pageStatusMessage}}\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n","import {Component, OnInit, AfterViewInit, ViewChild} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { UnitOfWork, StateMap} from '../../services/common';\r\nimport { UtilFns, LocationFns } from '../../utils/common';\r\nimport { PageState, ColumnSorter } from '../../controls/common';\r\nimport { PaginationService, IPaginationInstance} from '../../controls/ng2-pagination/ng2-pagination';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { Synonym } from '../../entities/Synonym';\r\n\r\nimport DataSource from 'devextreme/data/data_source';\r\nimport CustomStore from 'devextreme/data/custom_store';\r\nimport { DxDataGridComponent } from 'devextreme-angular';\r\n\r\nclass PageStateExt extends PageState {\r\n searchTerm: string;\r\n operatorName: string;\r\n}\r\n\r\n@Component({\r\n templateUrl: './search-synonyms.html',\r\n providers: [PaginationService]\r\n})\r\nexport class SearchSynonymsComponent implements OnInit, AfterViewInit {\r\n @ViewChild(DxDataGridComponent) dataGrid: DxDataGridComponent;\r\n\r\n _synonyms: Synonym[];\r\n\r\n _operators = [\r\n { name: 'startsWith', title: 'StartingWith' },\r\n { name: 'contains', title: 'Containing' }\r\n ];\r\n\r\n _pagination: IPaginationInstance;\r\n _colSorter: ColumnSorter;\r\n\r\n _pageSize = 50;\r\n _pageState = new PageStateExt('Synonyms');\r\n\r\n _componentInitializing = true;\r\n _pageStatusMessage: string;\r\n _totalItemCount = 0;\r\n\r\n dataSource: DataSource;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap,\r\n public _location: Location, public _router: Router ) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._pageState.operatorName = this._operators[0].name;\r\n\r\n this.defineGridCustomDataStore();\r\n }\r\n\r\n ngAfterViewInit() {\r\n if (this.dataGrid) {\r\n this.dataGrid.visible = false;\r\n }\r\n }\r\n\r\n opChange(event: any) {\r\n // avoid thrashing\r\n const opName = event.target.value;\r\n if (this._pageState.operatorName == opName) { return; }\r\n this._pageState.operatorName = opName;\r\n }\r\n\r\n newSearch() {\r\n this._pageStatusMessage = '';\r\n this._pageStatusMessage = '';\r\n\r\n this.dataGrid.visible = true;\r\n this.dataGrid.instance.pageIndex(0);\r\n\r\n this._pageState.resetPaging();\r\n\r\n this.getSynonymSearchTotalCount(this._pageState.searchTerm, this._pageState.operatorName).then(() => {\r\n this.dataGrid.instance.refresh();\r\n });\r\n }\r\n\r\n public getSynonymSearchTotalCount(synonym: string, opType: string): Promise {\r\n\r\n const params = { synonym: synonym, opType: opType};\r\n return this._uow.fetch('Materials/FetchSynonymSearchCount', params).then( c => {\r\n if (c != null && c.length > 0) {\r\n this._totalItemCount = c[0];\r\n } else {\r\n this._totalItemCount = 0;\r\n }\r\n });\r\n }\r\n\r\n clear() {\r\n this._pageState.searchTerm = '';\r\n this._pageState.resetPaging();\r\n this._pageStatusMessage = '';\r\n\r\n if (this.dataGrid.visible) {\r\n this._componentInitializing = true;\r\n this.dataGrid.instance.pageIndex(0);\r\n this.dataGrid.instance.refresh();\r\n this.dataGrid.visible = false;\r\n }\r\n }\r\n\r\n defineGridCustomDataStore() {\r\n this.dataSource = new DataSource({\r\n store: new CustomStore({\r\n load: (loadOptions: any) => {\r\n if (this._componentInitializing) {\r\n this._pageState.isLoading = false;\r\n this._pageState.itemCount = 0;\r\n this._pageState.isLoadedWithNoData = true;\r\n this._componentInitializing = false;\r\n return Promise.resolve({data: [], totalCount: 0});\r\n }\r\n\r\n let sort = {name: 'synonymWord', isDesc: false};\r\n if (loadOptions.sort) {\r\n sort = {\r\n name: loadOptions.sort[0].selector,\r\n isDesc: !!loadOptions.sort[0].desc\r\n };\r\n }\r\n\r\n const skip = loadOptions.skip ? loadOptions.skip / loadOptions.take : 0;\r\n\r\n this._pageState.isLoading = true;\r\n\r\n const opValue = {};\r\n const searchTerm = this._pageState.searchTerm.replace(/\\&/g, '%26');\r\n opValue[this._pageState.operatorName] = searchTerm;\r\n const pred = {'synonymWord': opValue};\r\n const orderBy = 'synonymWord';\r\n\r\n this._pageState.isLoading = true;\r\n return this._uow.synonymRepository.wherePaged(pred, orderBy, skip + 1, this._pageSize)\r\n .then( r => {\r\n if (r != null && r.length > 0) {\r\n this._pageState.itemCount = r.length;\r\n this._pageStatusMessage = this._totalItemCount + ' matching Synonyms found.';\r\n } else {\r\n this._pageState.itemCount = 0;\r\n this._pageState.isLoadedWithNoData = true;\r\n this._pageStatusMessage = 'No matching Synonyms found that match your search criteria';\r\n this.dataGrid.visible = false;\r\n }\r\n this._pageState.isLoading = false;\r\n return {\r\n data: r,\r\n totalCount: this._totalItemCount\r\n };\r\n });\r\n }\r\n })\r\n });\r\n }\r\n\r\n onSelectMaterial(evt: any) {\r\n const s = evt.selectedRowsData[0];\r\n\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, s.materialId ));\r\n\r\n return false;\r\n }\r\n\r\n hasStatusMessage(): boolean {\r\n return this.isValidString(this._pageStatusMessage);\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\n\r\n@Component({\r\n selector: 'default-table',\r\n template: `\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n `\r\n})\r\nexport class DefaultTableComponent {\r\n}\r\n","
\r\n
Search by Structure
\r\n \r\n\r\n
\r\n
\r\n Draw a structure or enter a SMILES:\r\n \r\n Cannot draw this SMILES\r\n \r\n \r\n
\r\n
\r\n Sorry: unable to run this search\r\n SMILES from Structure:\r\n {{smiles}}\r\n
\r\n\r\n
\r\n \r\n Searching through all the materials in the RIFM Database... \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n Similarity Threshold: \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n

{{_validationMessage}}

\r\n
\r\n\r\n

This value influences how closely the searched structure should match the drawn structure. Valid entries are a number between 1 and 99.\r\n The higher the value indicates you want a greater level of similarity; this results in a more restrictive the set of matches. Lower values (< 50) will\r\n return materials that are slightly similar to the drawn structure and typically increase the number of matches found.

\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {{searchResultsStatus}}\r\n \r\n
\r\n 0\">\r\n \r\n \r\n CAS #\r\n RIFM ID\r\n Principal Name\r\n Structure\r\n Similarity Score\r\n Captive\r\n \r\n \r\n \r\n \r\n \r\n {{e.RealCASNumber || '(No CAS#)'}}\r\n \r\n {{e.FormattedRIFMId}}\r\n \r\n \r\n \r\n \r\n {{utilFns.formatNumber(e.Score, 3, 2)}}\r\n \r\n Captive\r\n \r\n \r\n \r\n \r\n
\r\n\r\n\r\n
\r\n","import {ChangeDetectorRef, AfterViewInit, Component, OnInit} from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport {MolImageService, StateMap, UserManager} from '../../services/common';\r\nimport { UtilFns, } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { environment } from '../../../environments/environment';\r\nimport {EntityManagerProvider} from '../../services/entity-manager-provider';\r\n\r\ninterface SmileItem {\r\n MaterialId: number;\r\n RealCASNumber: string;\r\n FEMANumber: number;\r\n MonographNumber: number;\r\n SynonymWordOrWebVersion: string;\r\n TypeEssentialOilId: string;\r\n TypeBotanicalSubdivisionId: string;\r\n Smiles: string;\r\n Base32SmileUrl: string;\r\n FormattedRIFMId: string;\r\n Confidential: boolean;\r\n Score: number;\r\n}\r\n\r\n\r\n@Component({\r\n templateUrl: './marvin-search.html',\r\n})\r\nexport class MarvinSearchComponent implements OnInit, AfterViewInit {\r\n\r\n _materials: SmileItem[];\r\n _sketcherInstance: any;\r\n\r\n _isError = false;\r\n _isShowingSearch = true;\r\n _isSearching = false;\r\n _isStructureError = false;\r\n\r\n _pageState = new PageState('Materials');\r\n _sub: any;\r\n\r\n _similarityThreshold = '80';\r\n _validationMessage: string;\r\n\r\n _sketchSmiles: string;\r\n _inputSmiles: string;\r\n\r\n _maintainOriginalSMILES = true; // this is set to true only the first time the component is loaded so the SMILES matches the source.\r\n _originalSMILES: any;\r\n\r\n constructor(public _molImageService: MolImageService, private http: HttpClient, public _router: Router,\r\n public _stateMap: StateMap, public _route: ActivatedRoute, public _userManager: UserManager,\r\n public _cd: ChangeDetectorRef) {\r\n }\r\n\r\n ngOnInit() {\r\n this._isShowingSearch = true;\r\n }\r\n\r\n ngAfterViewInit() {\r\n let materialId;\r\n\r\n this._sub = this._route.params.subscribe(params => {\r\n if (params['id']) {\r\n materialId = +params['id'];\r\n }\r\n\r\n if (params['smiles']) {\r\n this._originalSMILES = params['smiles'];\r\n }\r\n });\r\n\r\n if (materialId == null || Number.isNaN(materialId)) {\r\n this.getSketcherInstance().then((si: any) => { // Get sketcher reference so event handlers will be bound\r\n return;\r\n });\r\n }\r\n\r\n let molData: any;\r\n this._molImageService.getMoleculeFromMaterial(materialId).then((r) => {\r\n molData = r;\r\n this.getSketcherInstance().then((si: any) => {\r\n return si.importStructure('mol', molData);\r\n });\r\n });\r\n }\r\n\r\n isStaff() {\r\n return this._userManager.currentUser.isStaff;\r\n }\r\n\r\n getSketcherInstance() {\r\n try {\r\n if (this._sketcherInstance) {\r\n return Promise.resolve(this._sketcherInstance);\r\n } else {\r\n return (window).MarvinJSUtil.getEditor('#sketch').then((si: any) => {\r\n this._sketcherInstance = si;\r\n\r\n this._sketcherInstance.on('molchange', () => {\r\n this.onMolChangeEvent();\r\n });\r\n\r\n return si;\r\n });\r\n }\r\n } catch (e) {\r\n alert('Cannot retrieve sketcher instance from iframe:' + e);\r\n }\r\n }\r\n\r\n search() {\r\n this._isSearching = true;\r\n this._materials = null;\r\n this._isError = false;\r\n\r\n if (this.validateSimilarityThreshold() == false) { return; }\r\n\r\n this._pageState.isLoading = true;\r\n\r\n const threshold = parseFloat(this._similarityThreshold) / 100;\r\n\r\n this.getSketcherInstance()\r\n .then((si: any) => {\r\n return si.exportStructure('mrv');\r\n })\r\n .then((mrv: any) => {\r\n return this.http\r\n .post(`${environment.appUrl}/breeze/MolImage/SearchByStructure`, { marvin: mrv, similarityThreshold: threshold })\r\n .toPromise();\r\n })\r\n .then((r: SmileItem[]) => {\r\n this._materials = r;\r\n this._materials.forEach(m => {\r\n this._molImageService.getBase32SmileUrl(m.MaterialId).then((url) => {\r\n m.Base32SmileUrl = url;\r\n });\r\n });\r\n this._isShowingSearch = false;\r\n this._isSearching = false;\r\n this._pageState.itemCount = r.length;\r\n this._pageState.isLoaded = r;\r\n })\r\n .catch((e: any) => {\r\n this._pageState.isLoaded = false;\r\n this._isSearching = false;\r\n console.log(e);\r\n this._isError = true;\r\n });\r\n }\r\n\r\n getMaterialImageUrl(m: SmileItem) {\r\n return this._molImageService.getImageUrlForMaterial(m.MaterialId);\r\n }\r\n\r\n onCasSelect(m: SmileItem) {\r\n return this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, m.MaterialId));\r\n }\r\n\r\n canDrawSMILES(): boolean {\r\n return this.isValidString(this._inputSmiles);\r\n }\r\n\r\n onMolChangeEvent() {\r\n\r\n this.getSketcherInstance()\r\n .then((si: any) => {\r\n return si.exportStructure('mrv');\r\n })\r\n .then((mrv: any) => {\r\n if (mrv == null || mrv == undefined ) {\r\n this.smiles = '';\r\n this._cd.detectChanges();\r\n return;\r\n }\r\n\r\n if (this._maintainOriginalSMILES == true && this._originalSMILES != null) { // only the first time when the component loads so the SMILES structure matches the query param exactly.\r\n this.smiles = this._originalSMILES;\r\n this._maintainOriginalSMILES = false;\r\n return;\r\n }\r\n\r\n this.getSMILESFromStructure(mrv).then( r => {\r\n if (r != null) {\r\n const s = JSON.stringify(r);\r\n this.smiles = s.replace(/\\\"/g, '');\r\n this._cd.detectChanges();\r\n return;\r\n }\r\n });\r\n });\r\n }\r\n\r\n getSMILESFromStructure(marvin: any) {\r\n return this.http\r\n .post(`${environment.appUrl}/breeze/MolImage/SmilesFromStructure`, { marvin: marvin, similarityThreshold: 0.0 })\r\n .toPromise();\r\n }\r\n\r\n onChangeSMILES() {\r\n this._isStructureError = false;\r\n }\r\n\r\n onDrawSMILES() {\r\n let molData: any;\r\n this._isStructureError = false;\r\n\r\n this.http\r\n .post(`${environment.appUrl}/breeze/MolImage/MoleculeFromSmiles`, { smiles: this._inputSmiles })\r\n .toPromise()\r\n .then((m) => {\r\n molData = m;\r\n if (molData == null || molData == undefined) {\r\n this._isStructureError = true;\r\n }\r\n this.getSketcherInstance().then((si: any) => {\r\n si.importStructure('mol', molData);\r\n });\r\n });\r\n }\r\n\r\n isValidString(teststring: string) {\r\n\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n validateSimilarityThreshold(): boolean {\r\n this._validationMessage = '';\r\n const msg = 'The Similarity Threshold should be a number between 1 and 99. The default is 80.';\r\n\r\n if (this._similarityThreshold == null || this._similarityThreshold.trim().length < 1) {\r\n this._validationMessage = msg;\r\n return false;\r\n }\r\n const regex = /^(\\d?[1-9]|[1-9]0)$/;\r\n\r\n if (!regex.test(this._similarityThreshold)) {\r\n event.preventDefault();\r\n this._validationMessage = msg;\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public hasSearchResults(): boolean {\r\n return (this._materials != null && this._materials.length > 0);\r\n }\r\n\r\n public get searchResultsStatus(): string {\r\n if (this._pageState.isLoading) {return ''; }\r\n\r\n if (this._materials == null || this._materials.length == 0) {\r\n return 'No materials matched the drawn structure with a similarity score of ' + this._similarityThreshold + ' or higher.';\r\n }\r\n\r\n return 'There are ' + this._materials.length + ' materials that are at least ' + this._similarityThreshold + '% similar to the drawn structure.';\r\n }\r\n\r\n public get smiles(): string {\r\n return this._sketchSmiles;\r\n }\r\n\r\n public set smiles(s: string) {\r\n this._sketchSmiles = s;\r\n }\r\n\r\n public get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n onCopyCASToClipboard() {\r\n const casNumbers = this._materials.filter(m => m.RealCASNumber).map(m => m.RealCASNumber).join(', ');\r\n\r\n const selBox = document.createElement('textarea');\r\n selBox.style.position = 'fixed';\r\n selBox.style.left = '0';\r\n selBox.style.top = '0';\r\n selBox.style.opacity = '0';\r\n selBox.value = casNumbers;\r\n document.body.appendChild(selBox);\r\n selBox.focus();\r\n selBox.select();\r\n document.execCommand('copy');\r\n document.body.removeChild(selBox);\r\n }\r\n}\r\n","
\r\n
\r\n
Select a Fragrance Structure Activity Group
\r\n \r\n \r\n
\r\n\r\n
There are {{_materialFSAGs.length || \"no\" }} related materials\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n CAS No.\r\n RIFM ID\r\n Principal Name\r\n Structure\r\n \r\n \r\n \r\n \r\n \r\n {{e.material.realCASNumber || '(No CAS#)'}}\r\n \r\n {{e.material.formattedRIFMId}}\r\n {{e.material.principalSynonym().synonymWordOrWebVersion()}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n","import { Component, OnInit, ViewChild, ElementRef} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { UnitOfWork, StateMap, MolImageService } from '../../services/common';\r\nimport { UtilFns, LocationFns } from '../../utils/common';\r\nimport { PageState, TabContainer } from '../../controls/common';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { FSAG, MaterialFSAG } from '../../entities/EntityModels';\r\n\r\n// TODO: need to support 'sub'-sorting by columns 'FullRefencned \r\n@Component({\r\n templateUrl: './material-groups.html',\r\n})\r\nexport class MaterialGroupsComponent implements OnInit {\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n \r\n _FSAGs: FSAG[];\r\n _materialFSAGs: MaterialFSAG[];\r\n _materialIds: number[];\r\n _canShowMaterials: boolean;\r\n _pageState: PageState = new PageState(\"Material Groups\");\r\n _image: any;\r\n _tab: number;\r\n _fsagIx: number;\r\n \r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _molImageService: MolImageService, \r\n public _location: Location, public _router: Router, public _elementRef: ElementRef ) { \r\n \r\n }\r\n \r\n ngOnInit() {\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n this._pageState.isLoading = true;\r\n this._uow.fSAGRepository.all().then(r => {\r\n // insert a blank line at the top of the select box.\r\n r.unshift(null);\r\n this._FSAGs = r;\r\n \r\n var fsagIx = LocationFns.getParamValue(this._location, 'fsagIx');\r\n if (fsagIx) {\r\n this.selectFSAGIndex(parseInt(fsagIx));\r\n }\r\n this._pageState.isLoaded = true;\r\n }).catch( () => {\r\n this._pageState.isLoadedWithNoData = true;\r\n })\r\n }\r\n \r\n selectEntireTable() {\r\n var eles = this._elementRef.nativeElement.getElementsByTagName('table');\r\n if (eles.length)\r\n var range= UtilFns.selectDOMElement(eles[0]);\r\n // range.execCommand(\"Copy\");\r\n }\r\n \r\n selectFSAG(event: any) {\r\n // on a filterChange we do NOT need to get a new list of filters.\r\n var ix = event.currentTarget.selectedIndex;\r\n this.selectFSAGIndex(ix);\r\n }\r\n \r\n selectFSAGIndex(fsagIx: number) {\r\n this._fsagIx = fsagIx;\r\n LocationFns.setParamValue(this._location, 'fsagIx', fsagIx.toString());\r\n // if the blank line at the top of the select is picked.\r\n if (fsagIx == 0) {\r\n this._canShowMaterials = false;\r\n return;\r\n }\r\n var fsag = this._FSAGs[fsagIx];\r\n\r\n this._canShowMaterials = false;\r\n var p = { materialId: null, sagId: fsag.sAGID };\r\n this._uow.materialFSAGRepository.whereWithParams(p).then(r => {\r\n this._canShowMaterials = true;\r\n this._materialFSAGs = UtilFns.sort(r, true, this.getName);\r\n this._materialIds = this._materialFSAGs.map(fsag => {\r\n this._molImageService.getBase32SmileUrl(fsag.material.materialId).then( (url) => {\r\n fsag.material.base32SmileUrl = url;\r\n }); \r\n return fsag.materialId;\r\n });\r\n // _tabContainer in an ngIf that won't be available until next tic - after _canShowMaterial is true.\r\n // setTimeout(() => this._tabContainer.selectTab(this._tab), 0);\r\n this._tabContainer.selectTab(this._tab); \r\n })\r\n }\r\n \r\n onCasSelect(materialFSAG: MaterialFSAG) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, materialFSAG.material.materialId ));\r\n \r\n }\r\n\r\n getName(materialFSAG: MaterialFSAG) {\r\n return materialFSAG.material.principalSynonym().synonymWordOrWebVersion();\r\n }\r\n \r\n onTabChange(paneNumber: number) {\r\n if (paneNumber == 0) {\r\n LocationFns.setTab(this._location, '0');\r\n }\r\n }\r\n\r\n}\r\n","import {Pipe} from \"@angular/core\";\r\nimport {PaginationService} from \"./pagination-service\";\r\nimport {IPaginationInstance} from \"./pagination-service\";\r\n\r\nconst LARGE_NUMBER = 999999999;\r\n\r\ninterface IPipeState {\r\n collection: any[];\r\n start: number;\r\n end: number;\r\n slice: any[];\r\n}\r\n\r\n@Pipe({\r\n name: 'paginate',\r\n pure: false\r\n})\r\nexport class PaginatePipe {\r\n\r\n // store the values from the last time the pipe\r\n state: { [id: string]: IPipeState } = {};\r\n\r\n constructor(public service: PaginationService) {\r\n }\r\n\r\n public transform(collection: any[], config: any): any {\r\n\r\n // for non-array types, throw an exception\r\n if (!(collection instanceof Array)) {\r\n throw new Error(`PaginationPipe: Argument error - expected an array, got ${typeof collection}`);\r\n }\r\n\r\n let usingConfig = typeof config === 'object';\r\n let serverSideMode = usingConfig && config.totalItems !== undefined;\r\n let instance = this.createInstance(collection, config);\r\n let id = instance.id;\r\n let start: number, end: number;\r\n\r\n this.service.register(instance);\r\n\r\n if (!usingConfig && instance.totalItems !== collection.length) {\r\n this.service.setTotalItems(id, collection.length);\r\n }\r\n let itemsPerPage = instance.itemsPerPage;\r\n if (!serverSideMode && collection instanceof Array) {\r\n itemsPerPage = itemsPerPage || LARGE_NUMBER;\r\n start = (this.service.getCurrentPage(id) - 1) * itemsPerPage;\r\n end = start + itemsPerPage;\r\n\r\n let isIdentical = this.stateIsIdentical(id, collection, start, end);\r\n if (isIdentical) {\r\n return this.state[id].slice;\r\n } else {\r\n let slice = collection.slice(start, end);\r\n this.saveState(id, collection, slice, start, end);\r\n return slice;\r\n }\r\n }\r\n return collection;\r\n }\r\n\r\n createInstance(collection: any[], config: any): IPaginationInstance {\r\n let instance: IPaginationInstance;\r\n if (typeof config === 'string' || typeof config === 'number') {\r\n let id = this.service.defaultId;\r\n instance = {\r\n id: id,\r\n itemsPerPage: parseInt(config),\r\n currentPage: this.service.getCurrentPage(id) || 1,\r\n totalItems: collection.length\r\n };\r\n } else if (typeof config === 'object') {\r\n instance = {\r\n id: config.id || this.service.defaultId,\r\n itemsPerPage: config.itemsPerPage || 0,\r\n currentPage: config.currentPage,\r\n totalItems: config.totalItems || collection.length\r\n };\r\n } else {\r\n throw new Error(`PaginatePipe: Argument must be a string, number or an object. Got ${typeof config}`);\r\n }\r\n return instance;\r\n }\r\n\r\n /**\r\n * To avoid returning a brand new array each time the pipe is run, we store the state of the sliced\r\n * array for a given id. This means that the next time the pipe is run on this collection & id, we just\r\n * need to check that the collection, start and end points are all identical, and if so, return the\r\n * last sliced array.\r\n */\r\n saveState(id: string, collection: any[], slice: any[], start: number, end: number) {\r\n this.state[id] = {\r\n collection,\r\n slice,\r\n start,\r\n end\r\n };\r\n }\r\n\r\n /**\r\n * For a given id, returns true if the collection, start and end values are identical.\r\n */\r\n stateIsIdentical(id: string, collection: any[], start: number, end: number): boolean {\r\n let state = this.state[id];\r\n if (!state) {\r\n return false;\r\n }\r\n\r\n return state.collection === collection && state.start === start && state.end === end;\r\n }\r\n}","\r\n
\r\n\r\n
Fragrance Safety Assessments
\r\n\r\n
\r\n \r\n
\r\n\r\n

{{_validationMessage}}

\r\n\r\n
\r\n \r\n
0\">\r\n There are {{ _countSafetyAssessments.drafts }} Fragrance Safety Assessment Drafts in progress.\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n **\r\n
\r\n
\r\n Please note that the citation dates used for studies sourced from the European Chemicals Agency (ECHA) website are the dates the dossiers were first posted, not the dates that the studies were conducted.\r\n
\r\n
\r\n
\r\n
\r\n

\r\n
\r\n \r\n\r\n \r\n \r\n \r\n Safety Assessment\r\n CAS No. \r\n Synonym \r\n Publish Date \r\n # Materials\r\n Additional Materials\r\n Categories\r\n Comments\r\n \r\n \r\n \r\n \r\n {{e.assessmentReportName}}\r\n {{e.realCASNumber || '(No CAS#)'}}\r\n \r\n \r\n {{ _stateMap.utilFns.formatDate(e.assessmentReportDate) }}\r\n {{1 + e.safetyAssessmentMaterials.length}}\r\n \r\n \r\n , \r\n {{am.realCASNumber}}\r\n \r\n \r\n {{getAssessmentCategories(e)}}\r\n {{e.sACategoryComment}}\r\n \r\n \r\n \r\n\r\n \r\n
\r\n\r\n
\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { UserManager, UnitOfWork, StateMap, SearchService } from '../../services/common';\r\nimport { UtilFns, LocationFns } from '../../utils/common';\r\nimport { PageState, SortColumn, ColumnSorter } from '../../controls/common';\r\nimport { PaginationService, IPaginationInstance } from '../../controls/ng2-pagination/ng2-pagination';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport {Material, AssessmentCategory, RIFMDownloadableFile} from '../../entities/EntityModels';\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\n\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n templateUrl: './safety-assessments.html',\r\n providers: [PaginationService]\r\n})\r\nexport class SafetyAssessmentsComponent implements OnInit {\r\n\r\n _materials: Material[];\r\n _pagination: IPaginationInstance;\r\n _colSorter: ColumnSorter;\r\n _countSafetyAssessments = {drafts: 0, reports: 0, matWith: 0};\r\n _assessmentCategories: AssessmentCategory[] = [];\r\n _documentManagementUrl: string;\r\n _isLoading = false;\r\n _validationMessage: string;\r\n\r\n _pageState = new PageState('Safety Assessments');\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _searchService: SearchService,\r\n public _userManager: UserManager, public _location: Location, public _router: Router, private _httpClient: HttpClient) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._pagination = this._pageState.getPaginationInfo();\r\n\r\n // default to publish date descending\r\n this._colSorter = new ColumnSorter(this, {\r\n 'Publish Date': (m: Material) => (m['assessmentReportDate'] || new Date(0)).toISOString(),\r\n 'CAS No.': (m: Material) => m.realCASNumber,\r\n 'Synonym': (m: Material) => m.principalSynonymText()\r\n },\r\n new SortColumn('Publish Date', false),\r\n (sortColumn) => this._pageState.sortColumn = sortColumn);\r\n\r\n // setTimeout needed because of Angular RC5 bug where Location is not set correctly until\r\n // after timeout resolves.\r\n setTimeout(() => {\r\n const isReturning = LocationFns.updatePageState(this._location, this._stateMap, this._pageState, (state: PageState) => {\r\n this._colSorter.sortColumn = state.sortColumn;\r\n });\r\n this.search(isReturning);\r\n }, 0);\r\n\r\n this._uow.fetch('Materials/CountSafetyAssessments', {}).then(ar => {\r\n const r = ar[0];\r\n this._countSafetyAssessments.drafts = r.drafts;\r\n this._countSafetyAssessments.reports = r.reports;\r\n this._countSafetyAssessments.matWith = r.matWith;\r\n });\r\n\r\n this._uow.assessmentCategoryRepository.all().then(r => {\r\n for (const ac of r) {\r\n this._assessmentCategories[ac.assessmentCategoryId] = ac;\r\n }\r\n });\r\n\r\n // needed for file downloads\r\n this._documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDownloadableFile';\r\n\r\n }\r\n\r\n sortWith(colSorter: ColumnSorter) {\r\n colSorter.sort(this._materials);\r\n }\r\n\r\n selectSafetyAssessment(m: Material) {\r\n this.downloadSAFile(m.assessmentReportName);\r\n }\r\n\r\n selectCAS(m: Material) {\r\n if (this.isStaff()) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, m.materialId, ROUTES.Material.childRoutes.SafetyAssessment));\r\n } else {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, m.materialId));\r\n }\r\n }\r\n\r\n search(isReturning: boolean): Promise {\r\n this._materials = null;\r\n setTimeout(() => this._pageState.isLoading = true, 0);\r\n const sortColumn = this._colSorter.sortColumn;\r\n\r\n return this._uow.fetchTyped('fetchSAMaterialsPage', Material, {})\r\n .then(r => {\r\n if (!this.isStaff()) {\r\n r = r.filter(m => m.assessmentReportName != null && m.assessmentReportName.trim() != '');\r\n }\r\n\r\n const addlmap = {};\r\n r.forEach(m => {\r\n m['assessmentReportDate'] = m.assessmentReportNameModified && m.assessmentReportNameModified;\r\n const addlMaterials = m.safetyAssessmentMaterials.map(sam => sam.additionalMaterial);\r\n addlMaterials.forEach(a => addlmap[a.cASNumber] = m.assessmentReportName);\r\n m['addlMaterials'] = addlMaterials;\r\n });\r\n\r\n // filter materials that are listed as additional in the SA, issue #550\r\n const mats: Material[] = [];\r\n let materialCount = 0;\r\n r.forEach(m => {\r\n // if this material is not listed as an 'additional material' for the sa, then put it in the list\r\n if (!(addlmap[m.cASNumber] == m.assessmentReportName)) {\r\n mats.push(m);\r\n materialCount++;\r\n materialCount += m.safetyAssessmentMaterials.length;\r\n }\r\n });\r\n this._materials = mats;\r\n\r\n this._pagination.currentPage = this._pageState.pageNumber;\r\n this._pagination.totalItems = this._pageState.updateEstimate(r.length);\r\n this._pageState.isLoaded = r;\r\n if (isReturning) {\r\n this._colSorter.sort(this._materials);\r\n }\r\n\r\n const sa = this._countSafetyAssessments;\r\n // this._pageState.loadStatusMsg = \"There are \" + sa.reports + \" Safety Assessments covering \" + sa.matWith + \" materials.\";\r\n this._pageState.loadStatusMsg = 'There are ' + sa.reports + ' Safety Assessments covering ' + materialCount + ' materials.';\r\n\r\n return r;\r\n });\r\n\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n getAssessmentCategories(e: Material) {\r\n return e.materialAssessmentCategories.map(ac => {\r\n return this._assessmentCategories[ac.assessmentCategoryId].name;\r\n }).join(', ');\r\n }\r\n\r\n // ***********************************************\r\n // *sa document downloads\r\n // ***********************************************\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n getDownloadFileURL(fileName: string): Observable {\r\n let url: string;\r\n url = this._documentManagementUrl + '/GetFileBySubFolderAndName?fileName=' + fileName + '&subFolder=' + 'SafetyAssessments' ;\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public downloadSAFile(fileName: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getDownloadFileURL(fileName)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = '';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","
\r\n\r\n

{{_validationMessage}}

\r\n
\r\n \r\n
\r\n\r\n
{{\"IFRA/IOFI Labeling Manual \" + _labelingManualYear}}
\r\n\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n","import { Component, OnInit, Input} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { UnitOfWork, UserManager, StateMap, SearchService } from '../../services/common';\r\nimport { UtilFns, LocationFns, } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { RIFMDownloadableFile } from '../../entities/EntityModels';\r\nimport {HttpClient, HttpHeaders, HTTP_INTERCEPTORS} from '@angular/common/http';\r\nimport {Observable} from 'rxjs';\r\n\r\n@Component({\r\n templateUrl: './ifra-attachments.html',\r\n})\r\nexport class IFRAAttachmentsComponent implements OnInit {\r\n\r\n _documentManagementUrl: string;\r\n _labelingManuals: RIFMDownloadableFile[] = [];\r\n _labelingManualYear = '';\r\n\r\n _isLoading = false;\r\n _validationMessage: string;\r\n\r\n constructor(public _stateMap: StateMap, private _httpClient: HttpClient, public _uow: UnitOfWork, public _userManager: UserManager) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDownloadableFile';\r\n\r\n this.loadData();\r\n }\r\n\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n loadData() {\r\n this._isLoading = true;\r\n\r\n const params = { category: 'LabelingManual'};\r\n\r\n this._labelingManuals = [];\r\n\r\n return this._uow.fetch('DocumentManagement/FetchRIFMDownloadableFilesByFileCategory', params).then(r => {\r\n if (r) {\r\n this._labelingManuals = r;\r\n\r\n const currentLM = this._labelingManuals.filter(lm => lm.fileIdentifier == 'LabelingManualCurrent');\r\n this._labelingManualYear = (currentLM != null && currentLM.length > 0) ? '(' + currentLM[0].fileDescription + ')' : '';\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n downloadFile(dfs: RIFMDownloadableFile) {\r\n if (dfs == null) {\r\n return ;\r\n }\r\n\r\n this.exportSubscriptionFile(dfs.fileName, dfs.fileSubFolder);\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url\r\n // ************************************************************************\r\n getDownloadFileURL(fileName: string, subFolder: string): Observable {\r\n let url: string;\r\n url = this._documentManagementUrl + '/GetFileBySubFolderAndName?fileName=' + fileName + '&subFolder=' + subFolder ;\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public exportSubscriptionFile(fileName: string, subFolder: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getDownloadFileURL(fileName, subFolder)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = 'File download successful.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","
\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
","import { Component, OnInit, Input } from '@angular/core';\r\nimport { Location} from '@angular/common';\r\n\r\nimport { UnitOfWork, provideParent, StateMap } from '../../services/common';\r\nimport { PageState, EditPropParent } from '../../controls/common';\r\nimport { RIFMProduct, TypeLinkTarget } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'tools-and-model',\r\n templateUrl: './tools-and-model.html',\r\n providers: [provideParent(ToolsAndModelComponent, EditPropParent)]\r\n})\r\nexport class ToolsAndModelComponent implements OnInit {\r\n\r\n @Input() entity: RIFMProduct;\r\n _typeLinkTargets: TypeLinkTarget[];\r\n _pageState = new PageState('Tools and Models Editor');\r\n\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.typeLinkTargetRepository.all().then( r => {\r\n this._typeLinkTargets = r;\r\n });\r\n\r\n }\r\n\r\n getError(propName: string) {\r\n return this.entity.getErrorFor(propName);\r\n }\r\n}\r\n","import { Component, ElementRef } from '@angular/core';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog } from '../../controls/common';\r\n\r\n@Component({\r\n selector: 'tools-and-models-license',\r\n templateUrl: './tools-and-models-license.html',\r\n})\r\nexport class ToolsAndModelsLicenseComponent extends ModalDialog {\r\n constructor(public elementRef: ElementRef) {\r\n super(elementRef);\r\n }\r\n\r\n onAccept(accept: boolean) {\r\n UtilFns.returnModal(this, accept);\r\n }\r\n\r\n}\r\n\r\n","
\r\n
\r\n
\r\n
\r\n \r\n

Software License Agreement for RIFM Members

\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n

\r\n PLEASE READ THIS SOFTWARE LICENSE AGREEMENT (AGREEMENT) CAREFULLY BEFORE DOWNLOADING OR USING THE SOFTWARE. BY CLICKING ON\r\n THE \"ACCEPT\" BUTTON, OPENING THE PACKAGE, OR DOWNLOADING THE PRODUCT, YOU ARE CONSENTING TO BE BOUND BY THIS AGREEMENT.\r\n IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT, CLICK THE \"DO NOT ACCEPT BUTTON\", THE INSTALLATION PROCESS\r\n WILL NOT CONTINUE AND YOU ARE NOT AUTHORIZED TO USE THE SOFTWARE.\r\n

\r\n\r\n
\r\n The Research Institute for Fragrance Materials (\"RIFM\"), a New York corporation, has compiled a database of toxicology data,\r\n literature and general information on fragrance and flavor raw materials (the \"RIFM Database\"). The RIFM\r\n Database is available online to RIFM members under the terms and conditions set forth in this Online\r\n Database Subscription Agreement (\"Agreement\") between RIFM and the undersigned subscriber member (\"Subscriber\").\r\n
\r\n\r\n
\r\n Multiple-Users License Grant:   The Research Institute for Fragrance Materials, Inc. (\"RIFM\")\r\n grants to you, the Customer (\"Customer\"), a nonexclusive, nontransferable license to use the RIFM software\r\n (\"Software\") in executable form: (i) installed in a single location on a hard disk or other storage device\r\n for up to 20 employees of the RIFM member company (\"Permitted Number of Computers\"); or (ii) provided\r\n the Software is configured for network use, installed on a single file server for use on a single local\r\n area network for either (but not both) of the following purposes: (a) permanent installation onto a hard\r\n disk or other storage device of up to the Permitted Number of Computers; or (b) use of the Software over\r\n such network, provided the number of computers connected to the server does not exceed the Permitted\r\n Number of Computers. Customer shall not: copy, in whole or in part, software or documentation; modify\r\n the software; reverse engineer or reverse assemble all or any portion of the software; or rent, lease,\r\n distribute, sell, or create derivative works of the software.\r\n
\r\n\r\n
\r\n DISCLAIMER: THE SOFTWARE IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS,\r\n AND WARRANTIES INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A\r\n PARTICULAR PURPOSE, NONINFRINGEMENT OR ARISING FROM A COURSE OF DEALING, USAGE, OR TRADE PRACTICE, ARE\r\n HEREBY EXCLUDED TO THE EXTENT ALLOWED BY APPLICABLE LAW. IN NO EVENT WILL RIFM BE LIABLE FOR ANY LOST\r\n REVENUE, PROFIT, OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR PUNITIVE DAMAGES HOWEVER\r\n CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE\r\n EVEN IF RIFM HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT SHALL RIFM'S OR ARA'S LIABILITY\r\n TO CUSTOMER, WHETHER IN CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE, EXCEED THE PRICE PAID BY\r\n CUSTOMER.\r\n
\r\n\r\n
\r\n Termination: This Agreement is effective until terminated. Customer may terminate this License\r\n at any time by destroying all copies of Software including any documentation. This License will terminate\r\n immediately without notice from RIFM for any reason, including if Customer fails to comply with any provision\r\n of this License. Upon termination, Customer must destroy all copies of Software.\r\n
\r\n\r\n
\r\n Miscellaneous: This Agreement shall be governed by and construed in accordance with the laws\r\n of the State of New York, United States of America, as if performed wholly within the state and without\r\n giving effect to the principles of conflict of law. If any portion hereof is found to be void or unenforceable,\r\n the remaining provisions of this Agreement shall remain in full force and effect. This Agreement constitutes\r\n the entire Agreement between the parties with respect to the use of the Software.\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
","
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n You cannot leave this tab until you either Save, Apply or Cancel\r\n \r\n\r\n {{edm.status.message}}\r\n
\r\n\r\n
\r\n
\r\n
{{ errorMessage }}
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport { Entity } from 'breeze-client';\r\n\r\nimport { EditManager } from '../utils/edit-manager';\r\n\r\n@Component({\r\n selector: 'editor-header',\r\n templateUrl: './editor-header.html',\r\n})\r\nexport class EditorHeaderComponent implements OnInit {\r\n @Input() edm: EditManager;\r\n @Input() customButtons: boolean;\r\n @Input() femaRestricted: boolean;\r\n\r\n ngOnInit() {\r\n if (this.edm != null) {\r\n this.edm.femaRestricted = (this.femaRestricted != null) ? this.femaRestricted : false;\r\n }\r\n }\r\n}\r\n\r\n","
\r\n
RIFM Tools and Models
\r\n \r\n \r\n\r\n

{{_validationMessage}}

\r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n Disabled\r\n \r\n
\r\n
\r\n \r\n
\r\n
Version: {{e.productVersion}}
\r\n \r\n \r\n\r\n
\r\n
\r\n
\r\n
\r\n
{{e.productDescription}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n\r\n\r\n\r\n","import {Component, OnInit, ViewChild} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport { UnitOfWork, UserManager, StateMap, ErrorLogger } from '../../services/common';\r\nimport { UtilFns, IEditHost, EditManager } from '../../utils/common';\r\n\r\nimport { RIFMProduct, RIFMProductLicense } from '../../entities/EntityModels';\r\nimport { ToolsAndModelComponent } from './tools-and-model.component';\r\nimport { ToolsAndModelsLicenseComponent } from './tools-and-models-license.component';\r\nimport { environment } from '../../../environments/environment';\r\n\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\n\r\n@Component({\r\n templateUrl: './tools-and-models.html'\r\n})\r\nexport class ToolsAndModelsComponent implements OnInit, IEditHost {\r\n @ViewChild(ToolsAndModelComponent) _editingComponent: ToolsAndModelComponent;\r\n @ViewChild(ToolsAndModelsLicenseComponent, { static: true }) _licenseComponent: ToolsAndModelsLicenseComponent;\r\n\r\n _edm: EditManager;\r\n _isLoading = false;\r\n _licenses: RIFMProductLicense[];\r\n _licenseProduct: RIFMProduct;\r\n _toolFileURL: string;\r\n _validationMessage: string;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location,\r\n public _userManager: UserManager, public _errorLogger: ErrorLogger, private _httpClient: HttpClient) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Tools and Models');\r\n\r\n if (this.isAuthorizedDownloadUser()) {\r\n this.fetchAuthorizedDownloads('AuthorizedDownloadUser');\r\n } else {\r\n this.fetch();\r\n }\r\n\r\n this.getDocumentManagementUrl().then(url => {\r\n this._stateMap.documentManagementBaseUrl = url; // Needs to be set if Material page is opened from an external link.\r\n this._toolFileURL = this._stateMap.documentManagementBaseUrl + '/ToolsAndModels'; // needed for UVS file management\r\n });\r\n }\r\n\r\n isAuthorizedDownloadUser() {\r\n return this._stateMap.currentUser.isAuthorizedDownloadUser;\r\n }\r\n\r\n fetch() {\r\n this._uow.rIFMProductRepository.all()\r\n .then(r => {\r\n r = this._edm.isStaff() ? r : r.filter(e => e.enabled);\r\n this._edm.entities = _.sortBy(r, e => e.productName);\r\n const params = {userId: this._stateMap.currentUser.name};\r\n return this._uow.rIFMProductLicenseRepository\r\n .whereWithParams(params)\r\n .then(result => {\r\n // bringing the licenses in will cause breeze to automatically add licenses to each of the\r\n // RIFMProducts if applicable. We can use this to determine if a Product is already licensed\r\n // for this user.\r\n this._licenses = result;\r\n });\r\n });\r\n }\r\n\r\n fetchAuthorizedDownloads(roleName: string) {\r\n const paramsRole = { roleName: roleName };\r\n this._uow.fetch('ContentAuthorization/FetchAuthorizedRIFMProducts', paramsRole).then(r => {\r\n this._edm.entities = _.sortBy(r, e => e.productName);\r\n const params = {userId: this._stateMap.currentUser.name};\r\n return this._uow.rIFMProductLicenseRepository\r\n .whereWithParams(params)\r\n .then(result => {\r\n this._licenses = result;\r\n });\r\n });\r\n }\r\n\r\n hasLicense(e: RIFMProduct) {\r\n if (this._licenses == null) { return false; }\r\n return this._licenses.some(l => l.productId == e.productId && l.licenseAcceptDate != null);\r\n // product will have licenses populated as a result of breeze hookup logic.\r\n // return e.rIFMProductLicenses.some(l => l.licenseAcceptDate != null);\r\n }\r\n\r\n getDownloadText(e: RIFMProduct) {\r\n if (e.linkTargetType == 'File') {\r\n return 'Click to Download Setup File';\r\n } else {\r\n return 'Click to Open Online Tool';\r\n }\r\n }\r\n\r\n getImage(e: RIFMProduct) {\r\n if (this.hasLicense(e)) {\r\n return environment.assetsUrl + 'assets/images/install.png';\r\n } else {\r\n return environment.assetsUrl + 'assets/images/license.png';\r\n }\r\n }\r\n\r\n formatProductName(name: string) {\r\n return name.replace('Model', 'Model ');\r\n }\r\n\r\n showLicense(e: RIFMProduct) {\r\n if (e.entityAspect.entityState.isAdded()) {\r\n this._stateMap.yesNoComponent.showModal(\r\n 'Cannot accept this license',\r\n 'Cannot accept a license on this product until the product is saved', ['Ok']);\r\n return;\r\n }\r\n this._licenseProduct = e;\r\n UtilFns.showModal(this._licenseComponent, this).then((ok) => this.onLicenseAccept(ok));\r\n\r\n }\r\n\r\n onLicenseAccept(accept: boolean) {\r\n if (accept == false) {\r\n this._licenseProduct = null;\r\n return;\r\n }\r\n const params = {\r\n productId: this._licenseProduct.productId,\r\n userId: this._stateMap.currentUser.name,\r\n licenseAcceptDate: new Date()\r\n };\r\n const license = this._uow.rIFMProductLicenseFactory.create(params);\r\n\r\n // HACK - because we don't want to combine this with 'Staff' editing.\r\n this._uow.commitSelected([license]).then(r => {\r\n // refresh license data\r\n const licenseparams = {userId: this._stateMap.currentUser.name};\r\n return this._uow.rIFMProductLicenseRepository\r\n .whereWithParams(licenseparams)\r\n .then(result => {\r\n this._licenses = result;\r\n });\r\n }).catch(e => {\r\n const err = license.entityAspect.getValidationErrors().map(ve => ve.errorMessage).join('; ');\r\n this._errorLogger.log(e + ':' + err);\r\n });\r\n }\r\n\r\n onDownload(e: RIFMProduct) {\r\n if (e.linkTargetType == 'RIFMSecureProduct') {\r\n this.linkToSecuredProduct(e.productLink, e.contentType);\r\n return;\r\n }\r\n\r\n if (e.linkTargetType == 'File') {\r\n this.downloadModelFile(e.productLink);\r\n return;\r\n }\r\n\r\n // legacy types\r\n let url: string;\r\n const token = this._stateMap.currentUser.authenticationToken;\r\n\r\n if (e.productLink.indexOf('?') >= 0) {\r\n url = `${e.productLink}&token=${token}`;\r\n } else {\r\n url = `${e.productLink}//?token=${token}`;\r\n }\r\n\r\n window.open(url, '_self');\r\n return;\r\n }\r\n\r\n linkToSecuredProduct(link: string, type: string) {\r\n\r\n let url: string = link;\r\n\r\n const params = {token: this._stateMap.currentUser.authenticationToken, contentType: type};\r\n this._uow.fetch('ToolsAndModels/GetApplicationToken', params).then(r => {\r\n if (r != null && r.length > 0) {\r\n if (link.indexOf('') >= 0) {\r\n url = url.replace('', r[0]);\r\n }\r\n if (link.indexOf('') >= 0) {\r\n const uname = this._userManager.currentUser.name.replace('@', '_');\r\n url = url.replace('', uname);\r\n }\r\n }\r\n\r\n window.open(url);\r\n });\r\n }\r\n\r\n\r\n // EditManager overrides.\r\n\r\n onAdd() {\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n const e = this._uow.rIFMProductFactory.create();\r\n e.contentType = 'None';\r\n this._edm.entities.push(e);\r\n this._edm.onSelect(e);\r\n }\r\n\r\n onCancel() {\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n this.fetch();\r\n }\r\n\r\n onDelete() {\r\n // need to delete all of the licences associated with this RIFMProduct.\r\n const params = {productId: this._edm.currentEntity.productId};\r\n return this._uow.fetchTyped('Misc/RIFMProductLicensesForProduct', RIFMProductLicense, params).then(r => {\r\n r.forEach(l => l.entityAspect.setDeleted());\r\n this._edm.onDeleteCore();\r\n });\r\n }\r\n\r\n // model file download url\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url for tool file downloads\r\n // ************************************************************************\r\n getDownloadFileURL(fileName: string): Observable {\r\n let url: string;\r\n url = this._toolFileURL + '/GetToolFileByName?fileName=' + fileName;\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public downloadModelFile(fileName: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getDownloadFileURL(fileName)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/octet-stream' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = 'File download successful.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n
Now select a row from below or click 'Cancel'
\r\n
\r\n
\r\n

{{validationMessage}}

\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
","import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';\r\n\r\nimport { SearchService } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog } from '../../controls/common';\r\n\r\nimport { MaterialListItem } from '../../entities/projections/MaterialListItem';\r\nimport { IMaterialResultsParent, MaterialResultsComponent } from './material-results.component';\r\n\r\n@Component({\r\n selector: 'material-selector',\r\n templateUrl: './material-selector.html',\r\n})\r\nexport class MaterialSelectorComponent extends ModalDialog implements IMaterialResultsParent, OnInit {\r\n @ViewChild(MaterialResultsComponent, { static: true }) _materialResultsComponent: MaterialResultsComponent;\r\n\r\n _searchTerm: string;\r\n _entities: MaterialListItem[];\r\n\r\n constructor(public elementRef: ElementRef, public _searchService: SearchService) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n canSearch() {\r\n return this._searchTerm && this._searchTerm.length > 1;\r\n }\r\n\r\n onSearch() {\r\n if (!this.canSearch()) {\r\n return;\r\n }\r\n const params = {\r\n searchTerm: this._searchTerm,\r\n searchType: 'searchall',\r\n pageNumber: 0,\r\n pageSize: 50\r\n };\r\n this.validationMessage = null;\r\n this._materialResultsComponent.loading(true);\r\n this._entities = null;\r\n this._searchService.fetchMaterialsPage(params).then(r => {\r\n this._entities = r.materials;\r\n this._materialResultsComponent.update(this, r);\r\n }).catch(e => {\r\n this._materialResultsComponent.loading(false);\r\n });\r\n }\r\n\r\n // called from MaterialResultsComponent\r\n selectMaterial(mli: MaterialListItem) {\r\n UtilFns.returnModal(this, mli);\r\n }\r\n\r\n\r\n}\r\n\r\n","
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
Now select a row from below or click 'Cancel'
\r\n
\r\n
\r\n

{{validationMessage}}

\r\n
\r\n \r\n \r\n \r\n Name\r\n Initials\r\n AuthorId\r\n \r\n \r\n \r\n \r\n {{a.authorName}}\r\n {{a.initials}}\r\n {{a.authorId}}\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n","import { Component, ElementRef } from '@angular/core';\r\n\r\nimport { UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { Author } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'author-selector',\r\n templateUrl: './author-selector.html',\r\n\r\n})\r\nexport class AuthorSelectorComponent extends ModalDialog {\r\n _searchTerm: string;\r\n _entities: Author[] = [];\r\n _pageState = new PageState('Authors');\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork) {\r\n super(elementRef);\r\n }\r\n\r\n canSearch() {\r\n return this._searchTerm && this._searchTerm.length > 1;\r\n }\r\n\r\n search() {\r\n this.validationMessage = null;\r\n this._pageState.isLoading = true;\r\n this._entities = null;\r\n this._uow.fetchTyped('Misc/AuthorsByName', Author, {name: UtilFns.encodeHackForAnd(this._searchTerm)}).then(r => {\r\n this._pageState.isLoaded = r;\r\n this._entities = r;\r\n });\r\n }\r\n\r\n onSelect(author: Author) {\r\n UtilFns.returnModal(this, author);\r\n }\r\n\r\n\r\n}\r\n\r\n","
\r\n
Report of Database Changes
\r\n\r\n
\r\n \r\n \r\n \r\n You cannot leave this page you either 'Save' or 'Cancel'\r\n \r\n {{_status.message}}\r\n
\r\n\r\n
\r\n
\r\n You are not setup to receive email reports of RIFM database changes yet. Please click the Create Settings button to specify\r\n your report preferences.\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n {{topic.changeReportTopicDesc}}\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n {{topic.changeReportTopicDesc}}\r\n
\r\n
\r\n \r\n\r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n All Flavors\r\n
\r\n
\r\n \r\n All Fragrances\r\n
\r\n
\r\n \r\n All Naturals\r\n
\r\n
\r\n Specific Materials of Interest\r\n \r\n
\r\n (None selected)\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n CAS No.\r\n RIFM ID\r\n Principal Synonym\r\n \r\n \r\n \r\n \r\n Remove\r\n {{m.realCASNumber}}\r\n {{m.formattedRifmId}}\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n New Publications\r\n
\r\n
\r\n Specific Authors of Interest\r\n \r\n
\r\n
\r\n (None selected)\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n Name\r\n Initials\r\n \r\n \r\n \r\n \r\n Remove\r\n {{a.authorName}}\r\n {{a.initials}}\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n\r\n\r\n","import { Component, OnInit, ViewChild} from '@angular/core';\r\nimport * as _ from 'lodash';\r\nimport { UnitOfWork, StateMap, SearchService } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { UserChangeReport, TypeChangeReportFrequency, TypeChangeReportTopic, Author, TypeStudy} from '../../entities/EntityModels';\r\nimport { MaterialListItem} from '../../entities/projections/MaterialListItem';\r\nimport { MaterialSelectorComponent} from '../material/material-selector.component';\r\nimport { AuthorSelectorComponent} from '../reference/author-selector.component';\r\n\r\n\r\n@Component({\r\n templateUrl: './report-database-changes.html'\r\n})\r\nexport class ReportDatabaseChangesComponent implements OnInit {\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n @ViewChild(AuthorSelectorComponent, { static: true }) _authorSelectorComponent: AuthorSelectorComponent;\r\n\r\n _userChangeReport: UserChangeReport;\r\n _typeChangeReportFrequencies: TypeChangeReportFrequency[];\r\n _typeChangeReportTopics: TypeChangeReportTopic[];\r\n _typeStudies: TypeStudy[];\r\n _filterStudyType: string;\r\n _selectedStudyTypes: TypeStudy[] = [];\r\n _studyFilterMode: string = \"All\";\r\n\r\n _studyTypeMap: { [key: string]: boolean } = {};\r\n _topicMap: { [key: string]: boolean } = {};\r\n _materialListItems: MaterialListItem[];\r\n _authors: Author[];\r\n\r\n _hasPendingEdits: boolean = false;\r\n _pageState = new PageState('Report of Database Changes');\r\n _status = {};\r\n _errorMessage: string;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _searchService: SearchService) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._uow.typeChangeReportFrequencyRespository.all().then(r => {\r\n this._typeChangeReportFrequencies = r;\r\n });\r\n\r\n this._uow.typeStudyRepository.all().then(r => {\r\n this._typeStudies = _.sortBy(r, t => t.studyLong);\r\n });\r\n\r\n this._uow.typeChangeReportTopicRepository.all().then(r => {\r\n this._typeChangeReportTopics = _.sortBy(r, t => t.topicDisplayOrder);\r\n this.fetch();\r\n });\r\n }\r\n\r\n\r\n fetch() {\r\n this._userChangeReport = null;\r\n this._materialListItems = null;\r\n this._authors = null;\r\n this._typeChangeReportTopics.forEach(topic => this._topicMap[topic.typeChangeReportTopicId] = false);\r\n\r\n var params = { userId: this._stateMap.currentUser.name }\r\n return this._uow.userChangeReportRepository.whereWithParams(params).then(r => {\r\n if (r.length == 0) {\r\n this._materialListItems = [];\r\n this._authors = [];\r\n return;\r\n }\r\n this._userChangeReport = r[0];\r\n\r\n this._userChangeReport.userChangeReportTopics.forEach(t => {\r\n this._topicMap[t.typeChangeReportTopicId] = true;\r\n });\r\n var materialIds = this._userChangeReport.userChangeReportMaterials.map(m => m.materialId);\r\n // return this._searchService.fetchMaterialListItems(materialIds);\r\n this._uow.fetch(\"Materials/MaterialListItems\", { materialIds: materialIds }).then(r => {\r\n this._materialListItems = r;\r\n if (this._materialListItems != null && this._materialListItems.length > 0) {\r\n this._materialListItems = _.sortBy(this._materialListItems, m => m.synonymWordOrWebVersion);\r\n }\r\n })\r\n\r\n this._typeStudies.forEach(s => this._studyTypeMap[s.typeStudyId] = false);\r\n this._selectedStudyTypes = [];\r\n this._userChangeReport.userChangeReportStudies.forEach(s => {\r\n this._studyTypeMap[s.typeStudyId] = true;\r\n this._selectedStudyTypes.push(s.typeStudy);\r\n });\r\n if (this._selectedStudyTypes.length > 0) {\r\n this._studyFilterMode = \"Specific\";\r\n this._selectedStudyTypes = _.sortBy(this._selectedStudyTypes, s => s.studyLong);\r\n }\r\n\r\n var authorIds = this._userChangeReport.userChangeReportAuthors.map(a => a.authorId);\r\n return this._uow.fetchTyped(\"Misc/AuthorsByIds\", Author, { authorIds: authorIds }).then(r => {\r\n this._authors = r;\r\n if (this._authors != null && this._authors.length > 0) {\r\n this._authors = _.sortBy(this._authors, a => a.authorName);\r\n }\r\n });\r\n\r\n })\r\n }\r\n\r\n dataReady() {\r\n return this._materialListItems != null && this._authors != null;\r\n }\r\n\r\n createSettings() {\r\n var params = {\r\n userId: this._stateMap.currentUser.name,\r\n staffReport: this._stateMap.currentUser.isStaff,\r\n typeChangeReportFrequencyId: \"Weekly\",\r\n enabled: true\r\n }\r\n this._userChangeReport = this._uow.userChangeReportFactory.create(params);\r\n return this._uow.commit().then(() => {\r\n this.fetch();\r\n }).catch(e => {\r\n\r\n })\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges() || this._hasPendingEdits;\r\n }\r\n\r\n canSave() {\r\n return this.hasEdits();\r\n }\r\n\r\n canCancel() {\r\n return this.hasEdits();\r\n }\r\n\r\n onSave() {\r\n // add/remove topics\r\n var topics = this._userChangeReport.userChangeReportTopics;\r\n // clone is so that we don't change the navProp while iterating over it.\r\n _.clone(topics).forEach(t => {\r\n if (this._topicMap[t.typeChangeReportTopicId] == false) {\r\n t.entityAspect.setDeleted();\r\n }\r\n });\r\n\r\n _.forEach(this._topicMap, (v, k) => {\r\n if (v && !_.find(topics, t => t.typeChangeReportTopicId == k)) {\r\n var params = {\r\n userChangeReportId: this._userChangeReport.userChangeReportId,\r\n typeChangeReportTopicId: k,\r\n enabled: true\r\n }\r\n var userChangeReportTopic = this._uow.userChangeReportTopicFactory.create(params);\r\n topics.push(userChangeReportTopic);\r\n }\r\n });\r\n\r\n // add/remove materials\r\n var reportMaterials = this._userChangeReport.userChangeReportMaterials;\r\n // clone is so that we don't change the navProp while iterating over it.\r\n _.clone(reportMaterials).forEach(reportMaterial => {\r\n if (!this._materialListItems.find(m => m.materialId == reportMaterial.materialId)) {\r\n reportMaterial.entityAspect.setDeleted();\r\n }\r\n });\r\n\r\n _.forEach(this._materialListItems, mli => {\r\n if (!_.find(reportMaterials, rm => rm.materialId == mli.materialId)) {\r\n var params = {\r\n userChangeReportId: this._userChangeReport.userChangeReportId,\r\n materialId: mli.materialId\r\n }\r\n var userChangeReportMaterial = this._uow.userChangeReportMaterialFactory.create(params);\r\n reportMaterials.push(userChangeReportMaterial);\r\n }\r\n })\r\n\r\n // add/remove authors\r\n var reportAuthors = this._userChangeReport.userChangeReportAuthors;\r\n this._userChangeReport.referenceAuthors = reportAuthors.length > 0;\r\n // clone is so that we don't change the navProp while iterating over it.\r\n _.clone(reportAuthors).forEach(reportAuthor => {\r\n if (!this._authors.find(a => a.authorId == reportAuthor.authorId)) {\r\n reportAuthor.entityAspect.setDeleted();\r\n }\r\n });\r\n\r\n _.forEach(this._authors, author => {\r\n if (!_.find(reportAuthors, ra => ra.authorId == author.authorId)) {\r\n var params = {\r\n userChangeReportId: this._userChangeReport.userChangeReportId,\r\n authorId: author.authorId\r\n }\r\n var userChangeReportAuthor = this._uow.userChangeReportAuthorFactory.create(params);\r\n reportAuthors.push(userChangeReportAuthor);\r\n }\r\n })\r\n\r\n //add/remove study types\r\n var studies = this._userChangeReport.userChangeReportStudies;\r\n this._selectedStudyTypes.forEach(s => {\r\n if (!_.find(studies, r => r.typeStudyId == s.typeStudyId)) {\r\n var params = {\r\n userChangeReportId: this._userChangeReport.userChangeReportId,\r\n typeStudyId: s.typeStudyId,\r\n enabled: true\r\n }\r\n var userChangeReportStudy = this._uow.userChangeReportStudyFactory.create(params);\r\n studies.push(userChangeReportStudy);\r\n }\r\n });\r\n\r\n //The default is All study types when either the health or environmental study topic is selected.\r\n //Only store specific study types if the user selects them.\r\n if (this._studyFilterMode == \"All\" || this.hasSelectedStudyTopic() == false) {\r\n _.clone(studies).forEach(s => {\r\n s.entityAspect.setDeleted();\r\n });\r\n this._typeStudies.forEach(s => this._studyTypeMap[s.typeStudyId] = false);\r\n this._selectedStudyTypes = [];\r\n }\r\n else {\r\n _.clone(studies).forEach(s => {\r\n if (this._studyTypeMap[s.typeStudyId] == false) {\r\n s.entityAspect.setDeleted();\r\n }\r\n });\r\n }\r\n\r\n // and then save\r\n return this._uow.commit().then(() => {\r\n this.setStatus({ message: 'Saved', classes: \"label-success\", isTemp: true });\r\n this._hasPendingEdits = false;\r\n }).catch(e => {\r\n this.setStatus({ message: 'Save failed: ' + e.toString(), classes: \"label-danger\", isTemp: false });\r\n })\r\n\r\n }\r\n\r\n onCancel() {\r\n this._uow.rollback();\r\n this._hasPendingEdits = false;\r\n this.fetch();\r\n }\r\n\r\n onTopicChanged() {\r\n this._hasPendingEdits = true;\r\n }\r\n\r\n onSelectingMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this, this.validateMaterial).then(mli => {\r\n if (mli == null) return;\r\n this._hasPendingEdits = true;\r\n this._materialListItems.push(mli);\r\n this._materialListItems = _.sortBy(this._materialListItems, m => m.synonymWordOrWebVersion);\r\n });\r\n }\r\n\r\n validateMaterial(mli: MaterialListItem): string {\r\n if (this._materialListItems.some(m => m.materialId == mli.materialId)) {\r\n return `Material: ${mli.realCASNumber} has already been referenced`;\r\n }\r\n }\r\n\r\n removeMaterial(mli: MaterialListItem) {\r\n _.remove(this._materialListItems, mli);\r\n this._hasPendingEdits = true;\r\n }\r\n\r\n onSelectingAuthor() {\r\n UtilFns.showModal(this._authorSelectorComponent, this, this.validateAuthor).then(author => {\r\n if (!author) return;\r\n this._hasPendingEdits = true;\r\n this._authors.push(author);\r\n this._authors = _.sortBy(this._authors, a => a.authorName);\r\n })\r\n }\r\n\r\n onRemoveStudyType(id: string) {\r\n this._selectedStudyTypes = this._selectedStudyTypes.filter(function (obj) {\r\n return obj.typeStudyId !== id;\r\n });\r\n\r\n this._studyTypeMap[id] = false;\r\n this._hasPendingEdits = true;\r\n }\r\n\r\n get filterStudyType() {\r\n return this._filterStudyType;\r\n }\r\n\r\n set filterStudyType(id: string) {\r\n if (this._studyTypeMap[id] != true) {\r\n this._studyTypeMap[id] = true;\r\n this._hasPendingEdits = true;\r\n this._selectedStudyTypes.push(_.find(this._typeStudies, s => s.typeStudyId == id));\r\n this._selectedStudyTypes = _.sortBy(this._selectedStudyTypes, s => s.studyLong);\r\n }\r\n }\r\n\r\n get topicsWithoutStudies() {\r\n if (this._typeChangeReportTopics != null) {\r\n return this._typeChangeReportTopics.filter(t => t.changeReportTopicDesc.indexOf(\"Studies\") < 0);\r\n }\r\n }\r\n\r\n get topicsOnlyStudies() {\r\n if (this._typeChangeReportTopics != null) {\r\n return this._typeChangeReportTopics.filter(t => t.changeReportTopicDesc.indexOf(\"Studies\") > -1);\r\n }\r\n }\r\n\r\n //Set style based on selected status\r\n isStudyTypeSelected(obj: TypeStudy): boolean {\r\n return this._studyTypeMap[obj.typeStudyId];\r\n }\r\n\r\n isStudyTypeUnselected(obj: any): boolean {\r\n return (this._studyTypeMap[obj.typeStudyId] == false);\r\n }\r\n\r\n hasSelectedStudyTopic() {\r\n var studytopics = this._typeChangeReportTopics.filter(t => t.changeReportTopicDesc.indexOf(\"Studies\") > -1);\r\n if (studytopics == null) {\r\n return false;\r\n }\r\n\r\n var result = false;\r\n studytopics.forEach(st => {\r\n if (this._topicMap[st.typeChangeReportTopicId] == true) {\r\n result = true;\r\n }\r\n });\r\n\r\n return result;\r\n }\r\n\r\n get showStudyTypeFilter() {\r\n return (this.hasSelectedStudyTopic() && this._studyFilterMode == \"Specific\");\r\n }\r\n\r\n setStudyFilterMode(mode: string) {\r\n this._studyFilterMode = mode;\r\n this._hasPendingEdits = true;\r\n }\r\n\r\n //Set style based on selection status\r\n isNotActiveStudyFilter(mode: string): boolean {\r\n return (this._studyFilterMode != mode);\r\n }\r\n\r\n isActiveStudyFilter(mode: string): boolean {\r\n return (this._studyFilterMode == mode);\r\n }\r\n\r\n validateAuthor(author: Author): string {\r\n if (this._authors.some(a => a.authorId == author.authorId)) {\r\n return `Author: ${author.authorName} has already been referenced`;\r\n }\r\n }\r\n\r\n removeAuthor(author: Author) {\r\n _.remove(this._authors, author);\r\n this._hasPendingEdits = true;\r\n }\r\n\r\n protected setStatus(status: { message: string, classes: string, isTemp: boolean }) {\r\n status.classes = \"label \" + status.classes;\r\n this._status = status;\r\n if (status.isTemp) {\r\n setTimeout(() => { this._status = null }, 2000)\r\n }\r\n }\r\n}\r\n","import { Component, OnInit, Input} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { UnitOfWork, UserManager, StateMap } from '../../services/common';\r\nimport { UtilFns, LocationFns} from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\n@Component({\r\n templateUrl: './system-requirements.html'\r\n})\r\nexport class SystemRequirementsComponent implements OnInit {\r\n constructor(public _uow: UnitOfWork, public _location: Location, public _stateMap: StateMap ) {\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n}\r\n","
\r\n\r\n
System Requirements and Tips for Navigating the New Database
\r\n\r\n
\r\n
\r\n

System Requirements:

\r\n
Subscribers should be using the latest versions of Internet browsers released in 2016. Recommended browsers are\r\n Google Chrome, Internet Explorer 11, Microsoft Edge, and Mozilla Firefox for optimal performance. Please\r\n work with your IT representative to update your browser or you can easily download any of these browsers\r\n by doing an Internet search. Internet Explorer 10 is being supported for those users who have difficulty\r\n switching to other recommended browsers.
\r\n
\r\n
\r\n\r\n
\r\n
\r\n

Tips:

\r\n
\r\n Watch the Webinar in the \"Introduction to the New Database and Demo\" link on the Home Page, this will\r\n help you find the basic reference and material information.\r\n
\r\n
\r\n
\r\n To report an issue, please send an email to help@rifm.org. Anytime you encounter errors, you should\r\n see the dialog below:

\r\n \r\n

Please take a screen shot/capture of this dialog box, including the error message and email\r\n it to help@rifm.org. It would be further helpful if you can enlist the actions you took prior to the error\r\n being generated. To resume working, you can click on either of the two buttons. Clicking on the button Reload\r\n the current page, will allow you to stay on the page, and resume working. Clicking on the button Return to\r\n the Home screen, will lead you to the Home page of RIFM Database.\r\n
\r\n
\r\n
\r\n To print, click on the Print button provided in the header. Do not use the Print functionality built\r\n into browsers.\r\n
\r\n
\r\n
\r\n Print any report in PDF format directly from the browser. Listed below are steps to print them in\r\n each of the supported browsers.\r\n
\r\n
\r\n
\r\n On Google Chrome:
(1) Click the Print button seen on Reports or in the Header to see a dialog\r\n pop-up that allows printing.

(2) Set the Destination printer to Microsoft Print as PDF and then\r\n click on the Print button.

\r\n \r\n

(3) A dialog called Save Print Output As should pop-up. On this dialog, specify a location and\r\n filename for the PDF document, and click on Save to generate a PDF document.

\r\n \r\n
\r\n
\r\n
\r\n On Microsoft Edge:
(1) Click the Print button seen on Reports or in the Header to see a dialog\r\n pop-up that allows printing.

(2) Set the Printer to Microsoft Print to PDF and then click on\r\n the Print button.

\r\n \r\n

(3) A dialog called Save Print Output As should pop-up. On this dialog, specify a location and\r\n filename for the PDF document, and click on Save to generate a PDF document.

\r\n \r\n
\r\n
\r\n
\r\n On Firefox:
(1) Click the Print button seen on Reports or in the Header to see a dialog pop-up\r\n that allows printing.

(2) Set the Printer Name to Microsoft Print to PDF and then click OK.
\r\n \r\n

(3) A dialog called Save Print Output As should pop-up. On this dialog, specify a location and\r\n filename for the PDF document, and click on Save to generate a PDF document.

\r\n \r\n
\r\n
\r\n
\r\n On Internet Explorer 11:
(1) Click the Print button seen on Reports or in the Header to see\r\n a dialog pop-up that allows printing.

(2) In the Select printer section, check the checkbox for\r\n Microsoft Print to PDF and then click on the Print button.

\r\n \r\n

(3) A dialog called Save Print Output As should pop-up. On this dialog, specify a location and\r\n filename for the PDF document, and click on Save to generate a PDF document.

\r\n \r\n
\r\n
\r\n
\r\n On Internet Explorer 10:
(1) Click the Print button seen on Reports or in the Header to see\r\n a dialog pop-up that allows printing.

(2) In the Select printer section, select item Send to\r\n OneNote 2007 and then click on the Print button.

\r\n \r\n

(3) This should launch OneNote. Click on this, and go to the File menu. Here onwards, at least\r\n two options are available to convert the document to PDF format. The first option involves installing a OneNote\r\n plug-in that allows publishing the document as a PDF. See below:

\r\n \r\n

(4) The second option would be to save the document as a Microsoft Word document, and then use\r\n any available plug-in to convert from Microsoft Word to PDF. Saving the document using any of these options\r\n should generate a PDF.

\r\n \r\n

\r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { UnitOfWork, StateMap } from '../../services/common';\r\nimport { HOME_ROUTES} from './home.routes';\r\n\r\n@Component({\r\n selector: 'ifra-survey-use',\r\n templateUrl: './ifra-survey-use.html',\r\n})\r\n\r\nexport class IFRASurveyUseComponent implements OnInit {\r\n\r\n _canLoad = false;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = HOME_ROUTES.IFRASurveyUse.name;\r\n }\r\n\r\n canDeactivate() {\r\n return (!this._uow.hasChanges());\r\n }\r\n}\r\n\r\n\r\n","
\r\n
\r\n \r\n
\r\n
\r\n\r\n","
\r\n\r\n
Database Subscription Information and Application Forms
\r\n
Please download the application and send the completed form to the email address provided on the application document.
\r\n\r\n

{{_validationMessage}}

\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n
0\">\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n {{_yearLabel}}\r\n
\r\n\r\n
0\">\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n","import { Component, OnInit } from '@angular/core';\r\nimport {StateMap, UnitOfWork, UserManager} from '../../services/common';\r\nimport { RIFMDownloadableFile } from '../../entities/EntityModels';\r\nimport {HttpClient, HttpHeaders, HTTP_INTERCEPTORS} from '@angular/common/http';\r\nimport {Observable} from 'rxjs';\r\n\r\n@Component({\r\n templateUrl: './database-subscription.html',\r\n})\r\nexport class DatabaseSubscriptionComponent implements OnInit {\r\n\r\n // DatabaseApplication\r\n // DatabasePricing\r\n\r\n _databaseApplicationFiles: RIFMDownloadableFile[] = [];\r\n _databasePricingFiles: RIFMDownloadableFile[] = [];\r\n _documentManagementUrl: string;\r\n\r\n _isLoading = false;\r\n _validationMessage: string;\r\n _yearLabel: string;\r\n\r\n constructor(public _stateMap: StateMap, private _httpClient: HttpClient, public _uow: UnitOfWork, public _userManager: UserManager) { }\r\n\r\n ngOnInit() {\r\n this._documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDownloadableFile';\r\n\r\n this.loadData();\r\n }\r\n\r\n loadData() {\r\n this._isLoading = true;\r\n\r\n const params = { category: 'DatabaseSubscriptionInformation' };\r\n\r\n return this._uow.fetch('DocumentManagement/FetchRIFMDownloadableFilesByFileCategory', params).then(r => {\r\n if (r) {\r\n const files = r;\r\n this._databaseApplicationFiles = files.filter(f => f.fileIdentifier == 'DatabaseApplication');\r\n\r\n this._databasePricingFiles = files.filter(f => f.fileIdentifier == 'DatabasePricing');\r\n this.setYearLabel();\r\n }\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n public setYearLabel() {\r\n this._yearLabel = (this._databasePricingFiles == null || this._databasePricingFiles.length == 0) ? '' : this._databasePricingFiles[0].fileDescription;\r\n }\r\n\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n downloadFile(dfs: RIFMDownloadableFile) {\r\n if (dfs == null) {\r\n return ;\r\n }\r\n\r\n this.exportSubscriptionFile(dfs.fileName, dfs.fileSubFolder);\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url\r\n // ************************************************************************\r\n getDownloadFileURL(fileName: string, subFolder: string): Observable {\r\n let url: string;\r\n url = this._documentManagementUrl + '/GetFileBySubFolderAndName?fileName=' + fileName + '&subFolder=' + subFolder ;\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public exportSubscriptionFile(fileName: string, subFolder: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getDownloadFileURL(fileName, subFolder)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = 'File download successful.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","import { JournalListItem } from './JournalListItem';\r\nimport { Material } from '../Material';\r\nimport { MaterialExposureSurvey } from '../MaterialExposureSurvey';\r\n\r\nexport class SelectableEntity {\r\n backgroundColor: string;\r\n data: T;\r\n sortField: string;\r\n isMultiple: boolean;\r\n selected: boolean;\r\n\r\n constructor(obj: T, color: string, sortField: string = '', isMultiple: boolean = false) {\r\n this.backgroundColor = color;\r\n this.data = obj;\r\n this.sortField = sortField;\r\n this.isMultiple = isMultiple;\r\n this.selected = false;\r\n }\r\n\r\n public static compareJournals(a: SelectableEntity, b: SelectableEntity) {\r\n if (a.data.relevance < b.data.relevance) {\r\n return -1;\r\n }\r\n if (a.data.relevance > b.data.relevance) {\r\n return 1;\r\n }\r\n if (a.data.journalName < b.data.journalName) {\r\n return -1;\r\n }\r\n if (a.data.journalName > b.data.journalName) {\r\n return 1;\r\n }\r\n return 0;\r\n }\r\n}\r\n","import { Component, Input, OnInit, ElementRef, ViewChild, ContentChild } from '@angular/core';\r\nimport { UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'cluster-help-video',\r\n templateUrl: './cluster-help-video.html',\r\n})\r\nexport class ClusterHelpVideoComponent extends ModalDialog {\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork) {\r\n super(elementRef);\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // ***************************************************************************************************\r\n // Close Modal\r\n // ***************************************************************************************************\r\n onClose() {\r\n UtilFns.returnModal(this, false);\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n Cluster Graph Tutorial Videos\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n

(1) Cluster Path Selection Tutorial

\r\n
\r\n \r\n
\r\n
\r\n
\r\n

(2) Cluster Graph Navigation Tutorial

\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n","
\r\n
\r\n
\r\n
\r\n Search for Cluster Paths by Chemical Terms\r\n
\r\n
\r\n
\r\n
\r\n Cluster Search Term:\r\n \r\n \r\n
\r\n\r\n
0\">\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n\r\n

{{_userNotifications}}

\r\n\r\n
\r\n
\r\n
\r\n

The Cluster Terms were found in Cluster Paths in Multiple Groups.

\r\n

Select a Cluster Group to see each set of Cluster Paths that match your query.

\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n
0\" class=\"subtitle-margin-top\" style=\"margin-left: 16px;\">\r\n Cluster Group:\r\n \r\n
\r\n\r\n
0\" style=\"margin-left: 16px; margin-top: 6px; max-height: 400px; overflow-y: auto; overflow-x: hidden;\">\r\n

The Cluster Term(s) were found in the following paths.

\r\n \r\n \r\n \r\n Select\r\n Cluster Group Name\r\n Cluster Path\r\n \r\n \r\n \r\n \r\n \r\n {{p.data.clusterGroup.clusterGroupName}}\r\n {{p.data.clusterPathName}}\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n","import { Component, Input, OnInit, ElementRef, ViewChild, ContentChild } from '@angular/core';\r\nimport { NgStyle } from '@angular/common';\r\nimport { UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\n\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\nimport { SearchService } from '../../services/common';\r\n\r\nimport { SuperCluster, SuperClusterPath, Material, ClusterGroup, ClusterPart, ClusterPath, MaterialCluster, ClusterNodeAndEdge } from '../../entities/EntityModels';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\n\r\nimport { MaterialListItem } from '../../entities/projections/MaterialListItem';\r\n\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'clusterpath-filter',\r\n templateUrl: './clusterpath-filter.html',\r\n})\r\nexport class ClusterPathFilterComponent extends ModalDialog {\r\n\r\n _isLoading = false;\r\n\r\n _selectedMaterial: Material;\r\n _materialCluster: MaterialCluster;\r\n\r\n _searchClusterTerm: string;\r\n _clusterPartSearchTerms: string[] = [];\r\n\r\n _clusterGroups: ClusterGroup[];\r\n _selectedClusterGroup: ClusterGroup;\r\n _selectedClusterGroupId = -1;\r\n\r\n _clusterPaths: ClusterPath[] = [];\r\n _clusterPathsEx: SelectableEntity[] = [];\r\n _selectedClusterPathIds: number[] = [];\r\n\r\n _userNotifications = '';\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork) {\r\n super(elementRef);\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // ***************************************************************************************************\r\n // Load Data\r\n // ***************************************************************************************************\r\n loadMaterialClusterPathData() {\r\n this._isLoading = true;\r\n this._materialCluster = null;\r\n\r\n const params = { materialId: this._selectedMaterial.materialId };\r\n this._uow.fetch('MaterialClusters/MaterialClusterByMaterialId', params).then(m => {\r\n if (m != null && m.length > 0) {\r\n this._materialCluster = m[0];\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n loadMatchingClusterGroups() {\r\n this._isLoading = true;\r\n\r\n this.clearSelections();\r\n\r\n const param = {\r\n partSearchTerms: this._clusterPartSearchTerms\r\n };\r\n this._uow.fetchTyped('MaterialClusters/FetchClusterGroupsByClusterPartLabels', ClusterGroup, param).then(g => {\r\n this._clusterGroups = g;\r\n\r\n if (this._clusterGroups != null && this._clusterGroups.length > 0) {\r\n this.onSelectClusterGroup(this._clusterGroups[0].clusterGroupId);\r\n } else {\r\n this._userNotifications = 'No Cluster Paths match your search terms.';\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n loadMatchingClusterPathData() {\r\n this._isLoading = true;\r\n\r\n this._clusterPaths = null;\r\n this._clusterPathsEx = null;\r\n this._selectedClusterPathIds = [];\r\n\r\n const params = {\r\n partSearchTerms: this._clusterPartSearchTerms,\r\n clusterGroupId: this._selectedClusterGroup.clusterGroupId\r\n };\r\n\r\n this._uow.fetchTyped('MaterialClusters/FetchClusterPathByClusterLabel', ClusterPath, params).then(p => {\r\n this._clusterPaths = p;\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._clusterPathsEx = [];\r\n if (this._clusterPaths == null || this._clusterPaths.length < 1) { return; }\r\n\r\n _.clone(this._clusterPaths).forEach(element => {\r\n this._clusterPathsEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n }\r\n\r\n // ***************************************************************************************************\r\n // Interaction\r\n // ***************************************************************************************************\r\n public get SelectedClusterPathIds(): number[] {\r\n return this._selectedClusterPathIds;\r\n }\r\n\r\n findClusterGroupById(clusterGroupId: number): ClusterGroup {\r\n const clusterGroups = this._clusterGroups.filter(g => g.clusterGroupId == clusterGroupId);\r\n return clusterGroups[0];\r\n }\r\n\r\n public get SelectedClusterGroupId(): number {\r\n return this._selectedClusterGroup.clusterGroupId;\r\n }\r\n\r\n clearSelections() {\r\n this._clusterGroups = null;\r\n this._selectedClusterGroup = null;\r\n this._selectedClusterGroupId = -1;\r\n this._clusterPaths = null;\r\n this._clusterPathsEx = null;\r\n }\r\n\r\n // ***************************************************************************************************\r\n // Close Modal\r\n // ***************************************************************************************************\r\n onCancel() {\r\n UtilFns.returnModal(this, false);\r\n }\r\n\r\n onSave() {\r\n UtilFns.returnModal(this, true);\r\n }\r\n\r\n canSave(): boolean {\r\n\r\n if (this._isLoading == true) {\r\n return false;\r\n }\r\n\r\n return (this._selectedClusterPathIds.length > 0);\r\n }\r\n\r\n canAddSearchTerm(): boolean {\r\n if (!this._searchClusterTerm || this._searchClusterTerm.length == 0) {\r\n return false;\r\n }\r\n\r\n return (this._searchClusterTerm.trim().length > 0);\r\n }\r\n\r\n canSearch(): boolean {\r\n return (this._clusterPartSearchTerms.length > 0);\r\n }\r\n\r\n showUserMessage() {\r\n return (this._clusterGroups != null && this._clusterGroups.length > 1);\r\n }\r\n\r\n // ***************************************************************************************************\r\n // Filter by a cluster part label\r\n // ***************************************************************************************************\r\n onAddSearchTerm() {\r\n const term = this._searchClusterTerm.trim();\r\n\r\n if (!term || term.length == 0) {\r\n return;\r\n }\r\n\r\n if (this._clusterPartSearchTerms.length == 0) {\r\n this._clusterPartSearchTerms.push(term);\r\n } else {\r\n const idx = this._clusterPartSearchTerms.indexOf(term);\r\n if (idx < 0) {\r\n this._clusterPartSearchTerms.push(term);\r\n // Search criteria has changed so reset the data\r\n this.clearSelections();\r\n }\r\n }\r\n this._searchClusterTerm = '';\r\n\r\n this.searchClusterParts();\r\n }\r\n\r\n onRemoveSearchTerm(term: string) {\r\n this._userNotifications = '';\r\n\r\n if (this._clusterPartSearchTerms.length == 0) {\r\n return;\r\n }\r\n\r\n const terms = _.clone(this._clusterPartSearchTerms);\r\n\r\n const idx = terms.indexOf(term);\r\n\r\n if (idx > -1) {\r\n if (this._clusterPartSearchTerms.length == 1) {\r\n this._clusterPartSearchTerms = [];\r\n } else {\r\n this._clusterPartSearchTerms = this._clusterPartSearchTerms.filter(s => s !== term);\r\n }\r\n\r\n // Search criteria has changed so reset the data\r\n this.clearSelections();\r\n }\r\n\r\n if (this._clusterPartSearchTerms.length > 0) {\r\n this.searchClusterParts();\r\n }\r\n }\r\n\r\n onSelectClusterGroup(id: number) {\r\n this._selectedClusterGroup = this.findClusterGroupById(id);\r\n this._selectedClusterGroupId = this._selectedClusterGroup.clusterGroupId;\r\n\r\n this.loadMatchingClusterPathData();\r\n }\r\n\r\n searchClusterParts() {\r\n\r\n this._userNotifications = '';\r\n this.loadMatchingClusterGroups();\r\n }\r\n\r\n onSelectClusterPath(event: any, clusterPathId: number) {\r\n const currentpaths = _.clone(this._selectedClusterPathIds);\r\n\r\n const selected = event.target.checked;\r\n const idx = currentpaths.indexOf(clusterPathId);\r\n\r\n if (idx < 0) {\r\n if (selected) {\r\n this._selectedClusterPathIds.push(clusterPathId);\r\n }\r\n } else {\r\n if (selected == false) {\r\n this._selectedClusterPathIds = currentpaths.splice(idx, 1);\r\n }\r\n }\r\n }\r\n\r\n get addClusterTermLabel() {\r\n return (this._clusterPartSearchTerms.length == 0) ? 'Search Term' : 'Add Term to Search';\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
0\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
ShowCluster Path
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n {{group.id}}\r\n
\r\n
{{p.data.clusterPath.clusterPathName}}
\r\n
\r\n
\r\n
\r\n\t\t
\r\n
\r\n
\r\n","import { Component, Input, OnInit, ElementRef } from '@angular/core';\r\nimport { NgStyle } from '@angular/common';\r\nimport { UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport { SuperCluster, SuperClusterPath, ClusterGroup, ClusterPath } from '../../entities/EntityModels';\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'clusterpath-selector',\r\n templateUrl: './clusterpath-selector.html',\r\n})\r\n\r\nexport class ClusterPathSelectorComponent extends ModalDialog {\r\n _superClusterPaths: SelectableEntity[] = [];\r\n _selectedClusterPathIds: number[] = [];\r\n _superClusterPathGroups: { id: string, paths: SelectableEntity[], selected: boolean, collapsed?: boolean }[] = [];\r\n _selectEntireGroup = false;\r\n _selectSuperCluster = false;\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork) {\r\n super(elementRef);\r\n }\r\n\r\n onSave() {\r\n this._selectedClusterPathIds = [];\r\n\r\n // tslint:disable-next-line:forin\r\n for (const key in this._superClusterPathGroups) {\r\n this._superClusterPathGroups[key].paths.forEach(p => {\r\n if (p.selected) {\r\n this._selectedClusterPathIds.push(p.data.clusterPathId);\r\n }\r\n });\r\n }\r\n\r\n UtilFns.returnModal(this, true);\r\n }\r\n\r\n onCancel() {\r\n UtilFns.returnModal(this, false);\r\n // tslint:disable-next-line:indent\r\n\t}\r\n\r\n // tslint:disable-next-line:indent\r\n\t// properties\r\n public set SuperClusterPaths(data: SelectableEntity[]) {\r\n this._superClusterPaths = data;\r\n\r\n const groups = _.groupBy(this._superClusterPaths, s => s.data.superCluster.superClusterName);\r\n\r\n this._superClusterPathGroups = _.map(groups, (v, k) => {\r\n return { id: k, paths: v, selected: false, isCollapsed: false };\r\n });\r\n }\r\n\r\n public get SuperClusterPaths(): SelectableEntity[] {\r\n return this._superClusterPaths;\r\n }\r\n\r\n public get SelectedClusterPathIds(): number[] {\r\n return this._selectedClusterPathIds;\r\n }\r\n\r\n public selectedClusterPaths(clusterPathIds: number[]) {\r\n clusterPathIds.forEach(c => {\r\n for (const key in this._superClusterPathGroups) {\r\n this._superClusterPathGroups[key].paths.forEach(p => {\r\n if (p.data.clusterPathId == c) {\r\n p.selected = true;\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n public get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // selectClusterPath(cpx: SelectableEntity) {\r\n // if (cpx.selected) {\r\n // this._selectedClusterPathIds.push(cpx.data.clusterPathId);\r\n // }\r\n // else {\r\n // var idx = this._selectedClusterPathIds.indexOf(cpx.data.clusterPathId);\r\n // if (idx > -1) {\r\n // this._selectedClusterPathIds = this._selectedClusterPathIds.splice(idx, 1);\r\n // }\r\n // }\r\n // }\r\n\r\n selectClusterPath(cpx: SelectableEntity) {\r\n }\r\n\r\n superClusterPathCollapse(ix: number) {\r\n this._superClusterPathGroups[ix].collapsed = !this._superClusterPathGroups[ix].collapsed;\r\n }\r\n\r\n // superClusterColorCode(group: SuperClusterGroup) {\r\n // return (group.paths[0].data.superCluster.colorCode);\r\n // }\r\n\r\n onSelectGroup() {\r\n this._superClusterPathGroups.forEach(s => {\r\n s.selected = this._selectEntireGroup;\r\n this.onSelectSuperCluster(s.id);\r\n });\r\n }\r\n\r\n onSelectSuperCluster(groupId: string) {\r\n const data = this._superClusterPathGroups.filter(g => g.id == groupId);\r\n data.forEach(c => {\r\n const checked = c.selected;\r\n c.paths.forEach(p => {\r\n p.selected = checked;\r\n });\r\n });\r\n }\r\n\r\n onUnselectAll() {\r\n for (const key in this._superClusterPathGroups) {\r\n this._superClusterPathGroups[key].selected = false;\r\n this._superClusterPathGroups[key].paths.forEach(p => {\r\n p.selected = false;\r\n });\r\n }\r\n }\r\n}\r\n","import { Component, OnInit, Input, Output, EventEmitter, ElementRef, OnChanges, AfterViewInit, Inject, forwardRef } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { UnitOfWork, UserManager, StateMap, SearchService, MolImageService } from '../../services/common';\r\nimport { UtilFns, LocationFns, } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport { MaterialClustersComponent } from './material-clusters.component';\r\n\r\nimport { ClusterGroup, ClusterPart, ClusterPath, MaterialCluster, ClusterNodeAndEdge } from '../../entities/EntityModels';\r\n\r\ndeclare var require: any;\r\n\r\nimport { CytoscapeNode } from '../../entities/projections/CytoscapeNode';\r\nimport { CytoscapeEdge } from '../../entities/projections/CytoscapeEdge';\r\nimport { CytoscapeElements } from '../../entities/projections/CytoscapeElements';\r\n\r\nimport * as cytoscape from 'cytoscape';\r\nconst cydagre = require('cytoscape-dagre');\r\ncydagre(cytoscape);\r\n\r\nexport class NodePosition {\r\n x: number;\r\n y: number;\r\n}\r\n\r\nconst contextMenus = require('../../../../node_modules/cytoscape-context-menus');\r\ncontextMenus(cytoscape, jQuery);\r\n\r\n@Component({\r\n selector: 'cytoscape-graph',\r\n templateUrl: './cytoscape-graph.html',\r\n})\r\nexport class CytoscapeGraphComponent implements OnChanges, OnInit, AfterViewInit {\r\n\r\n public cy: any;\r\n\r\n private _canvasCenter = 0;\r\n private _canvasTop = 0;\r\n\r\n private _hasData = false;\r\n private _nodeLevelMin = 0;\r\n private _nodeLevelMax = 99999;\r\n\r\n private _layout = 'dagre'; // 'dagre' 'cola', 'spread', 'cose-bilkent';\r\n private _rankDir = 'LR';\r\n // tslint:disable-next-line:max-line-length\r\n private _layoutOptions = { name: this._layout, nodeSep: 20, edgeSep: 6, padding: 10, avoidOverlap: true, rankSep: 8, rankDir: this._rankDir, spacingFactor: 3, nodeDimensionsIncludeLabels: true};\r\n\r\n @Output() apply = new EventEmitter();\r\n\r\n @Input() public zoom: any;\r\n @Input() public layout: any;\r\n @Input() public highlightTopNode: boolean;\r\n\r\n constructor(public _stateMap: StateMap, public _molImageService: MolImageService,\r\n public _uow: UnitOfWork, public _userManager: UserManager, public _elementRef: ElementRef,\r\n @Inject(forwardRef(() => MaterialClustersComponent)) public _parent: MaterialClustersComponent) {\r\n }\r\n\r\n ngOnInit() {\r\n this._hasData = false;\r\n\r\n this.layout = this.layout || {\r\n name: this._layout, // dagre, cola, cose-bilkent, 'spread'\r\n directed: true,\r\n padding: 0\r\n };\r\n\r\n this.zoom = this.zoom || {\r\n min: 0.5,\r\n max: 1.2\r\n };\r\n\r\n }\r\n\r\n public ngOnChanges(): any {\r\n }\r\n\r\n public ngAfterViewInit() {\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n // **************************************************************\r\n // Public Properties *\r\n // **************************************************************\r\n public hasData(): boolean {\r\n return this._hasData;\r\n }\r\n\r\n public get nodeLevelMin(): number {\r\n return this._nodeLevelMin;\r\n }\r\n\r\n public set nodeLevelMin(level) {\r\n this._nodeLevelMin = level;\r\n }\r\n\r\n public get nodeLevelMax(): number {\r\n return this._nodeLevelMax;\r\n }\r\n\r\n public set nodeLevelMax(level: number) {\r\n this._nodeLevelMax = level;\r\n }\r\n\r\n public get layoutType(): string {\r\n return this._layout;\r\n }\r\n\r\n public set layoutType(type: string) {\r\n this._layout = type;\r\n }\r\n\r\n public resetNodeLevelsToAll() {\r\n this._nodeLevelMin = 0;\r\n this._nodeLevelMax = 99999;\r\n }\r\n\r\n // **************************************************************\r\n // Display Interaction *\r\n // **************************************************************\r\n public centerAndFitGraph(graphObject?: any) {\r\n const test = this.cy.elements().length;\r\n\r\n if (graphObject === undefined || graphObject == null) {\r\n this.cy.fit();\r\n // this.cy.center();\r\n } else {\r\n this.cy.fit(graphObject);\r\n // this.cy.center(graphObject);\r\n }\r\n }\r\n\r\n public centerGraph(graphObject?: any) {\r\n if (graphObject === undefined || graphObject == null) {\r\n this.cy.center();\r\n } else {\r\n this.cy.center(graphObject);\r\n }\r\n }\r\n\r\n centerGraphToOrigin() {\r\n if (this.cy !== null && this.hasData()) {\r\n\r\n const n = this.cy.nodes().filter('[precedence = 1]');\r\n\r\n if (n) {\r\n this.centerGraph(n);\r\n }\r\n }\r\n }\r\n\r\n public moveGraphToTop(yvalue: number) {\r\n this.cy.elements().shift('y', yvalue); // Positioning at center and 0 not working so forcing graph to the top of the canvas\r\n }\r\n\r\n public clearGraph() {\r\n\r\n this._hasData = false;\r\n\r\n if (typeof this.cy === undefined) {\r\n return;\r\n }\r\n\r\n if (this.cy.elements()) {\r\n this.cy.elements().remove();\r\n }\r\n\r\n const layout = this.cy.makeLayout(this._layoutOptions);\r\n }\r\n\r\n // *************************************************************************************\r\n // Process and display node data *\r\n // *************************************************************************************\r\n public renderClusterData(clusterData: ClusterNodeAndEdge[]) {\r\n\r\n const graphdata: CytoscapeElements = this.buildCytoscapeGraphFromClusterData(clusterData);\r\n\r\n this.render(graphdata);\r\n\r\n const materialNodes = graphdata.nodes.filter(m => m.data.ismaterial);\r\n\r\n this.updateMaterialNodesWithImage(materialNodes);\r\n\r\n if (this.highlightTopNode) {\r\n this.highlightTopLevelNode();\r\n }\r\n\r\n this._hasData = true;\r\n\r\n }\r\n\r\n public renderClusterJSON(graphData: any) {\r\n\r\n this.render(graphData);\r\n\r\n const materialNodes = graphData.filter((m: CytoscapeNode) => m.data.ismaterial);\r\n\r\n this.updateMaterialNodesWithImage(materialNodes);\r\n\r\n if (this.highlightTopNode) {\r\n this.highlightTopLevelNode();\r\n }\r\n\r\n this._hasData = true;\r\n }\r\n\r\n public render(graphData: any) {\r\n\r\n const self = this;\r\n\r\n // @ts-ignore\r\n this.cy = cytoscape({\r\n container: document.getElementById('cy'),\r\n elements: graphData,\r\n wheelSensitivity: .2,\r\n style: [\r\n {\r\n selector: 'node',\r\n style: {\r\n 'background-color': 'data(colorcode)',\r\n 'label': 'data(name)',\r\n 'font-family': 'Arial',\r\n 'font-size': 11,\r\n 'font-weight': 'bold'\r\n }\r\n },\r\n {\r\n selector: 'edge',\r\n style: {\r\n 'width': 'data(strength)',\r\n 'target-arrow-shape': 'triangle',\r\n 'line-color': '#9dbaea',\r\n 'target-arrow-color': '#9dbaea',\r\n 'curve-style': 'bezier'\r\n }\r\n },\r\n {\r\n selector: ':parent',\r\n style: {\r\n 'background-opacity': 0.333\r\n }\r\n },\r\n {\r\n selector: 'edge.meta',\r\n style: {\r\n 'width': 2,\r\n 'line-color': 'red'\r\n }\r\n },\r\n {\r\n selector: ':selected',\r\n style: {\r\n 'background-color': '#4682B4',\r\n 'line-color': '#00FF00',\r\n 'target-arrow-color': '#32CD32',\r\n 'source-arrow-color': 'black',\r\n }\r\n },\r\n {\r\n selector: 'edge:selected',\r\n style: {\r\n 'width': 16\r\n }\r\n },\r\n {\r\n selector: 'node[type=\"rectangle\"]',\r\n style: {\r\n 'shape': 'rectangle',\r\n 'background-color': '#FFA500'\r\n }\r\n }\r\n ],\r\n layout: this._layoutOptions\r\n });\r\n\r\n this.cy.on('click', 'node', (evt: any) => {\r\n this.onGraphNodeClicked(evt.target);\r\n });\r\n\r\n this.cy.contextMenus({\r\n menuItems: [\r\n {\r\n id: 'collapse',\r\n content: 'Collapse Cluster Path',\r\n tooltipText: 'Hide the children nodes of the clicked node',\r\n image: { src: 'assets/images/ClusterCollapse.png', width: 24, height: 24, x: 6, y: 4 },\r\n selector: 'node, edge',\r\n onClickFunction: function (event: { target: any; }) {\r\n self.onCollapseNode(event.target);\r\n },\r\n hasTrailingDivider: true\r\n },\r\n {\r\n id: 'expandall',\r\n content: 'Expand All Cluster Path Nodes',\r\n tooltipText: 'Expand the cluster path to show all defined nodes',\r\n image: { src: 'assets/images/ClusterExpand.png', width: 24, height: 24, x: 6, y: 4 },\r\n selector: 'node, edge',\r\n onClickFunction: function (event: { target: any; }) {\r\n self.onExpandNodeAll(event.target);\r\n },\r\n hasTrailingDivider: true\r\n },\r\n {\r\n id: 'expand',\r\n content: 'Expand Cluster Path One Level',\r\n tooltipText: 'Expand the cluster path to show the next node in the hierarchy',\r\n image: { src: 'assets/images/ClusterExpand.png', width: 24, height: 24, x: 6, y: 4 },\r\n selector: 'node, edge',\r\n onClickFunction: function (event: { target: any; }) {\r\n self.onExpandNode(event.target);\r\n },\r\n hasTrailingDivider: true\r\n },\r\n {\r\n id: 'clipboard',\r\n content: 'Copy Selected Path to Clipboard',\r\n tooltipText: 'Copy the text version of the selected path to the clipboard',\r\n image: { src: 'assets/images/Clipboard.png', width: 24, height: 24, x: 6, y: 4 },\r\n selector: 'node, edge',\r\n hasTrailingDivider: true,\r\n onClickFunction: function (event: { target: any; }) {\r\n self.onCopyPathToClipboard(event.target);\r\n }\r\n }\r\n ,\r\n {\r\n id: 'searchstructure',\r\n content: 'Search by Structure',\r\n tooltipText: 'Navigate to the Search by Structure page and look for other materials similar to this structure',\r\n image: { src: 'assets/images/studies.png', width: 24, height: 24, x: 6, y: 4 },\r\n selector: 'node, edge',\r\n hasTrailingDivider: true,\r\n onClickFunction: function (event: { target: any; }) {\r\n self.onNavigateToStructureSearch(event.target);\r\n }\r\n }\r\n ],\r\n menuItemClasses: [\r\n 'text-center'\r\n ]\r\n });\r\n }\r\n\r\n public addClusterDataToGraph(clusterData: ClusterNodeAndEdge[], skipLayout?: boolean) {\r\n\r\n const graphdata: CytoscapeElements = this.buildCytoscapeGraphFromClusterData(clusterData);\r\n this._hasData = true;\r\n\r\n const eles = this.cy.add(graphdata);\r\n\r\n if (skipLayout == undefined || skipLayout == false) {\r\n const layout = this.cy.makeLayout(this._layoutOptions);\r\n layout.run();\r\n }\r\n\r\n const materialNodes = graphdata.nodes.filter(m => m.data.ismaterial);\r\n\r\n this.updateMaterialNodesWithImage(materialNodes);\r\n\r\n if (this.highlightTopNode) {\r\n this.highlightTopLevelNode();\r\n }\r\n }\r\n\r\n public removeNode(nodeId: string) {\r\n const n = this.cy.$('#' + nodeId);\r\n\r\n if (n) {\r\n this.cy.remove(n);\r\n }\r\n }\r\n\r\n buildCytoscapeGraphFromClusterData(clusterData: ClusterNodeAndEdge[]): CytoscapeElements {\r\n\r\n let _cytoscapeElements: CytoscapeElements;\r\n const nodes: CytoscapeNode[] = [];\r\n const edges: CytoscapeEdge[] = [];\r\n\r\n clusterData.forEach(el => {\r\n if (el.precedence > this._nodeLevelMin && el.precedence <= this._nodeLevelMax) {\r\n\r\n if (this.alreadyGraphed(el.clusterPartNode) == false) {\r\n nodes.push(\r\n {\r\n data:\r\n {\r\n id: el.clusterPartNode,\r\n name: el.clusterPartLabel,\r\n degree_layout: 1,\r\n colorcode: (el.colorCode == null) ? '#6495ED' : el.colorCode,\r\n type: el.shapeType,\r\n selected: false,\r\n ismaterial: el.isMaterial,\r\n relevance: el.clusterRelevance,\r\n precedence: el.precedence\r\n }\r\n });\r\n }\r\n\r\n if (el.parentNode != null) {\r\n const edgeId = el.parentNode + '_to_' + el.clusterPartNode;\r\n if (this.alreadyGraphed(edgeId) == false) {\r\n edges.push(\r\n {\r\n data:\r\n {\r\n source: el.parentNode,\r\n target: el.clusterPartNode,\r\n interaction: 'pc',\r\n colorcode: '#68838B',\r\n strength: el.clusterRelevance,\r\n selected: false,\r\n id: edgeId,\r\n name: edgeId\r\n }\r\n });\r\n }\r\n }\r\n }\r\n });\r\n\r\n _cytoscapeElements = { nodes: nodes, edges: edges };\r\n\r\n return (_cytoscapeElements);\r\n }\r\n\r\n alreadyGraphed(id: string): boolean {\r\n if (this.cy == null) {\r\n return false;\r\n }\r\n\r\n const graphObject = this.cy.$('#' + id);\r\n return (graphObject != null && graphObject.length > 0);\r\n }\r\n\r\n highlightTopLevelNode() {\r\n if (this.cy !== null && this.hasData()) {\r\n\r\n const n = this.cy.nodes().filter('[precedence = 1]');\r\n\r\n // let n = this.cy.nodes()[0];\r\n\r\n if (n) {\r\n n.css('height', '60px');\r\n n.css('width', '60px');\r\n n.css('background-color', '#FFA500');\r\n }\r\n }\r\n }\r\n\r\n // Test\r\n showOriginPosition() {\r\n const n = this.cy.$('#Oxygen-containing');\r\n\r\n const p = n.position();\r\n alert('left: ' + p.left + ' top: ' + p.top);\r\n }\r\n\r\n collapseNodePath(node: any) {\r\n node.successors().targets().remove();\r\n }\r\n\r\n zoomToNode(node: any) {\r\n const n = this.cy.$('#' + node.id());\r\n this.cy.center(n);\r\n\r\n this.cy.zoom({\r\n level: 1.1,\r\n position: n.position()\r\n });\r\n }\r\n\r\n zoomToOrigin() {\r\n if (this.cy !== null && this.hasData()) {\r\n\r\n const n = this.cy.nodes().filter('[precedence = 1]');\r\n\r\n if (n) {\r\n this.zoomToNode(n);\r\n }\r\n }\r\n }\r\n\r\n getGraphData() {\r\n return this.cy.elements().jsons();\r\n }\r\n\r\n getGraphImageData(): any {\r\n if (this.cy == null) {\r\n return null;\r\n }\r\n\r\n return this.cy.png();\r\n }\r\n\r\n getNodePosition(node: any): NodePosition {\r\n const position = node.position();\r\n\r\n const np = new NodePosition();\r\n np.x = position.x;\r\n np.y = position.y;\r\n\r\n return (np);\r\n }\r\n\r\n // *************************************************************************************\r\n // Material Nodes *\r\n // *************************************************************************************\r\n updateMaterialNodesWithImage(materialNodes: CytoscapeNode[]) {\r\n\r\n if (materialNodes == null || materialNodes.length < 1) {\r\n return;\r\n }\r\n\r\n try {\r\n materialNodes.forEach(m => {\r\n\r\n const materialId = parseInt(m.data.id, 10);\r\n this._molImageService.getBase32SmileUrlWithSize(materialId, 'S').then((url) => {\r\n const hasImage = (url != undefined && true && url.indexOf('null.png') < 0);\r\n const n = this.cy.$('#' + m.data.id);\r\n\r\n if (n) {\r\n n.css('height', '105px');\r\n n.css('width', '105px');\r\n n.css('background-color', '#FFFFFF');\r\n n.css('border-width', '2px');\r\n n.css('border-style', 'solid');\r\n n.css('border-color', m.data.colorcode); // '#104E8B'\r\n n.css('text-valign', 'top');\r\n n.css('text-align', 'center');\r\n n.css('text-wrap', 'wrap');\r\n n.css('text-max-width', '400');\r\n\r\n if (hasImage) {\r\n n.css('background-image', url);\r\n n.css('background-repeat', 'no-repeat');\r\n n.css('background-height', '100%');\r\n n.css('background-width', '100%');\r\n }\r\n }\r\n });\r\n });\r\n } catch (exc) {\r\n alert(exc.code);\r\n return;\r\n }\r\n }\r\n\r\n // *************************************************************************************\r\n // Graph User Interaction *\r\n // *************************************************************************************\r\n onGraphNodeClicked(node: any) {\r\n\r\n const selectedNodeIds: string[] = [];\r\n node.successors().targets().forEach(function (c: any) {\r\n selectedNodeIds.push(c.id());\r\n });\r\n this._parent.showStudyData(selectedNodeIds, node.id());\r\n }\r\n\r\n // **************************************************************\r\n // Menu Item Actions *\r\n // **************************************************************\r\n onCollapseNode(node: any) {\r\n\r\n const precedence = node.data('precedence');\r\n const isOriginNode: boolean = (precedence == 1);\r\n\r\n const edges = node.connectedEdges();\r\n if (isOriginNode) {\r\n if (edges.length > 0) {\r\n this.collapseNodePath(node);\r\n }\r\n } else {\r\n if (edges.length > 1) { // Always at least 1 edge connecting to the parent node\r\n this.collapseNodePath(node);\r\n }\r\n }\r\n }\r\n\r\n onExpandNode(node: any) {\r\n this._parent.expandNodeNextLevel(node);\r\n }\r\n\r\n onExpandNodeAll(node: any) {\r\n this._parent.expandAllNodes(node);\r\n\r\n/*\r\n const precedence = node.data('precedence');\r\n const isOriginNode: boolean = (precedence == 1);\r\n\r\n if (isOriginNode) {\r\n const edges = node.connectedEdges();\r\n\r\n if (edges.length == 0) {\r\n this._parent.expandNodeNextLevel(node); // Don't expand the entire graph from the origin of the cluster group\r\n }\r\n } else {\r\n this._parent.expandAllNodes(node);\r\n }\r\n*/\r\n }\r\n\r\n onCopyPathToClipboard(node: any) {\r\n this._parent.copyPathToClipboard(node);\r\n }\r\n\r\n onShowStudiesMenuItemClick(node: any) {\r\n const selectedNodeIds: string[] = [];\r\n node.successors().targets().forEach(function (c: any) {\r\n selectedNodeIds.push(c.id());\r\n });\r\n\r\n this._parent.showStudyData(selectedNodeIds, node.id());\r\n }\r\n\r\n onNavigateToStructureSearch(node: any) {\r\n this._parent.navigateToStructureSearch(node);\r\n }\r\n\r\n\r\n // *************************************************************************\r\n // Print Graph Image to File\r\n // *************************************************************************\r\n exportGraphToImageFile() {\r\n const filename = 'rifmclustergraph.png';\r\n const args = {\r\n bg: 'white',\r\n full: true\r\n };\r\n const png64 = this.cy.png(args);\r\n\r\n this.downloadFile(png64, filename);\r\n }\r\n\r\n downloadFile(data: any, filename: string) {\r\n const ele = document.createElement('a');\r\n ele.setAttribute('id', 'clusterimagedownload');\r\n ele.setAttribute('href', data);\r\n ele.setAttribute('download', filename);\r\n\r\n if (document.createEvent) {\r\n const event = document.createEvent('MouseEvents');\r\n event.initEvent('click', true, true);\r\n ele.dispatchEvent(event);\r\n } else {\r\n ele.click();\r\n }\r\n\r\n if (document.contains(document.getElementById('clusterimagedownload'))) {\r\n document.getElementById('clusterimagedownload').remove();\r\n }\r\n }\r\n}\r\n","\r\n\r\n\r\n
\r\n
\r\n
\r\n\r\n\r\n","
\r\n\r\n
\r\n
\r\n
\r\n
\r\n {{pageTitle}}\r\n
\r\n
\r\n

{{_userNotifications}}

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n Export Displayed Graph to Image File\r\n \r\n \r\n
\r\n Create an image file that shows the displayed graph.\r\n
\r\n \r\n
\r\n
\r\n \r\n Export All Cluster Data to File\r\n \r\n \r\n
\r\n Download a *.csv file with data for all cluster assignments.\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n Preparing cluster data...\r\n
\r\n\r\n
\r\n
\r\n
\r\n Select a Cluster Group:\r\n \r\n
\r\n
\r\n \r\n\r\n \r\n
\r\n Select one or more Cluster Paths to display.\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n Search for the Cluster Path assigned to a Material.\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n Search for Cluster Paths by a chemical structure term.\r\n
\r\n \r\n
\r\n
\r\n
\r\n Quick Search by CAS No. or MaterialId:\r\n\r\n \r\n \r\n Find\r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n

{{_selected_node_name}}

\r\n \r\n
\r\n \r\n

{{_selected_node_name}}

\r\n \r\n
\r\n \r\n

{{_selected_node_name}}

\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n Position the graph in the center of the display area.\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n Show Tutorial Videos on Cluster Graph Interaction.\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n Clear all selections and displayed graph nodes.\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","import { Component, OnInit, AfterViewInit, OnDestroy, Input, Output, EventEmitter, ElementRef, ViewChild } from '@angular/core';\r\nimport * as _ from 'lodash';\r\nimport { Location } from '@angular/common';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport { UnitOfWork, UserManager, StateMap, SearchService, provideParent } from '../../services/common';\r\nimport { UtilFns, LocationFns, } from '../../utils/common';\r\nimport { PageState, TabContainer } from '../../controls/common';\r\n\r\nimport { MaterialListItem } from '../../entities/projections/MaterialListItem';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport { SuperCluster, SuperClusterPath, ClusterGroup, ClusterPart, ClusterPath, MaterialCluster, ClusterNodeAndEdge } from '../../entities/EntityModels';\r\n\r\nimport { ClusterHelpVideoComponent } from './cluster-help-video.component';\r\nimport { ClusterPathFilterComponent } from './clusterpath-filter.component';\r\nimport { ClusterPathSelectorComponent } from './clusterpath-selector.component';\r\n\r\nimport { CytoscapeGraphComponent } from './cytoscape-graph.component';\r\n\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\n\r\nimport { HOME_ROUTES } from './home.routes';\r\nimport { ROUTES } from '../routes';\r\n\r\n@Component({\r\n selector: 'material-clusters',\r\n templateUrl: './material-clusters.html',\r\n providers: [provideParent(MaterialClustersComponent)],\r\n styles: [`\r\n cytoscape-graph {\r\n height: 100vh;\r\n float: left;\r\n width: 100%;\r\n position: relative;\r\n }`],\r\n})\r\nexport class MaterialClustersComponent implements OnInit, AfterViewInit, OnDestroy {\r\n @ViewChild(ClusterHelpVideoComponent, { static: true }) _clusterHelpVideoComponent: ClusterHelpVideoComponent;\r\n @ViewChild(ClusterPathFilterComponent, { static: true }) _clusterPathFilterComponent: ClusterPathFilterComponent;\r\n @ViewChild(ClusterPathSelectorComponent, { static: true }) _clusterPathSelectorComponent: ClusterPathSelectorComponent;\r\n @ViewChild(CytoscapeGraphComponent) _cytoscapeGraphComponent: CytoscapeGraphComponent;\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n\r\n _clusterGroups: ClusterGroup[];\r\n _selectedClusterGroup: ClusterGroup;\r\n _selectedClusterGroupId = -1;\r\n\r\n _superClusterPaths: SuperClusterPath[];\r\n\r\n _clusterObjectMap: { [key: number]: ClusterNodeAndEdge[] } = {};\r\n _selected_node_name: string;\r\n _savedGraphData: any;\r\n\r\n _selectedClusterPathIds: number[] = [];\r\n\r\n _materialIds: number[];\r\n _sub: any;\r\n\r\n _isClusterGraphDisplayed = true;\r\n _currentTabNumber = 0;\r\n _isLoading = false;\r\n _nodeLevel = 99999;\r\n _quickSearchCASNumber = '';\r\n _userNotifications = '';\r\n\r\n toggleShowSelectClusterGroupPaths = false;\r\n toggleShowTopLevelNodes = false;\r\n toggleShowClusterFilterModal = false;\r\n toggleShowHelpVideo = false;\r\n toggleClearGraph = false;\r\n toggleCenterGraph = false;\r\n toggleExportClusterImage = false;\r\n toggleExportClusterFile = false;\r\n toggleMaterialLookup = false;\r\n\r\n public _superClusterPathsEx: SelectableEntity[] = [];\r\n\r\n constructor(public _stateMap: StateMap, public _uow: UnitOfWork,\r\n public _userManager: UserManager, public _elementRef: ElementRef,\r\n public _route: ActivatedRoute, public _router: Router) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = HOME_ROUTES.MaterialClusters.name;\r\n\r\n this.loadClusterGroups();\r\n this.setTab(0);\r\n\r\n this._userNotifications = '';\r\n this._quickSearchCASNumber = ' ';\r\n }\r\n\r\n ngAfterViewInit() {\r\n this._sub = this._route.params.subscribe(params => {\r\n const materialId = +params['id'];\r\n\r\n if (materialId != null && materialId > 0) {\r\n this.navigateToMaterialClusterPath(materialId);\r\n }\r\n });\r\n }\r\n\r\n ngOnDestroy() {\r\n this._sub.unsubscribe();\r\n }\r\n\r\n canDeactivate() {\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n navigateToMaterialClusterPath(materialId: number) {\r\n const params = { materialId: materialId };\r\n this._uow.fetch('MaterialClusters/MaterialClusterByMaterialId', params).then(m => {\r\n if (m != null && m.length > 0) {\r\n this.setSelectedClusterGroup(m[0].clusterPath.clusterGroup).then(g => {\r\n this._selectedClusterPathIds.push(m[0].clusterPath.clusterPathId);\r\n this.loadClusterData().then(d => {\r\n if (this._clusterObjectMap != null) {\r\n this._cytoscapeGraphComponent.nodeLevelMin = 0;\r\n this._cytoscapeGraphComponent.nodeLevelMax = 99999;\r\n this.expandClusterPath(m[0].clusterPath.clusterPathId);\r\n this.alignGraph();\r\n }\r\n });\r\n });\r\n } else {\r\n this.onClearGraph();\r\n this._userNotifications = 'The searched Material is not yet assigned to a cluster.';\r\n}\r\n});\r\n }\r\n\r\n // ********************************************************************\r\n // Load data *\r\n // ********************************************************************\r\n loadClusterGroups() {\r\n this._isLoading = true;\r\n\r\n this._uow.fetchTyped('MaterialClusters/ClusterGroups', ClusterGroup, {}).then(g => {\r\n this._clusterGroups = g;\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n loadClusterPathData(): Promise {\r\n this._isLoading = true;\r\n\r\n const params = { clusterGroupId: this._selectedClusterGroup.clusterGroupId };\r\n return this._uow.fetchTyped('MaterialClusters/SuperClusterPathsByClusterGroupId', SuperClusterPath, params).then(p => {\r\n this._superClusterPaths = p;\r\n\r\n this.formatSuperSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n loadClusterData(): Promise {\r\n this._isLoading = true;\r\n\r\n const params = { clusterGroupId: this._selectedClusterGroup.clusterGroupId, isStaff: this.isStaff() };\r\n return this._uow.fetch('MaterialClusters/FetchClusterDataByGroupId', params).then(g => {\r\n if (g != null && g.length > 0) {\r\n this._clusterObjectMap = g[0];\r\n\r\n this._isLoading = false;\r\n }\r\n });\r\n }\r\n\r\n formatSuperSelectableEntities() {\r\n this._superClusterPathsEx = [];\r\n if (this._superClusterPaths == null || this._superClusterPaths.length < 1) { return; }\r\n\r\n _.clone(this._superClusterPaths).forEach(element => {\r\n this._superClusterPathsEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n }\r\n\r\n setSelectedClusterGroup(clusterGroup: ClusterGroup): Promise {\r\n\r\n if (this._selectedClusterGroup == null || this._selectedClusterGroup.clusterGroupId != clusterGroup.clusterGroupId) {\r\n this._selectedClusterGroup = clusterGroup;\r\n this._selectedClusterGroupId = this._selectedClusterGroup.clusterGroupId;\r\n this._superClusterPaths = [];\r\n this._clusterObjectMap = {};\r\n\r\n this.resetGraph();\r\n }\r\n\r\n if (this._superClusterPaths.length < 1) {\r\n return this.loadClusterPathData();\r\n } else {\r\n return Promise.resolve(true);\r\n }\r\n }\r\n\r\n isDictionaryEmpty(dict: object): boolean {\r\n return Object.keys(dict).length === 0;\r\n }\r\n\r\n hasNodeData(): boolean {\r\n return !this.isDictionaryEmpty(this._clusterObjectMap);\r\n }\r\n\r\n hasSelectedClusterGroup(): boolean {\r\n return (this._selectedClusterGroup != null);\r\n }\r\n\r\n // **************************************************************************************\r\n // Study display title *\r\n // **************************************************************************************\r\n get pageTitle(): string {\r\n return (this._selectedClusterGroup) ? 'Material Clusters for ' + this._selectedClusterGroup.clusterGroupName : 'Material Clusters';\r\n }\r\n\r\n formatNodeId(nodeId: string): string {\r\n const reg = /(_|-)/gi;\r\n return nodeId.replace(reg, ' ');\r\n }\r\n\r\n // ******************************************************\r\n // Show Study Data Event *\r\n // ******************************************************\r\n // Show the study data displayed in the tab control\r\n public showStudyData(nodeIds: string[], parentNodeId: string) {\r\n this.saveGraphData(); // This data will be used to redraw the graph when the user switches back to the tab with the graph canvas\r\n\r\n this._materialIds = [];\r\n\r\n // A single material node was clicked\r\n if (nodeIds == null || nodeIds.length < 1) {\r\n const clusterNode = this.findClusterNode(parentNodeId);\r\n if (clusterNode != null && clusterNode.isMaterial) {\r\n this._selected_node_name = 'CAS No.: ' + clusterNode.clusterPartLabel;\r\n this._materialIds = [];\r\n this._materialIds.push(Number(parentNodeId));\r\n }\r\n } else { // A parent node was clicked\r\n this._selected_node_name = this.formatNodeId(parentNodeId) + ' Materials';\r\n\r\n nodeIds.forEach(n => {\r\n const clusterNode = this.findClusterNode(n);\r\n if (clusterNode != null && clusterNode.isMaterial) {\r\n if (this._materialIds == null) {\r\n this._materialIds = [];\r\n }\r\n this._materialIds.push(Number(n));\r\n }\r\n });\r\n }\r\n\r\n if (this._materialIds.length > 0) {\r\n this.setTab(1);\r\n }\r\n }\r\n\r\n findClusterNode(nodeId: string): ClusterNodeAndEdge {\r\n const clusters = _.clone(this._clusterObjectMap);\r\n // tslint:disable-next-line:forin\r\n for (const key in clusters) {\r\n const data = this._clusterObjectMap[key];\r\n const node = data.find(n => n.clusterPartNode == nodeId);\r\n if (typeof node != 'undefined') {\r\n return (node);\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n // ******************************************************\r\n // *Graph Reset *\r\n // ******************************************************\r\n onClearGraph() {\r\n this._selectedClusterGroup = null;\r\n this._selectedClusterGroupId = -1;\r\n this._superClusterPaths = [];\r\n this._clusterObjectMap = {};\r\n\r\n this.resetGraph();\r\n }\r\n\r\n resetGraph() {\r\n this._userNotifications = '';\r\n\r\n // Clear materials\r\n this._materialIds = [];\r\n this._selectedClusterPathIds = [];\r\n\r\n this._clusterObjectMap = {};\r\n this._savedGraphData = null;\r\n\r\n if (this._cytoscapeGraphComponent != null && this._cytoscapeGraphComponent.hasData()) {\r\n this._cytoscapeGraphComponent.clearGraph();\r\n }\r\n }\r\n\r\n onRedrawGraphWithCurrentData() {\r\n\r\n if (typeof this._savedGraphData == undefined || this._savedGraphData == null) {\r\n return;\r\n }\r\n\r\n this._cytoscapeGraphComponent.highlightTopNode = true;\r\n this._cytoscapeGraphComponent.renderClusterJSON(this._savedGraphData);\r\n return;\r\n }\r\n saveGraphData() { // Save graph data when switching tabs\r\n this._savedGraphData = this._cytoscapeGraphComponent.getGraphData();\r\n }\r\n\r\n alignGraph() {\r\n this._cytoscapeGraphComponent.centerAndFitGraph();\r\n\r\n if (this._selectedClusterPathIds.length < 3) {\r\n this._cytoscapeGraphComponent.moveGraphToTop(-100);\r\n }\r\n }\r\n\r\n // ******************************************************\r\n // *Tab Events *\r\n // ******************************************************\r\n setTab(tabNumber: number) {\r\n this._currentTabNumber = tabNumber;\r\n setTimeout(() => {this._tabContainer.selectTab(tabNumber);\r\n }, 1);\r\n }\r\n\r\n onTabChange(tab: number) {\r\n if (tab == 0) {\r\n setTimeout(() => {\r\n this.onRedrawGraphWithCurrentData();\r\n }, 0);\r\n }\r\n\r\n this._isClusterGraphDisplayed = (tab == 0);\r\n }\r\n\r\n // ******************************************************\r\n // *Interactive Node Display *\r\n // ******************************************************\r\n onSelectClusterGroup(id: number) {\r\n const group = this.findClusterGroupById(id);\r\n return this.setSelectedClusterGroup(group).then(s => {\r\n this.onShowTopLevelNodes();\r\n this._quickSearchCASNumber = '';\r\n });\r\n }\r\n\r\n onShowTopLevelNodes() {\r\n this.resetGraph();\r\n this.loadClusterData().then(g => {\r\n this.graphTopLevelNodesForClusterGroup();\r\n this._cytoscapeGraphComponent.zoomToOrigin();\r\n });\r\n }\r\n\r\n graphTopLevelNodesForClusterGroup() {\r\n this._nodeLevel = 2;\r\n this._cytoscapeGraphComponent.nodeLevelMin = 0;\r\n this._cytoscapeGraphComponent.nodeLevelMax = this._nodeLevel;\r\n\r\n const clusters = _.clone(this._clusterObjectMap);\r\n // tslint:disable-next-line:forin\r\n for (const key in clusters) {\r\n const data = this._clusterObjectMap[key];\r\n if (this._cytoscapeGraphComponent) {\r\n if (this._cytoscapeGraphComponent.hasData()) {\r\n this._cytoscapeGraphComponent.addClusterDataToGraph(data);\r\n } else {\r\n this._cytoscapeGraphComponent.renderClusterData(data);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // ******************************************************\r\n // *Show Modal to Choose Paths to Display *\r\n // ******************************************************\r\n onShowSelectClusterGroupPaths() {\r\n if (this._clusterPathSelectorComponent == null) {\r\n return;\r\n }\r\n\r\n const previouslySelectedClusterPaths = _.clone(this._selectedClusterPathIds);\r\n\r\n this._clusterPathSelectorComponent.SuperClusterPaths = this._superClusterPathsEx;\r\n\r\n // Pass previously selected clusterPathIds\r\n this._clusterPathSelectorComponent.selectedClusterPaths(this._selectedClusterPathIds);\r\n\r\n UtilFns.showModal(this._clusterPathSelectorComponent, this).then(r => {\r\n if (r == false) {\r\n return;\r\n }\r\n\r\n if (this.isDictionaryEmpty(this._clusterObjectMap)) {\r\n this.loadClusterData().then(g => {\r\n this.processClusterPathSelections(previouslySelectedClusterPaths, this._clusterPathSelectorComponent.SelectedClusterPathIds);\r\n });\r\n } else {\r\n this.processClusterPathSelections(previouslySelectedClusterPaths, this._clusterPathSelectorComponent.SelectedClusterPathIds);\r\n }\r\n });\r\n }\r\n\r\n processClusterPathSelections(currentPathIds: number[], newPathIds: number[]) {\r\n\r\n const addedIds = newPathIds.filter(a => currentPathIds.indexOf(a) < 0);\r\n const removedIds = currentPathIds.filter(r => newPathIds.indexOf(r) < 0);\r\n\r\n this._selectedClusterPathIds = newPathIds;\r\n\r\n if (newPathIds.length == 0) {\r\n this._cytoscapeGraphComponent.clearGraph();\r\n return;\r\n }\r\n\r\n if (currentPathIds.length < 1) { // Load all the selected paths from the modal dialogue\r\n this.displaySelectedClusterPaths();\r\n this.alignGraph();\r\n return;\r\n }\r\n\r\n // Isolate the node and edge data to only those associated with a selected cluster path\r\n const graphablePaths: { [key: number]: ClusterNodeAndEdge[] } = {};\r\n newPathIds.forEach(key => {\r\n graphablePaths[key] = this._clusterObjectMap[key];\r\n });\r\n\r\n // Remove unselected paths node by node, starting at the end and finishing when a node is shared with a selected node path\r\n if (typeof removedIds != undefined && removedIds != null && removedIds.length > 0) {\r\n removedIds.forEach(i => {\r\n this.removePath(i, graphablePaths);\r\n });\r\n }\r\n\r\n // Add newly selected cluster paths to the graph\r\n if (typeof addedIds != undefined && addedIds != null && addedIds.length > 0) {\r\n this._cytoscapeGraphComponent.nodeLevelMin = 0;\r\n this._cytoscapeGraphComponent.nodeLevelMax = 99999;\r\n\r\n addedIds.forEach(i => {\r\n this.expandClusterPath(i);\r\n });\r\n }\r\n\r\n this.alignGraph();\r\n }\r\n\r\n displaySelectedClusterPaths() {\r\n this._userNotifications = '';\r\n\r\n this._cytoscapeGraphComponent.nodeLevelMin = 0;\r\n this._cytoscapeGraphComponent.nodeLevelMax = 99999;\r\n\r\n this._selectedClusterPathIds.forEach(p => {\r\n this.expandClusterPath(p);\r\n });\r\n }\r\n\r\n removePath(clusterPathId: number, graphableData: { [key: number]: ClusterNodeAndEdge[] }) {\r\n const clusterparts = this._clusterObjectMap[clusterPathId];\r\n\r\n const sortedparts = _.sortBy(clusterparts, p => p.precedence).reverse();\r\n\r\n sortedparts.forEach(p => {\r\n if (this.isSharedNode(p.clusterPartNode, graphableData)) {\r\n // done\r\n return;\r\n } else {\r\n this._cytoscapeGraphComponent.removeNode(p.clusterPartNode);\r\n }\r\n });\r\n }\r\n\r\n // ***************************************************************************************************\r\n // Material Lookup\r\n // ***************************************************************************************************\r\n public onSelectMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this).then(mli => {\r\n if (mli == null) { return; }\r\n this.navigateToMaterialClusterPath(mli.materialId);\r\n return;\r\n });\r\n }\r\n\r\n // **************************************************************************\r\n // *Show Dialog for Users to Filter and Search for Cluster Components *\r\n // **************************************************************************\r\n public onShowClusterFilterModal() {\r\n if (this._clusterPathFilterComponent == null) {\r\n return;\r\n }\r\n\r\n UtilFns.showModal(this._clusterPathFilterComponent, this).then(r => {\r\n if (r == false) { return; }\r\n\r\n this._cytoscapeGraphComponent.nodeLevelMin = 0;\r\n this._cytoscapeGraphComponent.nodeLevelMax = 99999;\r\n\r\n const clusterGroupId = this._clusterPathFilterComponent.SelectedClusterGroupId;\r\n const clusterGroup = this.findClusterGroupById(clusterGroupId);\r\n\r\n this.setSelectedClusterGroup(clusterGroup).then(g => {\r\n this.loadClusterData().then(g => {\r\n this._selectedClusterPathIds = this._clusterPathFilterComponent.SelectedClusterPathIds;\r\n this.displaySelectedClusterPaths();\r\n this.alignGraph();\r\n });\r\n });\r\n });\r\n }\r\n\r\n findClusterGroupById(clusterGroupId: number): ClusterGroup {\r\n const clusterGroups = this._clusterGroups.filter(g => g.clusterGroupId == clusterGroupId);\r\n return clusterGroups[0];\r\n }\r\n\r\n // **************************************************************************\r\n // *Quick Search by CAS Number *\r\n // **************************************************************************\r\n\r\n canQuickSearch() {\r\n return this._quickSearchCASNumber != null && this._quickSearchCASNumber.trim().length > 0;\r\n }\r\n\r\n onQuickSearch() {\r\n const searchMaterial = this._quickSearchCASNumber.trim();\r\n\r\n if (isNaN(Number(searchMaterial))) {\r\n this._uow.fetch('Materials/MaterialsByCASNumber', { realCASNumber: searchMaterial }).then(r => {\r\n const mats = r;\r\n\r\n if (mats == null || mats.length < 1) {\r\n this.onClearGraph();\r\n this._userNotifications = 'No materials matched the entered CAS Number.';\r\n\r\n return;\r\n }\r\n\r\n if (mats.length == 1) {\r\n this.navigateToMaterialClusterPath(mats[0].materialId);\r\n } else {\r\n this.onClearGraph();\r\n this._userNotifications = 'Multiple materials matched the entered CAS number. Use the advanced search or enter a MaterialId.';\r\n }\r\n });\r\n } else {\r\n this._uow.materialRepository.withId(Number(searchMaterial)).then(m => {\r\n if (m == null) {\r\n this.onClearGraph();\r\n this._userNotifications = 'No materials matched the entered MaterialId.';\r\n\r\n return;\r\n }\r\n this.navigateToMaterialClusterPath(m.materialId);\r\n });\r\n }\r\n }\r\n\r\n onQuickSearchCASNumber() {\r\n this._userNotifications = '';\r\n }\r\n\r\n // *******************************************************************************\r\n // Cluster Data Export\r\n // *******************************************************************************\r\n onExportClusterImage() {\r\n this._cytoscapeGraphComponent.exportGraphToImageFile();\r\n }\r\n\r\n onExportClusterFile() {\r\n const params: { key: string, value: string }[] = [];\r\n\r\n if (this.isStaff()) {\r\n params.push({ key: 'reporttype', value: 'materialclusterreport' });\r\n } else {\r\n params.push({ key: 'reporttype', value: 'materialclusterreportsubscribers' });\r\n }\r\n\r\n const url = this._userManager.getReportUrl(params);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n canExportGraphData(): boolean {\r\n if (this._cytoscapeGraphComponent == null) {\r\n return false;\r\n }\r\n\r\n return (this._cytoscapeGraphComponent.hasData());\r\n }\r\n\r\n // *******************************************************************************\r\n // Copy data to the clipboard\r\n // *******************************************************************************\r\n copyPathToClipboard(node: any) {\r\n const pathnames = this.prepareVisibleClusterPathDataForClipboard(node);\r\n\r\n const selBox = document.createElement('textarea');\r\n selBox.style.position = 'fixed';\r\n selBox.style.left = '0';\r\n selBox.style.top = '0';\r\n selBox.style.opacity = '0';\r\n selBox.value = pathnames;\r\n document.body.appendChild(selBox);\r\n selBox.focus();\r\n selBox.select();\r\n document.execCommand('copy');\r\n document.body.removeChild(selBox);\r\n }\r\n\r\n // Find any cluster path associated with a node. A node is displayed once but can be found in multiple cluster paths.\r\n prepareVisibleClusterPathDataForClipboard(node: any): string {\r\n let copytext = '';\r\n\r\n if (this._selectedClusterPathIds == null || this._selectedClusterPathIds.length < 1) {\r\n return copytext;\r\n }\r\n\r\n this._selectedClusterPathIds.forEach(p => {\r\n const data = this._clusterObjectMap[p];\r\n const obj = data.find(n => n.clusterPartNode == node.id());\r\n\r\n if (typeof obj != 'undefined' && obj != null) {\r\n const pathname = this.getFullPathName(+p);\r\n const materials = MaterialClustersComponent.getPathMaterials(data);\r\n\r\n if (copytext == '') {\r\n copytext = pathname + '//' + materials;\r\n } else {\r\n copytext = copytext + '\\n' + pathname + '//' + materials;\r\n }\r\n }\r\n });\r\n return copytext;\r\n }\r\n\r\n // *******************************************************************************\r\n // Routing *\r\n // *******************************************************************************\r\n private navigateLocal(path: string) {\r\n this._router.navigate(['../' + path], { relativeTo: this._route });\r\n }\r\n\r\n navigateToStructureSearch(node: any) {\r\n const materialId = node.id();\r\n const parts = UtilFns.asRouterParts(ROUTES.Home, ROUTES.Home.childRoutes.SearchStructure, materialId);\r\n this._router.navigate(parts);\r\n }\r\n\r\n // *******************************************************************************\r\n // Path Data Queries *\r\n // *******************************************************************************\r\n // Check if a node has multiple edges\r\n isSharedNode(nodeId: string, graphableData: { [key: number]: ClusterNodeAndEdge[] }): boolean {\r\n // tslint:disable-next-line:forin\r\n for (const key in graphableData) {\r\n const data = graphableData[key];\r\n const obj = data.find(n => n.clusterPartNode == nodeId);\r\n\r\n if (typeof obj != 'undefined' && obj != null) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n getFullPathName(clusterPathId: number): string {\r\n let path = '';\r\n if (this._superClusterPaths != null) {\r\n const paths = this._superClusterPaths.filter(p => p.clusterPathId == clusterPathId);\r\n\r\n if (paths != undefined && paths.length > 0) {\r\n path = paths[0].clusterPath.clusterPathName;\r\n }\r\n }\r\n return path;\r\n }\r\n\r\n static getPathMaterials(data: ClusterNodeAndEdge[]): string {\r\n let materials = '';\r\n\r\n const mats = data.filter(m => m.isMaterial == true);\r\n\r\n if (mats != undefined && mats.length > 0) {\r\n materials = $.map(mats, function (obj) {\r\n return obj.clusterPartLabel;\r\n }).join('; ');\r\n }\r\n\r\n return materials;\r\n }\r\n\r\n isClusterPathAlreadySelected(clusterPathId: number): boolean {\r\n const idx = this._selectedClusterPathIds.indexOf(clusterPathId);\r\n return (idx > -1);\r\n }\r\n\r\n isSelectedClusterGroup(id: number) {\r\n if (this._selectedClusterGroup == null) {\r\n return false;\r\n }\r\n\r\n return (this._selectedClusterGroup.clusterGroupId == id);\r\n }\r\n\r\n // ******************************************************\r\n // *Expand Path Display by Node *\r\n // ******************************************************\r\n expandClusterPath(clusterPathId: number) {\r\n const data = this._clusterObjectMap[clusterPathId];\r\n\r\n if (this._cytoscapeGraphComponent.hasData()) {\r\n this._cytoscapeGraphComponent.addClusterDataToGraph(data);\r\n } else {\r\n this._cytoscapeGraphComponent.renderClusterData(data); // Will happen during redraw when flipping back to the cluster tab\r\n }\r\n }\r\n\r\n expandNodeNextLevel(node: any) {\r\n if (node == null) {\r\n return;\r\n }\r\n\r\n const precedence = node.data('precedence');\r\n this._cytoscapeGraphComponent.nodeLevelMin = 0;\r\n this._cytoscapeGraphComponent.nodeLevelMax = precedence + 1;\r\n\r\n this.findAndGraphExpandNodes(node);\r\n }\r\n\r\n expandAllNodes(node: any) {\r\n this._isLoading = true;\r\n this._userNotifications = '';\r\n\r\n if (node.isNode() == false) {\r\n this._userNotifications = 'Please click a node instead of an edge to expand the cluster path.';\r\n return;\r\n }\r\n\r\n const params = {\r\n clusterGroupId: this._selectedClusterGroupId,\r\n clusterPartName: node.id(),\r\n precedence: node.data('precedence')\r\n };\r\n\r\n return this._uow.fetch('MaterialClusters/GetClusterNodeCountByPartAsync', params).then(c => {\r\n const cnt = (c != null) ? c[0] : 0;\r\n if (cnt > 50) { // Too many, just display the next level\r\n this._userNotifications = 'The clicked node has more than 50 child nodes so just one level is being added to the graph. Expand again to see the materials.';\r\n this._cytoscapeGraphComponent.nodeLevelMin = 0;\r\n this._cytoscapeGraphComponent.nodeLevelMax = node.data('precedence') + 1;\r\n } else {\r\n this._cytoscapeGraphComponent.resetNodeLevelsToAll(); // Expand the full cluster path, set defaults to maximum display levels\r\n }\r\n\r\n this.findAndGraphExpandNodes(node);\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n findAndGraphExpandNodes(node: any) {\r\n const clusters = _.clone(this._clusterObjectMap);\r\n\r\n // tslint:disable-next-line:forin\r\n for (const key in clusters) {\r\n const data = this._clusterObjectMap[key];\r\n const obj = data.find(n => n.clusterPartNode == node.id());\r\n if (typeof obj != 'undefined' && obj != null) {\r\n if (this.isClusterPathAlreadySelected(+key) == false) {\r\n this._selectedClusterPathIds.push(+key);\r\n }\r\n this._cytoscapeGraphComponent.addClusterDataToGraph(data, false);\r\n }\r\n }\r\n this._cytoscapeGraphComponent.zoomToNode(node);\r\n }\r\n\r\n isStaff() {\r\n return this._userManager.currentUser.isStaff;\r\n }\r\n\r\n // ******************************************************\r\n // *Show Modal with Help Video *\r\n // ******************************************************\r\n onShowHelpVideoModal() {\r\n UtilFns.showModal(this._clusterHelpVideoComponent, this).then(r => {\r\n });\r\n }\r\n\r\n // ******************************************************\r\n // *Tooltip Display *\r\n // ******************************************************\r\n toggleTooltip(whichButton: number) {\r\n switch (whichButton) {\r\n case 1: {\r\n this.toggleShowSelectClusterGroupPaths = !this.toggleShowSelectClusterGroupPaths;\r\n break;\r\n }\r\n case 2: {\r\n this.toggleShowTopLevelNodes = !this.toggleShowTopLevelNodes;\r\n break;\r\n }\r\n case 3: {\r\n this.toggleShowClusterFilterModal = !this.toggleShowClusterFilterModal;\r\n break;\r\n }\r\n case 4: {\r\n this.toggleShowHelpVideo = !this.toggleShowHelpVideo;\r\n break;\r\n }\r\n case 5: {\r\n this.toggleClearGraph = !this.toggleClearGraph;\r\n break;\r\n }\r\n case 6: {\r\n this.toggleCenterGraph = !this.toggleCenterGraph;\r\n break;\r\n }\r\n case 7: {\r\n this.toggleExportClusterImage = !this.toggleExportClusterImage;\r\n break;\r\n }\r\n case 8: {\r\n this.toggleExportClusterFile = !this.toggleExportClusterFile;\r\n break;\r\n }\r\n case 9: {\r\n this.toggleMaterialLookup = !this.toggleMaterialLookup;\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n","
\r\n\r\n
Environmental Data Summaries
\r\n\r\n

{{_validationMessage}}

\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n
0\">\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n","import { HomePageComponent} from './home-page.component';\r\nimport { IntroComponent} from './intro.component';\r\nimport { SearchResultsComponent} from './search-results.component';\r\nimport { SearchAuthorsComponent} from './search-authors.component';\r\nimport { SearchSynonymsComponent} from './search-synonyms.component';\r\nimport { MarvinSearchComponent} from './marvin-search.component';\r\nimport { MaterialGroupsComponent} from './material-groups.component';\r\nimport { SafetyAssessmentsComponent } from './safety-assessments.component';\r\nimport { IFRAAttachmentsComponent } from './ifra-attachments.component';\r\nimport { ToolsAndModelsComponent } from './tools-and-models.component';\r\nimport { ReportDatabaseChangesComponent } from './report-database-changes.component';\r\nimport { SystemRequirementsComponent } from './system-requirements.component';\r\nimport { IFRASurveyUseComponent } from './ifra-survey-use.component';\r\nimport { DatabaseSubscriptionComponent } from './database-subscription.component';\r\nimport { MaterialClustersComponent } from './material-clusters.component';\r\nimport { EnvironmentalDataComponent } from './environmental-data.component';\r\n\r\nexport const HOME_ROUTES = {\r\n HomePage: { path: 'home-page', name: 'HomePage', component: HomePageComponent },\r\n AfterLogin: { path: 'after-login:code/info', name: 'AfterLogin', component: HomePageComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n Introduction: { path: 'intro', name: 'Introduction', component: IntroComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n SearchResults: { path: 'search-results/:filter/:term', name: 'SearchResults', component: SearchResultsComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n _SearchResults: { path: 'search-results', name: 'SearchResults', component: SearchResultsComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n SearchAuthors: { path: 'search-authors', name: 'SearchAuthors', component: SearchAuthorsComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n SearchSynonyms: { path: 'search-synonyms', name: 'SearchSynonyms', component: SearchSynonymsComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n SearchStructure: { path: 'search-structure/:id', name: 'SearchStructure', component: MarvinSearchComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n _SearchStructure: { path: 'search-structure/:id/:smiles', name: 'SearchStructure', component: MarvinSearchComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n MaterialGroups: { path: 'material-groups', name: 'MaterialGroups', component: MaterialGroupsComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n SafetyAssessments: { path: 'safety-assessments', name: 'SafetyAssessments', component: SafetyAssessmentsComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n IFRAAttachments: { path: 'ifra-attachments', name: 'IFRAAttachments', component: IFRAAttachmentsComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n ToolsAndModels: { path: 'tools-and-models', name: 'ToolsAndModels', component: ToolsAndModelsComponent },\r\n ReportDatabaseChanges: { path: 'report-database-changes', name: 'ReportDatabaseChanges', component: ReportDatabaseChangesComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n SystemRequirements: { path: 'system-requirements', name: 'SystemRequirements', component: SystemRequirementsComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n IFRASurveyUse: { name: 'IFRASurveyUse', title: 'Survey Uses', path: 'ifraSurveyUse', component: IFRASurveyUseComponent, rolesPermitted: 'ifra', rolesExcluded: 'staff,subscriber,authorizeddownloaduser' },\r\n DatabaseSubscription: { path: 'database-subscription', name: 'DatabaseSubscription', component: DatabaseSubscriptionComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n MaterialClusters: { path: 'material-clusters/:id', name: 'MaterialClusters', component: MaterialClustersComponent, rolesExcluded: 'authorizeddownloaduser' },\r\n EnvironmentalData: { path: 'environmental-data', name: 'EnvironmentalData', component: EnvironmentalDataComponent, rolesExcluded: 'authorizeddownloaduser' }\r\n};\r\n","import { Component, OnInit, Input} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { UnitOfWork, UserManager, StateMap, SearchService } from '../../services/common';\r\nimport { UtilFns, LocationFns, } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { RIFMDownloadableFile } from '../../entities/EntityModels';\r\nimport {HttpClient, HttpHeaders, HTTP_INTERCEPTORS} from '@angular/common/http';\r\nimport { HOME_ROUTES} from './home.routes';\r\nimport {Observable} from 'rxjs';\r\n\r\n@Component({\r\n selector: 'environmental-data',\r\n templateUrl: './environmental-data.html',\r\n})\r\nexport class EnvironmentalDataComponent implements OnInit {\r\n\r\n _documentManagementUrl: string;\r\n _envDataFiles: RIFMDownloadableFile[] = [];\r\n\r\n _isLoading = false;\r\n _validationMessage: string;\r\n\r\n constructor(public _stateMap: StateMap, private _httpClient: HttpClient, public _uow: UnitOfWork, public _userManager: UserManager) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = HOME_ROUTES.EnvironmentalData.name;\r\n\r\n this._documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDownloadableFile';\r\n\r\n this.loadData();\r\n }\r\n\r\n canDeactivate() {\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n loadData() {\r\n this._isLoading = true;\r\n\r\n const params = { category: 'EnvironmentalData'};\r\n\r\n this._envDataFiles = [];\r\n\r\n return this._uow.fetch('DocumentManagement/FetchRIFMDownloadableFilesByFileCategory', params).then(r => {\r\n if (r) {\r\n this._envDataFiles = r;\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n downloadFile(dfs: RIFMDownloadableFile) {\r\n if (dfs == null) {\r\n return ;\r\n }\r\n\r\n this.exportEnvironmentalFile(dfs.fileName, dfs.fileSubFolder);\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url\r\n // ************************************************************************\r\n getDownloadFileURL(fileName: string, subFolder: string): Observable {\r\n let url: string;\r\n url = this._documentManagementUrl + '/GetFileBySubFolderAndName?fileName=' + fileName + '&subFolder=' + subFolder ;\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public exportEnvironmentalFile(fileName: string, subFolder: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getDownloadFileURL(fileName, subFolder)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = 'File download successful.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n template: ''\r\n})\r\nexport class HomeComponent {\r\n\r\n constructor() {\r\n \r\n }\r\n \r\n}\r\n","
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n {{_synonymCollisionWarning}}\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n {{tsu.synonymUseLong}}:\r\n \r\n
\r\n
\r\n
\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { UtilFns } from '../../utils/common';\r\n\r\nimport { Synonym, TypeSynonymUse } from '../../entities/EntityModels';\r\nimport { MaterialListItem } from '../../entities/projections/MaterialListItem';\r\n\r\n@Component({\r\n selector: 'synonym',\r\n templateUrl: './synonym.html',\r\n providers: [provideParent(SynonymComponent, EditPropParent)]\r\n})\r\nexport class SynonymComponent implements OnInit, EditPropParent {\r\n @Input() synonym: Synonym;\r\n @Input() entities: Synonym[];\r\n\r\n allTsus: TypeSynonymUse[];\r\n tsuChecks: boolean[];\r\n origTsuChecks: boolean[];\r\n _synonymChanged: boolean;\r\n _synonymCollisionWarning: string;\r\n originalValue: string;\r\n\r\n constructor(public _uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._synonymChanged = false;\r\n\r\n this._uow.typeSynonymUseRepository.all().then(tsus => {\r\n this.allTsus = tsus.sort((a, b) => {\r\n if (a.synonymUseLong > b.synonymUseLong) {\r\n return 1;\r\n } else {\r\n return -1;\r\n }\r\n });\r\n\r\n const longNames = this.synonym.useLongNames;\r\n this.tsuChecks = tsus.map(tsu => longNames.indexOf(tsu.synonymUseLong) >= 0);\r\n this.origTsuChecks = this.tsuChecks.map(b => b);\r\n });\r\n }\r\n\r\n getError(propName: string) {\r\n return this.synonym.getErrorFor(propName);\r\n }\r\n\r\n setRootWord() {\r\n this.synonym.rootWord = Synonym.rootWordFromSynonymWord(this.synonym.synonymWord);\r\n }\r\n\r\n validateSynonymWord() {\r\n const synonymWord = this.synonym.synonymWord;\r\n this._uow.fetch('Materials/MaterialsBySynonym', {synonymWord: UtilFns.encodeHackForAnd(synonymWord)}).then(r => {\r\n if (this.synonym.material.synonyms.filter(s => s.synonymWord == synonymWord).length > 1) {\r\n this._synonymCollisionWarning = 'Just a warning but this Synonym has already been added to this material.';\r\n return;\r\n }\r\n const mlis = r;\r\n // if no match\r\n if (mlis.length == 0 || (mlis.length == 1 && mlis[0].materialId == this.synonym.materialId)) {\r\n this._synonymCollisionWarning = null;\r\n return;\r\n }\r\n this._synonymCollisionWarning = 'Just a warning but this Synonym has already been used elsewhere.';\r\n });\r\n }\r\n\r\n onSetModified() {\r\n if (this.synonym.entityAspect.entityState.isUnchanged()) {\r\n this.synonym.entityAspect.setModified();\r\n }\r\n }\r\n\r\n setPrincipalName() {\r\n if (this.synonym && this.synonym.principal) {\r\n if (this.entities) {\r\n this.entities.filter(s => s.synonymId != this.synonym.synonymId).forEach(s => s.principal = false);\r\n }\r\n }\r\n }\r\n\r\n apply() {\r\n if (this.tsuHasChanged()) {\r\n this.tsuChecks.forEach((tsu, ix) => {\r\n const tsuId = this.allTsus[ix].typeSynonymUseId;\r\n if (tsu) {\r\n this.synonym.addSynonymNamer(tsuId);\r\n } else {\r\n this.synonym.removeSynonymNamer(tsuId);\r\n }\r\n });\r\n }\r\n\r\n // Only synonyms that have terms to be displayed as symbols will have web versions stored.\r\n const webVersion = this.synonym.formatSynonymWebVersion();\r\n this.synonym.webVersion = (webVersion == this.synonym.synonymWord) ? null : webVersion;\r\n }\r\n\r\n tsuHasChanged() {\r\n return this.tsuChecks.some((tsu, ix) => tsu !== this.origTsuChecks[ix]);\r\n }\r\n\r\n onSynonymWordChange(originalSynonymWord: string) {\r\n if (originalSynonymWord != this.synonym.synonymWord) {\r\n this._synonymChanged = true;\r\n this.validateSynonymWord();\r\n this.setRootWord();\r\n }\r\n }\r\n}\r\n","\r\n\r\n
\r\n {{_principalNameWarning}}\r\n
\r\n\r\n\r\n \r\n \r\n Synonym\r\n \r\n Used By\r\n Principal\r\n \r\n \r\n \r\n \r\n \r\n \r\n Principal{{s.useList ? ' - ' : ''}}{{s.useList}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n
\r\n \r\n
\r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { EditorService, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, IEditHost } from '../../utils/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { SynonymComponent } from './synonym.component';\r\nimport { Material, Synonym } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'synonyms',\r\n templateUrl: './synonyms.html',\r\n})\r\nexport class SynonymsComponent implements IEditHost, OnInit {\r\n @ViewChild(SynonymComponent) synonymComponent: SynonymComponent;\r\n\r\n _principalNameWarning: string;\r\n _material: Material;\r\n _edm: EditManager;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location, public _editorService: EditorService) {\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Synonyms.name;\r\n this._material = this._stateMap.currentMaterial;\r\n\r\n this._edm = this._editorService.createEditManager(this, 'Synonyms');\r\n this._edm.entities = this._material.synonyms.slice(0);\r\n this._edm.entities = this._edm.entities.sort((a, b) => {\r\n return a.synonymWordOrWebVersion().localeCompare(b.synonymWordOrWebVersion());\r\n });\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n onAdd() {\r\n if (this._edm.editing && this.synonymComponent) {\r\n this.synonymComponent.apply();\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n }\r\n\r\n const sy = this._uow.synonymFactory.create();\r\n sy.materialId = this._material.materialId;\r\n sy.synonymWord = '';\r\n this._edm.entities.push(sy);\r\n this._edm.onSelect(sy);\r\n }\r\n\r\n onDelete() {\r\n this._edm.currentEntity.synonymNamers.slice(0).forEach(sn => {\r\n if (sn.entityAspect.entityState.isAdded()) {\r\n sn.entityAspect.rejectChanges();\r\n } else {\r\n sn.entityAspect.setDeleted();\r\n }\r\n });\r\n this._edm.onDeleteCore();\r\n }\r\n\r\n onApply() {\r\n this.synonymComponent.apply();\r\n if (!this._edm.onApplyCore()) {\r\n return;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n onSave() {\r\n if (!this._edm.validateBeforeSave()) {\r\n return;\r\n }\r\n const hasEntities = this._edm.entities.length > 0;\r\n if (!hasEntities) {\r\n this._stateMap.yesNoComponent.showModal('Cannot save',\r\n 'You must have at least one synonym per material.', ['Ok']);\r\n return;\r\n }\r\n this._principalNameWarning = '';\r\n const principalNameCount = this._edm.entities.filter(s => s.principal).length;\r\n if (principalNameCount == 0) {\r\n this._principalNameWarning = 'At least 1 synonym should be designated as the Principal Name';\r\n return;\r\n } else if (principalNameCount > 1) {\r\n this._principalNameWarning = 'Only 1 synonym can be designated as the Principal Name';\r\n return;\r\n }\r\n\r\n return this._edm.commitSave();\r\n }\r\n\r\n stopProp(event: Event) {\r\n event.stopPropagation();\r\n }\r\n}\r\n","\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { LocationFns } from '../../utils/common';\r\nimport { TabContainer } from '../../controls/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { Material } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'structure-identity',\r\n\r\n templateUrl: './structure-identity.html',\r\n})\r\nexport class StructureIdentityComponent implements OnInit, AfterViewInit {\r\n material: Material;\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n _tab: number;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.StructureIdentity.name;\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n }\r\n\r\n ngAfterViewInit() {\r\n setTimeout(() => {\r\n this._tabContainer.selectTab(this._tab);\r\n }, 1);\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
Now select a row from below or click 'Cancel'
\r\n
\r\n
\r\n

{{validationMessage}}

\r\n
\r\n \r\n \r\n \r\n Reference No.\r\n Brief Reference\r\n Title\r\n \r\n \r\n \r\n \r\n {{e?.referenceId}}\r\n {{formatBriefReference(e.briefReference) }}\r\n {{e?.title}}\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n","import { Component, ElementRef, OnInit } from '@angular/core';\r\n\r\nimport { SearchService, StateMap } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { Reference } from '../../entities/EntityModels';\r\nimport { ReferenceListItem } from '../../entities/projections/ReferenceListItem';\r\n\r\n@Component({\r\n selector: 'reference-selector',\r\n templateUrl: './reference-selector.html',\r\n})\r\nexport class ReferenceSelectorComponent extends ModalDialog implements OnInit {\r\n\r\n _searchTerm: string;\r\n _entities: ReferenceListItem[] = [];\r\n _pageState = new PageState('References');\r\n\r\n constructor(elementRef: ElementRef, public _searchService: SearchService, public _stateMap: StateMap) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n search() {\r\n this.validationMessage = null;\r\n const params = {\r\n searchTerm: this._searchTerm,\r\n searchType: '',\r\n pageNumber: 0,\r\n pageSize: 200\r\n };\r\n\r\n this._pageState.isLoading = true;\r\n this._entities = null;\r\n return this._searchService.fetchReferencesPage(params).then(rsr => {\r\n this._pageState.isLoaded = rsr.references;\r\n this._entities = rsr.references;\r\n }).catch(e => {\r\n this._pageState.isLoaded = false;\r\n });\r\n }\r\n\r\n onSelect(rli: ReferenceListItem) {\r\n UtilFns.returnModal(this, rli);\r\n }\r\n\r\n // needed because ReferenceListItem only has the briefReference (not the trimmed briefReference).\r\n formatBriefReference(br: string) {\r\n return Reference.formatBriefReference(br, this.isStaff());\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n\r\n}\r\n\r\n","
\r\n
\r\n \r\n Currently Displayed File Name:\r\n {{downloadFileName}}\r\n Page Count:\r\n {{pdfPageCount}}\r\n \r\n
\r\n\r\n

{{_processingMessage}}

\r\n\r\n \r\n \r\n \r\n \r\n
\r\n","import {Component, OnInit, OnDestroy, Input, Output, EventEmitter, ElementRef, OnChanges, AfterViewInit, Inject, forwardRef, ViewChild, ViewEncapsulation, ChangeDetectorRef} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport {HttpClient, HttpHeaders, HTTP_INTERCEPTORS} from '@angular/common/http';\r\n\r\nimport { UnitOfWork, UserManager, StateMap } from '../../services/common';\r\nimport { UtilFns, LocationFns, } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport {\r\n PdfViewerComponent, LinkAnnotationService, BookmarkViewService, MagnificationService, ThumbnailViewService,\r\n ToolbarService, NavigationService, TextSearchService, TextSelectionService, PrintService, AnnotationService, FormFieldsService,\r\n LoadEventArgs, AnnotationAddEventArgs, AjaxRequestFailureEventArgs, ExportFailureEventArgs, AjaxRequestSuccessEventArgs,\r\n AnnotationRemoveEventArgs, AnnotationResizeEventArgs, BeforeAddFreeTextEventArgs, CommentEventArgs, FormFieldAddArgs,\r\n AnnotationPropertiesChangeEventArgs, PageChangeEventArgs, AjaxRequestInitiateEventArgs, DownloadEndEventArgs, DownloadStartEventArgs, LoadFailedEventArgs, ToolbarItem\r\n} from '@syncfusion/ej2-angular-pdfviewer';\r\nimport { ColorPickerModule } from '@syncfusion/ej2-angular-inputs';\r\nimport { ToolbarModule } from '@syncfusion/ej2-angular-navigations';\r\n\r\n@Component({\r\n selector: 'pdf-editor',\r\n templateUrl: './pdf-editor.html',\r\n encapsulation: ViewEncapsulation.None,\r\n // tslint:disable-next-line:max-line-length\r\n providers: [LinkAnnotationService, BookmarkViewService, MagnificationService, ThumbnailViewService, ToolbarService, NavigationService, TextSearchService, TextSelectionService, PrintService, AnnotationService, FormFieldsService]\r\n})\r\nexport class PDFEditorComponent implements OnInit, AfterViewInit, OnDestroy {\r\n @ViewChild(PdfViewerComponent, { static: true }) _pdfViewerComponent: PdfViewerComponent;\r\n\r\n @Input() serviceUrl: string;\r\n @Output() stateChange = new EventEmitter();\r\n\r\n // JAYT: added canShowHeader and changeDetectorRef logic to handle 'Expression has been changed...' issue.\r\n public _canShowHeader = false;\r\n public _canShowPDF = false;\r\n public _documentPath: string;\r\n public _enableToolbar = false;\r\n public _hasChanges = false;\r\n public _processingMessage: string;\r\n public _rifmDocumentSource: string;\r\n public _showPDFTronDocument = true;\r\n public _zoommode = 'FitToPage';\r\n\r\n // tslint:disable-next-line:max-line-length\r\n public _toolbarSettingsEdit = { toolbarItem: 'AnnotationEditTool, DownloadOption, MagnificationTool, OpenOption, PageNavigationTool, PrintOption, SearchOption, SelectionTool, UndoRedoTool, CommentTool' };\r\n // tslint:disable-next-line:max-line-length\r\n public _toolbarSettingsView = { toolbarItem: 'DownloadOption, MagnificationTool, PageNavigationTool, PrintOption, SearchOption, SelectionTool' };\r\n\r\n public _toolbarSettings = this._toolbarSettingsView;\r\n\r\n public _printMode = 'printMode.NewWindow';\r\n\r\n public _colorPicker: any;\r\n\r\n constructor(public _stateMap: StateMap, public _uow: UnitOfWork, private changeDetectorRef: ChangeDetectorRef) {\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n ngAfterViewInit() {\r\n\r\n if (this._pdfViewerComponent != null) {\r\n this._pdfViewerComponent.freeTextSettings.fontSize = 48;\r\n }\r\n this._canShowHeader = true;\r\n this.changeDetectorRef.detectChanges();\r\n\r\n\r\n\r\n // this._colorPicker = $('#colorpicker')[0] as HTMLInputElement;\r\n }\r\n\r\n ngOnDestroy() {\r\n if (this._pdfViewerComponent != null) {\r\n this.unloadPDF();\r\n }\r\n\r\n // if (this._colorPicker != null) {\r\n // console.log('remove colorpicker');\r\n // this._colorPicker.remove();\r\n // }\r\n }\r\n\r\n public destroyData() {\r\n this._pdfViewerComponent.destroy();\r\n }\r\n\r\n public loadPDF(fileName: string) {\r\n this.documentPath = fileName;\r\n this._pdfViewerComponent.fileName = fileName;\r\n\r\n this._pdfViewerComponent.load(fileName, '');\r\n\r\n }\r\n\r\n public savePDF() {\r\n this._processingMessage = 'Saving PDF File.';\r\n this._pdfViewerComponent.download();\r\n }\r\n\r\n public unloadPDF() {\r\n this._pdfViewerComponent.unload();\r\n this.documentPath = '';\r\n this._pdfViewerComponent.fileName = '';\r\n }\r\n\r\n public refreshPDF() {\r\n const fileName = this._pdfViewerComponent.fileName;\r\n\r\n this.documentPath = fileName;\r\n this.loadPDF(fileName);\r\n }\r\n\r\n // **************************************************************************\r\n // bindable properties\r\n // **************************************************************************\r\n public ajaxSetting = {\r\n ajaxHeaders: [\r\n {\r\n headerName: 'Authorization',\r\n\r\n headerValue: this._stateMap.currentUser.authenticationToken\r\n }\r\n ],\r\n\r\n withCredentials: false\r\n };\r\n\r\n public get rifmDocumentSource(): string {\r\n return this._rifmDocumentSource;\r\n }\r\n\r\n public set rifmDocumentSource(value: string) {\r\n this._rifmDocumentSource = value;\r\n this._pdfViewerComponent.load(this._rifmDocumentSource, null);\r\n // this.documentPath = 'data:application/pdf;base64,' + value;\r\n }\r\n\r\n public get downloadFileName() {\r\n return (this._pdfViewerComponent != null) ? this._pdfViewerComponent.documentPath : '';\r\n }\r\n\r\n public get canShowPDF() {\r\n return this._canShowPDF;\r\n }\r\n\r\n public set canShowPDF(value) {\r\n this._canShowPDF = value;\r\n }\r\n\r\n public get documentPath() {\r\n return this._documentPath;\r\n }\r\n\r\n public set documentPath(value: string) {\r\n this._documentPath = value;\r\n }\r\n\r\n public get enableToolbar(): boolean {\r\n return this._enableToolbar;\r\n }\r\n\r\n public set enableToolbar(value: boolean) {\r\n this._enableToolbar = value;\r\n this._pdfViewerComponent.toolbar.showToolbar(value);\r\n this._pdfViewerComponent.toolbar.showAnnotationToolbar(value);\r\n }\r\n\r\n public get hasChanges(): boolean {\r\n return this._hasChanges;\r\n }\r\n\r\n public set hasChanges(value) {\r\n this._hasChanges = value;\r\n\r\n if (this._hasChanges) {\r\n this.stateChange.emit('documentchanged');\r\n }\r\n }\r\n\r\n public get pdfPageCount() {\r\n if (this._pdfViewerComponent != null && this._pdfViewerComponent.documentPath != '') {\r\n return this._pdfViewerComponent.pageCount + '';\r\n }\r\n\r\n return '';\r\n }\r\n\r\n public get showPDFTronDocument() {\r\n return this._showPDFTronDocument;\r\n }\r\n\r\n public set showPDFTronDocument(value) {\r\n this._showPDFTronDocument = value;\r\n }\r\n\r\n public get toolbarSettings() {\r\n return this._toolbarSettings;\r\n }\r\n\r\n public set toolbarSettings(value) {\r\n this._toolbarSettings = value;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // **************************************************************************\r\n // public methods\r\n // **************************************************************************\r\n public setEditMode() {\r\n this.enableToolbar = true;\r\n this.toolbarSettings = this._toolbarSettingsEdit;\r\n\r\n if (this._pdfViewerComponent != null && this._pdfViewerComponent.toolbar != null) {\r\n this._pdfViewerComponent.toolbar.showToolbar(true);\r\n }\r\n }\r\n\r\n public setViewMode() {\r\n this.enableToolbar = false;\r\n this.toolbarSettings = this._toolbarSettingsView;\r\n\r\n if (this._pdfViewerComponent != null && this._pdfViewerComponent.toolbar != null) {\r\n this._pdfViewerComponent.toolbar.showToolbar(false);\r\n }\r\n }\r\n\r\n // **************************************************************************\r\n // pdf viewer ajax events\r\n // **************************************************************************\r\n public ajaxRequestInitiate(e: AjaxRequestInitiateEventArgs): void {\r\n // console.log(e);\r\n // this.stateChange.emit('ajaxrequeststarted');\r\n }\r\n\r\n public ajaxRequestSuccess(e: AjaxRequestSuccessEventArgs): void {\r\n this._processingMessage = '';\r\n this.stateChange.emit('success');\r\n }\r\n\r\n public ajaxRequestFailed(e: AjaxRequestFailureEventArgs): void {\r\n this._processingMessage = '';\r\n this.stateChange.emit('error');\r\n }\r\n\r\n// download actually saves the file\r\n public downloadStart(e: DownloadStartEventArgs): void {\r\n this.stateChange.emit('downloadstart');\r\n }\r\n\r\n public downloadEnd(e: DownloadEndEventArgs): void {\r\n this.hasChanges = false;\r\n this._processingMessage = '';\r\n this.stateChange.emit('downloadend');\r\n }\r\n\r\n // **************************************************************************\r\n // pdf viewer editing events\r\n // **************************************************************************\r\n public annotationAdded(e: AnnotationAddEventArgs): void {\r\n this.hasChanges = true;\r\n }\r\n\r\n public annotationRemoved(e: AnnotationRemoveEventArgs): void {\r\n this.hasChanges = true;\r\n }\r\n\r\n public annotationResized(e: AnnotationResizeEventArgs): void {\r\n this.hasChanges = true;\r\n }\r\n\r\n public beforeAddFreeText(e: BeforeAddFreeTextEventArgs): void {\r\n this.hasChanges = true;\r\n }\r\n\r\n public commentAdded(e: CommentEventArgs): void {\r\n this.hasChanges = true;\r\n }\r\n\r\n public commentDeleted(e: CommentEventArgs): void {\r\n this.hasChanges = true;\r\n }\r\n\r\n public commentEdited(e: CommentEventArgs): void {\r\n this.hasChanges = true;\r\n }\r\n\r\n public documentLoad(e: LoadEventArgs): void {\r\n this.hasChanges = false;\r\n this.stateChange.emit('documentloaded');\r\n\r\n }\r\n\r\n public documentLoadFailed(e: LoadFailedEventArgs) {\r\n this._processingMessage = '';\r\n this.stateChange.emit('loadfailederror');\r\n }\r\n\r\n public exportFailure(e: ExportFailureEventArgs): void {\r\n alert(e.errorDetails);\r\n }\r\n\r\n public formFieldAdd(e: FormFieldAddArgs): void {\r\n this.hasChanges = true;\r\n }\r\n\r\n\r\n public annotationPropertiesChange (e: AnnotationPropertiesChangeEventArgs): void {\r\n this.hasChanges = true;\r\n }\r\n\r\n\r\n public pageChange (e: PageChangeEventArgs): void {\r\n this.hasChanges = true;\r\n }\r\n\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n Reference Document\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n {{_validationMessage}}\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n","import {Component, ElementRef, Input, OnInit, OnDestroy, ViewChild} from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { UtilFns } from '../../utils/common';\r\nimport {HttpClient, HttpHeaders, HTTP_INTERCEPTORS} from '@angular/common/http';\r\nimport {Observable} from 'rxjs';\r\nimport {Reference, RIFMDocument, SurveyWhoUsedMostMaterial} from '../../entities/EntityModels';\r\nimport {PDFEditorComponent} from '../docmanagement/pdf-editor.component';\r\nimport {UnitOfWork} from '../../services/unit-of-work';\r\nimport {ModalDialog} from '../../controls/modal-dialog';\r\nimport {StateMap} from '../../services/state-map';\r\n\r\n\r\n@Component({\r\n selector: 'show-and-download-pdf',\r\n templateUrl: './show-and-download-pdf.html',\r\n})\r\nexport class ShowAndDownloadPDFComponent extends ModalDialog implements OnInit, OnDestroy {\r\n @ViewChild(PDFEditorComponent, { static: true }) _pdfEditorComponent: PDFEditorComponent;\r\n\r\n @Input() showUVSFile: boolean;\r\n\r\n public _fileName = '';\r\n public _isLoading = false;\r\n public _validationMessage = '';\r\n\r\n public _pdfEditorDisplay = 'inline';\r\n public _pdfEditorMessage = '';\r\n\r\n public _documentManagementUrl: string;\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork, private _httpClient: HttpClient, public _stateMap: StateMap) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n this.getDocumentManagementUrl().then(url => {\r\n this._stateMap.documentManagementBaseUrl = url;\r\n this._documentManagementUrl = (this.showUVSFile) ? this._stateMap.documentManagementBaseUrl + '/AnalyticalResults' : this._stateMap.documentManagementBaseUrl + '/RIFMDocument';\r\n this._stateMap.documentManagementUrl = this._documentManagementUrl;\r\n });\r\n }\r\n\r\n ngOnDestroy() {\r\n if (this._pdfEditorComponent != null) {\r\n this._pdfEditorComponent.destroyData();\r\n }\r\n\r\n // remove application cache\r\n this.clearPDFViewerCache();\r\n }\r\n\r\n public clearPDFViewerCache() {\r\n // remove application cache\r\n for (const key in sessionStorage) {\r\n if (key.indexOf('Sync_PdfViewer') !== -1) {\r\n sessionStorage.removeItem(key);\r\n }\r\n }\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n public get fileName(): string {\r\n return this._fileName;\r\n }\r\n\r\n public set fileName(fileName: string) {\r\n this._fileName = fileName;\r\n this.loadPDFFileData(this._fileName);\r\n }\r\n\r\n // ************************************************************************\r\n // PDF Component Interaction\r\n // ************************************************************************\r\n public onExportFile() {\r\n this.exportPDFFile(this._fileName);\r\n }\r\n\r\n public loadPDFFileData(fileName: string) {\r\n this._isLoading = true;\r\n this._validationMessage = 'Loading PDF file...';\r\n\r\n this._pdfEditorComponent.canShowPDF = true;\r\n this._pdfEditorComponent.loadPDF(fileName);\r\n this._pdfEditorComponent.setViewMode();\r\n }\r\n\r\n pdfEditorEventHandler(event: string) {\r\n switch (event) {\r\n case 'documentloaded': {\r\n break;\r\n }\r\n case 'success': {\r\n // this._pdfEditorMessage = this._pdfEditorLastRequest + ' Result: ' + 'Success.';\r\n break;\r\n }\r\n case 'error': {\r\n this._pdfEditorMessage = 'Error occurred, please contact support.';\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n this._isLoading = false;\r\n this._validationMessage = '';\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url\r\n // ************************************************************************\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n public isValidString(testString: string): boolean {\r\n return (testString && testString.length > 0);\r\n }\r\n\r\n // ************************************************************************\r\n // Export PDF File\r\n // ************************************************************************\r\n getExportFileURL(fileName: string): Observable {\r\n let url;\r\n\r\n if (this.showUVSFile) {\r\n url = this._documentManagementUrl + '/GetUVFileByName?fileName=' + fileName;\r\n } else {\r\n url = this._documentManagementUrl + '/GetReferenceDocumentPDFByFileName?fileName=' + fileName;\r\n }\r\n\r\n console.log(url);\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public exportPDFFile(fileName: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getExportFileURL(fileName)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = 'File download successful.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","
\r\n \r\n
\r\n\r\n

At least one file needs to be assigned to a UVS record.

\r\n\r\n
\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
\r\n

Manage UVA and UVS Files

\r\n\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
File NameShow FileActionRemove
{{u.fileName}}Show{{translateUVSFileActionToLabel(u.key)}}{{translateUVSFileCancelRemoveToLabel(u.key)}}
\r\n
\r\n\r\n
\r\n\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
\r\n\r\n\r\n\r\n","import {AfterViewInit, Component, forwardRef, Inject, Input, OnInit, ViewChild} from '@angular/core';\r\n\r\nimport {provideParent, UnitOfWork} from '../../services/common';\r\nimport {EditPropParent} from '../../controls/common';\r\nimport {UtilFns} from '../../utils/common';\r\nimport {AnalyticalResult, TypeAnalyticalProcedure} from '../../entities/EntityModels';\r\nimport {ReferenceSelectorComponent} from '../reference/reference-selector.component';\r\nimport {ShowAndDownloadPDFComponent} from '../docmanagement/show-and-download-pdf.component';\r\nimport {AnalyticalResultsComponent, UVFileAction, UVFileData} from './analytical-results.component';\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'analytical-result',\r\n templateUrl: './analytical-result.html',\r\n providers: [provideParent(AnalyticalResultComponent, EditPropParent)]\r\n})\r\nexport class AnalyticalResultComponent implements OnInit, EditPropParent, AfterViewInit {\r\n @Input() entity: AnalyticalResult;\r\n @ViewChild(ReferenceSelectorComponent, { static: true }) _referenceSelectorComponent: ReferenceSelectorComponent;\r\n @ViewChild(ShowAndDownloadPDFComponent, { static: true }) _showAndDownloadPDFComponent: ShowAndDownloadPDFComponent;\r\n\r\n public _data: UVFileData = new UVFileData();\r\n public _fileInputElement: any; // html element reference\r\n public _typeAnalyticalProcedures: TypeAnalyticalProcedure[];\r\n public _uvsFileActionLabels: string[];\r\n public _uvsFileCancelRemoveLabels: string[];\r\n\r\n public _loading = false;\r\n public _validationMessage: string;\r\n\r\n constructor(public uow: UnitOfWork, @Inject(forwardRef(() => AnalyticalResultsComponent)) public _parent: AnalyticalResultsComponent) {\r\n\r\n this._data = _parent._data;\r\n this._uvsFileActionLabels = ['', 'File will be Added', 'File will be Removed'];\r\n this._uvsFileCancelRemoveLabels = ['Remove', 'Cancel Add', 'Cancel Remove'];\r\n }\r\n\r\n ngOnInit() {\r\n this.uow.typeAnalyticalProcedureRepository.all().then(taps => {\r\n this._typeAnalyticalProcedures = taps.sort((a, b) => {\r\n return a.analyticalProcedure.localeCompare(b.analyticalProcedure);\r\n });\r\n });\r\n\r\n if (this.entity.typeAnalyticalProcedureID == 'UVS') {\r\n if (this.entity.uvsFileList != null && this.entity.uvsFileList.length > 0) {\r\n this.prepareUVSFiles(this.entity.uvsFileList);\r\n }\r\n }\r\n }\r\n\r\n ngAfterViewInit() {\r\n this._fileInputElement = $('#fileInputElement')[0] as HTMLInputElement;\r\n }\r\n\r\n getError(propName: string) {\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n public prepareUVSFiles(fileList: string[]) {\r\n\r\n const fileData: any = null;\r\n\r\n // check to see if the file data has already been inserted into the shared data array.\r\n // this can happen when a UVS record is edited after the \"Apply\" button has been pressed\r\n const dataFiles = this._data.uvFiles.filter(a => a.analyticalResultId == this.entity.analyticalResultId);\r\n if (dataFiles == null || dataFiles.length == 0) {\r\n const analyticalResultId = this.entity.analyticalResultId;\r\n fileList.map((fn, idx) => {\r\n this._data.uvFiles.push({ key: idx, fileName: fn, processType: UVFileAction.NONE, processResultMsg: '', analyticalResultId, fileData });\r\n });\r\n }\r\n }\r\n\r\n // hasChanges() {\r\n // return (!this.entity.entityAspect.entityState.isUnchanged());\r\n // }\r\n\r\n isAdded() {\r\n return this.entity.entityAspect.entityState.isAdded();\r\n }\r\n\r\n onSourceChange(source: string) {\r\n this.entity.referenceId = null;\r\n }\r\n\r\n onSelectReference() {\r\n UtilFns.showModal(this._referenceSelectorComponent, this, null).then(rli => {\r\n if (rli == null) {\r\n return;\r\n }\r\n this.entity.referenceId = rli.referenceId;\r\n this._loading = true;\r\n return this.uow.referenceRepository.withId(rli.referenceId).then(r => {\r\n this.entity.analyticalSource = r.briefReference;\r\n this._loading = false;\r\n });\r\n });\r\n }\r\n\r\n // uvs data\r\n // **********************************************************\r\n // **********************************************************\r\n entityUVFiles() {\r\n if (this._data.uvFiles == null || this._data.uvFiles.length == 0) {\r\n return null;\r\n }\r\n return this._data.uvFiles.filter(a => a.analyticalResultId == this.entity.analyticalResultId);\r\n }\r\n\r\n hasUVFileData() {\r\n return (this.entityUVFiles() != null);\r\n }\r\n\r\n disablePropertyTypeSelection() {\r\n if (this.entity == null) { return true; }\r\n\r\n if (this.entity.entityAspect.entityState.isAdded()) { return false; }\r\n\r\n return (this.entity.typeAnalyticalProcedureID == 'UVS');\r\n }\r\n\r\n canShowFileInformationalMessage(): boolean {\r\n if (this.entity.typeAnalyticalProcedureID != 'UVS') { return false; }\r\n\r\n const files = this._data.uvFiles.filter(f => f.processType != UVFileAction.DELETE);\r\n return (files == null || files.length == 0);\r\n }\r\n\r\n public onCancelAddUVSFile(idx: number) {\r\n const currentFileData = this._data.uvFiles.filter(f => f.key != idx);\r\n\r\n if (currentFileData == null || currentFileData.length == 0) {\r\n this._data.uvFiles = [];\r\n return;\r\n }\r\n\r\n // reindex the array of file data\r\n this._data.uvFiles = currentFileData.map( (obj, index) => {\r\n obj.key = index;\r\n return obj;\r\n });\r\n }\r\n\r\n onAddUVSFile(files: FileList) {\r\n const fileData: any = files.item(0);\r\n\r\n this._loading = true;\r\n this._validationMessage = '';\r\n\r\n const analyticalResultId = this.entity.analyticalResultId;\r\n this._data.addCount++; // used for file name\r\n\r\n // the file name includes a sequence number that considers all uvs files assigned to the material\r\n const params = { materialId: this.entity.materialID, incrementNumber: this._data.addCount };\r\n this.uow.fetch('Materials/FetchNextUVSFileName', params).then(fn => {\r\n if (fn != null && fn.length > 0) {\r\n const nextFileName = fn[0];\r\n this._data.uvFiles.push({ key: this._data.uvFiles.length, fileName: nextFileName, processType: UVFileAction.ADD, processResultMsg: '', analyticalResultId, fileData });\r\n\r\n this.setObservedResultForUVTypes();\r\n\r\n this._loading = false;\r\n\r\n }\r\n });\r\n }\r\n\r\n onPropertyTypeChange() {\r\n if (this.entity.typeAnalyticalProcedureID != 'UVS') {\r\n this.resetUVData();\r\n }\r\n }\r\n\r\n onRemoveUVSFile(idx: number) {\r\n const processType = this._data.uvFiles[idx].processType;\r\n switch (processType) {\r\n case UVFileAction.ADD: {\r\n this.onCancelAddUVSFile(idx);\r\n break;\r\n }\r\n case UVFileAction.DELETE: {\r\n this._data.uvFiles[idx].processType = UVFileAction.NONE;\r\n break;\r\n }\r\n case UVFileAction.NONE: {\r\n this._data.uvFiles[idx].processType = UVFileAction.DELETE;\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n\r\n this.setObservedResultForUVTypes();\r\n }\r\n\r\n onShowUVSFile(idx: number) {\r\n const uvFiles = this.entityUVFiles();\r\n\r\n this._showAndDownloadPDFComponent.fileName = uvFiles[idx].fileName;\r\n UtilFns.showModal(this._showAndDownloadPDFComponent, this).then(m => {\r\n return;\r\n });\r\n }\r\n\r\n resetUVData() {\r\n const currentFileData = _.clone(this._data.uvFiles);\r\n this._data.uvFiles = currentFileData.filter(a => a.analyticalResultId != this.entity.analyticalResultId);\r\n }\r\n\r\n setObservedResultForUVTypes() {\r\n if (this._data.uvFiles != null && this._data.uvFiles.length > 0) {\r\n const uvsfiles = this._data.uvFiles.filter(f => f.analyticalResultId == this.entity.analyticalResultId && f.processType != UVFileAction.DELETE);\r\n this.entity.observedResult = (uvsfiles != null && uvsfiles.length > 0) ? uvsfiles.map(fn => fn.fileName).join(',') : null;\r\n } else {\r\n this.entity.observedResult = null;\r\n }\r\n }\r\n\r\n translateUVSFileActionToLabel(idx: number) {\r\n return (this._uvsFileActionLabels[this._data.uvFiles[idx].processType]);\r\n }\r\n\r\n translateUVSFileCancelRemoveToLabel(idx: number) {\r\n return (this._uvsFileCancelRemoveLabels[this._data.uvFiles[idx].processType]);\r\n }\r\n\r\n isUVAdd(idx: number) {\r\n return (this._data.uvFiles[idx].processType == UVFileAction.ADD);\r\n }\r\n\r\n isUVS() {\r\n if (this.entity == null) { return false; }\r\n return (this.entity.typeAnalyticalProcedureID == 'UVS');\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n return (teststring.trim().length > 0);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { Entity } from 'breeze-client';\r\nimport {Material, TypeWorkflowContact, TypeWorkflowMaterialAction, TypeWorkflowMaterialActionTransition, WorkflowMaterialRecordedAction} from '../entities/EntityModels';\r\nimport { WorkflowEntityState, WorkflowState } from './workflow-state';\r\nimport { UnitOfWork } from './unit-of-work';\r\nimport {UserManager} from './user-manager';\r\n\r\nexport enum SurveyReportedUseChangeType { ADD, EDIT, DELETE}\r\n\r\n@Injectable()\r\nexport class MaterialWorkflowService {\r\n\r\n public _typeWorkflowContacts: TypeWorkflowContact[] = [];\r\n public _typeWorkflowMaterialActionTransitions: TypeWorkflowMaterialActionTransition[] = [];\r\n\r\n\r\n constructor(private _uow: UnitOfWork, private _userManager: UserManager) {\r\n\r\n this._uow.typeWorkflowContactRepository.all().then(w => {\r\n this._typeWorkflowContacts = (w != null) ? w : [];\r\n });\r\n\r\n this._uow.typeWorkflowMaterialActionTransitionRepository.all()\r\n .then(r => {\r\n this._typeWorkflowMaterialActionTransitions = r;\r\n });\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // Volume of Use editing actions.\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordNewReportingOrganization(workflowEntityState: WorkflowEntityState, notes: string, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowEntityName = 'ReportingOrganization';\r\n workflow.workflowNotes = notes;\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'ADDED');\r\n\r\n }\r\n\r\n public recordChangedReportingOrganizationName(workflowEntityState: WorkflowEntityState, notes: string, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowEntityName = 'ReportingOrganization';\r\n workflow.workflowPropertyName = 'organizationName';\r\n workflow.workflowNotes = notes;\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'MODIFIED');\r\n\r\n }\r\n\r\n // tslint:disable-next-line:max-line-length\r\n public recordMaterialSurveyReportedUseChange(materialId: number, workflowEntityState: WorkflowEntityState, changeNumberValue: number, surveyId: number, notes: string, userNotes: string, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'SurveyReportedUse';\r\n workflow.workflowPropertyName = 'kilogramsConsumed';\r\n workflow.workflowChangeValueNumber = changeNumberValue;\r\n workflow.workflowNotes = notes;\r\n workflow.workflowActionObjectId = surveyId;\r\n workflow.workflowActionPropertyName = 'surveyId';\r\n workflow.workflowUserNotes = userNotes;\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n switch (workflowEntityState) {\r\n case WorkflowEntityState.Added: {\r\n this.recordMaterialWorkflowActions(workflow, 'ADDED');\r\n break;\r\n }\r\n case WorkflowEntityState.Deleted: {\r\n this.recordMaterialWorkflowActions(workflow, 'DELETED');\r\n break;\r\n }\r\n case WorkflowEntityState.Modified: {\r\n this.recordMaterialWorkflowActions(workflow, 'MODIFIED');\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n public recordMaterialSurveyReportedUseUserNotesOnlyChange(materialId: number, workflowEntityState: WorkflowEntityState, surveyId: number, notes: string, userNotes: string, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'SurveyReportedUse';\r\n workflow.workflowPropertyName = 'userNotes';\r\n workflow.workflowNotes = notes;\r\n workflow.workflowActionObjectId = surveyId;\r\n workflow.workflowActionPropertyName = 'surveyId';\r\n workflow.workflowUserNotes = userNotes;\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'MODIFIED');\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // * Material Publications\r\n // * MaterialMonographs\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordMaterialMonographChange(materialId: number, workflowEntityState: WorkflowEntityState, fileName: string, materialMonographId: number, notes: string, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'MaterialMonograph';\r\n workflow.workflowChangeValueString \t= fileName;\r\n workflow.workflowNotes = notes;\r\n workflow.workflowActionObjectId = materialMonographId;\r\n workflow.workflowPropertyName = 'fileName';\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n switch (workflowEntityState) {\r\n case WorkflowEntityState.Added: {\r\n this.recordMaterialWorkflowActions(workflow, 'ADDED');\r\n break;\r\n }\r\n case WorkflowEntityState.Deleted: {\r\n this.recordMaterialWorkflowActions(workflow, 'DELETED');\r\n break;\r\n }\r\n case WorkflowEntityState.Modified: {\r\n this.recordMaterialWorkflowActions(workflow, 'MODIFIED');\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // * UVS File Actions\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordMaterialUVSFileAdded(materialId: number, workflowEntityState: WorkflowEntityState, fileName: string, analyticalResultId: number, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'AnalyticalResult';\r\n workflow.workflowPropertyName = 'uvsfile';\r\n workflow.workflowChangeValueString \t= fileName;\r\n workflow.workflowNotes = 'UVS file added. File name is: ' + fileName;\r\n workflow.workflowActionObjectId = analyticalResultId;\r\n workflow.workflowActionPropertyName = 'analyticalresultid';\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'ADDED');\r\n }\r\n\r\n // tslint:disable-next-line:max-line-length\r\n public recordMaterialUVSFileDeleted(materialId: number, workflowEntityState: WorkflowEntityState, fileName: string, analyticalResultId: number, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'AnalyticalResult';\r\n workflow.workflowPropertyName = 'uvsfile';\r\n workflow.workflowChangeValueString \t= fileName;\r\n workflow.workflowNotes = 'UVS file archived and removed. File name is: ' + fileName;\r\n workflow.workflowActionObjectId = analyticalResultId;\r\n workflow.workflowActionPropertyName = 'analyticalresultid';\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'DELETED');\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // * Material Data Changes\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordMaterialMonographNumberChange(materialId: number, workflowEntityState: WorkflowEntityState, monographNumberNew: number, monographNumberPrevious: number, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n const newMonographNumber = (monographNumberNew == null) ? 'unassigned' : '' + monographNumberNew;\r\n const previousMonographNumber = (monographNumberPrevious == null) ? 'unassigned' : '' + monographNumberPrevious;\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'Material';\r\n workflow.workflowPropertyName = 'monographNumber';\r\n workflow.workflowChangeValueNumber \t= monographNumberNew;\r\n workflow.workflowNotes = 'Monograph Number changed from ' + previousMonographNumber + ' to ' + newMonographNumber;\r\n workflow.workflowActionObjectId = materialId;\r\n workflow.workflowActionPropertyName = 'materialId';\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'MODIFIED');\r\n }\r\n\r\n public recordMaterialBotanicalPartChange(materialId: number, workflowEntityState: WorkflowEntityState, botanicalPartNew: string, botanicalPartPrevious: string, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n const newBotanicalPart \t\t= (this.isValidString(botanicalPartNew)) ? botanicalPartNew : 'unassigned';\r\n const previousBotanicalPart = (this.isValidString(botanicalPartPrevious)) ? botanicalPartPrevious : 'unassigned';\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'Material';\r\n workflow.workflowPropertyName = 'typeBotanicalSubdivisionId';\r\n workflow.workflowChangeValueString \t= botanicalPartNew;\r\n workflow.workflowNotes = 'Botanical part changed from ' + previousBotanicalPart + ' to ' + newBotanicalPart;\r\n workflow.workflowActionObjectId = materialId;\r\n workflow.workflowActionPropertyName = 'materialId';\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'MODIFIED');\r\n }\r\n\r\n public recordMaterialExtractTypeChange(materialId: number, workflowEntityState: WorkflowEntityState, extractTypeNew: string, extractTypePrevious: string, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n const newExtractType \t\t= (this.isValidString(extractTypeNew)) ? extractTypeNew : 'unassigned';\r\n const previousExtractType \t= (this.isValidString(extractTypePrevious)) ? extractTypePrevious : 'unassigned';\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'Material';\r\n workflow.workflowPropertyName = 'typeEssentialOilId';\r\n workflow.workflowChangeValueString \t= extractTypeNew;\r\n workflow.workflowNotes = 'Extract type changed from ' + previousExtractType + ' to ' + newExtractType;\r\n workflow.workflowActionObjectId = materialId;\r\n workflow.workflowActionPropertyName = 'materialId';\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'MODIFIED');\r\n }\r\n\r\n public recordMaterialFEMANumberChange(materialId: number, workflowEntityState: WorkflowEntityState, femaNumberNew: number, femaNumberPrevious: number, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n const newFEMANumber \t\t= (femaNumberNew == null) ? 'unassigned' : '' + femaNumberNew;\r\n const previousFEMANumber \t= (femaNumberPrevious == null) ? 'unassigned' : '' + femaNumberPrevious;\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'Material';\r\n workflow.workflowPropertyName = 'femaNumber';\r\n workflow.workflowChangeValueNumber \t= femaNumberNew;\r\n workflow.workflowNotes = 'FEMA Number changed from ' + previousFEMANumber + ' to ' + newFEMANumber;\r\n workflow.workflowActionObjectId = materialId;\r\n workflow.workflowActionPropertyName = 'materialId';\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'MODIFIED');\r\n }\r\n\r\n public recordMaterialRealCASNumberChange(materialId: number, workflowEntityState: WorkflowEntityState, realCASNumberNew: string, realCASNumberPrevious: string, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n const newCASNumber \t\t= (realCASNumberNew == null || realCASNumberNew == '') ? 'unassigned' : '' + realCASNumberNew;\r\n const previousCASNumber = (realCASNumberPrevious == null || realCASNumberPrevious == '') ? 'unassigned' : '' + realCASNumberPrevious;\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'Material';\r\n workflow.workflowPropertyName = 'realCASNumber';\r\n workflow.workflowChangeValueString \t= newCASNumber;\r\n workflow.workflowNotes = 'CAS Number changed from ' + previousCASNumber + ' to ' + newCASNumber;\r\n workflow.workflowActionObjectId = materialId;\r\n workflow.workflowActionPropertyName = 'materialId';\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'MODIFIED');\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // * Material Add and Delete\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordMaterialAdded(materialId: number, workflowEntityState: WorkflowEntityState, realCASNumber: string, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowMaterialId = materialId;\r\n workflow.workflowEntityName = 'Material';\r\n workflow.workflowPropertyName = 'realCASNumber';\r\n workflow.workflowChangeValueString \t= realCASNumber;\r\n workflow.workflowNotes = 'Material added';\r\n workflow.workflowActionObjectId = materialId;\r\n workflow.workflowActionPropertyName = 'materialId';\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'ADDED');\r\n }\r\n\r\n public recordMaterialDeleted(materialId: number, workflowEntityState: WorkflowEntityState, realCASNumber: string, userName: string) {\r\n\r\n const workflow = new WorkflowState();\r\n\r\n workflow.workflowMaterialId = null;\r\n workflow.workflowEntityName = 'Material';\r\n workflow.workflowPropertyName = 'realCASNumber';\r\n workflow.workflowChangeValueString \t= realCASNumber;\r\n workflow.workflowNotes = 'Attempt to delete Material with MaterialId: ' + materialId + ' and CAS Number: ' + realCASNumber;\r\n workflow.workflowActionObjectId = materialId;\r\n workflow.workflowActionPropertyName = 'materialId';\r\n workflow.workflowContactId = this.findWorkflowContactId(userName);\r\n\r\n this.recordMaterialWorkflowActions(workflow, 'DELETED');\r\n }\r\n\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n // * record activity\r\n // ----------------------------------------------------------------------------------------------------------------------------------\r\n public recordMaterialWorkflowActions(wfs: WorkflowState, entityState: string) {\r\n const transitions = this._typeWorkflowMaterialActionTransitions\r\n // tslint:disable-next-line:max-line-length\r\n .filter(w => w.entityName == wfs.workflowEntityName && w.entityState == entityState && ((w.propertyName == null && wfs.workflowPropertyName == null) || (w.propertyName == wfs.workflowPropertyName)));\r\n\r\n if (transitions != null && transitions.length > 0) {\r\n\r\n transitions.forEach(t => {\r\n this.createWorkflowMaterialRecordedAction(wfs, t.typeWorkflowMaterialActionId);\r\n });\r\n }\r\n }\r\n\r\n private createWorkflowMaterialRecordedAction(wfs: WorkflowState, actionCurrent: string, actionNext?: string) {\r\n const params = { typeWorkflowMaterialActionId: actionCurrent };\r\n\r\n const action = this._uow.workflowMaterialRecordedActionFactory.create(params);\r\n\r\n action.entityName = wfs.workflowEntityName;\r\n action.notes = wfs.workflowNotes;\r\n action.userNotes = wfs.workflowUserNotes;\r\n action.sequenceNumber = 1;\r\n\r\n if (wfs.workflowMaterialId != null) {\r\n action.materialId = wfs.workflowMaterialId;\r\n }\r\n\r\n if (wfs.workflowPropertyName != null) {\r\n action.propertyName = wfs.workflowPropertyName;\r\n }\r\n\r\n if (wfs.workflowChangeValueNumber != null) {\r\n action.changeValueNumber = wfs.workflowChangeValueNumber;\r\n }\r\n\r\n if (wfs.workflowChangeValueString != null) {\r\n action.changeValueString = wfs.workflowChangeValueString;\r\n }\r\n\r\n if (wfs.workflowActionObjectId != null) {\r\n action.actionObjectId = wfs.workflowActionObjectId;\r\n }\r\n\r\n if (wfs.workflowActionPropertyName != null) {\r\n action.actionPropertyName = wfs.workflowActionPropertyName;\r\n }\r\n\r\n if (actionNext != null) {\r\n action.completedWorkflowMaterialActionId = actionNext;\r\n }\r\n\r\n if (wfs.workflowContactId > 0) {\r\n action.createdWorkflowMaterialContactId = wfs.workflowContactId;\r\n }\r\n }\r\n\r\n public findWorkflowContactId(userName: string) {\r\n const contacts = this._typeWorkflowContacts.filter(c => c.emailAddress.toUpperCase() == userName.toUpperCase());\r\n\r\n if (contacts != null && contacts.length > 0) {\r\n return contacts[0].workflowContactId;\r\n }\r\n\r\n return 0;\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n}\r\n","\r\n\r\n
\r\n \r\n
\r\n\r\n

{{_validationMessage}}

\r\n\r\n
\r\n There are pending UV file changes that will be processed when the Save button is clicked.\r\n
\r\n\r\n
\r\n {{_finishedMessage}}\r\n {{_uvsFileSavedMessage}}\r\n
\r\n\r\n\r\n \r\n \r\n Procedure/Method\r\n Result\r\n Source\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\t \r\n\t {{'UVS' + (ix+1) + ' '}}\r\n\t \r\n
\r\n
\r\n \r\n
\r\n \r\n {{formatAnalyticalSource(ent)}}\r\n {{ent.analyticalSource}}\r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n","import { Component, OnInit, AfterViewInit, ViewChild, ChangeDetectorRef } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { ReferenceFinishState, ReferenceState, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { EditManager, IEditHost, UtilFns } from '../../utils/common';\r\n\r\nimport { AnalyticalResultComponent } from './analytical-result.component';\r\nimport { AnalyticalResult, Material, Reference, WorkflowMaterialRecordedAction} from '../../entities/EntityModels';\r\nimport { MaterialWorkflowService } from '../../services/material-workflow-service';\r\nimport { WorkflowEntityState } from '../../services/workflow-state';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\n\r\nimport * as _ from 'lodash';\r\n\r\nexport enum UVFileAction { NONE, ADD, DELETE }\r\n\r\nexport class UVFileData {\r\n addCount: number;\r\n uvFiles: { key: number, fileName: string, processType: UVFileAction, processResultMsg: string, analyticalResultId: number, fileData: any } [];\r\n}\r\n\r\nexport class ReferenceLink {\r\n public _referenceId: number;\r\n public _hasAddition: boolean;\r\n public _hasDeletion: boolean;\r\n\r\n constructor(referenceId?: number, hasAddition?: boolean, hasDeletion?: boolean) {\r\n this._referenceId = referenceId || null;\r\n this._hasAddition = hasAddition || false;\r\n this._hasDeletion = hasDeletion || false;\r\n }\r\n}\r\n\r\n@Component({\r\n selector: 'analytical-results',\r\n templateUrl: './analytical-results.html',\r\n providers: [MaterialWorkflowService],\r\n})\r\nexport class AnalyticalResultsComponent implements IEditHost, OnInit, AfterViewInit {\r\n @ViewChild(AnalyticalResultComponent) _editingComponent: AnalyticalResultComponent;\r\n\r\n _material: Material;\r\n _edm: EditManager;\r\n _edmWorkflowReferences: EditManager;\r\n _workflowLinkedReferences: ReferenceLink[] = [];\r\n _materialWorkflowService: MaterialWorkflowService;\r\n _finishedMessage: string;\r\n _uvsFileSavedMessage: string;\r\n _isLoading = false;\r\n _unfinishedRefs: string;\r\n _uvsFileURL: string;\r\n _validationMessage: string;\r\n\r\n public _data: UVFileData = new UVFileData();\r\n public _uvsAddedSuccessfully = false;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location, public _router: Router, private _userManager: UserManager,\r\n private _referenceState: ReferenceState, private changeDetectorRef: ChangeDetectorRef, private _httpClient: HttpClient, materialWorkflowService: MaterialWorkflowService) {\r\n this._materialWorkflowService = materialWorkflowService;\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.AnalyticalResults.name;\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Physical Data');\r\n this._material = this._stateMap.currentMaterial;\r\n\r\n this.fetch();\r\n\r\n // Reference Workflow\r\n this._edmWorkflowReferences = new EditManager(this, this._uow, this._stateMap, 'Workflow References');\r\n this._edmWorkflowReferences.entities = [];\r\n\r\n this.getDocumentManagementUrl().then(url => {\r\n this._stateMap.documentManagementBaseUrl = url; // Needs to be set if Material page is opened from an external link.\r\n this._uvsFileURL = this._stateMap.documentManagementBaseUrl + '/AnalyticalResults'; // needed for UVS file management\r\n });\r\n\r\n this.resetUVData();\r\n }\r\n\r\n fetch() {\r\n const p = {materialId: this._material.materialId};\r\n\r\n this._isLoading = true;\r\n\r\n return this._uow.analyticalResultRepository.whereWithParams(p).then(r => {\r\n const result = UtilFns.sort(r, true,\r\n (x: AnalyticalResult) => (x.typeAnalyticalProcedure && x.typeAnalyticalProcedure.analyticalProcedure) || '');\r\n this._edm.entities = result;\r\n this._edm.pageState.isLoaded = result;\r\n this._isLoading = false;\r\n }).catch(e => {\r\n this._edm.pageState.isLoaded = [];\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.changeDetectorRef.detectChanges();\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n selectAnalyticalResult(ar: AnalyticalResult) {\r\n this._edm.onSelect(ar);\r\n }\r\n\r\n getEntities() {\r\n if (this.isStaff()) {\r\n return this._edm.entities;\r\n } else {\r\n return this._edm.entities.filter(a => a.reference == null || a.reference.complete);\r\n }\r\n }\r\n\r\n get analyticalResults() {\r\n if (this.isStaff()) {\r\n return this._edm.entities;\r\n } else {\r\n return this._edm.entities.filter(a => a.reference == null || a.reference.complete);\r\n }\r\n }\r\n\r\n hasAnalyticalResults(): boolean {\r\n if (this._edm.entities == null || this._edm.entities.length == 0) {\r\n return false;\r\n }\r\n\r\n if (this.isStaff()) { return true; }\r\n\r\n const subscriberData = this._edm.entities.filter(a => a.reference == null || a.reference.complete);\r\n return (subscriberData != null && subscriberData.length > 0);\r\n }\r\n\r\n navToRef(ar: AnalyticalResult) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, ar.reference.referenceId));\r\n }\r\n\r\n stopProp(event: Event) {\r\n event.stopPropagation();\r\n }\r\n\r\n formatAnalyticalSource(ar: AnalyticalResult) {\r\n try {\r\n return Reference.formatBriefReference(ar.analyticalSource, this.isStaff());\r\n } catch (e) {\r\n return ar.analyticalSource;\r\n }\r\n }\r\n\r\n private downloadReport(fileName: string, event: any) {\r\n const url = this._userManager.getUVUrl(fileName);\r\n window.open(url);\r\n event.stopPropagation();\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n onApply() {\r\n // HACK\r\n const r = this._edm.onApplyCore();\r\n const x = this._edm.entities;\r\n this._edm.entities = null;\r\n setTimeout(() => this._edm.entities = x, 0);\r\n return r;\r\n }\r\n\r\n onAdd() {\r\n if (this._edm.editing && this._editingComponent) {\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n }\r\n\r\n if (this._data.uvFiles != null && this._data.uvFiles.length > 0) {\r\n const addedFiles = this._data.uvFiles.filter(u => u.processType == UVFileAction.ADD);\r\n if (addedFiles) {\r\n this._data.addCount = addedFiles.length;\r\n }\r\n }\r\n\r\n const entity = this._uow.analyticalResultFactory.create();\r\n entity.materialID = this._material.materialId;\r\n this._edm.entities.push(entity);\r\n this._edm.onSelect(entity);\r\n }\r\n\r\n onSave() {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n\r\n // right now only for UVS file activity\r\n this.recordMaterialWorkflowActivity();\r\n\r\n return this.recordWorkflowChanges().then(s => {\r\n this._edmWorkflowReferences.onSaveCore()\r\n .then(async () => {\r\n this._edm.onSaveCore();\r\n\r\n if (this._unfinishedRefs) {\r\n this._finishedMessage = 'These References are now marked Unfinished and need checked: ' + this._unfinishedRefs;\r\n }\r\n\r\n // process UVS file requests\r\n if (this.hasUVFileChanges()) {\r\n this._uvsFileSavedMessage = '';\r\n let result: any;\r\n for (let idx = 0; idx < this._data.uvFiles.length; idx++) {\r\n const processType = this._data.uvFiles[idx].processType;\r\n\r\n switch (processType) {\r\n case UVFileAction.ADD: {\r\n result = await this.addUVFile(idx);\r\n break;\r\n }\r\n case UVFileAction.DELETE: {\r\n result = await this.removeUVFile(this._data.uvFiles[idx].fileName);\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n\r\n this._data.uvFiles[idx].processResultMsg = result;\r\n\r\n }\r\n }\r\n\r\n this._uvsFileSavedMessage = this._data.uvFiles.filter(m => m.processResultMsg).map(m => m.processResultMsg).join(', ');\r\n\r\n this.resetUVData();\r\n\r\n }\r\n\r\n // refresh Material physical properties\r\n return this.fetch();\r\n\r\n this._isLoading = false;\r\n });\r\n });\r\n }\r\n\r\n // Record deletions of linked references in workflow\r\n onDelete() {\r\n const analyticalResultId = this._edm.currentEntity.analyticalResultId;\r\n\r\n if (this._edm.currentEntity.reference != null) {\r\n\r\n if (this._edmWorkflowReferences.entities == null) {\r\n this._edmWorkflowReferences.entities = [];\r\n }\r\n\r\n this.fetchDeletedLinkedReference(this._edm.currentEntity.reference.referenceId).then(r => {\r\n\r\n if (this.indexOfEditReference(r.referenceId, this._edmWorkflowReferences.entities) == -1) {\r\n this._edmWorkflowReferences.entities.push(r);\r\n this._workflowLinkedReferences.push(new ReferenceLink(r.referenceId, false, true));\r\n } else { // If it exists in the _edmWorkflowReferences then it should already be in the _workflowLinkedReferences array\r\n const idx = this.indexOfReferenceLink(r.referenceId, this._workflowLinkedReferences);\r\n this._workflowLinkedReferences[idx]._hasDeletion = true;\r\n }\r\n\r\n });\r\n }\r\n\r\n this._edm.onDeleteCore();\r\n\r\n // mark all assigned uv files for deletion on save and record deletions in the material workflow history\r\n const files = this._data.uvFiles.filter(f => f.analyticalResultId == analyticalResultId && f.processType != UVFileAction.ADD);\r\n if (files != null && files.length > 0) {\r\n files.forEach(f => {\r\n f.processType = UVFileAction.DELETE;\r\n });\r\n }\r\n }\r\n\r\n // This will include the related WorkflowRecordedAction records\r\n private fetchDeletedLinkedReference(referenceId: number): Promise {\r\n return this._uow.referenceRepository.withId(referenceId);\r\n }\r\n\r\n onCancel() {\r\n if (this._edm.editing) {\r\n const analyticalResultId = this._edm.currentEntity.analyticalResultId;\r\n const currentFileData = _.clone(this._data.uvFiles);\r\n this._data.uvFiles = currentFileData.splice(currentFileData.findIndex(a => a.analyticalResultId === analyticalResultId), 1);\r\n }\r\n\r\n this._edmWorkflowReferences.entities = [];\r\n this._workflowLinkedReferences = [];\r\n\r\n this._edm.onCancelCore();\r\n\r\n this.resetUVData();\r\n }\r\n\r\n private recordWorkflowChanges(): Promise {\r\n this._finishedMessage = '';\r\n this._unfinishedRefs = '';\r\n\r\n this.markWorkflowAdds();\r\n\r\n const func = this.processWorkflowItem.bind(this);\r\n\r\n const promises = this._workflowLinkedReferences.map(function (reflink) {\r\n return func(reflink);\r\n });\r\n\r\n return Promise.all(promises);\r\n }\r\n\r\n private markWorkflowAdds() {\r\n\r\n const changedEntities = this._edm.entities;\r\n if (changedEntities == null || changedEntities.length == 0) {\r\n return Promise.resolve(true);\r\n }\r\n\r\n if (this._edmWorkflowReferences.entities == null) {\r\n this._edmWorkflowReferences.entities = [];\r\n }\r\n\r\n changedEntities.forEach(e => {\r\n if (e.entityAspect.entityState.isAdded() || e.entityAspect.entityState.isModified()) {\r\n if (e.reference != null) {\r\n if (this.indexOfEditReference(e.referenceId, this._edmWorkflowReferences.entities) == -1) {\r\n this._edmWorkflowReferences.entities.push(e.reference);\r\n this._workflowLinkedReferences.push(new ReferenceLink(e.referenceId, true, false));\r\n } else { // If it exists in the _edmWorkflowReferences then it should already be in the _workflowLinkedReferences array\r\n const idx = this.indexOfReferenceLink(e.referenceId, this._workflowLinkedReferences);\r\n this._workflowLinkedReferences[idx]._hasAddition = true;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n public processWorkflowItem(reflink: ReferenceLink): Promise {\r\n\r\n const idx = this.indexOfEditReference(reflink._referenceId, this._edmWorkflowReferences.entities);\r\n\r\n if (reflink._hasAddition) {\r\n this._referenceState.recordAnalyticalResultAdd(this._edmWorkflowReferences.entities[idx], this._material.materialId);\r\n }\r\n\r\n if (reflink._hasDeletion) {\r\n this._referenceState.recordAnalyticalResultDelete(this._edmWorkflowReferences.entities[idx], this._material.materialId);\r\n this._referenceState\r\n .reconcileLinkedAnalyticalResultDeletesWithPendingActions(this._edmWorkflowReferences.entities[idx], this._edmWorkflowReferences.entities[idx].analyticalResults);\r\n }\r\n\r\n // AnalyticalResult records can be linked to a Reference for UV Spectra Observations.\r\n // Adding or Deleting linked References can affect the Finished state of the record.\r\n return this.checkWorkflowItemFinishedState(idx);\r\n }\r\n\r\n private checkWorkflowItemFinishedState(idx: number): Promise {\r\n return this._referenceState.isReferenceFinished(this._edmWorkflowReferences.entities[idx]).then(f => {\r\n const finished: boolean = (f == ReferenceFinishState.MissingData) ? false : true;\r\n\r\n if (finished != this._edmWorkflowReferences.entities[idx].finished) {\r\n this._edmWorkflowReferences.entities[idx].finished = finished;\r\n this._referenceState.recordReferenceFinishedStateChange(this._edmWorkflowReferences.entities[idx]);\r\n if (this._unfinishedRefs) {\r\n this._unfinishedRefs = ', ' + this._edmWorkflowReferences.entities[idx].referenceId.toString();\r\n } else {\r\n this._unfinishedRefs = this._edmWorkflowReferences.entities[idx].referenceId.toString();\r\n }\r\n }\r\n });\r\n }\r\n\r\n private indexOfReferenceLink(referenceId: number, data: ReferenceLink[]): number {\r\n if (data == null || data.length == 0) {\r\n return -1;\r\n }\r\n\r\n let idx = data.length;\r\n while (idx--) {\r\n if (data[idx]._referenceId === referenceId) {\r\n return idx;\r\n }\r\n }\r\n return -1;\r\n }\r\n\r\n private indexOfEditReference(referenceId: number, data: Reference[]): number {\r\n if (data == null || data.length == 0) {\r\n return -1;\r\n }\r\n\r\n let idx = data.length;\r\n while (idx--) {\r\n if (data[idx].referenceId === referenceId) {\r\n return idx;\r\n }\r\n }\r\n return -1;\r\n }\r\n\r\n // UVS file links\r\n public downloadUVSFile(fileName: string) {\r\n if (fileName) {\r\n this.exportUVSFile(fileName);\r\n }\r\n }\r\n\r\n public referenceFinishedStatesHaveChanged(): boolean {\r\n return (this._finishedMessage && this._finishedMessage.length > 0);\r\n }\r\n\r\n // uva and uvs file logic\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n public showUVFileMessage() {\r\n return (!this._edm.editing && this._edm.hasEdits() && this.hasUVFileChanges() );\r\n }\r\n\r\n // ************************************************************************\r\n // uv file related methods\r\n // ************************************************************************\r\n hasUVFileChanges() {\r\n if (this._data.uvFiles == null || this._data.uvFiles.length == 0) {\r\n return false;\r\n }\r\n const files = this._data.uvFiles.filter(f => f.processType != UVFileAction.NONE);\r\n return (files != null && files.length > 0);\r\n }\r\n\r\n recordMaterialWorkflowActivity() {\r\n if (this.hasUVFileChanges()) {\r\n for (let idx = 0; idx < this._data.uvFiles.length; idx++) {\r\n const processType = this._data.uvFiles[idx].processType;\r\n\r\n switch (processType) {\r\n case UVFileAction.ADD: {\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialUVSFileAdded(this._material.materialId, WorkflowEntityState.Added, this._data.uvFiles[idx].fileName, this._data.uvFiles[idx].analyticalResultId, this._userManager.currentUser.name);\r\n break;\r\n }\r\n case UVFileAction.DELETE: {\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialUVSFileDeleted(this._material.materialId, WorkflowEntityState.Deleted, this._data.uvFiles[idx].fileName, this._data.uvFiles[idx].analyticalResultId, this._userManager.currentUser.name);\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n resetUVData() {\r\n this._data.addCount = 0;\r\n this._data.uvFiles = [];\r\n this._validationMessage = '';\r\n }\r\n\r\n // ************************************************************************\r\n // web api calls\r\n // ************************************************************************\r\n getAddUVDocumentURL(fileIdx: number): Observable {\r\n const url = this._uvsFileURL + '/UploadUVFile';\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n\r\n const formData: FormData = new FormData();\r\n formData.append('materialId', this._edm.currentEntity.materialID + '');\r\n formData.append('fileName', this._data.uvFiles[fileIdx].fileName);\r\n formData.append('file', this._data.uvFiles[fileIdx].fileData);\r\n\r\n return this._httpClient.post(url, formData);\r\n }\r\n\r\n public addUVFile(fileIdx: number): Observable {\r\n const subject = new Subject();\r\n this.getAddUVDocumentURL(fileIdx)\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n subject.next('Error occurred: ' + data.ExceptionMessage);\r\n } else {\r\n subject.next('File was processed successfully.');\r\n }\r\n },\r\n (error) => {\r\n subject.next(error.message);\r\n });\r\n\r\n return subject.asObservable();\r\n }\r\n\r\n getRemoveUVFileURL(fileName: string): Observable {\r\n const url = this._uvsFileURL + '/Remove?fileName=' + fileName;\r\n\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n return this._httpClient.post(url, { });\r\n }\r\n\r\n public removeUVFile(fileName: string): Observable {\r\n const subject = new Subject();\r\n this._isLoading = true;\r\n\r\n this.getRemoveUVFileURL(fileName)\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n this._uvsFileSavedMessage = 'Error occurred, unable to remove the file: ' + data.ExceptionMessage;\r\n subject.next('Error occurred, unable to remove the file: ' + data.ExceptionMessage);\r\n }\r\n\r\n this._uvsFileSavedMessage = 'UV File archived and removed successfully.';\r\n subject.next('UV File archived and removed successfully.');\r\n },\r\n (error) => {\r\n subject.next(error.message);\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n\r\n return subject.asObservable();\r\n }\r\n\r\n getDownloadFileURL(fileName: string): Observable {\r\n const url = this._uvsFileURL + '/GetUVFileByName?fileName=' + fileName;\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public exportUVSFile(fileName: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getDownloadFileURL(fileName)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = 'File download successful.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap } from '../../services/common';\r\nimport { LocationFns } from '../../utils/common';\r\nimport { TabContainer } from '../../controls/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { Material } from '../../entities/Material';\r\n\r\n@Component({\r\n selector: 'toxic-data',\r\n templateUrl: './toxic-data.html',\r\n})\r\nexport class ToxicDataComponent implements OnInit, AfterViewInit {\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n\r\n material: Material;\r\n _materialIds: number[];\r\n _tab: number;\r\n\r\n constructor(public _stateMap: StateMap, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n this._materialIds = [this._stateMap.currentMaterial.materialId];\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.ToxicData.name;\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n }\r\n\r\n ngAfterViewInit() {\r\n setTimeout(() => {\r\n this._tabContainer.selectTab(this._tab);\r\n }, 1);\r\n }\r\n}\r\n","\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { LocationFns } from '../../utils/common';\r\nimport { TabContainer } from '../../controls/tab-container';\r\n\r\nimport { Material } from '../../entities/Material';\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\n\r\n@Component({\r\n templateUrl: './flavor.html',\r\n})\r\nexport class FlavorComponent implements OnInit, AfterViewInit {\r\n material: Material;\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n _tab: number;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n }\r\n\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Flavor.name;\r\n\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n }\r\n\r\n ngAfterViewInit() {\r\n if (this._tab != 0) {\r\n setTimeout(() => this._tabContainer.selectTab(this._tab), 0);\r\n }\r\n }\r\n\r\n canDeactivate() {\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n}\r\n","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'print-to-pdf-doc',\r\n templateUrl: './print-to-pdf-doc.html',\r\n\r\n})\r\nexport class PrintToPdfDocComponent {\r\n\r\n showModal(): Promise {\r\n const ele = PrintToPdfDocComponent.getModalEle();\r\n const p = new Promise((resolve) => {\r\n ele.modal({backdrop: 'static', keyboard: false}).on('hidden.bs.modal', () => {\r\n resolve(true);\r\n });\r\n });\r\n return p;\r\n }\r\n\r\n static getModalEle(): any {\r\n return $('#dialog-root');\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n How to print to PDF\r\n \r\n
\r\n
\r\n
\r\n Print any report in PDF format directly from the browser. Listed below are steps to print them\r\n in each of the supported browsers.\r\n
\r\n
\r\n
\r\n On Google Chrome:
(1) Click the Print button seen on Reports or in the Header to see a\r\n dialog pop-up that allows printing.

(2) Set the Destination printer to Microsoft Print as\r\n PDF and then click on the Print button.

\r\n \r\n

(3) A dialog called Save Print Output As should pop-up. On this dialog, specify a location\r\n and filename for the PDF document, and click on Save to generate a PDF document.

\r\n \r\n
\r\n
\r\n
\r\n On Microsoft Edge:
(1) Click the Print button seen on Reports or in the Header to see a\r\n dialog pop-up that allows printing.

(2) Set the Printer to Microsoft Print to PDF and then\r\n click on the Print button.

\r\n \r\n

(3) A dialog called Save Print Output As should pop-up. On this dialog, specify a location\r\n and filename for the PDF document, and click on Save to generate a PDF document.

\r\n \r\n
\r\n
\r\n
\r\n On Firefox:
(1) Click the Print button seen on Reports or in the Header to see a dialog\r\n pop-up that allows printing.

(2) Set the Printer Name to Microsoft Print to PDF and then\r\n click OK.

\r\n \r\n

(3) A dialog called Save Print Output As should pop-up. On this dialog, specify a location\r\n and filename for the PDF document, and click on Save to generate a PDF document.

\r\n \r\n
\r\n
\r\n
\r\n On Internet Explorer 11:
(1) Click the Print button seen on Reports or in the Header to\r\n see a dialog pop-up that allows printing.

(2) In the Select printer section, check the checkbox\r\n for Microsoft Print to PDF and then click on the Print button.

\r\n \r\n

(3) A dialog called Save Print Output As should pop-up. On this dialog, specify a location\r\n and filename for the PDF document, and click on Save to generate a PDF document.

\r\n \r\n
\r\n
\r\n
\r\n On Internet Explorer 10:
(1) Click the Print button seen on Reports or in the Header to\r\n see a dialog pop-up that allows printing.

(2) In the Select printer section, select item\r\n Send to OneNote 2007 and then click on the Print button.

\r\n \r\n

(3) This should launch OneNote. Click on this, and go to the File menu. Here onwards, at\r\n least two options are available to convert the document to PDF format. The first option involves installing\r\n a OneNote plug-in that allows publishing the document as a PDF. See below:

\r\n \r\n

(4) The second option would be to save the document as a Microsoft Word document, and then\r\n use any available plug-in to convert from Microsoft Word to PDF. Saving the document using any of these\r\n options should generate a PDF.

\r\n \r\n

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n","import { Directive, ElementRef, Input, OnChanges } from '@angular/core';\r\n\r\n// Example:\r\n//
\r\n@Directive({\r\n selector: '[chemFormula]',\r\n})\r\nexport class ChemFormulaDirective implements OnChanges {\r\n @Input() chemFormula: string;\r\n\r\n constructor(public _el: ElementRef) {\r\n }\r\n\r\n ngOnChanges() {\r\n const newVal = this.translateToUseSubscripts(this.chemFormula);\r\n this._el.nativeElement.innerHTML = newVal;\r\n\r\n }\r\n\r\n translateToUseSubscripts(chemFormula: string) {\r\n if (chemFormula == null || chemFormula.length === 0) {\r\n return chemFormula;\r\n }\r\n const parts = chemFormula.split(/(\\d*)/);\r\n const tparts = parts.map(p => {\r\n p.startsWith('');\r\n if (p.match(/\\d/)) {\r\n return '' + p + '';\r\n } else {\r\n return p;\r\n }\r\n });\r\n return tparts.join('');\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n Synopis Report\r\n \r\n Generated on: {{ _stateMap.utilFns.formatDate(_reportDate) }} \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n

\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
SynonymsUse
{{s.useList}}
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
CAS No.RIFM IDFEMAEC No./EINECS/ELINCSMETI/ENCSECLRegistration
{{_material.realCASNumber || '(No CAS#)'}}{{_material.formattedRIFMId}}{{_material.fEMANumber}}{{_material.eCInventoryEINECSELINCSNumbers()}}{{_material.mETIENCS()}}{{_material.eCL}}{{_material.registrationText()}}
\r\n\r\n
0\">\r\n Alternative Identifiers\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Alt. CAS No.EC No.ECLEINECSRegistration
{{m.cASNumber}}\r\n {{m.eCInventoryNumber}}\r\n {{m.eCL}}\r\n {{m.eINECSNumber}}\r\n \r\n DSL\r\n ECN\r\n EINECS\r\n NDSL\r\n REACH\r\n TSCA\r\n
\r\n
\r\n\r\n
\r\n RIFM Monograph:\r\n {{_material.monographReference}}\r\n
\r\n\r\n
\r\n \"[Structure\r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Formula:
Structure:{{_material.structure}}
Weight:{{_material.molecularWeightWithUnit}}
Smiles:{{_material.smiles}}
Generic Class:{{_material.typeTscaClass?.genericClass}}
Description:{{_material.materialDescription}}
\r\n\r\n

Physical Data

\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Procedure/MethodObserved ResultSourceSample
{{a.analyticalSource}}{{a.analyticalSample}}
\r\n\r\n
\r\n\r\n

Flavor Consumption (in kg)

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
YearGeographyConsumed
{{fc.survey?.surveyYear}}{{fc.survey?.typeGeographicalArea?.geographicalArea}}{{fc.kilogramsConsumed}}
\r\n
\r\n\r\n
\r\n

Uses

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
ProductAverageUsual (ppm)AverageMaximum (ppm)MeanDailyConsumption (gms)Updated
{{u.typeFoodCategory?.foodDescription}}{{u.averageUsual}}{{u.averageMaximum}}{{u.typeFoodCategory?.meanDailyConsumption}}{{ _stateMap.utilFns.formatDate(u.modified) }}
\r\n
\r\n\r\n
\r\n

Flavor Status

\r\n
\r\n {{st.agencyTitle()}}: \r\n {{st.prefixedDetermination()}} {{st.linkDisplay}}\r\n
\r\n
\r\n\r\n
\r\n

IFRA Status

\r\n
\r\n {{st.agencyTitle()}}: \r\n {{st.prefixedDetermination()}} {{st.linkDisplay}}\r\n
\r\n
\r\n\r\n
\r\n

Occupational Status

\r\n
\r\n {{st.agencyTitle()}}: \r\n {{st.prefixedDetermination()}} {{st.linkDisplay}}\r\n
\r\n
\r\n\r\n
0\">\r\n

Human Health Data

\r\n
\r\n

{{em.studyLong()}}

\r\n
\r\n Study: {{em.studyLong()}}\r\n \r\n        {{stDescr}}
\r\n
\r\n Route: \r\n Species: \r\n Protocol: {{em.biologicalData?.protocol || '-'}}\r\n 0 \" style=\"display:block\">Summary: {{em.biologicalData?.comment}}\r\n \r\n Subjects:\r\n \r\n {{em.biologicalData?.subjectsMale}}\r\n \r\n {{em.biologicalData?.subjectsFemale}}\r\n \r\n {{em.biologicalData?.subjectsUnspecifiedSex}}\r\n \r\n
\r\n Study Length:\r\n {{em.biologicalData?.studyLength}}\r\n {{em.biologicalData?.typeTimeUnitId}}\r\n
\r\n Compliance: {{em.biologicalData?.compliance}}\r\n Details: {{em.experimentalDetails}}\r\n FFDS Statement: {{em.fFDSStatement}}\r\n Sample: {{em.sampleText}}\r\n Vehicle: {{em.typeExperimentVehicle?.vehicle}}\r\n Result Type: {{em.calculatedResultTypeAndValue}}\r\n Contains Mixture: {{em.typeStudyMixture?.description}}\r\n
\r\n
\r\n
\r\n
\r\n Dose: {{er.formattedDose()}} Effects: {{er.toxicEffects()}}\r\n Results: {{er.resultNote}}\r\n Vehicle: {{er.typeExperimentVehicle?.vehicle}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n Reference: {{em.biologicalData?.reference?.description(isStaff())}}\r\n Sub-Reference: {{em.biologicalData.subReference}}\r\n {{em.biologicalData?.reference?.finishedText()}}\r\n
\r\n
\r\n
\r\n\r\n
0\">\r\n

Environmental Data

\r\n
\r\n

{{em.studyLong()}}

\r\n
\r\n Study: {{em.studyLong()}}\r\n Route: \r\n Species: \r\n Protocol: {{em.biologicalData?.protocol || '-'}}\r\n 0 \" style=\"display:block\">Summary: {{em.biologicalData?.comment}}\r\n \r\n Subjects:\r\n \r\n {{em.biologicalData?.subjectsMale}}\r\n \r\n {{em.biologicalData?.subjectsFemale}}\r\n \r\n {{em.biologicalData?.subjectsUnspecifiedSex}}\r\n \r\n
\r\n Study Length:\r\n {{em.biologicalData?.studyLength}}\r\n {{em.biologicalData?.typeTimeUnitId}}\r\n
\r\n Compliance: {{em.biologicalData?.compliance}}\r\n Details: {{em.experimentalDetails}}\r\n FFDS Statement: {{em.fFDSStatement}}\r\n Sample: {{em.sampleText}}\r\n Vehicle: {{em.typeExperimentVehicle?.vehicle}}\r\n Result Type: {{em.calculatedResultTypeAndValue}}\r\n Contains Mixture: {{em.typeStudyMixture?.description}}\r\n
\r\n
\r\n
\r\n
\r\n Dose: {{er.formattedDose()}} Effects: {{er.toxicEffects()}}\r\n Results: {{er.resultNote}}\r\n Vehicle: {{er.typeExperimentVehicle?.vehicle}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n Reference: {{em.biologicalData?.reference?.description(isStaff())}}\r\n Sub-Reference: {{em.biologicalData.subReference}}\r\n {{em.biologicalData?.reference?.finishedText()}}\r\n
\r\n
\r\n
\r\n\r\n
\r\n

References

\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n\r\n","import { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { MolImageService, StateMap, UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\nimport { PrintToPdfDocComponent } from '../main/print-to-pdf-doc.component';\r\n\r\nimport {\r\n ExperimentalMaterial,\r\n Material,\r\n MaterialAdditionalIdentifier,\r\n MaterialConsumption,\r\n MaterialUses,\r\n RegulatoryStatus\r\n} from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'synopsis-report',\r\n templateUrl: './synopsis-report.html',\r\n})\r\nexport class SynopsisReportComponent implements OnInit {\r\n @ViewChild(PrintToPdfDocComponent, { static: true }) _printToPdfDocComponent: PrintToPdfDocComponent;\r\n\r\n @Input() _material: Material;\r\n @Input() _typeStudyIds: string[];\r\n @Input() _expMats: ExperimentalMaterial[];\r\n @Input() _pageState: PageState;\r\n @Input() _rifmAsAuthorOnly: boolean;\r\n\r\n _reportDate: Date;\r\n _flavorConsumptions: MaterialConsumption[];\r\n _uses: MaterialUses[];\r\n _flavorStatuses: RegulatoryStatus[];\r\n _ifraStatuses: RegulatoryStatus[];\r\n _occupationalStatuses: RegulatoryStatus[];\r\n _hhExpMats: ExperimentalMaterial[];\r\n _envExpMats: ExperimentalMaterial[];\r\n _refCitations: string[];\r\n _matIds: MaterialAdditionalIdentifier[];\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _molImageService: MolImageService) {\r\n }\r\n\r\n ngOnInit() {\r\n this.fetch();\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n fetch() {\r\n this._reportDate = new Date();\r\n const materialId = this._material.materialId;\r\n\r\n const pFlc = {materialId: materialId, materialType: 'flavor'};\r\n this._uow.materialConsumptionRepository.whereWithParams(pFlc).then(r => {\r\n this._flavorConsumptions = r;\r\n this._pageState.isLoading = false;\r\n });\r\n\r\n const pUses = {materialId: materialId};\r\n this._uow.materialUsesRepository.whereWithParams(pUses).then(r => {\r\n this._uses = r;\r\n });\r\n\r\n const pFlavor = {materialId: materialId, statusType: 'flavor'};\r\n this._uow.regulatoryStatusRepository.whereWithParams(pFlavor).then(r => {\r\n this._flavorStatuses = r;\r\n });\r\n\r\n const pIfra = {materialId: materialId, statusType: 'ifra'};\r\n this._uow.regulatoryStatusRepository.whereWithParams(pIfra).then(r => {\r\n this._ifraStatuses = r;\r\n });\r\n\r\n const pOcc = {materialId: materialId, statusType: 'occupational'};\r\n this._uow.regulatoryStatusRepository.whereWithParams(pOcc).then(r => {\r\n this._occupationalStatuses = r;\r\n });\r\n\r\n const pMatIds = {materialId: materialId};\r\n this._uow.fetchTyped('Materials/MaterialAdditionalIdentifierForMaterial', MaterialAdditionalIdentifier, pMatIds).then(r => {\r\n this._matIds = r;\r\n });\r\n\r\n if (this._rifmAsAuthorOnly) {\r\n const params = {materialId: materialId};\r\n this._uow.fetch('Misc/GetRIFMAsAuthorReferenceIds', params).then(r => {\r\n if (r && r.length > 0) {\r\n this.filterExpMatsForRIFMAsAuthor(r);\r\n }\r\n });\r\n } else {\r\n this.filterExpMats();\r\n }\r\n\r\n }\r\n\r\n filterExpMats() {\r\n let expMats = this._expMats;\r\n if (this._typeStudyIds != null) {\r\n expMats = expMats.filter(x => this._typeStudyIds.indexOf(x.biologicalData.typeStudyId) >= 0);\r\n }\r\n this._hhExpMats = expMats.filter(x => x.biologicalData.humanHealthData);\r\n if (this._hhExpMats) {\r\n this._hhExpMats.forEach(em => {\r\n UtilFns.sortNumeric(em.experimentalResults, true, (expRes) => {\r\n return expRes.dose;\r\n });\r\n });\r\n }\r\n\r\n this._envExpMats = expMats.filter(x => x.biologicalData.environmentalData);\r\n if (this._envExpMats) {\r\n this._envExpMats.forEach(em => {\r\n UtilFns.sortNumeric(em.experimentalResults, true, (expRes) => {\r\n return expRes.dose;\r\n });\r\n });\r\n }\r\n\r\n const refs = expMats.map(em => em.biologicalData.reference);\r\n const citations = _.uniq(refs).map(r => r.citationText(this.isStaff()));\r\n this._refCitations = _.sortBy(citations);\r\n }\r\n\r\n filterExpMatsForRIFMAsAuthor(referenceIds: number[]) {\r\n let expMats = this._expMats;\r\n if (this._typeStudyIds != null) {\r\n expMats = expMats.filter(x => this._typeStudyIds.indexOf(x.biologicalData.typeStudyId) >= 0 && referenceIds.indexOf(x.biologicalData.referenceId) >= 0);\r\n } else {\r\n expMats = expMats.filter(x => referenceIds.indexOf(x.biologicalData.referenceId) >= 0);\r\n }\r\n this._hhExpMats = expMats.filter(x => x.biologicalData.humanHealthData);\r\n if (this._hhExpMats) {\r\n this._hhExpMats.forEach(em => {\r\n UtilFns.sortNumeric(em.experimentalResults, true, (expRes) => {\r\n return expRes.dose;\r\n });\r\n });\r\n }\r\n\r\n this._envExpMats = expMats.filter(x => x.biologicalData.environmentalData);\r\n if (this._envExpMats) {\r\n this._envExpMats.forEach(em => {\r\n UtilFns.sortNumeric(em.experimentalResults, true, (expRes) => {\r\n return expRes.dose;\r\n });\r\n });\r\n }\r\n\r\n const refs = expMats.map(em => em.biologicalData.reference);\r\n const citations = _.uniq(refs).map(r => r.citationText(this.isStaff()));\r\n this._refCitations = _.sortBy(citations);\r\n }\r\n\r\n printReport() {\r\n // need to insure that we get to an element below the bootstrap modal styling.\r\n const ele = document.querySelector('#SynopsisReport .modal-content');\r\n UtilFns.printElement(ele);\r\n }\r\n\r\n getSmileUrl(material: Material) {\r\n if (material.smiles == null) {\r\n return null;\r\n }\r\n return this._molImageService.getImageUrlForSmile(material.smiles);\r\n }\r\n\r\n\r\n showPrintToPdfDoc() {\r\n setTimeout(() => {\r\n this._printToPdfDocComponent.showModal();\r\n }, 0);\r\n }\r\n}\r\n\r\n","
\r\n

Synopsis Report

\r\n
\r\n \r\n \r\n
\r\n
\r\n Study Types \r\n  \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n {{_largeResultMessage}}\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{ts.typeStudy.studyLong}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { IBrowser, UtilFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { SynopsisReportComponent } from './synopsis-report.component';\r\nimport { ExperimentalMaterial, Material, TypeStudy } from '../../entities/EntityModels';\r\n\r\ninterface TypeStudySelector {\r\n typeStudy: TypeStudy;\r\n selected: boolean;\r\n}\r\n\r\n@Component({\r\n selector: 'synopsis',\r\n templateUrl: './synopsis.html',\r\n})\r\nexport class SynopsisComponent implements OnInit {\r\n @ViewChild(SynopsisReportComponent) _synopsisReportComponent: SynopsisReportComponent;\r\n\r\n _material: Material;\r\n _pageState = new PageState('Synopsis');\r\n _typeStudies: TypeStudySelector[];\r\n _typeStudyIds: string[];\r\n _canShowReport = false;\r\n _expMats: ExperimentalMaterial[];\r\n _browser: IBrowser;\r\n _largeResultMessage: string;\r\n _rifmAsAuthorOnly = false;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Synopsis.name;\r\n this._material = this._stateMap.currentMaterial;\r\n let studyIds: string[];\r\n const pEm = {materialId: this._material.materialId};\r\n this._pageState.isLoading = true;\r\n this._uow.fetchTyped('Materials/FullExperimentalMaterials', ExperimentalMaterial, pEm).then(r => {\r\n this._expMats = _.sortBy(r, x => x.biologicalData.typeStudy.studyLong);\r\n studyIds = _.uniq(this._expMats.map(em => em.typeStudyId()));\r\n this.checkIfTooLarge();\r\n return this._uow.typeStudyRepository.all();\r\n }).then((r) => {\r\n r = r.filter(ts => studyIds.indexOf(ts.typeStudyId) != -1);\r\n r = _.sortBy(r, x => x.studyLong);\r\n this._typeStudies = r.map(item => {\r\n typeStudy: item,\r\n selected: true\r\n });\r\n this._pageState.isLoaded = true;\r\n }).catch(() => {\r\n this._pageState.isLoaded = false;\r\n });\r\n }\r\n\r\n checkIfTooLarge() {\r\n if (this._expMats.length < 500) {\r\n return;\r\n }\r\n this._browser = UtilFns.detectBrowser();\r\n if (this._browser.isEdge || this._browser.isChrome) {\r\n // chrome and edge can handle larger sizes than the other browsers.\r\n if (this._expMats.length < 1000) {\r\n return;\r\n }\r\n }\r\n this._largeResultMessage = `Generating this report for all Study Types may take awhile. Please consider selecting just a subset of the existing study types`;\r\n\r\n }\r\n\r\n selectAll(value: boolean) {\r\n this._typeStudies && this._typeStudies.forEach(ts => ts.selected = value);\r\n }\r\n\r\n generateReport(rifmAsAuthorOnly: boolean) {\r\n this._pageState.isLoading = true;\r\n this._rifmAsAuthorOnly = rifmAsAuthorOnly;\r\n setTimeout(() => {\r\n const filteredStudies = this._typeStudies.filter(x => x.selected);\r\n if (filteredStudies.length == this._typeStudies.length) {\r\n this._typeStudyIds = null;\r\n } else {\r\n this._typeStudyIds = filteredStudies.map(x => x.typeStudy.typeStudyId);\r\n }\r\n this._canShowReport = true;\r\n setTimeout(() => {\r\n const ele = $('#SynopsisReport');\r\n (ele).modal('show');\r\n ele.on('hidden.bs.modal', () => {\r\n this._pageState.isLoading = false;\r\n this._canShowReport = false;\r\n });\r\n }, 0);\r\n });\r\n }\r\n}\r\n","\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { Material } from '../../entities/Material';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\n\r\n@Component({\r\n selector: 'naturals',\r\n templateUrl: './naturals.html',\r\n})\r\nexport class NaturalsComponent implements OnInit {\r\n\r\n material: Material;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Naturals.name;\r\n }\r\n\r\n canDeactivate() {\r\n return true;\r\n }\r\n}\r\n","\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { LocationFns } from '../../utils/common';\r\nimport { TabContainer } from '../../controls/common';\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\n\r\nimport { Material } from '../../entities/Material';\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\n\r\n@Component({\r\n selector: 'status-root',\r\n templateUrl: './status-root.html',\r\n})\r\nexport class StatusRootComponent implements OnInit, AfterViewInit {\r\n material: Material;\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n _tab: number;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Status.name;\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n }\r\n\r\n ngAfterViewInit() {\r\n if (this._tab != 0) {\r\n setTimeout(() => this._tabContainer.selectTab(this._tab), 1);\r\n }\r\n }\r\n\r\n canDeactivate() {\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n\r\n}\r\n","\r\n \r\n \r\n \r\n \r\n \r\n\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap } from '../../services/common';\r\nimport { LocationFns } from '../../utils/common';\r\nimport { TabContainer } from '../../controls/common';\r\n\r\nimport { Material } from '../../entities/Material';\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\n\r\n@Component({\r\n selector: 'fragrance-use',\r\n templateUrl: './fragrance-use.html'\r\n})\r\nexport class FragranceUseComponent implements OnInit, AfterViewInit {\r\n material: Material;\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n _tab: number;\r\n\r\n constructor(public _stateMap: StateMap, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.FragranceUse.name;\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n }\r\n\r\n ngAfterViewInit() {\r\n if (this._tab != 0) {\r\n setTimeout(() => this._tabContainer.selectTab(this._tab), 1);\r\n }\r\n }\r\n}\r\n","\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap } from '../../services/common';\r\nimport { LocationFns } from '../../utils/common';\r\nimport { TabContainer } from '../../controls/common';\r\n\r\nimport { Material } from '../../entities/Material';\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\n\r\n@Component({\r\n selector: 'predictions',\r\n templateUrl: './predictions.html',\r\n})\r\nexport class PredictionsComponent implements OnInit, AfterViewInit {\r\n material: Material;\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n _tab: number;\r\n\r\n constructor(public _stateMap: StateMap, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Predictions.name;\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n\r\n }\r\n\r\n ngAfterViewInit() {\r\n setTimeout(() => {\r\n this._tabContainer.selectTab(this._tab);\r\n }, 1);\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n}\r\n","\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { SearchService, StateMap, UnitOfWork } from '../../services/common';\r\nimport { LocationFns } from '../../utils/common';\r\nimport { TabContainer } from '../../controls/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\n\r\nimport { Material } from '../../entities/Material';\r\n\r\n@Component({\r\n selector: 'relations',\r\n templateUrl: './relations.html',\r\n})\r\nexport class RelationsComponent implements OnInit, AfterViewInit {\r\n material: Material;\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n _tab: number;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _searchService: SearchService, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Relations.name;\r\n\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n }\r\n\r\n ngAfterViewInit() {\r\n setTimeout(() => {\r\n this._tabContainer.selectTab(this._tab);\r\n }, 1);\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n\r\n}\r\n","
\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
","import { Component, Input, OnInit } from '@angular/core';\r\nimport { REACHRegistration, TypeREACHTonnageBand } from '../../entities/EntityModels';\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\n@Component({\r\n selector: 'reach-registration',\r\n templateUrl: './reach-registration.html',\r\n providers: [provideParent(REACHRegistrationComponent, EditPropParent)]\r\n})\r\nexport class REACHRegistrationComponent implements OnInit {\r\n\r\n @Input() entity: REACHRegistration;\r\n _types: TypeREACHTonnageBand[];\r\n\r\n constructor(public _uow: UnitOfWork) {\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.typeREACHTonnageBandRepository.all().then(r => {\r\n this._types = r;\r\n });\r\n }\r\n\r\n getError(propName: string) {\r\n return this.entity.getErrorFor(propName);\r\n }\r\n}\r\n","

Reach Registrations

\r\n\r\n\r\n\r\n\r\n \r\n \r\n Type\r\n CAS No.\r\n Name\r\n Registration Type\r\n Total Tonnage Band\r\n Link to Dossier\r\n Source\r\n \r\n \r\n \r\n \r\n Registered under REACH\r\n {{e.registrationCASNumber}}\r\n \r\n {{e.registrationType}}\r\n {{e.typeREACHTonnageBand?.totalTonnageBand || '-'}}\r\n Dossier\r\n European Chemicals Agency, July 2014 - http://echa.europa.eu\r\n \r\n \r\n \r\n\r\n\r\n
\r\n \r\n
","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, IEditHost } from '../../utils/common';\r\nimport { ColumnSorter } from '../../controls/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { REACHRegistration } from '../../entities/EntityModels';\r\nimport { REACHRegistrationComponent } from './reach-registration.component';\r\n\r\n@Component({\r\n selector: 'reach-registrations',\r\n templateUrl: './reach-registrations.html',\r\n})\r\nexport class REACHRegistrationsComponent implements IEditHost, OnInit {\r\n\r\n @ViewChild(REACHRegistrationComponent) _editingComponent: REACHRegistrationComponent;\r\n\r\n _materialId: number;\r\n _edm: EditManager;\r\n _colSorter: ColumnSorter;\r\n\r\n constructor(protected _uow: UnitOfWork, protected _stateMap: StateMap, protected _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Reach.name;\r\n const material = this._stateMap.currentMaterial;\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Reach Registrations');\r\n this._materialId = material.materialId;\r\n\r\n this._colSorter = new ColumnSorter(this, {\r\n 'Type': (r: REACHRegistration) => r.registrationType,\r\n 'CAS No.': (r: REACHRegistration) => r.registrationCASNumber,\r\n 'Name': (r: REACHRegistration) => r.registrationName\r\n }, 'CAS No');\r\n\r\n this._edm.pageState.isLoading = true;\r\n this._uow.rEACHRegistrationRepository.whereWithParams({materialId: material.materialId}).then(r => {\r\n this._edm.entities = r;\r\n this._edm.pageState.isLoaded = r;\r\n }).catch(e => {\r\n this._edm.pageState.isLoaded = false;\r\n });\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n onAdd() {\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n const e = this._uow.rEACHRegistrationFactory.create();\r\n e.materialId = this._materialId;\r\n e.typeREACHTonnageBandId = null;\r\n this._edm.entities.push(e);\r\n this._edm.onSelect(e);\r\n }\r\n\r\n sortWith(colSorter: ColumnSorter) {\r\n colSorter.sort(this._edm.entities);\r\n }\r\n\r\n linkToDossier(e: REACHRegistration) {\r\n const url = e.dossierWebLink;\r\n window.open(url);\r\n }\r\n\r\n}\r\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport { HouseStatus } from '../../entities/HouseStatus';\r\n\r\n@Component({\r\n selector: 'house-status',\r\n templateUrl: './house-status.html'\r\n})\r\nexport class HouseStatusComponent implements OnInit {\r\n @Input() entity: HouseStatus;\r\n\r\n constructor() {\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n hasChanges() {\r\n return (!this.entity.entityAspect.entityState.isUnchanged());\r\n }\r\n\r\n apply() {\r\n }\r\n}\r\n","
\r\n
\r\n \r\n \r\n
{{entity.getErrorFor(\"topic\")}}
\r\n
\r\n\r\n
\r\n \r\n \r\n
{{entity.getErrorFor(\"determination\")}}
\r\n
\r\n
","\r\n\r\n\r\n \r\n \r\n Topic\r\n Determination\r\n \r\n \r\n \r\n \r\n {{e.topic}}\r\n {{e.determination}}\r\n \r\n \r\n \r\n\r\n\r\n
\r\n \r\n
","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, IEditHost } from '../../utils/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { HouseStatusComponent } from './house-status.component';\r\nimport { HouseStatus } from '../../entities/HouseStatus';\r\n\r\n@Component({\r\n selector: 'house-statuses',\r\n templateUrl: './house-statuses.html',\r\n})\r\nexport class HouseStatusesComponent implements IEditHost, OnInit {\r\n @ViewChild(HouseStatusComponent) editingComponent: HouseStatusComponent;\r\n\r\n _materialId: number;\r\n _edm: EditManager;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.RIFMStatus.name;\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'House Status');\r\n\r\n const material = this._stateMap.currentMaterial;\r\n this._materialId = material.materialId;\r\n this._edm.pageState.isLoading = true;\r\n const p = {materialId: this._materialId};\r\n this._uow.houseStatusRepository.whereWithParams(p).then(r => {\r\n this._edm.entities = r;\r\n this._edm.pageState.isLoaded = r;\r\n }).catch(e => {\r\n this._edm.pageState.isLoaded = [];\r\n });\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n onAdd() {\r\n if (this._edm.editing && this.editingComponent) {\r\n this.editingComponent.apply();\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n }\r\n\r\n // TODO: add a unique validation for materialId, product pair.\r\n const config = {\r\n materialId: this._materialId,\r\n topic: '-'\r\n };\r\n const entity = this._uow.houseStatusFactory.create(config);\r\n entity.topic = '';\r\n this._edm.entities.push(entity);\r\n this._edm.onSelect(entity);\r\n }\r\n\r\n\r\n}\r\n","
\r\n \r\n
\r\n\r\n

{{_validationMessage}}

\r\n\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n\r\n \r\n \r\n This will be generated when a file is chosen, but you can change the file name.\r\n \r\n\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n

Please confirm you would like this file removed.

\r\n
\r\n \r\n {{_data.editMaterialFileData.fileLabel}}\r\n
\r\n
\r\n \r\n {{_data.editMaterialFileData.fileName}}\r\n
\r\n
\r\n
\r\n\r\n","import {Component, forwardRef, Inject, OnInit, ChangeDetectorRef} from '@angular/core';\r\nimport {provideParent, StateMap, UnitOfWork, UserManager} from '../../services/common';\r\nimport {PageState} from '../../controls/common';\r\nimport {MaterialFileAction, MaterialFileData, MaterialFileEditData, MaterialFileManagerComponent, MaterialFileType} from './material-file-manager.component';\r\nimport * as _ from 'lodash';\r\n\r\nexport interface FileOption {\r\n id: number;\r\n name: string;\r\n}\r\n\r\n@Component({\r\n selector: 'material-file-editor',\r\n templateUrl: './material-file-editor.html',\r\n providers: [provideParent(MaterialFileEditorComponent)]\r\n})\r\nexport class MaterialFileEditorComponent implements OnInit {\r\n\r\n _pageState = new PageState('Material File Manager');\r\n\r\n // file download links\r\n _isLoading = false;\r\n _validationMessage = '';\r\n\r\n _data: MaterialFileEditData;\r\n _saveData: MaterialFileData;\r\n private _saveDatadata: any;\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap,\r\n @Inject(forwardRef(() => MaterialFileManagerComponent)) public _parent: MaterialFileManagerComponent, private changeDetectorRef: ChangeDetectorRef) {\r\n\r\n this._data = _parent._data;\r\n this._saveData = _.clone(this._data.editMaterialFileData);\r\n }\r\n\r\n ngOnInit() {\r\n\r\n }\r\n\r\n isExpertPanelSummary() {\r\n return (this._data.editMaterialFileData.fileType == MaterialFileType.EXPERTPANELSUMMARY);\r\n }\r\n\r\n isFragranceMaterialReview() {\r\n return (this._data.editMaterialFileData.fileType == MaterialFileType.FRAGRANCEMATERIALREVIEW);\r\n }\r\n\r\n isMonograph() {\r\n return (this._data.editMaterialFileData.fileType == MaterialFileType.MONOGRAPH);\r\n }\r\n\r\n // file editing\r\n isAdding(): boolean {\r\n return (this._data.editMaterialFileData != null) ? (this._data.editMaterialFileData.fileAction == MaterialFileAction.ADD) : false;\r\n }\r\n\r\n isEditing(): boolean {\r\n return (this._data.editMaterialFileData != null) ? (this._data.editMaterialFileData.fileAction == MaterialFileAction.EDIT) : false;\r\n }\r\n\r\n isRemoving(): boolean {\r\n return (this._data.editMaterialFileData != null) ? (this._data.editMaterialFileData.fileAction == MaterialFileAction.DELETE) : false;\r\n }\r\n\r\n onFileInput(files: FileList) {\r\n this._validationMessage = '';\r\n this._data.editMaterialFileData.fileData = files.item(0);\r\n\r\n const fname = files.item(0).name;\r\n const fext = this.fileExtension(fname);\r\n\r\n this._data.edmMaterialMonograph.currentEntity.fileName = this._data.nextFileName + '.' + fext;\r\n\r\n this._data.hasFileChanges = true;\r\n\r\n // this.changeDetectorRef.detectChanges();\r\n }\r\n\r\n fileExtension(fileName: string) {\r\n const fileData = fileName.split('.');\r\n\r\n if (fileData == null || fileData.length < 2) {\r\n return '';\r\n }\r\n\r\n return (fileData[1]);\r\n }\r\n}\r\n\r\n","

{{pageTitle()}}

\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n

{{_validationMessage}}

\r\n\r\n
\r\n
\r\n
\r\n
\r\n
Remove
\r\n
File Label
\r\n
File Name
\r\n
File Type
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
{{mf.data.fileLabel}}
\r\n
{{mf.data.fileName}}
\r\n
{{mf.data.materialFileType()}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n","import {Component, forwardRef, Inject, OnInit, ViewChild} from '@angular/core';\r\nimport {Location} from '@angular/common';\r\nimport * as _ from 'lodash';\r\nimport {EditorService, provideParent, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport {EditPropParent, PageState} from '../../controls/common';\r\n\r\nimport {ExpertPanelSummary, Material, MaterialExpertPanelSummary, MaterialMonograph} from '../../entities/EntityModels';\r\n\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\nimport {EditManager} from '../../utils/edit-manager';\r\nimport {MaterialFileEditorComponent} from './material-file-editor.component';\r\nimport {SelectableEntity} from '../../entities/projections/SelectableEntity';\r\nimport {MaterialWorkflowService} from '../../services/material-workflow-service';\r\nimport {WorkflowEntityState} from '../../services/workflow-state';\r\nimport {PublicationData, PublicationsComponent} from './publications.component';\r\n\r\nexport enum MaterialFileAction { NONE, ADD, DELETE, EDIT}\r\nexport enum MaterialFileType { NONE, EXPERTPANELSUMMARY, FRAGRANCEMATERIALREVIEW, MONOGRAPH}\r\n\r\nexport class MaterialFileData {\r\n key: number;\r\n materialId: number;\r\n fileLabel: string;\r\n fileName: string;\r\n fileType: MaterialFileType;\r\n fileAction: MaterialFileAction;\r\n processResultMsg: string;\r\n fileData: any;\r\n\r\n constructor(key: number, materialId: number, fileLabel: string, fileName: string, fileType: MaterialFileType, fileAction: MaterialFileAction) {\r\n this.key = key;\r\n this.materialId = materialId;\r\n this.fileLabel = fileLabel;\r\n this.fileName = fileName;\r\n this.fileType = fileType;\r\n this.fileAction = fileAction;\r\n }\r\n\r\n public materialFileAction(): string {\r\n if (this.fileAction == MaterialFileAction.ADD) {\r\n return 'File will be Added';\r\n } else if (this.fileAction == MaterialFileAction.DELETE) {\r\n return 'File will be Removed';\r\n } else if (this.fileAction = MaterialFileAction.EDIT) {\r\n return 'File will be Renamed';\r\n }\r\n\r\n return '';\r\n }\r\n\r\n public materialFileType(): string {\r\n if (this.fileType == MaterialFileType.EXPERTPANELSUMMARY) {\r\n return 'Expert Panel Summary';\r\n } else if (this.fileType == MaterialFileType.FRAGRANCEMATERIALREVIEW) {\r\n return 'Fragrance Material Review';\r\n } else if (this.fileType = MaterialFileType.MONOGRAPH) {\r\n return 'Monograph';\r\n }\r\n\r\n return '';\r\n }\r\n}\r\n\r\nexport class MaterialFileEditData {\r\n edmMaterialMonograph: EditManager;\r\n editMaterialFileData: MaterialFileData;\r\n hasFileChanges: boolean; // set when a file is uploaded\r\n inSubEditor: boolean;\r\n material: Material;\r\n nextFileName: string;\r\n\r\n constructor() {}\r\n}\r\n\r\n@Component({\r\n selector: 'material-file-manager',\r\n templateUrl: './material-file-manager.html',\r\n providers: [provideParent(MaterialFileManagerComponent, EditPropParent)]\r\n})\r\nexport class MaterialFileManagerComponent implements OnInit, EditPropParent {\r\n @ViewChild(MaterialFileEditorComponent) _materialFileEditorComponent: MaterialFileEditorComponent;\r\n\r\n entity: MaterialMonograph;\r\n _pageState = new PageState('Material File Manager');\r\n _fmr: MaterialExpertPanelSummary;\r\n _summaries: ExpertPanelSummary[];\r\n\r\n // file download links\r\n _documentManagementUrl: string;\r\n _hasMonographFiles = false;\r\n _isLoading = false;\r\n _validationMessage = '';\r\n\r\n _materialFilesEx: SelectableEntity[] = [];\r\n\r\n _data: MaterialFileEditData = new MaterialFileEditData();\r\n _parentData: PublicationData = new PublicationData();\r\n\r\n _materialWorkflowService: MaterialWorkflowService;\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap, public _editorService: EditorService,\r\n @Inject(forwardRef(() => PublicationsComponent)) public _parent: PublicationsComponent,\r\n public _location: Location, private _httpClient: HttpClient, materialWorkflowService: MaterialWorkflowService) {\r\n\r\n this._parentData = _parent._data;\r\n this._materialWorkflowService = materialWorkflowService;\r\n }\r\n\r\n ngOnInit() {\r\n this._data.material = this._stateMap.currentMaterial;\r\n this._data.hasFileChanges = false;\r\n this._data.inSubEditor = false;\r\n\r\n this._pageState.isLoading = true;\r\n\r\n this._data.edmMaterialMonograph = this._editorService.createEditManager(this, 'Material Monograph');\r\n\r\n this._uow.materialExpertPanelSummaryRepository.whereWithParams({materialId: this._data.material.materialId}).then(r => {\r\n this._fmr = _.find(r, m => m.review != null);\r\n const summaries = r.map(item => item.expertPanelSummary);\r\n this._summaries = summaries.filter(s => s.narrativeLink != null && s.narrativeLink.trim() != '');\r\n this._hasMonographFiles = (this._data.material.materialMonographs != null && this._data.material.materialMonographs.length > 0);\r\n\r\n this.prepareFileDisplay();\r\n\r\n this._pageState.isLoaded = (summaries.length > 0) || (this._fmr != null) || this._hasMonographFiles;\r\n });\r\n\r\n this._documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDownloadableFile';\r\n this._stateMap.documentManagementUrl = this._documentManagementUrl;\r\n }\r\n\r\n prepareFileDisplay() {\r\n this._materialFilesEx = [];\r\n\r\n if (this._hasMonographFiles) {\r\n const mfiles = _.sortBy(_.clone(this._data.material.materialMonographs), l => l.fileLabel);\r\n mfiles.forEach(element => {\r\n this.recordMaterialFile(element.materialMonographId, element.fileLabel, element.fileName, MaterialFileType.MONOGRAPH, MaterialFileAction.NONE, '#FFFFFF');\r\n });\r\n }\r\n\r\n if (this._fmr) {\r\n this.recordMaterialFile(this._fmr.expertPanelID, '', this._fmr.review, MaterialFileType.FRAGRANCEMATERIALREVIEW, MaterialFileAction.NONE, '#F0F0F0');\r\n }\r\n\r\n if (this._summaries && this._summaries.length > 0) {\r\n _.clone(this._summaries).forEach(element => {\r\n this.recordMaterialFile(element.expertPanelID, element.narrativeTitle, element.narrativeLink, MaterialFileType.EXPERTPANELSUMMARY, MaterialFileAction.NONE, '#F0F0F0');\r\n });\r\n }\r\n\r\n this._materialFilesEx = _.orderBy(this._materialFilesEx, ['fileType', 'fileName'], ['asc', 'asc']);\r\n }\r\n\r\n public get editMaterialFileData() {\r\n return this._data.editMaterialFileData;\r\n }\r\n\r\n public set editMaterialFileData(value: MaterialFileData ) {\r\n this._data.editMaterialFileData = value;\r\n }\r\n\r\n canAdd() {\r\n if (this._data.inSubEditor) { return false; }\r\n\r\n if (this._data.hasFileChanges) { return false; }\r\n\r\n if (this._data.edmMaterialMonograph.editing && this._uow.hasChanges()) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n get canApply(): boolean {\r\n if (!this._data.inSubEditor) { return false; }\r\n\r\n if (this._data.editMaterialFileData.fileAction = MaterialFileAction.ADD) {\r\n if (!this._data.hasFileChanges) { // this is set to true when a file is uploaded\r\n return false;\r\n }\r\n }\r\n\r\n if (this._data.edmMaterialMonograph.editing && this._uow.hasChanges()) {\r\n return (!this._data.edmMaterialMonograph.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n }\r\n\r\n get canCancel(): boolean {\r\n return (this._data.inSubEditor);\r\n }\r\n\r\n get canConfirmRemove(): boolean {\r\n if (!this._data.inSubEditor) { return false; }\r\n return (this._data.editMaterialFileData.fileAction == MaterialFileAction.DELETE);\r\n }\r\n\r\n get canSave(): boolean {\r\n if (!this._data.inSubEditor) { return false; }\r\n\r\n // file deletions are handled by the \"Confirm Removal\" button\r\n if (this._data.editMaterialFileData.fileAction == MaterialFileAction.DELETE) {\r\n return false;\r\n }\r\n\r\n if (this._data.editMaterialFileData.fileAction = MaterialFileAction.ADD) {\r\n if (!this._data.hasFileChanges) { // this is set to true when a file is uploaded\r\n return false;\r\n }\r\n }\r\n\r\n if (this._data.edmMaterialMonograph.editing && this._uow.hasChanges()) {\r\n return (!this._data.edmMaterialMonograph.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n }\r\n\r\n canShowBack() {\r\n return (!this._data.inSubEditor);\r\n }\r\n\r\n canShowRemove(mf: MaterialFileData) {\r\n return (mf.fileType == MaterialFileType.MONOGRAPH);\r\n }\r\n\r\n getError(propName: string) {\r\n return this._data.material.getErrorFor(propName);\r\n }\r\n\r\n hasFileData() {\r\n return (this._materialFilesEx != null && this._materialFilesEx.length > 0);\r\n }\r\n\r\n nextMonographFileName(): string {\r\n const monographNum = (this._data.material.monographNumber == null) ? '' : '_' + this._data.material.monographNumber;\r\n if (this._data.material.materialMonographs == null || this._data.material.materialMonographs.length == 0) {\r\n return this._data.editMaterialFileData.materialId + monographNum;\r\n }\r\n\r\n let maxSeq = 0;\r\n const regEx = new RegExp('(.*_(\\d+)$)', 'i');\r\n this._data.material.materialMonographs.forEach(mf => {\r\n if (!mf.entityAspect.entityState.isAdded()) {\r\n const fileData = mf.fileName.split('.');\r\n\r\n // file name format for new monograph files is: materialId_monographnumber_seqnumber\r\n const fname = fileData[0];\r\n const uscore = fname.charAt(fname.length - 2);\r\n const seqChar = fname.charAt(fname.length - 1);\r\n\r\n if (uscore == '_' && this.isValidNumber(seqChar)) {\r\n const seqNum = parseInt(seqChar, 10);\r\n maxSeq = (maxSeq < seqNum) ? seqNum : maxSeq;\r\n }\r\n }\r\n });\r\n maxSeq++;\r\n const nextSeq = maxSeq;\r\n return this._data.editMaterialFileData.materialId + monographNum + '_' + nextSeq;\r\n }\r\n\r\n isValidNumber(test: string) {\r\n const num = parseInt(test, 10);\r\n return !isNaN(num);\r\n }\r\n\r\n // file editing\r\n onAddMonographFile() {\r\n this._validationMessage = '';\r\n\r\n const data = new MaterialFileData(0, this._data.material.materialId, '', '', MaterialFileType.MONOGRAPH, MaterialFileAction.ADD);\r\n this._data.editMaterialFileData = data;\r\n\r\n this._data.nextFileName = this.nextMonographFileName();\r\n const newMonographFile: MaterialMonograph = this._uow.materialMonographFactory.create();\r\n newMonographFile.materialId = this._data.material.materialId;\r\n\r\n this.entity = newMonographFile;\r\n this._data.edmMaterialMonograph.onlyEntity \t = this.entity;\r\n this._data.edmMaterialMonograph.editing \t\t= true;\r\n\r\n this._data.inSubEditor = true;\r\n }\r\n\r\n onBack() {\r\n this._parentData.isEditingFiles = false;\r\n this._parent.refreshMonographStatus();\r\n }\r\n\r\n onCancel() {\r\n if (this._data.editMaterialFileData.fileType == MaterialFileType.MONOGRAPH) {\r\n this._data.edmMaterialMonograph.onCancelCore();\r\n }\r\n\r\n this._data.editMaterialFileData = null;\r\n this._data.hasFileChanges = false;\r\n this._data.inSubEditor = false;\r\n }\r\n\r\n onConfirmRemove() {\r\n if (this._data.editMaterialFileData.fileAction != MaterialFileAction.DELETE) {\r\n return;\r\n }\r\n\r\n if (this._data.editMaterialFileData.fileType == MaterialFileType.MONOGRAPH) {\r\n this.removeMonographFile();\r\n }\r\n }\r\n\r\n // 03/09/2025: Editing not required yet\r\n onEdit(mf: MaterialFileData) {\r\n this._data.editMaterialFileData = mf;\r\n this._data.editMaterialFileData.fileAction = MaterialFileAction.EDIT;\r\n\r\n if (this._data.editMaterialFileData.fileType == MaterialFileType.MONOGRAPH) {\r\n this.fetchMaterialMonographForEdit(this._data.editMaterialFileData.key).then(r => {\r\n if (r) {\r\n this._data.inSubEditor = true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n onRemove(mf: MaterialFileData) {\r\n this._validationMessage = '';\r\n\r\n this._data.editMaterialFileData = mf;\r\n this._data.editMaterialFileData.fileAction = MaterialFileAction.DELETE;\r\n\r\n if (this._data.editMaterialFileData.fileType == MaterialFileType.MONOGRAPH) {\r\n this.fetchMaterialMonographForEdit(this._data.editMaterialFileData.key).then(r => {\r\n if (r) {\r\n this._data.inSubEditor = true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n onSave() {\r\n if (this._data.editMaterialFileData.fileType == MaterialFileType.MONOGRAPH) {\r\n if (this._data.editMaterialFileData.fileAction == MaterialFileAction.ADD) {\r\n this.saveMonographFile();\r\n }\r\n }\r\n }\r\n\r\n removeMonographFile() {\r\n this._data.edmMaterialMonograph.currentEntity.entityAspect.setDeleted();\r\n\r\n this.recordMaterialWorkflow(WorkflowEntityState.Deleted, 'Monograph file deleted');\r\n\r\n this._data.edmMaterialMonograph.onApplyCore();\r\n return this._data.edmMaterialMonograph.onSaveCore().then(() => {\r\n this.removeMaterialFile( this._data.editMaterialFileData.fileName, 'Monographs');\r\n }).catch((e) => {\r\n // leave in _editing mode to see error.\r\n this._data.edmMaterialMonograph.errorMessages.push(e.toString());\r\n this._validationMessage = e.toString();\r\n });\r\n }\r\n\r\n saveMonographFile() {\r\n this._data.editMaterialFileData.fileLabel = this._data.edmMaterialMonograph.currentEntity.fileLabel;\r\n this._data.editMaterialFileData.fileName = this._data.edmMaterialMonograph.currentEntity.fileName;\r\n\r\n this.recordMaterialWorkflow(WorkflowEntityState.Added, 'Monograph file added');\r\n\r\n return this._data.edmMaterialMonograph.onSaveCore().then(() => {\r\n this._data.edmMaterialMonograph.editing = false;\r\n this.uploadMaterialFile('Monographs');\r\n }).catch((e) => {\r\n this._data.edmMaterialMonograph.errorMessages.push(e.toString());\r\n this._validationMessage = e.toString();\r\n });\r\n }\r\n\r\n pageTitle() {\r\n if (!this._data.inSubEditor) {\r\n return 'Material File Manager';\r\n }\r\n\r\n let action = '';\r\n if (this._data.editMaterialFileData.fileAction == MaterialFileAction.ADD) {\r\n action = 'Adding';\r\n } else if (this._data.editMaterialFileData.fileAction == MaterialFileAction.DELETE) {\r\n action = 'Removing';\r\n } else if (this._data.editMaterialFileData.fileAction == MaterialFileAction.EDIT) {\r\n action = 'Renaming';\r\n }\r\n\r\n return (action + ' ' + this._data.editMaterialFileData.materialFileType() + ' File');\r\n }\r\n\r\n refreshMaterialData(materialId: number): Promise {\r\n return this._uow.materialRepository.withId(materialId).then(m => {\r\n if (m) {\r\n this._data.material = m;\r\n this._stateMap.currentMaterial = m;\r\n\r\n this._hasMonographFiles = (this._data.material.materialMonographs != null && this._data.material.materialMonographs.length > 0);\r\n\r\n this.prepareFileDisplay();\r\n } else {\r\n this._validationMessage = 'Error refreshing material data after file changes.';\r\n }\r\n });\r\n }\r\n\r\n recordMaterialFile(key: number, fileLabel: string, fileName: string, fileType: MaterialFileType, fileAction: MaterialFileAction, color: string) {\r\n const data = new MaterialFileData(key, this._data.material.materialId, fileLabel, fileName, fileType, fileAction);\r\n this._materialFilesEx.push(new SelectableEntity(data, color, '', false));\r\n }\r\n\r\n filterToExpertPanelSummaryId(expertPanelID: number): ExpertPanelSummary {\r\n if (this._summaries == null || this._summaries.length < 1) {\r\n return null;\r\n }\r\n\r\n const eps = this._summaries.filter(e => e.expertPanelID == expertPanelID);\r\n if (eps != null && eps.length > 0) {\r\n return eps[0];\r\n }\r\n }\r\n\r\n fetchMaterialForEdit(materialId: number): Promise {\r\n this._data.edmMaterialMonograph.editing = false;\r\n\r\n return this._uow.materialRepository.withId(materialId).then(m => {\r\n if (m) {\r\n this._data.material \t\t\t\t= m;\r\n this._stateMap.currentMaterial \t = m;\r\n // this._data.edmMaterial.onlyEntity = m; // for workflow\r\n // this._data.edmMaterial.editing = true;\r\n }\r\n });\r\n }\r\n\r\n fetchMaterialMonographForEdit(materialMonographId: number): Promise {\r\n this._data.edmMaterialMonograph.editing = false;\r\n\r\n let result = false;\r\n const param = {materialMonographId: materialMonographId};\r\n return this._uow.fetch('Materials/MaterialMonographsById', param).then(m => {\r\n if (m != null && m.length > 0) {\r\n this.entity = m[0];\r\n this._data.edmMaterialMonograph.onlyEntity \t = this.entity;\r\n this._data.edmMaterialMonograph.editing \t\t= true;\r\n result = true;\r\n } else {\r\n this._validationMessage = 'Error retrieving data for editing.';\r\n }\r\n return Promise.resolve(result);\r\n });\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n recordMaterialWorkflow(workflowState: WorkflowEntityState, notes: string) {\r\n const fileName = this._data.edmMaterialMonograph.currentEntity.fileName;\r\n const key = this._data.edmMaterialMonograph.currentEntity.materialMonographId;\r\n this._materialWorkflowService.recordMaterialMonographChange(this._data.material.materialId, workflowState, fileName, key, notes, this._userManager.currentUser.name);\r\n }\r\n\r\n // ************************************************************************\r\n // web api calls\r\n // ************************************************************************\r\n // add file\r\n getUploadFileURL(subFolder: string): Observable {\r\n const url = this._documentManagementUrl + '/UploadFile';\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n\r\n const formData: FormData = new FormData();\r\n formData.append('fileName', this._data.editMaterialFileData.fileName);\r\n formData.append('subFolder', subFolder);\r\n formData.append('file', this._data.editMaterialFileData.fileData);\r\n\r\n return this._httpClient.post(url, formData);\r\n }\r\n\r\n public uploadMaterialFile(subFolder: string): Observable {\r\n const subject = new Subject();\r\n this.getUploadFileURL(subFolder)\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n subject.next('Error occurred: ' + data.ExceptionMessage);\r\n this._validationMessage = 'Error occurred: ' + data.ExceptionMessage;\r\n } else {\r\n subject.next('File was processed successfully.');\r\n this._validationMessage = 'File was uploaded successfully.';\r\n\r\n this.refreshMaterialData(this._data.material.materialId);\r\n\r\n this._data.hasFileChanges = false;\r\n this._data.inSubEditor = false;\r\n }\r\n },\r\n (error) => {\r\n subject.next(error.message);\r\n });\r\n\r\n return subject.asObservable();\r\n }\r\n\r\n // remove file\r\n getRemoveMaterialFileURL(fileName: string, subFolder: string): Observable {\r\n const url = this._documentManagementUrl + '/Remove?fileName=' + fileName + '&subFolder=' + subFolder;\r\n\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n return this._httpClient.post(url, { });\r\n }\r\n\r\n public removeMaterialFile(fileName: string, subFolder: string): Observable {\r\n const subject = new Subject();\r\n this._isLoading = true;\r\n\r\n this.getRemoveMaterialFileURL(fileName, subFolder)\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n this._validationMessage = 'Error occurred, unable to remove the file: ' + data.ExceptionMessage;\r\n subject.next('Error occurred, unable to remove the file: ' + data.ExceptionMessage);\r\n return;\r\n }\r\n\r\n this._validationMessage = 'File archived and removed successfully.';\r\n subject.next('File archived and removed successfully.');\r\n\r\n this.refreshMaterialData(this._data.material.materialId);\r\n\r\n this._data.hasFileChanges = false;\r\n this._data.inSubEditor = false;\r\n },\r\n (error) => {\r\n subject.next(error.message);\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n\r\n return subject.asObservable();\r\n }\r\n}\r\n","
\r\n \r\n
\r\n\r\n

Historical Publications

\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n","import {Component, OnInit, ViewChild} from '@angular/core';\r\nimport {Location} from '@angular/common';\r\nimport * as _ from 'lodash';\r\nimport {StateMap, UnitOfWork, UserManager} from '../../services/common';\r\nimport {PageState} from '../../controls/common';\r\n\r\nimport {MATERIAL_ROUTES} from './material.routes';\r\nimport {ExpertPanelSummary, Material, MaterialExpertPanelSummary, MaterialMonograph } from '../../entities/EntityModels';\r\n\r\nimport { MaterialFileManagerComponent } from './material-file-manager.component';\r\n\r\nimport {Observable} from 'rxjs';\r\nimport {HttpClient} from '@angular/common/http';\r\nimport {MaterialWorkflowService} from '../../services/material-workflow-service';\r\n\r\nexport class PublicationData {\r\n isEditingFiles: boolean;\r\n}\r\n\r\n@Component({\r\n selector: 'publications',\r\n templateUrl: './publications.html',\r\n providers: [MaterialWorkflowService],\r\n})\r\nexport class PublicationsComponent implements OnInit {\r\n @ViewChild(MaterialFileManagerComponent) _materialFileManagerComponent: MaterialFileManagerComponent;\r\n\r\n _material: Material;\r\n _pageState = new PageState('Publications');\r\n _fmr: MaterialExpertPanelSummary;\r\n _monographs: MaterialMonograph[];\r\n _allSummaries: ExpertPanelSummary[];\r\n _summaries: ExpertPanelSummary[]; // with Narrative Links\r\n _hasMonographFiles: boolean;\r\n\r\n // file download links\r\n _expertPanelSummarySubFolder = 'Expert Panel Summaries';\r\n _documentManagementUrl: string;\r\n _isLoading = false;\r\n _validationMessage = '';\r\n\r\n _data: PublicationData;\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap,\r\n public _location: Location, private _httpClient: HttpClient) {\r\n this._data = new PublicationData();\r\n this._data.isEditingFiles = false;\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Publications.name;\r\n this._material = this._stateMap.currentMaterial;\r\n this._material.principalSynonym().synonymWordOrWebVersion();\r\n\r\n this._pageState.isLoading = true;\r\n this._uow.materialExpertPanelSummaryRepository.whereWithParams({materialId: this._material.materialId}).then(r => {\r\n this._fmr = _.find(r, m => m.review != null);\r\n this._allSummaries = r.map(item => item.expertPanelSummary);\r\n this._summaries = this._allSummaries.filter(s => s.narrativeLink != null && s.narrativeLink.trim() != '');\r\n this._hasMonographFiles = (this._material.materialMonographs != null && this._material.materialMonographs.length > 0);\r\n this._pageState.isLoaded = (this._allSummaries.length > 0) || (this._fmr != null) || this._hasMonographFiles;\r\n });\r\n\r\n this._documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDownloadableFile';\r\n this._stateMap.documentManagementUrl = this._documentManagementUrl;\r\n }\r\n\r\n get materialMonographFiles() {\r\n return _.sortBy(this._material.materialMonographs, l => l.fileLabel);\r\n }\r\n\r\n linkToSummary(summary: ExpertPanelSummary) {\r\n this.downloadPublicationFile(summary.narrativeLink, 'Expert Panel Summaries');\r\n }\r\n\r\n linkToFmr() {\r\n this.downloadPublicationFile(this._fmr.review, 'Expert Panel Summaries');\r\n }\r\n\r\n linkToMonographFile(m: MaterialMonograph) {\r\n this.downloadPublicationFile(m.fileName, 'Monographs');\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n // File Editing for Staff\r\n onEditFiles() {\r\n this._data.isEditingFiles = true;\r\n }\r\n\r\n refreshMonographStatus() {\r\n this._pageState.isLoading = true;\r\n\r\n this._material = this._stateMap.currentMaterial;\r\n this._hasMonographFiles = (this._material.materialMonographs != null && this._material.materialMonographs.length > 0);\r\n\r\n this._pageState.isLoaded = (this._allSummaries.length > 0) || (this._fmr != null) || this._hasMonographFiles;\r\n }\r\n\r\n // ***********************************************\r\n // *material publication file downloads\r\n // ***********************************************\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n getDownloadFileURL(fileName: string, subFolder: string): Observable {\r\n let url: string;\r\n url = this._documentManagementUrl + '/GetFileBySubFolderAndName?fileName=' + fileName + '&subFolder=' + subFolder ;\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public downloadPublicationFile(fileName: string, subFolder: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getDownloadFileURL(fileName, subFolder)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = '';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","
\r\n \r\n
\r\n\r\n

{{_validationMessage}}

\r\n\r\n
\r\n
Fragrance Safety Assessment Report
\r\n \r\n
\r\n\r\n
\r\n
Elsevier Fragrance Safety Assessment Report
\r\n \r\n
\r\n\r\n
\r\n
Fragrance Safety Assessment Categories
\r\n \r\n \r\n \r\n Category\r\n \r\n \r\n \r\n \r\n {{ac.name}}\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n
{{_material.sACategoryComment}}
\r\n
\r\n\r\n
\r\n
Additional Related Materials
\r\n \r\n \r\n \r\n CAS No.\r\n RIFM ID\r\n FEMA No.\r\n EINECS\r\n ECN\r\n Principal Synonym\r\n \r\n \r\n \r\n \r\n {{m.realCASNumber}}\r\n {{m.formattedRifmId}}\r\n {{m.fEMANumber}}\r\n {{m.eINECSNumber}}\r\n {{m.eCNNumber}}\r\n \r\n \r\n \r\n \r\n
\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { IMaterialSearchResult, SearchService, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { ROUTES } from '../routes';\r\nimport { AssessmentCategory, Material } from '../../entities/EntityModels';\r\nimport { MaterialListItem } from '../../entities/projections/MaterialListItem';\r\n\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\n\r\n@Component({\r\n selector: 'safety-assessment',\r\n templateUrl: './safety-assessment.html',\r\n})\r\n\r\nexport class SafetyAssessmentComponent implements OnInit {\r\n _editing = false;\r\n _material: Material;\r\n _materialListItems: MaterialListItem[];\r\n _assessmentCategories: AssessmentCategory[];\r\n _pageState = new PageState('Safety Assessment');\r\n\r\n _documentManagementUrl: string;\r\n _isLoading = false;\r\n _validationMessage: string;\r\n\r\n constructor(public _stateMap: StateMap, public _userManager: UserManager, public _searchService: SearchService, public _router: Router,\r\n public _uow: UnitOfWork, private _httpClient: HttpClient) {\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.SafetyAssessment.name;\r\n this._material = this._stateMap.currentMaterial;\r\n this._pageState.isLoaded = this.hasAssessment();\r\n this.getRelatedMaterials(this._material.materialId);\r\n this._uow.fetch('Materials/MaterialAndAdditionalMaterialAssessmentCategories', {materialId: this._material.materialId})\r\n .then(r => {\r\n this._assessmentCategories = r;\r\n });\r\n\r\n this.getDocumentManagementUrl().then(url => {\r\n this._stateMap.documentManagementBaseUrl = url; // Needs to be set if Material page is opened from an external link.\r\n this._documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDownloadableFile';\r\n });\r\n }\r\n\r\n hasAssessment() {\r\n const assessment = this._material.assessmentReportName;\r\n return (assessment != null) && (assessment.trim().length > 0);\r\n }\r\n\r\n hasElsevierAssessment() {\r\n const assessment = this._material.elsevierReportName;\r\n return (assessment != null) && (assessment.trim().length > 0);\r\n }\r\n\r\n downloadReport() {\r\n this.downloadSAFile(this._material.assessmentReportName, 'SafetyAssessments');\r\n }\r\n\r\n downloadElsevierReport() {\r\n this.downloadSAFile(this._material.elsevierReportName, 'Elsevier SAs');\r\n }\r\n\r\n getRelatedMaterials(materialId: number): Promise {\r\n this._materialListItems = null;\r\n const params = {\r\n searchTerm: '' + materialId,\r\n searchType: 'safety-assessment-materials',\r\n pageNumber: 1,\r\n pageSize: 500 // insure that we bring them all in.\r\n };\r\n\r\n return this._searchService.fetchMaterialsPage(params).then(r => {\r\n const mlItems = r.materials.filter(m => m.materialId != this._material.materialId);\r\n mlItems.forEach(m => {\r\n m['assessmentReportDate'] = m.assessmentReportNameModified && new Date(m.assessmentReportNameModified);\r\n });\r\n this._materialListItems = mlItems;\r\n return r;\r\n });\r\n }\r\n\r\n selectMaterial(material: MaterialListItem) {\r\n return this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, material.materialId));\r\n }\r\n\r\n // ***********************************************\r\n // *sa & elsevier document downloads\r\n // ***********************************************\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n getDownloadFileURL(fileName: string, folderName: string): Observable {\r\n let url: string;\r\n url = this._documentManagementUrl + '/GetFileBySubFolderAndName?fileName=' + fileName + '&subFolder=' + folderName ;\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public downloadSAFile(fileName: string, folderName: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getDownloadFileURL(fileName, folderName)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = '';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","
\r\n
\r\n \r\n
\r\n
\r\n
\r\n {{\"Unit of Measure: \" + _unitOfMeasure}}\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n {{group.year}}\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
{{c.geographicalArea}}{{ utilFns.formatNumber(c.kilogramsConsumed, 12, 3) }}{{ utilFns.scaleNumber(c.kilogramsConsumed, 1000, 10, 4) }}
\r\n
\r\n
\r\n
\r\n\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport * as _ from 'lodash';\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { Material } from '../../entities/Material';\r\nimport { MaterialConsumptionListItem } from '../../entities/projections/MaterialConsumptionListItem';\r\n\r\n\r\n@Component({\r\n selector: 'material-consumptions',\r\n templateUrl: './material-consumptions.html',\r\n})\r\nexport class MaterialConsumptionsComponent implements OnInit {\r\n @Input() material: Material;\r\n\r\n _material: Material;\r\n _materialConsumptions: MaterialConsumptionListItem[] = [];\r\n _consumptionsYearGroups: { year: string, consumptions: MaterialConsumptionListItem[], collapsed?: boolean }[] = [];\r\n _unitOfMeasure: string;\r\n\r\n _isLoading = true;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.MaterialConsumptions.name;\r\n this._material = this._stateMap.currentMaterial;\r\n if (this._material == null) {\r\n return;\r\n }\r\n\r\n this._isLoading = true;\r\n this._uow.fetch('MaterialReportedUses/FetchMaterialConsumption', {materialId: this._material.materialId}).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._materialConsumptions = r;\r\n\r\n const groups = _.groupBy(this._materialConsumptions, c => c.surveyYear);\r\n\r\n this._consumptionsYearGroups = _.map(groups, (v, k) => {\r\n return {year: k, consumptions: v, isCollapsed: false};\r\n });\r\n\r\n this._consumptionsYearGroups = _.sortBy(this._consumptionsYearGroups, (g) => g.year).reverse();\r\n }\r\n this._isLoading = false;\r\n });\r\n\r\n this._unitOfMeasure = 'Kilograms';\r\n }\r\n\r\n public hasConsumptions(): boolean {\r\n return (this._materialConsumptions != null && this._materialConsumptions.length > 0);\r\n }\r\n\r\n public get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n private yearGroupCollapse(ix: number) {\r\n this._consumptionsYearGroups[ix].collapsed = !this._consumptionsYearGroups[ix].collapsed;\r\n }\r\n\r\n public expandAll(expand: boolean) {\r\n setTimeout(() => {\r\n this._consumptionsYearGroups.forEach(g => g.collapsed = !expand);\r\n }, 0);\r\n }\r\n\r\n public setUnitOfMeasure(uom: string) {\r\n this._unitOfMeasure = uom;\r\n }\r\n\r\n}\r\n","import { MeasuresByCategory } from './MeasuresByCategory';\r\n\r\nexport class MeasureSurveyCategoryGroup {\r\n id: string;\r\n measuresByCategory: MeasuresByCategory[];\r\n isomers: string;\r\n notes: string;\r\n collapsed?: boolean;\r\n exposureSurveyDate: Date;\r\n exposureSurveyNumber: number;\r\n backgroundColor: string;\r\n\r\n // tslint:disable-next-line:max-line-length\r\n constructor(id: string, measuresByCategory: MeasuresByCategory[], isomers: string = '', notes: string = '', exposureSurveyDate: Date, exposureSurveyNumber: number, backgroundColor: string, collapsed: boolean = true) {\r\n this.id = id;\r\n this.measuresByCategory = measuresByCategory;\r\n this.isomers = isomers;\r\n this.notes = notes;\r\n this.collapsed = collapsed;\r\n this.exposureSurveyDate = exposureSurveyDate;\r\n this.backgroundColor = backgroundColor;\r\n this.exposureSurveyNumber = exposureSurveyNumber;\r\n }\r\n\r\n public get fontColor(): string {\r\n if (this.backgroundColor == null) {\r\n return '#000000';\r\n }\r\n\r\n return (this.backgroundColor == '#4CAF50' ? '#FFFFFF' : '#000000');\r\n }\r\n\r\n}\r\n","import { MaterialExposureSurveyMeasureItem } from './MaterialExposureSurveyMeasureItem';\r\n\r\nexport class MeasuresByCategory {\r\n categoryId: string;\r\n measureValues: MaterialExposureSurveyMeasureItem[];\r\n\r\n constructor(categoryId: string, measureValues: MaterialExposureSurveyMeasureItem[]) {\r\n this.categoryId = categoryId;\r\n this.measureValues = measureValues;\r\n }\r\n}\r\n","import { MaterialExposureCustomSurveyMeasureItem } from './MaterialExposureCustomSurveyMeasureItem';\r\n\r\nexport class CustomSurveyMeasuresByCategory {\r\n categoryId: string;\r\n measureValues: MaterialExposureCustomSurveyMeasureItem[];\r\n\r\n constructor(categoryId: string, measureValues: MaterialExposureCustomSurveyMeasureItem[]) {\r\n this.categoryId = categoryId;\r\n this.measureValues = measureValues;\r\n }\r\n}\r\n","import { CustomSurveyMeasuresByCategory } from './CustomSurveyMeasuresByCategory';\r\n\r\nexport class MeasureCustomSurveyCategoryGroup {\r\n id: string;\r\n customSurveyMeasuresByCategory: CustomSurveyMeasuresByCategory[];\r\n notes: string;\r\n collapsed?: boolean;\r\n customSurveyDate: Date;\r\n backgroundColor: string;\r\n\r\n // tslint:disable-next-line:max-line-length\r\n constructor(id: string, customSurveyMeasuresByCategory: CustomSurveyMeasuresByCategory[], notes: string = '', customSurveyDate: Date, backgroundColor: string, collapsed: boolean = true) {\r\n this.id = id;\r\n this.customSurveyMeasuresByCategory = customSurveyMeasuresByCategory;\r\n this.notes = notes;\r\n this.collapsed = collapsed;\r\n this.customSurveyDate = customSurveyDate;\r\n this.backgroundColor = backgroundColor;\r\n }\r\n\r\n public get fontColor(): string {\r\n return '#000000';\r\n }\r\n\r\n}\r\n","\r\n\r\n
\r\n

Reported Exposure Data by Survey

\r\n\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n

There is no Exposure Survey data for this material.

\r\n
\r\n\r\n
\r\n \r\n \r\n Indicates multiple runs of the same measure within an Exposure Survey.\r\n \r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n {{surveyDescription(group)}}\r\n
\r\n\r\n
\r\n

{{data.categoryId}}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
MeasureValueVersionNotesMultiple
\r\n {{m.measureDescription}}\r\n 0\">{{m.measureQualitativeResult}}{{utilFns.formatNumber(m.measureQuantitativeResult, 12, 4)}}{{m.cremeVersion}}\r\n {{m.measureNotes}}\r\n \r\n \r\n
\r\n
\r\n
0\">\r\n \r\n *\r\n Notes:\r\n {{group.notes}}\r\n \r\n
\r\n
0\">\r\n \r\n *\r\n Isomers included in this survey:\r\n {{group.isomers}}\r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
0\">\r\n This Material was surveyed as an isomer of the following materials and surveys\r\n\r\n
\r\n \r\n \r\n \r\n Survey Material CAS No.\r\n RIFM Id\r\n Survey Date\r\n Survey Number\r\n \r\n \r\n \r\n \r\n {{i.materialExposureSurvey?.material?.realCASNumber}}\r\n {{i.materialExposureSurvey?.material?.formattedRIFMId}}\r\n {{i.materialExposureSurvey?.exposureSurvey?.exposureSurveyMonthYear}}\r\n {{i.materialExposureSurvey?.exposureSurvey?.exposureSurveyNumber}}\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n This Material was surveyed as part of one or more Custom Surveys\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n {{customSurveyDescription(group)}}\r\n
\r\n\r\n
\r\n

{{data.categoryId}}

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
MeasureValueVersionNotesMultiple
\r\n {{m.measureDescription}}\r\n 0\">{{m.measureQualitativeResult}}{{utilFns.formatNumber(m.measureQuantitativeResult, 12, 4)}}{{m.cremeVersion}}\r\n {{m.measureNotes}}\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n","import {AfterViewInit, Component, OnInit} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\n\r\nimport * as _ from 'lodash';\r\n\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\n\r\nimport { UnitOfWork } from '../../services/unit-of-work';\r\nimport { UserManager } from '../../services/user-manager';\r\nimport { StateMap } from '../../services/state-map';\r\n\r\nimport { ExposureSurvey, Material, MaterialExposureSurvey, MaterialExposureSurveyIsomer, MaterialExposureCustomSurveyMeasure } from '../../entities/EntityModels';\r\nimport { MaterialExposureSurveyMeasureItem } from '../../entities/projections/MaterialExposureSurveyMeasureItem';\r\nimport { MeasureSurveyCategoryGroup } from '../../entities/projections/MeasureSurveyCategoryGroup';\r\nimport { MeasuresByCategory } from '../../entities/projections/MeasuresByCategory';\r\n\r\nimport { CustomSurveyMeasuresByCategory } from '../../entities/projections/CustomSurveyMeasuresByCategory';\r\nimport { MeasureCustomSurveyCategoryGroup } from '../../entities/projections/MeasureCustomSurveyCategoryGroup';\r\nimport { MaterialExposureCustomSurveyMeasureItem } from '../../entities/projections/MaterialExposureCustomSurveyMeasureItem';\r\n\r\nconst compareCustomSurveyMeasures = function (a: MaterialExposureCustomSurveyMeasureItem, b: MaterialExposureCustomSurveyMeasureItem) {\r\n if (a.sortOrder < b.sortOrder) {\r\n return -1;\r\n }\r\n if (a.sortOrder > b.sortOrder) {\r\n return 1;\r\n }\r\n // reverse sort order for created date\r\n if (a.created > b.created) {\r\n return -1;\r\n }\r\n if (a.created < b.created) {\r\n return 1;\r\n }\r\n return 0;\r\n};\r\n\r\nconst compareCustomSurveys = function (a: MeasureCustomSurveyCategoryGroup, b: MeasureCustomSurveyCategoryGroup) {\r\n if (a.customSurveyDate > b.customSurveyDate) {\r\n return -1;\r\n }\r\n if (a.customSurveyDate < b.customSurveyDate) {\r\n return 1;\r\n }\r\n return 0;\r\n};\r\n\r\nconst compareMeasures = function (a: MaterialExposureSurveyMeasureItem, b: MaterialExposureSurveyMeasureItem) {\r\n if (a.sortOrder < b.sortOrder) {\r\n return -1;\r\n }\r\n if (a.sortOrder > b.sortOrder) {\r\n return 1;\r\n }\r\n // reverse sort order for created date\r\n if (a.created > b.created) {\r\n return -1;\r\n }\r\n if (a.created < b.created) {\r\n return 1;\r\n }\r\n return 0;\r\n};\r\n\r\nconst compareSurveys = function (a: MeasureSurveyCategoryGroup, b: MeasureSurveyCategoryGroup) {\r\n if (a.exposureSurveyDate > b.exposureSurveyDate) {\r\n return -1;\r\n }\r\n if (a.exposureSurveyDate < b.exposureSurveyDate) {\r\n return 1;\r\n }\r\n if (a.exposureSurveyNumber > b.exposureSurveyNumber) {\r\n return -1;\r\n }\r\n if (a.exposureSurveyNumber < b.exposureSurveyNumber) {\r\n return 1;\r\n }\r\n return 0;\r\n};\r\n\r\nexport interface MeasureSurveyGroup { id: string; measures: MaterialExposureSurveyMeasureItem[]; collapsed?: boolean; }\r\nexport interface MeasureCustomSurveyGroup { id: string; measures: MaterialExposureCustomSurveyMeasureItem[]; collapsed?: boolean; }\r\n\r\n@Component({\r\n selector: 'material-exposure',\r\n templateUrl: './material-exposure.html',\r\n})\r\nexport class MaterialExposureComponent implements OnInit, AfterViewInit {\r\n\r\n _monthFullNames = [\r\n 'January', 'February', 'March',\r\n 'April', 'May', 'June', 'July',\r\n 'August', 'September', 'October',\r\n 'November', 'December'\r\n ];\r\n\r\n _material: Material;\r\n _materialExposureMeasures: MaterialExposureSurveyMeasureItem[] = [];\r\n _materialExposureSurveys: MaterialExposureSurvey[] = [];\r\n _measureSurveyGroups: MeasureSurveyGroup[] = [];\r\n _measureSurveyCategoryGroups: MeasureSurveyCategoryGroup[] = [];\r\n\r\n _exposureSurveys: ExposureSurvey[] = [];\r\n _isomerOfMaterialExposureSurveys: MaterialExposureSurveyIsomer[] = [];\r\n\r\n _materialExposureCustomSurveyMeasureItems: MaterialExposureCustomSurveyMeasureItem[] = [];\r\n _measureCustomSurveyGroups: MeasureCustomSurveyGroup[] = [];\r\n _measureCustomSurveyCategoryGroups: MeasureCustomSurveyCategoryGroup[] = []; // includes the measure display categories\r\n\r\n _pageState = new PageState('Exposure');\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap,\r\n public _location: Location, public _router: Router) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.MaterialExposure.name;\r\n this._material = this._stateMap.currentMaterial;\r\n\r\n if (this._material == null) {\r\n return;\r\n }\r\n\r\n this._pageState.isLoading = true;\r\n\r\n const params = {materialId: this._material.materialId};\r\n this._uow.fetch('ExposureSurveys/MaterialExposureSurveyByMaterialId', params).then(m => {\r\n this._materialExposureSurveys = m;\r\n\r\n if (this._materialExposureSurveys == null || this._materialExposureSurveys.length < 1) {\r\n this._pageState.isLoaded = true;\r\n return;\r\n }\r\n\r\n // ************************************************************************************************************************\r\n // Change: 07/24/2020: Show Exp. Survey data for a material even if they only have notes and no measure data\r\n // Create objects for each survey the material is registered for and fill in measure and isomer data if available.\r\n // ************************************************************************************************************************\r\n this._materialExposureSurveys.forEach(e => {\r\n // tslint:disable-next-line:max-line-length\r\n this._measureSurveyCategoryGroups.push(new MeasureSurveyCategoryGroup(e.exposureSurveyId.toString(), [], null, e.notes, e.exposureSurvey.exposureSurveyDate, e.exposureSurvey.exposureSurveyNumber, '#DCF1D3', true));\r\n });\r\n\r\n // Fetch all measure data for the material across surveys. Group the data by survey and display category, then update the _measureSurveyCategoryGroups object\r\n this._uow.fetch('ExposureSurveys/FetchExposureSurveyMaterialMeasureItems', params).then(e => {\r\n if (e != null && e.length > 0) {\r\n this._materialExposureMeasures = e;\r\n\r\n // First group measures by Exposure Survey, then within each survey, group measure values by category.\r\n const groups = _.groupBy(this._materialExposureMeasures, item => item.exposureSurveyId);\r\n this._measureSurveyGroups = _.map(groups, (v, k) => {\r\n return {id: k, measures: v, isCollapsed: false};\r\n });\r\n\r\n (async () => {\r\n this._measureSurveyCategoryGroups = await this.forEachMeasureCategoryAsync();\r\n })();\r\n }\r\n this._pageState.isLoaded = true;\r\n });\r\n\r\n\r\n });\r\n\r\n this.fetchMaterialAsIsomerSurveys();\r\n this.fetchCustomSurveyMeasureData();\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.expandAll(false);\r\n }\r\n\r\n fetchCustomSurveyMeasureData() {\r\n this._materialExposureCustomSurveyMeasureItems = [];\r\n const params = {materialId: this._material.materialId};\r\n return this._uow.fetch('ExposureSurveys/FetchMaterialExposureCustomSurveyMeasureItems', params).then(c => {\r\n if (c != null && c.length > 0) {\r\n this._materialExposureCustomSurveyMeasureItems = c;\r\n\r\n const uniqueCustomSurveys = [...new Set( this._materialExposureCustomSurveyMeasureItems.map(obj => obj.customSurveyDate))];\r\n uniqueCustomSurveys.forEach((cs) => {\r\n this._measureCustomSurveyCategoryGroups.push(new MeasureCustomSurveyCategoryGroup(this.utilFns.formatDate(cs, 'MM/DD/YYYY'), [], null, cs, '#B0B8B9'));\r\n });\r\n\r\n // First group measures by the date part of the Custom Survey date, then within each survey, group measure values by category.\r\n const groups = _.groupBy(this._materialExposureCustomSurveyMeasureItems, item => this.utilFns.formatDate(item.customSurveyDate, 'MM/DD/YYYY'));\r\n this._measureCustomSurveyGroups = _.map(groups, (v, k) => {\r\n return {id: k, measures: v, isCollapsed: false};\r\n });\r\n\r\n (async () => {\r\n this._measureCustomSurveyCategoryGroups = await this.forEachCustomSurveyMeasureCategoryAsync();\r\n })();\r\n }\r\n });\r\n }\r\n\r\n async forEachCustomSurveyMeasureCategoryAsync(): Promise {\r\n\r\n for (let idx = 0; idx < this._measureCustomSurveyGroups.length; idx++) {\r\n const msg = this._measureCustomSurveyGroups[idx];\r\n\r\n // Group measures by their display category\r\n const cg = _.groupBy(msg.measures, d => d.displayCategory);\r\n const categorygroups: CustomSurveyMeasuresByCategory[] = _.map(cg, (v, k) => {\r\n return {categoryId: k, measureValues: v};\r\n });\r\n\r\n // Then sort each measure within each display category\r\n const sortedcategorygroups: CustomSurveyMeasuresByCategory[] = [];\r\n _.clone(categorygroups).forEach(v => {\r\n const sortedmeasurevalues: MaterialExposureCustomSurveyMeasureItem[] = v.measureValues.sort(compareCustomSurveyMeasures);\r\n sortedcategorygroups.push(new CustomSurveyMeasuresByCategory(v.categoryId, sortedmeasurevalues));\r\n });\r\n\r\n // filter to the material custom survey and update the measures\r\n const measureCustomSurveyCategoryGroup = this.filterToMeasureCustomSurveyCategoryGroup(msg.id);\r\n\r\n if (measureCustomSurveyCategoryGroup != null) {\r\n measureCustomSurveyCategoryGroup.customSurveyMeasuresByCategory = sortedcategorygroups;\r\n measureCustomSurveyCategoryGroup.backgroundColor = '#C1CDD3';\r\n }\r\n }\r\n\r\n return (this._measureCustomSurveyCategoryGroups.sort(compareCustomSurveys));\r\n }\r\n\r\n async forEachMeasureCategoryAsync(): Promise {\r\n\r\n for (let idx = 0; idx < this._measureSurveyGroups.length; idx++) {\r\n const msg = this._measureSurveyGroups[idx];\r\n\r\n // Group measures by their display category\r\n const cg = _.groupBy(msg.measures, d => d.displayCategory);\r\n const categorygroups: MeasuresByCategory[] = _.map(cg, (v, k) => {\r\n return {categoryId: k, measureValues: v};\r\n });\r\n\r\n // Then sort each measure within each display category\r\n const sortedcategorygroups: MeasuresByCategory[] = [];\r\n _.clone(categorygroups).forEach(v => {\r\n const sortedmeasurevalues: MaterialExposureSurveyMeasureItem[] = v.measureValues.sort(compareMeasures);\r\n sortedcategorygroups.push(new MeasuresByCategory(v.categoryId, sortedmeasurevalues));\r\n });\r\n\r\n // Fetch any material isomers that were surveyed along with this material\r\n const i = await (this.fetchIsomers(this._material.materialId, Number(msg.id))); // msg.id = exposureSurveyId.ToString()\r\n\r\n // filter to the material exposure survey and update the measures and isomers fields\r\n const measureSurveyCategoryGroup = this.filterToMeasureSurveyCategoryGroup(msg.id);\r\n\r\n if (measureSurveyCategoryGroup != null) {\r\n measureSurveyCategoryGroup.measuresByCategory = sortedcategorygroups;\r\n measureSurveyCategoryGroup.isomers = i;\r\n measureSurveyCategoryGroup.backgroundColor = '#4CAF50';\r\n }\r\n }\r\n\r\n return (this._measureSurveyCategoryGroups.sort(compareSurveys));\r\n }\r\n\r\n // display isomer materials included in the survey.\r\n async fetchIsomers(materialId: number, exposureSurveyId: number): Promise {\r\n let isomers = '';\r\n const params = {materialId: materialId, exposureSurveyId: exposureSurveyId};\r\n return this._uow.fetch('ExposureSurveys/MaterialExposureSurveyIsomerByMaterialAndSurvey', params).then(i => {\r\n if (i != null && i.length > 0) {\r\n isomers = i.map((m: { material: Material; }) => {\r\n return this.formatIsomerIdentifiers(m.material);\r\n }).join('; ');\r\n }\r\n return isomers;\r\n });\r\n }\r\n\r\n formatIsomerIdentifiers(material: Material): string {\r\n const rifmId = (material.formattedRIFMId == '-') ? '' : ' (RIFM Id: ' + material.formattedRIFMId + ')';\r\n return material.realCASNumber + rifmId;\r\n }\r\n\r\n fetchMaterialAsIsomerSurveys() {\r\n this._isomerOfMaterialExposureSurveys = [];\r\n const params = {materialId: this._material.materialId};\r\n return this._uow.fetch('ExposureSurveys/MaterialExposureSurveyIsomersByMaterialId', params).then(i => {\r\n this._isomerOfMaterialExposureSurveys = i;\r\n });\r\n\r\n }\r\n\r\n // ******************************************************\r\n // interaction for the exposure survey groups\r\n // ******************************************************\r\n hasData(): boolean {\r\n return (this._measureSurveyCategoryGroups !== null && this._measureSurveyCategoryGroups.length > 0);\r\n }\r\n\r\n private surveyGroupCollapse(ix: number) {\r\n this._measureSurveyGroups[ix].collapsed = !this._measureSurveyGroups[ix].collapsed;\r\n }\r\n\r\n private surveyGroupCollapseNew(ix: number) {\r\n this._measureSurveyCategoryGroups[ix].collapsed = !this._measureSurveyCategoryGroups[ix].collapsed;\r\n }\r\n\r\n public expandAll(expand: boolean) {\r\n setTimeout(() => {\r\n this._measureSurveyCategoryGroups.forEach(g => g.collapsed = !expand);\r\n this._measureCustomSurveyCategoryGroups.forEach(g => g.collapsed = !expand);\r\n }, 0);\r\n }\r\n\r\n public surveyDescription(grp: MeasureSurveyCategoryGroup) {\r\n\r\n if (grp == null) {\r\n return '';\r\n }\r\n\r\n const month = this._monthFullNames[grp.exposureSurveyDate.getUTCMonth()];\r\n const year = grp.exposureSurveyDate.getUTCFullYear().toString();\r\n let msg = '';\r\n\r\n if (grp.measuresByCategory == null || grp.measuresByCategory.length < 1) {\r\n msg = ' (The material was surveyed but no measure data has been entered)';\r\n }\r\n\r\n return month + ', ' + year + ' Number: ' + grp.exposureSurveyNumber + msg;\r\n\r\n }\r\n\r\n // ******************************************************\r\n // interaction for the custom survey data\r\n // ******************************************************\r\n hasCustomSurveyData(): boolean {\r\n return (this._measureCustomSurveyCategoryGroups !== null && this._measureCustomSurveyCategoryGroups.length > 0);\r\n }\r\n\r\n private customSurveyGroupCollapse(ix: number) {\r\n this._measureCustomSurveyGroups[ix].collapsed = !this._measureCustomSurveyGroups[ix].collapsed;\r\n }\r\n\r\n private customSurveyGroupCollapseNew(ix: number) {\r\n this._measureCustomSurveyCategoryGroups[ix].collapsed = !this._measureCustomSurveyCategoryGroups[ix].collapsed;\r\n }\r\n\r\n public customSurveyDescription(grp: MeasureCustomSurveyCategoryGroup) {\r\n\r\n if (grp == null) {\r\n return '';\r\n }\r\n\r\n const csDate = new Date(grp.customSurveyDate);\r\n const day = csDate.getDate();\r\n const monthIndex = csDate.getMonth();\r\n const year = csDate.getFullYear().toString();\r\n\r\n return 'Custom Survey Date: ' + this._monthFullNames[monthIndex] + ' ' + day + ', ' + year;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n onShowMaterial(isomer: MaterialExposureSurveyIsomer) {\r\n if (isomer == null || isomer.materialExposureSurvey == null || isomer.materialExposureSurvey.material == null) {\r\n return;\r\n }\r\n\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, isomer.materialExposureSurvey.material.materialId));\r\n // this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, isomer.materialExposureSurvey.material.materialId, ROUTES.Material.childRoutes.MaterialExposure));\r\n }\r\n\r\n // Filters\r\n private filterToExposureSurveyById(exposureSurveyId: number): ExposureSurvey {\r\n if (this._exposureSurveys == null || this._exposureSurveys.length < 1) {\r\n return null;\r\n }\r\n\r\n const expsurvey = this._exposureSurveys.filter(e => e.exposureSurveyId == exposureSurveyId);\r\n if (expsurvey != null && expsurvey.length > 0) {\r\n return expsurvey[0];\r\n }\r\n }\r\n\r\n filterToMeasureSurveyCategoryGroup(id: string): any {\r\n if (this._measureSurveyCategoryGroups == null || this._measureSurveyCategoryGroups.length < 1) {\r\n return (null);\r\n }\r\n\r\n const mscg = this._measureSurveyCategoryGroups.filter(c => c.id == id);\r\n return (mscg != null && mscg.length > 0) ? mscg[0] : null;\r\n }\r\n\r\n filterToMeasureCustomSurveyCategoryGroup(id: string): any {\r\n if (this._measureCustomSurveyCategoryGroups == null || this._measureCustomSurveyCategoryGroups.length < 1) {\r\n return (null);\r\n }\r\n\r\n const mscg = this._measureCustomSurveyCategoryGroups.filter(c => c.id == id);\r\n return (mscg != null && mscg.length > 0) ? mscg[0] : null;\r\n }\r\n}\r\n","import { SynonymsComponent } from './synonyms.component';\r\nimport { StructureIdentityComponent } from './structure-identity.component';\r\nimport { AnalyticalResultsComponent } from './analytical-results.component';\r\nimport { ToxicDataComponent } from './toxic-data.component';\r\nimport { FlavorComponent } from './flavor.component';\r\nimport { SynopsisComponent } from './synopsis.component';\r\nimport { NaturalsComponent } from './naturals.component';\r\nimport { StatusRootComponent } from './status-root.component';\r\nimport { FragranceUseComponent } from './fragrance-use.component';\r\nimport { PredictionsComponent } from './predictions.component';\r\nimport { RelationsComponent } from './relations.component';\r\nimport { REACHRegistrationsComponent } from './reach-registrations.component';\r\nimport { HouseStatusesComponent } from './house-statuses.component';\r\nimport { PublicationsComponent } from './publications.component';\r\n// import { LabelingComponent} from './labeling.component';\r\nimport { SafetyAssessmentComponent } from './safety-assessment.component';\r\nimport { MaterialConsumptionsComponent } from './material-consumptions.component';\r\nimport { MaterialExposureComponent } from './material-exposure.component';\r\n\r\nexport const MATERIAL_ROUTES = {\r\n Synonyms: { name: 'Synonyms', title: 'Synonyms', path: 'synonyms', component: SynonymsComponent },\r\n StructureIdentity: {\r\n name: 'StructureIdentity',\r\n title: 'Structure / Identity',\r\n path: 'structure-identity',\r\n component: StructureIdentityComponent\r\n },\r\n Relations: { name: 'Relations', title: 'Relations', path: 'relations', component: RelationsComponent },\r\n AnalyticalResults: { name: 'AnalyticalResults', title: 'Physical Data', path: 'physical-data', component: AnalyticalResultsComponent },\r\n ToxicData: { name: 'ToxicData', title: 'Toxicological Data', path: 'toxic-data', component: ToxicDataComponent },\r\n Flavor: { name: 'Flavor', title: 'Flavor', path: 'flavor', component: FlavorComponent },\r\n Synopsis: { name: 'Synopsis', title: 'Synopsis', path: 'synopsis', component: SynopsisComponent },\r\n Status: { name: 'Status', title: 'Status', path: 'status', component: StatusRootComponent },\r\n FragranceUse: {\r\n name: 'FragranceUse',\r\n title: 'Fragrance Use',\r\n path: 'fragrance-use',\r\n component: FragranceUseComponent,\r\n staffOnly: true,\r\n rolesPermitted: 'ifra',\r\n rolesExcluded: 'consultant'\r\n },\r\n // Labeling: { name: 'Labeling', title: 'Labeling', path: 'labeling', component: LabelingComponent },\r\n Naturals: {\r\n name: 'Naturals',\r\n title: 'Naturals',\r\n path: 'naturals',\r\n component: NaturalsComponent,\r\n staffOnly: true,\r\n rolesPermitted: 'ifra'\r\n },\r\n Predictions: { name: 'Predictions', title: 'Predictions', path: 'predictions', component: PredictionsComponent },\r\n Publications: { name: 'Publications', title: 'Publications', path: 'publications', component: PublicationsComponent },\r\n Reach: { name: 'Reach', title: 'REACH', path: 'reach', component: REACHRegistrationsComponent },\r\n SafetyAssessment: {\r\n name: 'SafetyAssessment',\r\n title: 'Safety Assessment',\r\n path: 'safety-assessment',\r\n component: SafetyAssessmentComponent\r\n },\r\n RIFMStatus: { name: 'RIFMStatus', title: 'RIFM Status', path: 'rifm-status', component: HouseStatusesComponent, staffOnly: true },\r\n MaterialConsumptions: {\r\n name: 'MaterialConsumptions',\r\n title: 'Material Consumption',\r\n path: 'material-consumptions',\r\n component: MaterialConsumptionsComponent,\r\n staffOnly: true,\r\n rolesPermitted: 'ifra',\r\n rolesExcluded: 'consultant'\r\n },\r\n MaterialExposure: {\r\n name: 'MaterialExposure',\r\n title: 'Material Exposure',\r\n path: 'material-exposure',\r\n component: MaterialExposureComponent,\r\n staffOnly: true,\r\n rolesExcluded: 'consultant'\r\n }\r\n};\r\n\r\n\r\n","
0\">\r\n
\r\n \r\n Alternative Identifiers\r\n
\r\n
\r\n 0\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n DSL\r\n ECN\r\n EINECS\r\n NDSL\r\n REACH\r\n TSCA\r\n
\r\n
\r\n
\r\n","import { Component, Input, OnChanges, OnInit } from '@angular/core';\r\nimport { MaterialAdditionalIdentifier } from '../../entities/EntityModels';\r\nimport { UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { trigger, state, style, animate, transition } from '@angular/animations';\r\n\r\n@Component({\r\n selector: 'material-additional-identifiers',\r\n templateUrl: './material-additional-identifiers.html',\r\n animations: [\r\n trigger('visibility', [\r\n state('shown', style({\r\n opacity: 1\r\n })),\r\n state('hidden', style({\r\n opacity: 0\r\n })),\r\n transition('* => *', animate('.5s'))\r\n ])\r\n ],\r\n})\r\n\r\nexport class MaterialAdditionalIdentifiersComponent implements OnInit, OnChanges {\r\n\r\n _additionalMaterialIds: MaterialAdditionalIdentifier[];\r\n\r\n visibility = 'hidden';\r\n\r\n @Input() materialId: number;\r\n @Input() defaultVisibility: string;\r\n\r\n constructor(private _uow: UnitOfWork) {\r\n }\r\n\r\n ngOnInit() {\r\n this.visibility = (this.defaultVisibility != null) ? this.defaultVisibility : 'hidden';\r\n }\r\n\r\n ngOnChanges() {\r\n this.getMaterialAdditionalIdentifiers();\r\n }\r\n\r\n getMaterialAdditionalIdentifiers() {\r\n if (this.materialId) {\r\n const params = {materialId: this.materialId};\r\n return this._uow.fetchTyped('Materials/MaterialAdditionalIdentifierForMaterial', MaterialAdditionalIdentifier, params)\r\n .then(r => {\r\n this._additionalMaterialIds = r;\r\n });\r\n }\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n toggleVisibility() {\r\n this.visibility = this.visibility == 'shown' ? 'hidden' : 'shown';\r\n }\r\n}\r\n","
\r\n
\r\n
{{title}}
\r\n
\r\n
\r\n
{{title}}
\r\n
\r\n
\r\n
CAS No:
\r\n
{{material.realCASNumber || '-'}}
\r\n
\r\n
\r\n
RIFM ID:
\r\n \r\n
{{ material.formattedRIFMId}}
\r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n
{{material.formattedRIFMId}}
\r\n
\r\n
\r\n
ECB:
\r\n
{{material.eCB}}
\r\n
\r\n
\r\n
FEMA No:
\r\n
{{material.fEMANumber}}
\r\n
\r\n
\r\n
EC No./EINECS/ELINCS:
\r\n
{{material.eCInventoryEINECSELINCSNumbers()}}
\r\n
\r\n
\r\n
METI/ENCS:
\r\n
{{material.mETIENCS()}}
\r\n
\r\n
\r\n
ECL:
\r\n
{{material.eCL}}
\r\n
\r\n
\r\n
Registration:
\r\n
{{ getRegistration() }}
\r\n
\r\n
\r\n
Alternative CAS No:
\r\n
{{material.alternateCASNumber}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n {{material.getCaptiveText()}}\r\n
\r\n
\r\n","import { Component, Input } from '@angular/core';\r\nimport { Material } from '../../entities/Material';\r\n\r\n@Component({\r\n selector: 'material-header',\r\n templateUrl: './material-header.html',\r\n})\r\nexport class MaterialHeaderComponent {\r\n\r\n showTooltip = false;\r\n @Input() material: Material;\r\n @Input() title: string;\r\n\r\n hasRIFMTooltip() {\r\n return !!(this.material.typeBotanicalSubdivision || this.material.typeEssentialOil);\r\n }\r\n\r\n toggleTooltip() {\r\n this.showTooltip = !this.showTooltip;\r\n }\r\n\r\n formatRIFMTooltip() {\r\n const bs = this.material.typeBotanicalSubdivision;\r\n const bsText = bs ? `${bs.typeBotanicalSubdivisionId}: ${bs.botanicalSource}` : '';\r\n const te = this.material.typeEssentialOil;\r\n const teText = te ? `${te.typeEssentialOilId}: ${te.essentialOilTerm}` : '';\r\n const result = `\r\n
\r\n
Botanical Definition
\r\n
${bsText}
\r\n
\r\n
Processing Method
\r\n
${teText}
\r\n
\r\n `;\r\n return result;\r\n }\r\n\r\n getRegistration() {\r\n const registrations: string[] = [];\r\n if (this.material.dSLRegistration) {\r\n registrations.push('DSL');\r\n }\r\n if (this.material.eCNRegistration) {\r\n registrations.push('ECN');\r\n }\r\n if (this.material.eINECSRegistration) {\r\n registrations.push('EINECS');\r\n }\r\n if (this.material.nDSLRegistration) {\r\n registrations.push('NDSL');\r\n }\r\n if (this.material.reachRegistration) {\r\n registrations.push('REACH');\r\n }\r\n if (this.material.tSCARegistration) {\r\n registrations.push('TSCA');\r\n }\r\n\r\n return registrations.join(' ');\r\n }\r\n}\r\n","\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n

This material no longer exists in the database

\r\n ","import { Component, OnDestroy, OnInit, } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport * as _ from 'lodash';\r\nimport { IRouteDefinition, SearchService, StateMap, UnitOfWork } from '../../services/common';\r\n\r\nimport { Material } from '../../entities/Material';\r\nimport { MaterialResolver } from './material.resolver';\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\n\r\n\r\n@Component({\r\n selector: 'material',\r\n templateUrl: './material.html',\r\n})\r\nexport class MaterialComponent implements OnInit, OnDestroy {\r\n material: Material;\r\n currentMaterialId: number;\r\n additionalIdsVisibility = 'hidden';\r\n _sub: any;\r\n _materialNotFound = false;\r\n _routes = _.values(MATERIAL_ROUTES);\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _searchService: SearchService,\r\n private _materialResolver: MaterialResolver, public _route: ActivatedRoute, public _location: Location) {\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n canShow(routeDef: IRouteDefinition) {\r\n\r\n this.additionalIdsVisibility = 'hidden';\r\n\r\n if (this._stateMap.currentUser.isStaff) {\r\n // Exception to prevent consultant staff from seeing otherwise staff viewable content.\r\n if (routeDef.rolesExcluded) {\r\n const roles = routeDef.rolesExcluded.split(',');\r\n if (roles != null && roles.length > 0) {\r\n return (!this.userRoleFound(roles));\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n if (typeof routeDef.staffOnly === 'undefined') { // staffOnly only defined if true\r\n return true;\r\n }\r\n\r\n // Exception to allow a role to view staff only content\r\n if (routeDef.rolesPermitted) {\r\n const roles = routeDef.rolesPermitted.split(',');\r\n if (roles != null && roles.length > 0) {\r\n return (this.userRoleFound(roles));\r\n }\r\n }\r\n\r\n\r\n return false;\r\n }\r\n\r\n userRoleFound(roles: string[]): boolean {\r\n for (let idx = 0; idx < roles.length; idx++) {\r\n if (this._stateMap.currentUser.isInRole(roles[idx])) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n ngOnInit() {\r\n this._sub = this._route.params.subscribe(params => {\r\n // this is needed to get the right header to display\r\n const materialId = +params['id'];\r\n this._materialResolver.fetch(materialId).then(m => {\r\n this.material = m;\r\n this.currentMaterialId = (this.material) ? this.material.materialId : null;\r\n this._materialNotFound = !this.material;\r\n });\r\n });\r\n\r\n this.getDocumentManagementUrl().then(url => {\r\n this._stateMap.documentManagementBaseUrl = url; // Needs to be set if Material page is opened from an external link.\r\n });\r\n }\r\n\r\n ngOnDestroy() {\r\n this._sub.unsubscribe();\r\n }\r\n\r\n canDeactivate() {\r\n if (this._uow.hasChanges()) {\r\n return this._stateMap.yesNoComponent.showModal(\r\n 'Changes will be lost', 'Do you want to continue?').then(ok => {\r\n if (ok) {\r\n this._uow.rollback();\r\n }\r\n return ok;\r\n });\r\n } else {\r\n return Promise.resolve(true);\r\n }\r\n }\r\n\r\n isActiveTab(r: IRouteDefinition) {\r\n const currentRouteName = this._stateMap.currentRouteName || this._routes[0].name;\r\n return r.name == currentRouteName;\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url\r\n // make sure it set for when users navigate from external links\r\n // ************************************************************************\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n}\r\n","
\r\n
\r\n

Workflow Status and History

\r\n
(Still Loading...)
\r\n
\r\n\r\n
\r\n
\r\n
Pending Actions
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Action/Missing Data
{{r}}
\r\n
No Remaining Tasks
\r\n
\r\n\r\n
\r\n
Completed Actions
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
DateCompleted ActionCompleted BySent To/NotifiedUndo
{{utilFns.formatDate(c.created) }}{{c.workflowActionDescription}}{{c.staffFirstName || ''}}{{c.actionData}}Remove
\r\n\r\n
\r\n
\r\n
\r\n\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { ReferenceState, UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { Reference, WorkflowRecordedAction } from '../../entities/EntityModels';\r\nimport { WorkflowActivityCompletedItem } from '../../entities/projections/WorkflowActivityCompletedItem';\r\n\r\n@Component({\r\n selector: 'workflow-history',\r\n templateUrl: './workflow-history.html'\r\n})\r\n\r\nexport class WorkflowHistoryComponent implements OnInit {\r\n\r\n _isDataLoading: boolean;\r\n _unfinishedReasons: string[];\r\n _workflowActivityCompletedItems: WorkflowActivityCompletedItem[];\r\n _workflowPendingActions: WorkflowRecordedAction[];\r\n\r\n @Input() entity: Reference;\r\n @Input() editable: boolean;\r\n\r\n constructor(private _uow: UnitOfWork, private _referenceState: ReferenceState) {\r\n }\r\n\r\n ngOnInit() {\r\n this.loadData();\r\n }\r\n\r\n public loadData() {\r\n\r\n this._unfinishedReasons = [];\r\n this._workflowActivityCompletedItems = [];\r\n this._workflowPendingActions = [];\r\n\r\n if (this.entity == null) {\r\n return;\r\n }\r\n\r\n this._isDataLoading = true;\r\n\r\n this._referenceState.enumerateMissingData(this.entity).then(e => {\r\n if (e > 0) {\r\n // Number of missing data elements\r\n this._unfinishedReasons = this._referenceState.unfinishedReasons;\r\n }\r\n\r\n this._workflowActivityCompletedItems = this._referenceState.getCompletedWorkflowActions(this.entity);\r\n this._isDataLoading = false;\r\n });\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n hasCompletedActions(): boolean {\r\n return (this._workflowActivityCompletedItems != null && this._workflowActivityCompletedItems.length > 0);\r\n }\r\n\r\n hasPendingActions(): boolean {\r\n return (this._unfinishedReasons != null && this._unfinishedReasons.length > 0);\r\n }\r\n\r\n hasData(): boolean {\r\n return (this.hasCompletedActions() || this.hasPendingActions());\r\n }\r\n\r\n public get currentReferenceId(): number {\r\n if (this.entity) {\r\n return this.entity.referenceId;\r\n }\r\n return null;\r\n }\r\n\r\n public onReferenceChange(reference: Reference) {\r\n this.entity = reference;\r\n this.loadData();\r\n }\r\n\r\n public removeAction(c: WorkflowActivityCompletedItem) {\r\n this._referenceState.processDeleteWorkflowAction(this.entity, c);\r\n this._workflowActivityCompletedItems = this._workflowActivityCompletedItems.filter(w => w.workflowActivityCompletedItemId != c.workflowActivityCompletedItemId);\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n\t\t\t\t\r\n\t\t\t\t\tFinished  \r\n\t\t\t\t\r\n
\r\n
\r\n\t\t\t\t\r\n\t\t\t\t\tUnfinished  \r\n\t\t\t\t\r\n
\r\n
\r\n\t\t\t\t\r\n\t\t\t\t\tReference Proofed\r\n\t\t\t\t\r\n
\r\n
\r\n\t\t\t\t\r\n\t\t\t\t\tReference Unproofed\r\n\t\t\t\t\r\n
\r\n
\r\n \r\n

{{reference.referenceId}}

\r\n
\r\n \r\n

{{reference.title}}

\r\n
\r\n \r\n

{{reference.project?.projectName}}

\r\n
\r\n \r\n

{{reference.authorDisplay()}}

\r\n
\r\n \r\n

{{reference.journal?.journalName || '-'}}; {{reference.journalDetail || ''}}

\r\n
\r\n \r\n

{{reference.typeKlimischId || '-'}}

\r\n
\r\n \r\n

{{reference.publicationWebReference || '-'}}

\r\n
\r\n \r\n

\r\n
\r\n \r\n

{{reference.abstractNumber}}

\r\n
\r\n \r\n

{{reference.meetingDetails}}

\r\n
\r\n \r\n \r\n \r\n \r\n

{{reference.contractorId || '-'}}

\r\n
\r\n \r\n {{reference.inLifePortion || '-'}}\r\n \r\n
\r\n \r\n

{{reference.govSponsors || '-'}}

\r\n
\r\n \r\n

{{reference.govDocNumbers || '-'}}

\r\n
\r\n
\r\n \r\n
\r\n \r\n

{{reference.staffComments || '-'}}

\r\n
\r\n \r\n

{{reference.precedence || '-'}}

\r\n
\r\n
\r\n
\r\n \r\n

{{reference.sponsoringCompany || '-'}}

\r\n
\r\n \r\n

{{reference.typePublication.publicationType}}

\r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n

{{reference.typeSearchServiceId}}

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
0\">\r\n
Material Links
\r\n
\r\n \r\n
{{group.keyExpl}}
\r\n
{{group.keyDescr}}
\r\n \r\n \r\n CAS No.\r\n RIFM ID\r\n Synonym\r\n FEMA No.\r\n Human Health\r\n Environmental\r\n \r\n \r\n \r\n \r\n {{sl.material.realCASNumber || '(No CAS#)'}}\r\n {{sl.material.formattedRIFMId}}\r\n \r\n {{sl.material.fEMANumber}}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n \r\n","import { Component, OnInit } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { Reference, SpecialLink, TypePublication } from '../../entities/EntityModels';\r\nimport { ROUTES } from '../routes';\r\nimport { REFERENCE_ROUTES } from './reference.routes';\r\n\r\n@Component({\r\n selector: 'reference-details',\r\n templateUrl: './reference-details.html',\r\n providers: [provideParent(ReferenceDetailsComponent, EditPropParent)]\r\n})\r\nexport class ReferenceDetailsComponent implements EditPropParent, OnInit {\r\n reference: Reference;\r\n\r\n _typePublications: TypePublication[];\r\n _groupedLinks: {};\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _router: Router, public _userManager: UserManager) {\r\n }\r\n\r\n ngOnInit() {\r\n this.reference = this._stateMap.currentReference;\r\n this._stateMap.currentRouteName = REFERENCE_ROUTES.ReferenceDetails.name;\r\n this._uow.typePublicationRepository.all().then(tps => {\r\n this._typePublications = tps;\r\n });\r\n this._uow.projectRepository.all().then(r => {\r\n // just need them brought in\r\n });\r\n this.fetchSpecialLinks(this.reference.referenceId);\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n getAbstract() {\r\n return this.reference.abstractText.replace(/\\n/g, '
');\r\n }\r\n\r\n canDeactivate() {\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n getError(propName: string) {\r\n return this.reference.getErrorFor(propName);\r\n }\r\n\r\n isProofed() {\r\n return this.reference.complete;\r\n }\r\n\r\n isGovernmentDocument(): boolean {\r\n return (this.reference.publicationTypeId == 7);\r\n }\r\n\r\n fetchSpecialLinks(referenceId: number) {\r\n const p = {referenceId: referenceId};\r\n\r\n return this._uow.specialLinkReferenceRepository.whereWithParams(p).then(r => {\r\n const groups = _.groupBy(r, x => x.explanation() + ':::' + x.description());\r\n\r\n const groupedLinks = _.keys(groups).map(k => {\r\n const groupLinks = _.sortBy(groups[k], (sl: SpecialLink) => sl.material.principalSynonym().synonymWordOrWebVersion());\r\n const parts = k.split(':::');\r\n return {keyExpl: parts[0], keyDescr: parts[1], specialLinks: groupLinks};\r\n });\r\n this._groupedLinks = _.sortBy(groupedLinks, g => g.keyExpl);\r\n });\r\n }\r\n\r\n onCasSelect(specialLink: SpecialLink) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, specialLink.material.materialId));\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n Reference Data Report\r\n Reference Data Single Material Report\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n Reference: {{bd.reference?.referenceId}}\r\n
\r\n
\r\n Sub-Reference: {{bd.subReference}}\r\n
\r\n
\r\n Study: {{bd.typeStudy?.studyLong || '-'}}\r\n \r\n
   {{stDescr}}\r\n
\r\n
\r\n
\r\n Route: \r\n
\r\n
\r\n Species: \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
Study Length:
\r\n
\r\n {{bd.studyLength}}\r\n {{bd.typeTimeUnitId}}\r\n
\r\n
\r\n
\r\n
GLP:
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
Protocol:
\r\n
{{bd.protocol}}
\r\n
\r\n
\r\n
Comment:
\r\n
{{bd.comment || '-'}}
\r\n
\r\n
\r\n
Compliance:
\r\n
{{bd.compliance || '-'}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
    \r\n \r\n
  • \r\n
    \r\n
    \r\n
    Experimental Material
    \r\n
    \r\n
    Material Name:
    \r\n
    \r\n
    \r\n
    \r\n
    CAS Number:
    \r\n
    {{expMaterial?.material.realCASNumber || '(No CAS#)'}}
    \r\n
    \r\n
    \r\n
    RIFM ID:
    \r\n
    {{expMaterial?.material.monographNumber}}
    \r\n
    \r\n
    \r\n
    \r\n
    Experimental Description
    \r\n
    \r\n
    Calculated:
    \r\n
    {{expMaterial?.calculatedResultTypeAndValue}}
    \r\n
    \r\n
    \r\n
    Vehicle:
    \r\n
    {{expMaterial?.typeExperimentVehicle.vehicle}}
    \r\n
    \r\n
    \r\n
    Summary:
    \r\n
    {{expMaterial?.experimentalSummary}}
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n
    \r\n\r\n
    Experimental Results
    \r\n
    \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
    Dose/UnitEffectsResults
    {{er.formattedDose()}}{{er.toxicEffects() || '-'}}{{er.resultNote}}{{(er.typeExperimentVehicleId != 'NONE') ? 'Vehicle: ' + er.typeExperimentVehicle.vehicle : ''}}
    \r\n
    \r\n
    \r\n
    \r\n\r\n
  • \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n","import { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PrintToPdfDocComponent } from '../main/print-to-pdf-doc.component';\r\n\r\nimport { BiologicalData, ExperimentalMaterial } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'report',\r\n templateUrl: './reference-data-report.html',\r\n})\r\nexport class ReferenceDataReportComponent implements OnInit {\r\n @ViewChild(PrintToPdfDocComponent, { static: true }) _printToPdfDocComponent: PrintToPdfDocComponent;\r\n\r\n @Input() bd: BiologicalData;\r\n @Input() selectedExpMaterial: ExperimentalMaterial;\r\n\r\n ngOnInit() {\r\n\r\n }\r\n\r\n _selectedExpMaterials: ExperimentalMaterial[] = [];\r\n\r\n\r\n getSelectedExpMaterials(bd: BiologicalData) {\r\n if (this.selectedExpMaterial) {\r\n // HACK - because of Angular2 devMode bug.\r\n this._selectedExpMaterials.length = 0;\r\n this._selectedExpMaterials.push(bd.experimentalMaterials.filter(expMat => expMat == this.selectedExpMaterial)[0]);\r\n return this._selectedExpMaterials;\r\n } else {\r\n return bd.experimentalMaterials;\r\n }\r\n }\r\n\r\n printFullReport() {\r\n // need to insure that we get to an element below the bootstrap modal styling.\r\n const ele = document.querySelector('#FullReport .modal-content');\r\n UtilFns.printElement(ele);\r\n }\r\n\r\n showPrintToPdfDoc() {\r\n this._printToPdfDocComponent.showModal();\r\n }\r\n}\r\n\r\n","\r\n
\r\n
\r\n Show Study Details \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n {{bd.subReference}}\r\n
\r\n
\r\n \r\n {{bd.typeStudy?.studyLong}}\r\n \r\n
{{stDescr}}\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n

Compliance: {{bd.compliance || '-'}}

\r\n
\r\n \r\n
\r\n
\r\n
\r\n

Protocol: {{bd.protocol || '-'}}

\r\n
\r\n
\r\n \r\n
Protocol: {{bd.protocol}}
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n {{briefRef}}\r\n {{briefRef}}\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n {{bd.subjectsMale}}\r\n \r\n {{bd.subjectsFemale}}\r\n \r\n {{bd.subjectsUnspecifiedSex}}\r\n
\r\n
\r\n Study Length:\r\n {{bd.studyLength}}\r\n {{bd.typeTimeUnitId}}\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n {{bd.comment}}\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n {{bd.safetyAssessmentSummary}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n {{ expMaterial?.material.realCASNumber || '(No CAS#)' }}\r\n Captive\r\n
\r\n
\r\n \r\n {{expMaterial?.material.monographNumber}}\r\n
\r\n
\r\n \r\n {{expMaterial?.material.fEMANumber}}\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{expMaterial?.typeExperimentVehicle.vehicle || '-'}}\r\n
\r\n
\r\n \r\n {{expMaterial?.experimentalDetails || '-'}}\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{expMaterial?.sampleText || '-'}}\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{expMaterial?.typeToxicEffectId || '-'}}\r\n
\r\n
\r\n \r\n {{expMaterial?.calculatedResultTypeAndValue}}\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{expMaterial?.typeStudyMixture.description}}\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{expMaterial?.experimentalSummary}}\r\n
\r\n
\r\n \r\n {{expMaterial?.fFDSStatement || '-'}}\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{er.formattedDose()}}\r\n \r\n {{er.toxicEffects()}}\r\n
\r\n
\r\n
\r\n
\r\n \r\n
{{er.dPMperLymphNode}}
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
{{er.stimulationIndex}}
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
{{er.resultNote || '-'}}
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
{{er.typeExperimentVehicle.vehicle}}
\r\n
\r\n
\r\n
\r\n

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n","import { Component, Input, OnDestroy, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { BiologicalData, ExperimentalMaterial, Material, Reference } from '../../entities/EntityModels';\r\nimport { ReferenceListItem } from '../../entities/projections/ReferenceListItem';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { REFERENCE_ROUTES } from './reference.routes';\r\n\r\n@Component({\r\n selector: 'reference-data',\r\n templateUrl: './reference-data.html',\r\n})\r\nexport class ReferenceDataComponent implements OnInit, OnDestroy {\r\n @Input() toxaudit: boolean;\r\n @Input() expanded: boolean;\r\n @Input() reference: Reference;\r\n @Input() initTitle = true;\r\n\r\n _queryParamsSub: any;\r\n _emptyQueryParams: { queryParams: {} };\r\n\r\n\r\n _casContext: string;\r\n _bioIdContext: number;\r\n\r\n visibleIxs = {};\r\n\r\n material: Material;\r\n biologicalDatas: BiologicalData[];\r\n _sub: any;\r\n _pageState = new PageState('Reference');\r\n _printBd: BiologicalData;\r\n _printExpMaterial: ExperimentalMaterial;\r\n _briefRefsNotFound: string[] = [];\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap,\r\n public _router: Router, public _route: ActivatedRoute, public _location: Location) {\r\n this.reference = this._stateMap.currentReference;\r\n }\r\n\r\n ngOnInit() {\r\n // this._queryParamsSub = this._router.routerState.queryParams.subscribe(params => {\r\n // this._queryParamsSub = this._router.routerState.root.queryParams.subscribe(params => {\r\n if (this.initTitle) {\r\n this._stateMap.currentRouteName = REFERENCE_ROUTES.ReferenceData.name;\r\n }\r\n\r\n this._queryParamsSub = this._route.queryParams.subscribe(params => {\r\n this._casContext = params['cas'];\r\n this._bioIdContext = +params['bioid'];\r\n this.fetchBioData();\r\n });\r\n }\r\n\r\n ngOnDestroy() {\r\n this._queryParamsSub.unsubscribe();\r\n }\r\n\r\n private fetchBioData() {\r\n if (this.reference.biologicalDatas == null || this.reference.biologicalDatas.length == 0 || this._bioIdContext) {\r\n this._pageState.isLoading = true;\r\n // basically doing this + some includes.\r\n // this.reference.entityAspect.loadNavigationProperty(\"biologicalDatas\")\r\n const that = this;\r\n this._uow.referenceRepository.populateBiologicalData(this.reference).then(() => {\r\n this._pageState.isLoaded = true;\r\n that.initializeLocals();\r\n })\r\n .catch();\r\n } else {\r\n this.initializeLocals();\r\n }\r\n }\r\n\r\n doReport(bd: BiologicalData, expMaterial: ExperimentalMaterial) {\r\n this._printBd = bd;\r\n this._printExpMaterial = expMaterial;\r\n setTimeout(() => {\r\n const ele = $('#FullReport');\r\n (ele).modal('show');\r\n }, 0);\r\n }\r\n\r\n abbreviate(s: string, length: number) {\r\n if (s == null || s.trim().length === 0) {\r\n return '-';\r\n }\r\n if (s.length <= length) {\r\n return s;\r\n }\r\n return s.trim().substr(0, length) + ' . . .';\r\n }\r\n\r\n\r\n initializeLocals() {\r\n this.biologicalDatas = this.reference.biologicalDatas;\r\n // sort biologicalData by fileReference with biologicalDatas matching this._bioIdContext to the top;\r\n if (this.biologicalDatas.length == 0) {\r\n this._pageState.isLoadedWithNoData = true;\r\n return;\r\n }\r\n // assign tempSubRef #s to blank fileRefs from oldest to newest.\r\n let tempIx = 1;\r\n _.sortBy(this.biologicalDatas, bd => bd.created).forEach(bd => {\r\n // if fileRef is null or blank ( or 0)\r\n if (!bd.fileReference) {\r\n bd._tempSubReference = tempIx++;\r\n }\r\n });\r\n UtilFns.sort(this.biologicalDatas, true, (bd) => {\r\n let prefix = '';\r\n if (this._bioIdContext) {\r\n prefix = bd.biologicalDataId == this._bioIdContext ? 'a_' : 'z_';\r\n }\r\n return prefix + bd.subReference || '';\r\n });\r\n // sort each experimentalMaterial by casNumber with casNumbers matching this._casContext to the top\r\n this.biologicalDatas.forEach(bd => {\r\n UtilFns.sort(bd.experimentalMaterials, true, (expMat) => {\r\n let prefix = '';\r\n if (this._casContext != null) {\r\n prefix = expMat.material.realCASNumber == this._casContext ? 'a_' : 'z_';\r\n }\r\n return prefix + expMat.material.realCASNumber;\r\n });\r\n\r\n bd.experimentalMaterials.forEach(em => {\r\n UtilFns.sortNumeric(em.experimentalResults, true, (expRes) => {\r\n return expRes.dose;\r\n });\r\n });\r\n });\r\n this._pageState.isLoaded = true;\r\n\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n isNotZero(s: number) {\r\n return s != 0;\r\n }\r\n\r\n\r\n showHide(op: string, ix: number, jx: number) {\r\n const key = op + ':' + ix + ':' + jx;\r\n this.visibleIxs[key] = !this.visibleIxs[key];\r\n }\r\n\r\n isVisible(op: string, ix: number, jx: number) {\r\n const key = op + ':' + ix + ':' + jx;\r\n if (this.visibleIxs[key] == undefined) {\r\n if (this.expanded || op == 'expMaterial') {\r\n this.visibleIxs[key] = true;\r\n }\r\n }\r\n\r\n return !!this.visibleIxs[key];\r\n }\r\n\r\n getShowHideText(op: string, ix: number, jx: number) {\r\n const show = this.isVisible(op, ix, jx);\r\n return show ? 'Less details...' : 'More Details...';\r\n }\r\n\r\n isClickableBriefRef(briefRef: string) {\r\n if (this._briefRefsNotFound.indexOf(briefRef) >= 0) {\r\n return false;\r\n }\r\n return briefRef != null && briefRef.indexOf(',') >= 0;\r\n }\r\n\r\n goToBriefRef(briefRef: string) {\r\n return this._uow.fetch('References/ReferencesByBriefReference', { briefReference: briefRef }).then(r => {\r\n const brMatches = r;\r\n if (brMatches.length == 0) {\r\n this._briefRefsNotFound.push(briefRef);\r\n return;\r\n }\r\n\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, brMatches[0].referenceId), this._emptyQueryParams);\r\n });\r\n }\r\n\r\n goToSynonyms(expmaterial: ExperimentalMaterial) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, expmaterial.materialId));\r\n }\r\n\r\n showDetailsToggle() {\r\n // All reference data is shown by default when displayed in the Staff Editing Reference Audit view\r\n if (this.toxaudit && this.toxaudit == true) {\r\n return false;\r\n }\r\n return (this.biologicalDatas && this.biologicalDatas.length > 0);\r\n }\r\n\r\n toggleDetailsDisplay(event: any) {\r\n this.expanded = event.target.checked;\r\n for (const key in this.visibleIxs) {\r\n if (this.visibleIxs.hasOwnProperty(key)) {\r\n this.visibleIxs[key] = event.target.checked;\r\n }\r\n }\r\n\r\n }\r\n}\r\n","\r\n \r\n \r\n Reference No.\r\n Brief Reference\r\n Title\r\n Relation Type\r\n \r\n \r\n \r\n \r\n \r\n \r\n {{e.relatedReference?.referenceId}}\r\n {{ e.relatedReference?.briefRef(isStaff()) }}\r\n {{e.relatedReference?.title}}\r\n {{e.typeReferenceRelation?.label}}\r\n \r\n \r\n \r\n\r\n","import { ReferenceDetailsComponent } from './reference-details.component';\r\nimport { ReferenceDataComponent } from './reference-data.component';\r\nimport { ReferenceRelationsComponent } from './reference-relations.component';\r\n\r\nexport const REFERENCE_ROUTES = {\r\n ReferenceDetails: {\r\n title: 'Reference',\r\n path: 'reference-details',\r\n name: 'ReferenceDetails',\r\n component: ReferenceDetailsComponent\r\n },\r\n ReferenceData: {\r\n title: 'Reference Data',\r\n path: 'reference-data',\r\n name: 'ReferenceData',\r\n component: ReferenceDataComponent\r\n },\r\n ReferenceRelations: {\r\n title: 'Related References',\r\n path: 'reference-relations',\r\n name: 'ReferenceRelations',\r\n component: ReferenceRelationsComponent\r\n },\r\n};\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { REFERENCE_ROUTES } from './reference.routes';\r\n\r\nimport { Reference, ReferenceRelation } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'synonyms',\r\n templateUrl: './reference-relations.html',\r\n})\r\nexport class ReferenceRelationsComponent implements OnInit {\r\n\r\n _referenceId: number;\r\n _entities: ReferenceRelation[];\r\n _pageState = new PageState('Reference Relations');\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap,\r\n public _router: Router) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = REFERENCE_ROUTES.ReferenceRelations.name;\r\n this._referenceId = this._stateMap.currentReference.referenceId;\r\n this._uow.typeReferenceRelationRepository.all().then(r => {\r\n // this._typeReferenceRelations = r;\r\n });\r\n\r\n this.fetchEntities();\r\n }\r\n\r\n isStaff() {\r\n return this._userManager.currentUser.isStaff;\r\n }\r\n\r\n fetchEntities() {\r\n this._pageState.isLoading = true;\r\n\r\n const q = { referenceId: this._referenceId };\r\n this._uow.referenceRelationRepository\r\n .whereWithParams(q)\r\n .then(r => {\r\n this._entities = r;\r\n this._pageState.isLoaded = r;\r\n })\r\n .catch(e => {\r\n this._pageState.isLoaded = false;\r\n });\r\n }\r\n\r\n\r\n navToRef(r: Reference) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, r.referenceId));\r\n }\r\n\r\n\r\n}\r\n","\r\n
{{title}}
\r\n \r\n {{ reference?.description(isStaff()) }}\r\n \r\n \r\n Restricted Distribution\r\n \r\n \r\n {{reference?.captiveFinishedText()}}\r\n \r\n
\r\n","import { Component, Input } from '@angular/core';\r\n\r\nimport { Reference } from '../../entities/Reference';\r\nimport { DocUniqReference } from '../../entities/DocUniqReference';\r\n\r\nimport {UnitOfWork, UserManager} from '../../services/common';\r\n\r\n@Component({\r\n selector: 'reference-header',\r\n templateUrl: './reference-header.html',\r\n})\r\nexport class ReferenceHeaderComponent {\r\n @Input() reference: Reference;\r\n @Input() title: string;\r\n\r\n constructor(public _userManager: UserManager, public _uow: UnitOfWork) {\r\n }\r\n\r\n isStaff() {\r\n return this._userManager.currentUser.isStaff;\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n

This reference no longer exists in the database

\r\n\r\n\r\n","import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { IRouteDefinition, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\n\r\nimport { Reference, DocUniqReference } from '../../entities/EntityModels';\r\nimport { ReferenceResolver } from './reference.resolver';\r\nimport { REFERENCE_ROUTES } from './reference.routes';\r\nimport { ShowAndDownloadPDFComponent } from '../docmanagement/show-and-download-pdf.component';\r\nimport {UtilFns} from '../../utils/util-fns';\r\n\r\n@Component({\r\n selector: 'reference',\r\n templateUrl: './reference.html',\r\n})\r\nexport class ReferenceComponent implements OnInit, OnDestroy {\r\n @ViewChild(ShowAndDownloadPDFComponent, { static: true }) _showAndDownloadPDFComponent: ShowAndDownloadPDFComponent;\r\n\r\n reference: Reference;\r\n _referenceNotFound: boolean;\r\n\r\n _hasReferenceDocumentFile = false;\r\n _referenceFileName = '';\r\n\r\n _sub: any;\r\n _routes = _.values(REFERENCE_ROUTES);\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap,\r\n public _referenceResolver: ReferenceResolver, public _location: Location, public _route: ActivatedRoute) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._sub = this._route.params.subscribe(params => {\r\n // this is needed to get the right header to display\r\n const referenceId = +params['id'];\r\n this._referenceResolver.fetch(referenceId).then(m => {\r\n this.reference = m;\r\n this._referenceNotFound = !this.reference;\r\n this.fetchReferenceDocumentFileStatus();\r\n });\r\n });\r\n\r\n this.getDocumentManagementUrl().then(url => {\r\n this._stateMap.documentManagementBaseUrl = url; // Needs to be set if Reference page is opened from an external link.\r\n this._stateMap.documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDocument';\r\n });\r\n }\r\n\r\n ngOnDestroy() {\r\n this._sub.unsubscribe();\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n isActiveTab(r: IRouteDefinition) {\r\n const currentRouteName = this._stateMap.currentRouteName || this._routes[0].name;\r\n return r.name == currentRouteName;\r\n }\r\n\r\n canDeactivate() {\r\n if (this._uow.hasChanges()) {\r\n return this._stateMap.yesNoComponent.showModal(\r\n 'Changes will be lost', 'Do you want to continue?').then(ok => {\r\n if (ok) {\r\n this._uow.rollback();\r\n }\r\n return ok;\r\n });\r\n } else {\r\n return Promise.resolve(true);\r\n }\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n fetchReferenceDocumentFileStatus() {\r\n this._hasReferenceDocumentFile = false;\r\n\r\n if (this.reference == null) {\r\n return false;\r\n }\r\n\r\n return this._uow.fetch('DocumentManagement/RIFMDocumentByReferenceId', {referenceId: this.reference.referenceId}).then(rd => {\r\n const doc = (rd && rd.length) ? rd[0] : null;\r\n if (doc != null) {\r\n this._referenceFileName = doc.fileName;\r\n this._hasReferenceDocumentFile = (doc.fileName != null && doc.fileName.length > 0);\r\n }\r\n });\r\n }\r\n\r\n canDownloadReferenceDocument(): boolean {\r\n\r\n if (this.isStaff() || this._userManager.currentUser.isInRole('fema')) {\r\n return true;\r\n }\r\n\r\n if (this.reference) {\r\n if (this._userManager.currentUser.isInRole('iff') && (this.matchDocumentToRole('iff') || this.matchDocumentToRole('bba'))) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n matchDocumentToRole(role: string) {\r\n if (this.reference.briefReference.length < role.length) {\r\n return false;\r\n }\r\n\r\n return (this.reference.briefReference.substring(0, role.length).toUpperCase() == role.toUpperCase());\r\n }\r\n\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n showReferenceDocument() {\r\n this._showAndDownloadPDFComponent.fileName = this._referenceFileName;\r\n UtilFns.showModal(this._showAndDownloadPDFComponent, this).then(m => {\r\n return;\r\n });\r\n }\r\n}\r\n","\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n {{_CASCollisionWarning}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n MaterialId:\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n \r\n
\r\n 0)\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
MaterialIdCAS No.CaptiveRIFM IDFEMA No.
{{m.materialId}}{{m.realCASNumber}}{{ getCaptiveText(m.confidential) }}{{m.formattedRifmId}}{{m.fEMANumber}}
\r\n
\r\n {{_noMonographNumberMatchesMsg}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n 0)\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
MaterialIdCAS No.CaptiveFEMA No.RIFM ID
{{fm.materialId}}{{fm.realCASNumber}}{{ getCaptiveText(fm.confidential) }}{{fm.fEMANumber}}{{fm.formattedRifmId}}
\r\n
\r\n
\r\n {{_noFEMANumberMatchesMsg}}\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n {{_synonymCollisionWarning}}\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n
\r\n
0\" class=\"material-edit-box\">\r\n
\r\n 0\">\r\n \r\n \r\n \r\n \r\n Type\r\n CAS No.\r\n EC Inventory\r\n ECL\r\n EINECS\r\n ECN\r\n Registration\r\n \r\n \r\n \r\n \r\n Delete\r\n Edit\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n DSL\r\n ECN\r\n EINECS\r\n NDSL\r\n REACH\r\n TSCA\r\n \r\n \r\n \r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n At least on identifier must be entered.\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n","import {Component, forwardRef, Inject, Input, OnInit, QueryList, ViewChild, ViewChildren} from '@angular/core';\r\nimport { Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { EditorService, provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/edit-prop.component';\r\n\r\nimport {\r\n MaterialAdditionalIdentifier,\r\n TypeBotanicalSubdivision,\r\n TypeEssentialOil,\r\n TypeNaturalOccurrence,\r\n TypeTSCAClass\r\n} from '../../entities/EntityModels';\r\nimport { MaterialListItem } from '../../entities/projections/MaterialListItem';\r\n\r\nimport { MaterialEditData, MaterialEditorComponent } from './material-editor.component';\r\nimport { MaterialResultsComponent } from '../material/material-results.component';\r\n\r\nexport enum MaterialAdditionalIdentifierMode { NotSet, Adding, Editing }\r\n\r\n@Component({\r\n selector: 'material-editor-base',\r\n templateUrl: './material-editor-base.html',\r\n providers: [provideParent(MaterialEditorBaseComponent, EditPropParent)]\r\n})\r\nexport class MaterialEditorBaseComponent implements OnInit, EditPropParent {\r\n @ViewChildren(MaterialResultsComponent) _materialResultsComponents: QueryList;\r\n\r\n _data: MaterialEditData;\r\n\r\n _edmIds: EditManager;\r\n _CASChanged: boolean;\r\n _CASCollisionWarning: string;\r\n _synonymChanged: boolean;\r\n _synonymCollisionWarning: string;\r\n _synonymError: string;\r\n _synonymName: string;\r\n _typeTSCAClasses: TypeTSCAClass[];\r\n _typeBotanicalSubdivisions: TypeBotanicalSubdivision[];\r\n _typeEssentialOils: TypeEssentialOil[];\r\n _typeNaturalOccurrences: TypeNaturalOccurrence[];\r\n\r\n _monographMaterials: MaterialListItem[];\r\n _fEMAMaterials: MaterialListItem[];\r\n _materialAdditionalIdentifiersHasChanges = false;\r\n _materialAdditionalIdentifierMode: MaterialAdditionalIdentifierMode = MaterialAdditionalIdentifierMode.NotSet;\r\n editMaterialAdditionalIdentifer: MaterialAdditionalIdentifier;\r\n\r\n editingAdditionalIdentifiers = false;\r\n missingAllAdditionalIdentifierFields = false;\r\n\r\n _noFEMANumberMatchesMsg = '';\r\n _noMonographNumberMatchesMsg = '';\r\n\r\n readonly _tabNumber: number = 0;\r\n\r\n constructor(@Inject(forwardRef(() => MaterialEditorComponent)) _parent: MaterialEditorComponent,\r\n public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService,\r\n public _router: Router) {\r\n\r\n this._data = _parent._data;\r\n this._data.onCancelMap['base'] = this.onCancel.bind(this);\r\n this._data.onSaveMap['base'] = this.onSave.bind(this);\r\n\r\n this._data.inSubEditor = false;\r\n }\r\n\r\n ngOnInit() {\r\n this._edmIds = this._editorService.createEditManager(this, 'MaterialAdditionalIdentifier');\r\n this._edmIds.entities = [];\r\n\r\n this._uow.typeTSCAClassRepository.all().then(r => {\r\n this._typeTSCAClasses = r;\r\n });\r\n this._uow.typeBotanicalSubdivisionRepository.all().then(r => {\r\n this._typeBotanicalSubdivisions = r;\r\n });\r\n this._uow.typeEssentialOilRepository.all().then(r => {\r\n this._typeEssentialOils = r;\r\n });\r\n this._uow.typeNaturalOccurrenceRepository.all().then(r => {\r\n this._typeNaturalOccurrences = r;\r\n });\r\n\r\n if (this._data.entity != null) {\r\n this._edmIds.entities = this._data.entity.materialAdditionalIdentifiers.slice(0);\r\n }\r\n this._edmIds.editing = false;\r\n\r\n this._data.currentTab = this._tabNumber;\r\n\r\n }\r\n\r\n checkIfNull(value: string) {\r\n if (value == '') {\r\n return null;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n onAdd() {\r\n this._synonymName = '';\r\n this.onSynonymChange();\r\n\r\n this._edmIds.entities = [];\r\n this._edmIds.editing = false;\r\n }\r\n\r\n onCancel() {\r\n if (this._data.inSubEditor == false) {\r\n this._fEMAMaterials = null;\r\n this._monographMaterials = null;\r\n this._CASCollisionWarning = '';\r\n this._synonymCollisionWarning = '';\r\n\r\n // Material Additional Identifiers\r\n this._edmIds.clearErrors();\r\n this._edmIds.editing = false;\r\n this.editingAdditionalIdentifiers = false;\r\n this.missingAllAdditionalIdentifierFields = false;\r\n this._materialAdditionalIdentifierMode = MaterialAdditionalIdentifierMode.NotSet;\r\n this._edmIds.entities = this._data.entity.materialAdditionalIdentifiers.slice(0);\r\n }\r\n }\r\n\r\n onEdit() {\r\n\r\n if (this._data.entity != null) {\r\n this._edmIds.entities = this._data.entity.materialAdditionalIdentifiers.slice(0);\r\n }\r\n this._edmIds.editing = false;\r\n }\r\n\r\n onSave() {\r\n this.refreshData();\r\n }\r\n\r\n getError(propName: string) {\r\n\r\n if (propName == '_synonymName' && this._data.adding) {\r\n if (this._synonymName && this._synonymName.trim().length > 0) {\r\n return this._synonymError;\r\n } else {\r\n return 'A principal synonym is required.';\r\n }\r\n }\r\n\r\n const r = this._data.entity.getErrorFor(propName);\r\n return r;\r\n }\r\n\r\n get material() {\r\n return this._data.entity;\r\n }\r\n\r\n onChangeCAS() {\r\n if (!this._CASChanged) {\r\n return;\r\n }\r\n\r\n this._CASChanged = false;\r\n\r\n this._data.entity.cASNumber = this._data.entity.realCASNumber;\r\n if (this._data.entity.cASNumber) {\r\n const numericalCASNumber = parseFloat(this._data.entity.cASNumber.replace(/-/g, ''));\r\n this._data.entity.numericalCASNumber = numericalCASNumber;\r\n } else {\r\n this._data.entity.numericalCASNumber = null;\r\n }\r\n\r\n if (this._data.entity.cASNumber) {\r\n this._uow.fetch('Materials/MaterialsByCASNumber', { realCASNumber: this._data.entity.cASNumber }).then(r => {\r\n const mlis = r;\r\n // if no match\r\n if (mlis.length == 0 || (mlis.length == 1 && mlis[0].materialId == this._data.entity.materialId)) {\r\n this._CASCollisionWarning = null;\r\n return;\r\n }\r\n this._CASCollisionWarning = 'Just a warning but this CAS Number has already been used elsewhere.';\r\n\r\n if (mlis.some(mli => mli.materialId == this._data.entity.materialId)) {\r\n return;\r\n }\r\n\r\n const maxMli = _.maxBy(mlis, mli => mli.numericalCASNumber);\r\n const maxNumber = maxMli.numericalCASNumber;\r\n let maxSuffix = maxNumber % 1;\r\n\r\n if (maxSuffix >= .9) {\r\n maxSuffix = (1 + Math.round(maxSuffix * 100)) / 100;\r\n } else {\r\n maxSuffix = (1 + Math.round(maxSuffix * 10)) / 10;\r\n }\r\n this._data.entity.numericalCASNumber = Math.floor(maxNumber) + maxSuffix;\r\n });\r\n }\r\n }\r\n\r\n onShowMongraphMaterials() {\r\n if (this._noMonographNumberMatchesMsg != '') {\r\n this._noMonographNumberMatchesMsg = '';\r\n return;\r\n }\r\n\r\n if (this._monographMaterials) {\r\n this._monographMaterials = null;\r\n return;\r\n }\r\n\r\n const num = this._data.entity.monographNumber;\r\n if (num == null || isNaN(num)) {\r\n if (isNaN(num)) {\r\n this._data.entity.monographNumber = this._data.maxMonographNumber + 1;\r\n this._noMonographNumberMatchesMsg = 'The non-numeric Monograph Number has been changed to the next available.';\r\n } else {\r\n this._noMonographNumberMatchesMsg = 'No Monograph Number has been assigned.';\r\n }\r\n this._monographMaterials = null;\r\n return;\r\n }\r\n\r\n if (num == this._data.maxMonographNumber + 1) {\r\n this._noMonographNumberMatchesMsg = 'This is a new Monograph Number.';\r\n this._monographMaterials = null;\r\n return;\r\n }\r\n\r\n const params = {\r\n monographNumber: num,\r\n materialId: this._data.entity.materialId\r\n };\r\n this._uow.fetch('Materials/FetchMaterialIdentifiersByMonographNumber', params).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._monographMaterials = r;\r\n } else {\r\n this._noMonographNumberMatchesMsg = 'No matching RIFM IDs found.';\r\n }\r\n });\r\n }\r\n\r\n onShowFEMAMaterials() {\r\n if (this._noFEMANumberMatchesMsg != '') {\r\n this._noFEMANumberMatchesMsg = '';\r\n return;\r\n }\r\n\r\n if (this._fEMAMaterials) {\r\n this._fEMAMaterials = null;\r\n return;\r\n }\r\n\r\n const num = this._data.entity.fEMANumber;\r\n if (num == null || isNaN(num)) {\r\n if (isNaN(num)) {\r\n this._data.entity.fEMANumber = this._data.maxFEMANumber + 1;\r\n this._noFEMANumberMatchesMsg = 'The non-numeric FEMA Number has been changed to the next available.';\r\n } else {\r\n this._noFEMANumberMatchesMsg = 'No FEMA Number has been assigned.';\r\n }\r\n this._fEMAMaterials = null;\r\n return;\r\n }\r\n\r\n if (num == this._data.maxFEMANumber + 1) {\r\n this._noFEMANumberMatchesMsg = 'This is a new FEMA Number.';\r\n this._fEMAMaterials = null;\r\n return;\r\n }\r\n\r\n const params = {\r\n femaNumber: num,\r\n materialId: this._data.entity.materialId\r\n };\r\n this._uow.fetch('Materials/FetchMaterialIdentifiersByFEMANumber', params).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._fEMAMaterials = r;\r\n } else {\r\n this._noFEMANumberMatchesMsg = 'No matching FEMA Numbers found.';\r\n }\r\n });\r\n }\r\n\r\n onSynonymChange() {\r\n if (!this._synonymChanged) {\r\n return;\r\n }\r\n\r\n this._synonymChanged = false;\r\n this._synonymError = '';\r\n this._synonymCollisionWarning = '';\r\n\r\n if (this._synonymName == null || this._synonymName.length < 3) {\r\n this._synonymError = 'You must enter a Principal synonym name with 3 or more characters.';\r\n return;\r\n }\r\n\r\n const synonymWord = this._synonymName;\r\n this._uow.fetch('Materials/MaterialsBySynonym', { synonymWord: UtilFns.encodeHackForAnd(synonymWord) }).then(r => {\r\n const mlis = r;\r\n // if no match\r\n if (mlis.length == 0 || (mlis.length == 1 && mlis[0].materialId == this._data.entity.materialId)) {\r\n this._synonymCollisionWarning = null;\r\n return;\r\n }\r\n this._synonymCollisionWarning = 'Just a warning but this Synonym has already been used elsewhere.';\r\n });\r\n }\r\n\r\n checkConfidential(confidential: boolean) {\r\n if (!confidential) {\r\n this._data.entity.captiveCompany = null;\r\n }\r\n }\r\n\r\n hasFEMAMatchResponse() {\r\n return (this._noFEMANumberMatchesMsg != '' || (this._fEMAMaterials != null && this._fEMAMaterials.length > 0));\r\n }\r\n\r\n hasMonographMatchResponse() {\r\n return (this._noMonographNumberMatchesMsg != '' || (this._monographMaterials != null && this._monographMaterials.length > 0));\r\n }\r\n\r\n materialHasChanges(): boolean {\r\n // Make sure unit of work has material changes and not just materialadditionalidentifier changes\r\n return (!this._data.entity.entityAspect.entityState.isUnchanged());\r\n }\r\n\r\n materialAdditionalIdentifiersHasChanges(): boolean {\r\n return (this._edmIds.hasEdits());\r\n }\r\n\r\n materialHasValidationErrors(): boolean {\r\n if (!this._data.edm.validateBeforeSave()) {\r\n return true;\r\n }\r\n\r\n if (this.getError('_synonymName')) {\r\n return true;\r\n }\r\n\r\n if (this.editingAdditionalIdentifiers) {\r\n if (!this.hasAtLeastOneAdditionalIdentifierField(this.editMaterialAdditionalIdentifer)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n refreshData() {\r\n this.missingAllAdditionalIdentifierFields = false;\r\n if (this._data.entity) {\r\n this._edmIds.entities = this._data.entity.materialAdditionalIdentifiers.slice(0);\r\n }\r\n }\r\n\r\n // EditManager overrides\r\n canSave(): boolean {\r\n if (this.editingAdditionalIdentifiers) {\r\n return false;\r\n }\r\n\r\n if (this.materialHasChanges() || this.materialAdditionalIdentifiersHasChanges()) {\r\n return (!this.materialHasValidationErrors());\r\n }\r\n return false;\r\n }\r\n\r\n canShowBack(): boolean {\r\n if (!this._data.edm.editing) {\r\n return false;\r\n }\r\n\r\n return (this.materialHasChanges() == false && this.materialAdditionalIdentifiersHasChanges() == false);\r\n }\r\n\r\n // Material Additional Identifiers\r\n confirmMaterialAdditionalIdChanges() {\r\n if (this._materialAdditionalIdentifierMode == MaterialAdditionalIdentifierMode.Adding) {\r\n this.addMaterialAdditionalIdentifier();\r\n } else if (this._materialAdditionalIdentifierMode == MaterialAdditionalIdentifierMode.Editing) {\r\n this.editMaterialAdditionalIdentifier();\r\n }\r\n }\r\n\r\n addMaterialAdditionalIdentifier() {\r\n if (!this.hasAtLeastOneAdditionalIdentifierField(this.editMaterialAdditionalIdentifer)) {\r\n this.missingAllAdditionalIdentifierFields = true;\r\n return;\r\n }\r\n\r\n this.applyMaterialAdditionalIdentifierChanges(this._edmIds.currentEntity, this.editMaterialAdditionalIdentifer);\r\n\r\n this.missingAllAdditionalIdentifierFields = false;\r\n this._materialAdditionalIdentifiersHasChanges = true;\r\n this.editingAdditionalIdentifiers = false;\r\n this._materialAdditionalIdentifierMode = MaterialAdditionalIdentifierMode.NotSet;\r\n }\r\n\r\n editMaterialAdditionalIdentifier() {\r\n\r\n if (this.editMaterialAdditionalIdentifer.hasChanges(this._edmIds.currentEntity)) { // compare versions\r\n if (!this.hasAtLeastOneAdditionalIdentifierField(this.editMaterialAdditionalIdentifer)) {\r\n this.missingAllAdditionalIdentifierFields = true;\r\n return;\r\n }\r\n\r\n this.applyMaterialAdditionalIdentifierChanges(this._edmIds.currentEntity, this.editMaterialAdditionalIdentifer);\r\n\r\n this.missingAllAdditionalIdentifierFields = false;\r\n this._materialAdditionalIdentifiersHasChanges = true;\r\n }\r\n this.editingAdditionalIdentifiers = false;\r\n this._materialAdditionalIdentifierMode = MaterialAdditionalIdentifierMode.NotSet;\r\n }\r\n\r\n cancelMaterialAdditionalIdChanges() {\r\n\r\n if (this._materialAdditionalIdentifierMode == MaterialAdditionalIdentifierMode.Adding) {\r\n if (this._edmIds.currentEntity) {\r\n const matId = this._edmIds.currentEntity;\r\n if (matId.entityAspect.entityState.isAdded()) {\r\n matId.entityAspect.rejectChanges();\r\n } else {\r\n matId.entityAspect.setDeleted();\r\n }\r\n _.remove(this._edmIds.entities, this._edmIds.currentEntity);\r\n }\r\n }\r\n\r\n this.editingAdditionalIdentifiers = false;\r\n this._materialAdditionalIdentifierMode = MaterialAdditionalIdentifierMode.NotSet;\r\n\r\n }\r\n\r\n hasAtLeastOneAdditionalIdentifierField(matAdditionalId: MaterialAdditionalIdentifier) {\r\n // 01/23/2019: ECNNumber no longer displayed so one of the remaining 4 values needs to be present\r\n return (matAdditionalId.cASNumber || matAdditionalId.eCL || matAdditionalId.eINECSNumber || matAdditionalId.eCInventoryNumber);\r\n }\r\n\r\n applyMaterialAdditionalIdentifierChanges(target: MaterialAdditionalIdentifier, source: MaterialAdditionalIdentifier) {\r\n // Remove empty strings that result from the user clearing the field data\r\n if (this.isStringNullOrEmpty(source.cASNumber)) {\r\n source.cASNumber = null;\r\n }\r\n if (target.cASNumber != source.cASNumber) {\r\n target.cASNumber = source.cASNumber;\r\n }\r\n\r\n if (this.isStringNullOrEmpty(source.eCL)) {\r\n source.eCL = null;\r\n }\r\n if (target.eCL != source.eCL) {\r\n target.eCL = source.eCL;\r\n }\r\n\r\n if (this.isStringNullOrEmpty(source.eINECSNumber)) {\r\n source.eINECSNumber = null;\r\n }\r\n if (target.eINECSNumber != source.eINECSNumber) {\r\n target.eINECSNumber = source.eINECSNumber;\r\n }\r\n\r\n if (this.isStringNullOrEmpty(source.eCNNumber)) {\r\n source.eCNNumber = null;\r\n }\r\n if (target.eCNNumber != source.eCNNumber) {\r\n target.eCNNumber = source.eCNNumber;\r\n }\r\n\r\n if (this.isStringNullOrEmpty(source.eCInventoryNumber)) {\r\n source.eCInventoryNumber = null;\r\n }\r\n if (target.eCInventoryNumber != source.eCInventoryNumber) {\r\n target.eCInventoryNumber = source.eCInventoryNumber;\r\n }\r\n\r\n if (target.dSLRegistration != source.dSLRegistration) {\r\n target.dSLRegistration = source.dSLRegistration;\r\n }\r\n\r\n if (target.eCNRegistration != source.eCNRegistration) {\r\n target.eCNRegistration = source.eCNRegistration;\r\n }\r\n\r\n if (target.eINECSRegistration != source.eINECSRegistration) {\r\n target.eINECSRegistration = source.eINECSRegistration;\r\n }\r\n\r\n if (target.nDSLRegistration != source.nDSLRegistration) {\r\n target.nDSLRegistration = source.nDSLRegistration;\r\n }\r\n\r\n if (target.reachRegistration != source.reachRegistration) {\r\n target.reachRegistration = source.reachRegistration;\r\n }\r\n\r\n if (target.tSCARegistration != source.tSCARegistration) {\r\n target.tSCARegistration = source.tSCARegistration;\r\n }\r\n\r\n if (target.typeMaterialIdentifierId != source.typeMaterialIdentifierId) {\r\n target.typeMaterialIdentifierId = source.typeMaterialIdentifierId;\r\n }\r\n\r\n return;\r\n }\r\n\r\n onAddMaterialAdditionalIdentifiers() {\r\n this._materialAdditionalIdentifierMode = MaterialAdditionalIdentifierMode.Adding;\r\n\r\n const entity = this._edmIds.uow.materialAdditionalIdentifierFactory.create();\r\n entity.materialId = this._data.entity.materialId;\r\n entity.typeMaterialIdentifierId = 'ALTERNATIVECAS';\r\n\r\n this._edmIds.entities.push(entity);\r\n this._edmIds.onSelect(entity);\r\n\r\n this.editMaterialAdditionalIdentifer = new MaterialAdditionalIdentifier(this._edmIds.currentEntity);\r\n this.editingAdditionalIdentifiers = true;\r\n }\r\n\r\n onDeleteAdditionalIdentifier(matid: MaterialAdditionalIdentifier) {\r\n\r\n if (matid.entityAspect.entityState.isAdded()) {\r\n matid.entityAspect.rejectChanges();\r\n } else {\r\n matid.entityAspect.setDeleted();\r\n }\r\n _.remove(this._edmIds.entities, matid);\r\n\r\n }\r\n\r\n onEditAdditionalIdentifier(matid: MaterialAdditionalIdentifier) {\r\n this._materialAdditionalIdentifierMode = MaterialAdditionalIdentifierMode.Editing;\r\n\r\n this._edmIds.onSelect(matid);\r\n this.editMaterialAdditionalIdentifer = new MaterialAdditionalIdentifier(matid);\r\n this.editingAdditionalIdentifiers = true;\r\n }\r\n\r\n get changeModeDescription() {\r\n return (this._materialAdditionalIdentifierMode == MaterialAdditionalIdentifierMode.Adding) ? 'Add Alternative Identifier' : 'Edit Alternative Identifer';\r\n }\r\n\r\n getCaptiveText(confidential: boolean): string {\r\n\r\n return confidential ? 'Captive' : '';\r\n }\r\n\r\n isStringNullOrEmpty(s: string): boolean {\r\n return (s == null || s.trim() === '');\r\n }\r\n}\r\n","
\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { Prediction, TypePrediction, TypePredictionClass } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'prediction-cramer-editor',\r\n templateUrl: './prediction-cramer-editor.html',\r\n providers: [provideParent(PredictionCramerEditorComponent, EditPropParent)]\r\n})\r\nexport class PredictionCramerEditorComponent implements OnInit, EditPropParent {\r\n @Input() prediction: Prediction;\r\n _typePredictions: TypePrediction[];\r\n _typePredictionClasses: TypePredictionClass[];\r\n\r\n _pageTitle: string;\r\n\r\n constructor(public uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this.uow.typePredictionRepository.all()\r\n .then(r => {\r\n this._typePredictions = r;\r\n this.uow.typePredictionClassRepository.all()\r\n .then(data => {\r\n this._typePredictionClasses = data;\r\n });\r\n });\r\n }\r\n\r\n checkIfNull(value: string) {\r\n if (value == '') {\r\n return null;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n getError(propName: string) {\r\n if (this.prediction == null) {\r\n return;\r\n }\r\n\r\n const err = this.prediction.getErrorFor(propName);\r\n if (err) {\r\n return err;\r\n }\r\n return null;\r\n }\r\n}\r\n","
\r\n\r\n
\r\n
{{_adding ? \"Adding a Cramer Class\" : \"Editing a Cramer Class\" }}
\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n\r\n
\r\n\r\n 0\">\r\n

Cramer Classes

\r\n \r\n \r\n \r\n \r\n Prediction Type\r\n Prediction Class\r\n Comment\r\n Enabled\r\n \r\n \r\n \r\n \r\n Delete\r\n Edit\r\n {{p.typePrediction?.predictionName}}\r\n {{p.predictionClass}}\r\n {{p.comment}}\r\n {{p.enabled}}\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n

{{subTitle}}

\r\n \r\n
\r\n","import { Component, OnInit,ViewChild, Inject, forwardRef } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { UnitOfWork, StateMap, EditorService } from '../../services/common';\r\nimport { EditManager } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/edit-prop.component';\r\n\r\nimport { Prediction } from '../../entities/EntityModels';\r\nimport { MaterialEditorComponent, MaterialEditData} from './material-editor.component';\r\nimport { PredictionCramerEditorComponent} from './prediction-cramer-editor.component';\r\n\r\n@Component({\r\n selector: 'predictions-cramer-editor',\r\n templateUrl: './predictions-cramer-editor.html',\r\n})\r\nexport class PredictionsCramerEditorComponent implements OnInit, EditPropParent {\r\n @ViewChild(PredictionCramerEditorComponent) _editingComponent: PredictionCramerEditorComponent;\r\n\r\n _adding: boolean = false;\r\n _data: MaterialEditData;\r\n _edmPredictions: EditManager;\r\n readonly _tabNumber: number = 1;\r\n\r\n constructor( @Inject(forwardRef(() => MaterialEditorComponent)) public _parent: MaterialEditorComponent,\r\n public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService) {\r\n\r\n this._data = _parent._data;\r\n this._data.onCancelMap['base'] = this.onCancel.bind(this);\r\n this._data.onSaveMap['base'] = this.onSave.bind(this);\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._edmPredictions = this._editorService.createEditManager(this, \"Prediction\");\r\n\r\n if (this._data.entity) {\r\n this._edmPredictions.entities = this._data.entity.predictions.slice(0);\r\n }\r\n\r\n this._edmPredictions.editing = false;\r\n this._data.inSubEditor = false;\r\n\r\n //this._data.currentTab = this._tabNumber;\r\n }\r\n\r\n getError(propName: string) {\r\n var r = this._data.entity.getErrorFor(propName);\r\n return r;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n //Events\r\n canApply() {\r\n\r\n if (this._edmPredictions.editing) {\r\n return (this._uow.hasChanges() && !this._edmPredictions.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canShowBack() {\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n onAdd() {\r\n this._adding = true;\r\n this._data.inSubEditor = true;\r\n\r\n let prediction = this._uow.predictionFactory.create();\r\n prediction.materialId = this._data.entity.materialId;\r\n prediction.typePredictionId = 0;\r\n prediction.enabled = true;\r\n\r\n this._edmPredictions.entities.push(prediction);\r\n this._edmPredictions.onSelect(prediction);\r\n }\r\n\r\n onApply() {\r\n if (this._edmPredictions.editing) {\r\n this._edmPredictions.onApplyCore();\r\n\r\n this._adding = false;\r\n this._data.inSubEditor = false;\r\n }\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edmPredictions.editing = false;\r\n this._data.inSubEditor = false;\r\n }\r\n\r\n onCancel() {\r\n this._edmPredictions.clearErrors();\r\n\r\n this._adding = false;\r\n this._edmPredictions.editing = false;\r\n this._data.inSubEditor = false;\r\n this._edmPredictions.entities = this._data.entity.predictions.slice(0);\r\n }\r\n\r\n onDeletePrediction(prediction: Prediction) {\r\n\r\n if (prediction.entityAspect.entityState.isAdded()) {\r\n prediction.entityAspect.rejectChanges();\r\n } else {\r\n prediction.entityAspect.setDeleted();\r\n }\r\n _.remove(this._edmPredictions.entities, prediction);\r\n\r\n }\r\n\r\n onEdit() {\r\n if (this._data.entity) {\r\n this._edmPredictions.entities = this._data.entity.predictions.slice(0);\r\n }\r\n\r\n this._edmPredictions.editing = false;\r\n this._data.inSubEditor = false;\r\n }\r\n\r\n onEditPrediction(prediction: Prediction) {\r\n this._edmPredictions.onSelect(prediction);\r\n this._data.inSubEditor = true;\r\n this._edmPredictions.editing = true;\r\n }\r\n\r\n onSave() {\r\n this._adding = false;\r\n this._data.inSubEditor = false;\r\n this._edmPredictions.editing = false;\r\n this._edmPredictions.entities = this._data.entity.predictions.slice(0);\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n Material Reported Use Notes\r\n
\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n MaterialId:\r\n {{material.materialId}}\r\n\r\n CAS #:\r\n {{material.realCASNumber}}\r\n\r\n RIFM ID:\r\n {{material.formattedRIFMId}}\r\n\r\n \r\n Principal Name:\r\n {{material.principalSynonymText()}}\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n

\r\n There is no Workflow History for this Material.\r\n

\r\n

\r\n There is no history of Reported Use changes for this Material.\r\n

\r\n
\r\n\r\n
0\" style=\"margin-left: 2px; width: 98%;\">\r\n \r\n ***\r\n Double-click a row to edit the notes data.\r\n \r\n
\r\n
\r\n
Date
\r\n
Completed By
\r\n
Action
\r\n
Action Details
\r\n
User Notes
\r\n
Field Affected
\r\n
Change Value
\r\n\r\n
\r\n
\r\n
\r\n\r\n
{{utilFns.formatDate(w.created)}}
\r\n
{{w.createdTypeWorkflowMaterialContact?.firstName || ''}}
\r\n
{{w.typeWorkflowMaterialAction?.description}}
\r\n
{{w.notes}}
\r\n
{{w.userNotes}}
\r\n
{{w.propertyName}}
\r\n
{{materialWorkflowChangeValue(w)}}
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n\r\n \r\n\r\n
\r\n","import { Component, Input, OnInit, ElementRef, ViewChild, ContentChild, AfterViewInit } from '@angular/core';\r\nimport {provideParent, StateMap, UnitOfWork} from '../../services/common';\r\nimport {EditManager, IEditHost, UtilFns} from '../../utils/common';\r\nimport {EditPropParent, ModalDialog, PageState} from '../../controls/common';\r\nimport { Material, WorkflowMaterialRecordedAction } from '../../entities/EntityModels';\r\n\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'material-workflow-history',\r\n templateUrl: './material-workflow-history.html',\r\n providers: [MaterialWorkflowHistoryComponent, provideParent(MaterialWorkflowHistoryComponent, EditPropParent)]\r\n})\r\nexport class MaterialWorkflowHistoryComponent extends ModalDialog implements OnInit, AfterViewInit, IEditHost {\r\n @Input() material: Material;\r\n @Input() activityType: string;\r\n\r\n public _workflowMaterialRecordedActions: WorkflowMaterialRecordedAction[];\r\n\r\n public _edm: EditManager;\r\n public _isEditing = false;\r\n public _validationMessage = '';\r\n\r\n public _loading = false;\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork, private _stateMap: StateMap) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Workflow Material History');\r\n\r\n if (this.material != null) {\r\n if (this.activityType == 'reporteduse') {\r\n this.loadReportedUseData();\r\n } else {\r\n this.loadAllData();\r\n }\r\n }\r\n }\r\n\r\n ngAfterViewInit() {\r\n }\r\n\r\n public loadAllData(): Promise {\r\n\r\n this._workflowMaterialRecordedActions = [];\r\n\r\n if (this.material == null) {\r\n return Promise.resolve();\r\n }\r\n\r\n this._loading = true;\r\n\r\n const params = { materialId: this.material.materialId };\r\n\r\n return this._uow.fetch('Workflow/FetchWorkflowMaterialRecordedActionsByMaterialId', params).then(r => {\r\n if (r != null) {\r\n this._workflowMaterialRecordedActions = r;\r\n }\r\n this._loading = false;\r\n });\r\n }\r\n\r\n public loadReportedUseData(): Promise {\r\n\r\n this._workflowMaterialRecordedActions = [];\r\n\r\n if (this.material == null) {\r\n return Promise.resolve();\r\n }\r\n\r\n this._loading = true;\r\n\r\n const params = { materialId: this.material.materialId };\r\n\r\n return this._uow.fetch('Workflow/FetchWorkflowMaterialRecordedActionsForMaterialReportedUse', params).then(r => {\r\n if (r != null) {\r\n this._workflowMaterialRecordedActions = r;\r\n }\r\n this._loading = false;\r\n });\r\n }\r\n\r\n public get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n rowColor(idx: number) {\r\n return ((idx % 2) > 0) ? '#F0F8FF' : '#FFFFFF';\r\n }\r\n\r\n materialWorkflowChangeValue(action: WorkflowMaterialRecordedAction) {\r\n if (action.changeValueNumber == null && action.changeValueString == null) {\r\n return '';\r\n }\r\n\r\n if (action.changeValueNumber != null) {\r\n return (action.typeWorkflowMaterialAction.formatDecimals) ? action.changeValueNumber.toFixed(4) : action.changeValueNumber;\r\n }\r\n\r\n return (action.changeValueString);\r\n }\r\n\r\n // ***************************************************************************************************\r\n // edit manager overrides\r\n // ***************************************************************************************************\r\n canApply() {\r\n if (this._edm.editing && this._uow.hasChanges()) {\r\n if (this._edm.currentEntity != null) {\r\n return (!this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canClose() {\r\n return (!this._isEditing);\r\n }\r\n\r\n canSave() {\r\n if (this._edm.editing) { return false; }\r\n if (!this._edm.hasEdits()) { return false; }\r\n if (!this._edm.validateBeforeSave()) { return false; }\r\n\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) { return false; }\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n canShowEditSection() {\r\n return (this._edm.currentEntity != null);\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n\r\n if (this._edm.editing) {\r\n if (this._edm.currentEntity.userNotes.trim() == '') { this._edm.currentEntity.userNotes = null; } // replace empty strings with null\r\n this._edm.onApplyCore();\r\n }\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._edm.editing = false;\r\n this._edm.currentEntity = null;\r\n this._isEditing = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._edm.onCancelCore();\r\n this._edm.currentEntity = null;\r\n this._isEditing = false;\r\n }\r\n\r\n onEdit(wmra: WorkflowMaterialRecordedAction) {\r\n this._edm.onlyEntity = wmra;\r\n this._edm.editing = true;\r\n this._isEditing = true;\r\n }\r\n\r\n onSave() {\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n\r\n this._edm.editing = false;\r\n this._isEditing = false;\r\n\r\n if (this.activityType == 'reporteduse') {\r\n this.loadReportedUseData();\r\n } else {\r\n this.loadAllData();\r\n }\r\n });\r\n }\r\n }\r\n\r\n // ***************************************************************************************************\r\n // Close Modal\r\n // ***************************************************************************************************\r\n onClose() {\r\n if (!this.canClose()) { return; }\r\n\r\n UtilFns.returnModal(this, false);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\n@Injectable()\r\nexport class BusyService {\r\n\tprivate busyCounter: number = 0;\r\n\r\n\tget isBusy(): boolean {\r\n\t\treturn this.busyCounter > 0;\r\n\t}\r\n\r\n\tasync busy(op: Promise): Promise {\r\n\t\tthis.busyCounter++;\r\n\r\n\t\ttry {\r\n\t\t\treturn await op;\r\n\t\t} finally {\r\n\t\t\tthis.busyCounter--;\r\n\t\t}\r\n\t}\r\n}","import { UnitOfWork } from '../../../services/unit-of-work';\r\nimport { StateMap } from '../../../services/state-map';\r\nimport { BusyService } from '../../../services/busy.service';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable()\r\nexport class MaterialLoader {\r\n\tconstructor(private uow: UnitOfWork, private stateMap: StateMap, private busyService: BusyService) {\r\n\t}\r\n\r\n\tload(materialId: number) {\r\n\t\tif (materialId == null) {\r\n\t\t\treturn Promise.resolve(null);\r\n\t\t}\r\n\r\n\t\tlet shouldLoad = false;\r\n\t\tif (this.stateMap.currentMaterial == null) {\r\n\t\t\tshouldLoad = true;\r\n\t\t} else if (this.stateMap.currentMaterial.materialId != materialId) {\r\n\t\t\tshouldLoad = true;\r\n\t\t}\r\n\r\n\t\tif (!shouldLoad) {\r\n\t\t\treturn Promise.resolve(this.stateMap.currentMaterial);\r\n\t\t}\r\n\r\n\t\tconst promise = this.uow.materialRepository\r\n\t\t\t.withId(materialId)\r\n\t\t\t.then(r => {\r\n\t\t\t\tthis.stateMap.currentMaterial = r;\r\n\t\t\t\treturn r;\r\n\t\t\t});\r\n\r\n\t\treturn this.busyService.busy(promise);\r\n\t}\r\n}","
\r\n
{{_data.adding ? \"Adding a Material\" : \"Editing a Material\" }}
\r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n

{{_userMessage}}

\r\n\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n \r\n
\r\n","import { AfterViewInit, Component, Input, OnInit, ViewChild } from '@angular/core';\r\n\r\nimport { Location } from '@angular/common';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\n\r\nimport { EditorService, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, UtilFns } from '../../utils/common';\r\nimport { PageState, TabContainer } from '../../controls/common';\r\n\r\nimport {Material, Synonym, WorkflowMaterialRecordedAction} from '../../entities/EntityModels';\r\n\r\nimport { MaterialEditorBaseComponent } from './material-editor-base.component';\r\nimport { PredictionsCramerEditorComponent } from './predictions-cramer-editor.component';\r\n\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\nimport {MaterialWorkflowHistoryComponent} from './material-workflow-history.component';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { STAFF_ROUTES } from './staff.routes';\r\nimport { MaterialLoader } from './services/material-loader';\r\nimport {MaxIdBundle} from '../../entities/projections/MaxIdBundle';\r\nimport { MaterialWorkflowService } from '../../services/material-workflow-service';\r\nimport { WorkflowEntityState } from '../../services/workflow-state';\r\n\r\nexport class MaterialEditData {\r\n edm: EditManager;\r\n entity: Material;\r\n adding: boolean;\r\n inSubEditor: boolean;\r\n currentTab: number;\r\n otherErrorMap: { [key: string]: string } = {};\r\n onCancelMap: { [key: string]: () => void } = {};\r\n onSaveMap: { [key: string]: () => void } = {};\r\n maxMonographNumber: number;\r\n maxFEMANumber: number;\r\n}\r\n\r\nexport class MaterialWorkflowEventFields {\r\n monographNumber: number;\r\n typeBotanicalSubdivisionId: string;\r\n typeEssentialOilId: string;\r\n fEMANumber: number;\r\n realCASNumber: string;\r\n}\r\n\r\nclass PageStateExt extends PageState {\r\n materialId: number;\r\n}\r\n\r\n@Component({\r\n selector: 'material-editor',\r\n templateUrl: './material-editor.html',\r\n providers: [MaterialWorkflowService],\r\n})\r\n\r\nexport class MaterialEditorComponent implements OnInit, AfterViewInit {\r\n @ViewChild(MaterialEditorBaseComponent) _materialEditorBaseComponent: MaterialEditorBaseComponent;\r\n @ViewChild(PredictionsCramerEditorComponent) _predictionsCramerEditorComponent: PredictionsCramerEditorComponent;\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n @ViewChild(MaterialWorkflowHistoryComponent) _materialWorkflowHistoryComponent: MaterialWorkflowHistoryComponent;\r\n @ViewChild(TabContainer) _tabContainer: TabContainer;\r\n\r\n @Input() entity: Material;\r\n\r\n _canShowWorkflowModal = true;\r\n _edm: EditManager;\r\n _data: MaterialEditData = new MaterialEditData();\r\n _materialWorkflowService: MaterialWorkflowService;\r\n _workflowEventData = new MaterialWorkflowEventFields();\r\n _pageState = new PageStateExt('Material editor');\r\n _userMessage = '';\r\n _workflowActivityType = 'all';\r\n\r\n _isLoading = false;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService,\r\n public _location: Location, public _router: Router,\r\n private route: ActivatedRoute,\r\n private materialLoader: MaterialLoader,\r\n public materialWorkflowService: MaterialWorkflowService) {\r\n\r\n this._materialWorkflowService = materialWorkflowService;\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = STAFF_ROUTES.Material.name;\r\n this._edm = this._editorService.createEditManager(this, 'Material');\r\n this._data.edm = this._edm;\r\n\r\n this._uow.fetch('Materials/MaxIds', {})\r\n .then(r => {\r\n const maxIds = r[0] as MaxIdBundle;\r\n this._data.maxFEMANumber = maxIds.maxFEMANumber;\r\n this._data.maxMonographNumber = maxIds.maxMonographNumber;\r\n });\r\n\r\n this.route.params\r\n .subscribe(params => {\r\n const materialId = params['materialId'];\r\n if (materialId) {\r\n this.materialLoader.load(materialId)\r\n .then(mat => {\r\n this.editMaterial(mat);\r\n });\r\n } else {\r\n this._data.edm.editing = false;\r\n }\r\n });\r\n\r\n this._data.currentTab = 0;\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.focusInitialTab();\r\n }\r\n\r\n focusInitialTab() {\r\n if (this._tabContainer) {\r\n this._tabContainer.selectTab(this._data.currentTab);\r\n }\r\n }\r\n\r\n isActiveTab(tabNumber: number): boolean {\r\n return (this._data.currentTab == tabNumber);\r\n }\r\n\r\n setTabNumber(tabNumber: number) {\r\n this._data.currentTab = tabNumber;\r\n }\r\n\r\n editMaterial(m: Material) {\r\n\r\n this.resetMaterialWorkflowModal();\r\n\r\n this._data.edm.editing = false;\r\n\r\n if (m == null) {\r\n return;\r\n }\r\n this._pageState.materialId = m.materialId;\r\n\r\n this._stateMap.currentMaterial = m;\r\n this._stateMap.staffMaterialId = m.materialId;\r\n\r\n this._data.adding = false;\r\n this._data.entity = m;\r\n this._data.edm.onlyEntity = m;\r\n this._data.edm.editing = true;\r\n\r\n if (this._materialEditorBaseComponent) {\r\n this._materialEditorBaseComponent.onEdit();\r\n }\r\n\r\n // certain field changes should be recorded in the material workflow history\r\n this.storeMaterialWorkflowEventData();\r\n\r\n return m;\r\n }\r\n\r\n createMaterial() {\r\n const material = this._edm.uow.materialFactory.create();\r\n\r\n material.fEMANumber = this._data.maxFEMANumber + 1;\r\n material.monographNumber = this._data.maxMonographNumber + 1;\r\n\r\n material.cASNumber = '';\r\n material.typeNaturalOccurrenceId = 1; // default = None\r\n this._stateMap.staffMaterialId = material.materialId;\r\n this._stateMap.currentMaterial = material;\r\n return material;\r\n }\r\n\r\n // EditManager overrides\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canDeactivate() {\r\n // The edit-manager checks the base Unit of Work.\r\n return !this._data.edm.hasEdits() && !this._data.inSubEditor;\r\n }\r\n\r\n canDeactivateEditor() {\r\n // Allow the focus to shift to material edit base when adding a new material\r\n if (this._data.adding) {\r\n return true;\r\n }\r\n return this.canDeactivate();\r\n }\r\n\r\n canEdit() {\r\n return ((this._stateMap.currentUser.isStaff) && (this._stateMap.currentUser.isInRole('fema') == false));\r\n }\r\n\r\n canSave(): boolean {\r\n\r\n const data = this._data;\r\n\r\n if (!data.edm.hasEdits()) {\r\n return false;\r\n }\r\n\r\n if (!data.edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n\r\n const errMap = data.otherErrorMap;\r\n for (const key in errMap) {\r\n if (errMap[key]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n onAdd() {\r\n this._userMessage = '';\r\n\r\n const data = this._data;\r\n data.adding = true;\r\n data.entity = this.createMaterial();\r\n\r\n data.edm.onlyEntity = data.entity;\r\n data.edm.editing = true;\r\n\r\n if (this._materialEditorBaseComponent) {\r\n this._materialEditorBaseComponent.onAdd();\r\n }\r\n\r\n this._data.currentTab = 0;\r\n this.focusInitialTab();\r\n }\r\n\r\n onCancel() {\r\n this._userMessage = '';\r\n\r\n const data = this._data;\r\n const hadEdits = data.edm.hasEdits();\r\n\r\n this._uow.rollback();\r\n data.edm.clearErrors();\r\n data.edm.pageState.loadStatusMsg = null;\r\n\r\n // tslint:disable-next-line:forin\r\n for (const k in data.onCancelMap) {\r\n data.onCancelMap[k]();\r\n }\r\n\r\n if (this._data.adding || !hadEdits) {\r\n data.edm.editing = false;\r\n this._stateMap.staffMaterialId = null;\r\n this._stateMap.currentMaterial = null;\r\n }\r\n this._data.adding = false;\r\n }\r\n\r\n onEdit() {\r\n this._userMessage = '';\r\n\r\n UtilFns.showModal(this._materialSelectorComponent, this, null).then(mli => {\r\n if (mli == null) {\r\n return;\r\n }\r\n return this._router.navigate(['/staff/material/', mli.materialId, 'info']);\r\n });\r\n\r\n this._data.currentTab = 0;\r\n this.focusInitialTab();\r\n }\r\n\r\n onMore() {\r\n return this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, this._data.entity.materialId));\r\n }\r\n\r\n onSave() {\r\n this._userMessage = '';\r\n\r\n if (!this.canSave()) {\r\n return Promise.resolve();\r\n }\r\n\r\n if (!this._edm.validateBeforeSave()) {\r\n return;\r\n }\r\n\r\n if (this._data.adding) {\r\n\r\n if (!this.isValidString(this._materialEditorBaseComponent._synonymName)) {\r\n this._userMessage = 'Please enter a Principal Name.';\r\n return;\r\n }\r\n\r\n const sy = this._uow.synonymFactory.create();\r\n sy.materialId = this._data.entity.materialId;\r\n sy.synonymWord = this._materialEditorBaseComponent._synonymName;\r\n\r\n sy.principal = true;\r\n sy.rootWord = Synonym.rootWordFromSynonymWord(this._materialEditorBaseComponent._synonymName);\r\n\r\n // for legacy purposes.\r\n if (!this._data.entity.cASNumber) {\r\n this._data.entity.cASNumber = this._data.entity.realCASNumber;\r\n }\r\n\r\n this.recordMaterialWorkflowAdd();\r\n\r\n } else {\r\n this.processMaterialWorkflowEvents();\r\n }\r\n\r\n return this._data.edm\r\n .commitSave()\r\n .then(() => { // uow saved so will commit all changes\r\n if (this._data.adding) {\r\n this._data.adding = false;\r\n return this._router.navigate(['/staff/material/', this._data.entity.materialId, 'info']);\r\n }\r\n\r\n this.editMaterial(this._data.entity);\r\n\r\n // tslint:disable-next-line:forin\r\n for (const k in this._data.onSaveMap) {\r\n this._data.onSaveMap[k]();\r\n }\r\n });\r\n }\r\n\r\n onDelete() {\r\n return this._stateMap.yesNoComponent\r\n .showModal('Delete entire material',\r\n 'Are you sure?').then(ok => {\r\n if (ok) {\r\n return this.deleteMaterial();\r\n }\r\n });\r\n }\r\n\r\n deleteMaterial() {\r\n this._isLoading = true;\r\n\r\n const materialId = this._edm.currentEntity.materialId;\r\n const cas = this._edm.currentEntity.realCASNumber;\r\n\r\n // TODO: check that all entries in related tables are deleted.\r\n // this is done on the db with a cascade delete.\r\n this._edm.onDeleteCore();\r\n\r\n return this._uow.commitSelected([this._data.entity])\r\n .then(() => {\r\n this._edm.setSavedStatus('Deleted');\r\n // Next line is needed because the onDeleteCore above will have modified all\r\n // entities in cache that ref'd this material.\r\n this._uow.rollback();\r\n this.recordMaterialWorkflowDelete(materialId, cas);\r\n this._userMessage = 'The material has been successfully deleted.';\r\n\r\n this._isLoading = false;\r\n\r\n }).catch((e) => {\r\n this._edm.setSaveFailedStatus('Delete failed: ' + e);\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n // ****************************************************************************\r\n // Material Workflow History Modal\r\n // ****************************************************************************\r\n onShowMaterialWorkflowHistory() {\r\n if (this._materialWorkflowHistoryComponent == null || this._data.entity == null) {\r\n return;\r\n }\r\n\r\n UtilFns.showModal(this._materialWorkflowHistoryComponent, this).then(mrun => {\r\n // this.resetMaterialWorkflowModal();\r\n return;\r\n });\r\n }\r\n\r\n resetMaterialWorkflowModal() {\r\n this._canShowWorkflowModal = false;\r\n\r\n setTimeout(() => {\r\n this._canShowWorkflowModal = true;\r\n }, 1);\r\n }\r\n\r\n storeMaterialWorkflowEventData() {\r\n this._workflowEventData.monographNumber = this._edm.currentEntity.monographNumber;\r\n this._workflowEventData.typeBotanicalSubdivisionId = this._edm.currentEntity.typeBotanicalSubdivisionId;\r\n this._workflowEventData.typeEssentialOilId = this._edm.currentEntity.typeEssentialOilId;\r\n this._workflowEventData.fEMANumber = this._edm.currentEntity.fEMANumber;\r\n this._workflowEventData.realCASNumber = this._edm.currentEntity.realCASNumber;\r\n }\r\n\r\n processMaterialWorkflowEvents() {\r\n if (this._edm.currentEntity.monographNumber != this._workflowEventData.monographNumber) {\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialMonographNumberChange(this._data.entity.materialId, WorkflowEntityState.Modified, this._data.entity.monographNumber, this._workflowEventData.monographNumber, this._stateMap.currentUser.name);\r\n }\r\n\r\n if (this._edm.currentEntity.typeBotanicalSubdivisionId != this._workflowEventData.typeBotanicalSubdivisionId) {\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialBotanicalPartChange(this._data.entity.materialId, WorkflowEntityState.Modified, this._data.entity.typeBotanicalSubdivisionId, this._workflowEventData.typeBotanicalSubdivisionId, this._stateMap.currentUser.name);\r\n }\r\n\r\n if (this._edm.currentEntity.typeEssentialOilId != this._workflowEventData.typeEssentialOilId) {\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialExtractTypeChange(this._data.entity.materialId, WorkflowEntityState.Modified, this._data.entity.typeEssentialOilId, this._workflowEventData.typeEssentialOilId, this._stateMap.currentUser.name);\r\n }\r\n\r\n if (this._edm.currentEntity.fEMANumber != this._workflowEventData.fEMANumber) {\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialFEMANumberChange(this._data.entity.materialId, WorkflowEntityState.Modified, this._data.entity.fEMANumber, this._workflowEventData.fEMANumber, this._stateMap.currentUser.name);\r\n }\r\n\r\n if (this._edm.currentEntity.realCASNumber != this._workflowEventData.realCASNumber) {\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialRealCASNumberChange(this._data.entity.materialId, WorkflowEntityState.Modified, this._data.entity.realCASNumber, this._workflowEventData.realCASNumber, this._stateMap.currentUser.name);\r\n }\r\n }\r\n\r\n recordMaterialWorkflowAdd() {\r\n this._materialWorkflowService.recordMaterialAdded(this._data.entity.materialId, WorkflowEntityState.Added, this._data.entity.realCASNumber, this._stateMap.currentUser.name);\r\n }\r\n\r\n // this happens after the material deletion is committed so the new record needs to be committed\r\n recordMaterialWorkflowDelete(materialId: number, cas: string) {\r\n this._materialWorkflowService.recordMaterialDeleted(materialId, WorkflowEntityState.Added, cas, this._stateMap.currentUser.name);\r\n\r\n return this._uow.commit();\r\n }\r\n}\r\n","
\r\n
\r\n \r\n
\r\n\r\n

{{userMessage}}

\r\n\r\n
0\" style=\"margin-left: -8px;\">\r\n\t\t\r\n\t\t\t{{'Number of matches: ' + resultsCount}}\r\n\t\t\tSelect a row to view Related Names, Reserves and Subscription data.\r\n\t\t\r\n
\r\n
\r\n
\r\n JournalId\r\n
\r\n
\r\n Current Name\r\n
\r\n
\r\n Journal Reserves in Library\r\n
\r\n
\r\n Subscription Status\r\n
\r\n
\r\n Subscription Type\r\n
\r\n
\r\n Notes\r\n
\r\n \r\n
\r\n Found In\r\n
\r\n
\r\n Publishers\r\n
\r\n
\r\n\r\n
\r\n
\r\n
{{j.data.journalId}}
\r\n
{{j.data.journalName}}
\r\n
{{j.data.hasReserves?'Yes' : ''}}
\r\n
{{j.data.subscriptionStatus}}
\r\n
{{j.data.subscriptionTypeDescriptions?.join('; ')}}
\r\n
{{j.data.notes}}
\r\n
{{j.data.formerNames?.join('; ')}}
\r\n
{{j.data.foundIn}}
\r\n
{{j.data.publishers?.join('; ')}}
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n","import { Component, ViewChild, Inject, Input, forwardRef, OnInit } from '@angular/core';\r\n\r\nimport { UnitOfWork, provideParent } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { Journal, JournalReserve, JournalSubscription} from '../../entities/EntityModels';\r\nimport { JournalListItem } from '../../entities/projections/JournalListItem';\r\nimport { JournalReserveItem } from '../../entities/projections/JournalReserveItem';\r\nimport { JournalSubscriptionItem } from '../../entities/projections/JournalSubscriptionItem';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\n\r\nimport {JournalSelectorComponent, JournalSearchData } from './journal-selector.component';\r\n\r\nimport * as _ from 'lodash';\r\n\r\nexport enum SearchType { Journal, Publisher }\r\n\r\n@Component({\r\n selector: 'journal-search',\r\n templateUrl: './journal-search.html',\r\n providers: [provideParent(JournalSearchComponent)]\r\n})export class JournalSearchComponent implements OnInit {\r\n\r\n _pageState = new PageState('Journals');\r\n _userMessage: string;\r\n _validationMessage: string;\r\n\r\n _journalSearchResults: JournalListItem[];\r\n _selectedJournalListItem: JournalListItem;\r\n _selectOnlyMode = false;\r\n\r\n _journal: Journal;\r\n _journalsEx: SelectableEntity[] = [];\r\n\r\n _currentSearchTerm: string;\r\n _data: JournalSearchData;\r\n _searchType: SearchType = SearchType.Journal;\r\n\r\n private colorSelected = '#B0C4DE'; // '#C6E7CE'; // '#e0eeee';\r\n private colorUnselected = '#FFFFFF';\r\n\r\n toggleShowJournalIdTip = false;\r\n toggleShowJournalNameTip = false;\r\n toggleShowJournalReservesTip = false;\r\n toggleShowJournalSubscriptionsTip = false;\r\n toggleShowJournalSubscriptionTypeTip = false;\r\n toggleShowJournalNotesTip = false;\r\n toggleShowJournalRelatedNamesTip = false;\r\n toggleShowJournalFoundInTip = false;\r\n toggleShowJournalSubscriptionPublishersTip = false;\r\n\r\n constructor(@Inject(forwardRef(() => JournalSelectorComponent)) public _parent: JournalSelectorComponent, public _uow: UnitOfWork) {\r\n this._data = _parent._data;\r\n // this._data.onResetMap['base'] = this.onReset.bind(this);\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n canSelect() {\r\n return this._journal != null;\r\n }\r\n\r\n // load data\r\n search(searchTerm: string, hasJournalReservesInLibrary: boolean, startsWith: boolean, activeSubscriptionsOnly: boolean, subscriptionType: string) {\r\n\r\n this.clearDisplayData();\r\n\r\n this._currentSearchTerm = searchTerm;\r\n this._searchType = SearchType.Journal;\r\n\r\n this._pageState.isLoading = true;\r\n\r\n const searchTermParam = (searchTerm === null || searchTerm == undefined) ? '' : searchTerm;\r\n\r\n // tslint:disable-next-line:max-line-length\r\n const params = { searchText: UtilFns.encodeHackForAnd(searchTermParam), hasJournalReservesInLibrary: hasJournalReservesInLibrary, startsWith: startsWith, activeSubscriptionsOnly: activeSubscriptionsOnly, subscriptionType: UtilFns.encodeHackForAnd(subscriptionType)};\r\n return this._uow.fetch('Misc/FetchFilteredJournals', params).then(r => {\r\n\r\n if (r && r.length > 0) {\r\n this._journalSearchResults = r;\r\n\r\n this.formatSelectableEntities();\r\n\r\n } else {\r\n this._userMessage = 'No matches found.';\r\n }\r\n\r\n this._pageState.isLoading = false;\r\n });\r\n }\r\n\r\n searchPublications(searchTerm: string) {\r\n\r\n this.clearDisplayData();\r\n\r\n this._currentSearchTerm = searchTerm;\r\n this._searchType = SearchType.Publisher;\r\n\r\n this._pageState.isLoading = true;\r\n const searchTermParam = (searchTerm === null || searchTerm == undefined) ? '' : searchTerm;\r\n const params = { searchText: UtilFns.encodeHackForAnd(searchTermParam) };\r\n return this._uow.fetch('Misc/FetchJournalsBySubscriptionPublisher', params).then(r => {\r\n\r\n if (r && r.length > 0) {\r\n this._journalSearchResults = r;\r\n\r\n this.formatSelectableEntities();\r\n\r\n } else {\r\n this._userMessage = 'No matches found.';\r\n }\r\n\r\n this._pageState.isLoading = false;\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._journalsEx = [];\r\n if (this._journalSearchResults == null || this._journalSearchResults.length < 1) { return; }\r\n\r\n _.clone(this._journalSearchResults).forEach(element => {\r\n this._journalsEx.push(new SelectableEntity(_.clone(element), '#FFFFFF'));\r\n });\r\n\r\n this._journalsEx = this._journalsEx.sort(SelectableEntity.compareJournals);\r\n }\r\n\r\n\r\n clearDisplayData() {\r\n this._userMessage = null;\r\n this._validationMessage = null;\r\n\r\n this._journalSearchResults = null;\r\n this._journalsEx = [];\r\n this._selectedJournalListItem = null;\r\n\r\n this._currentSearchTerm = null;\r\n }\r\n\r\n onSelect(selectedEntity: SelectableEntity) {\r\n this._selectedJournalListItem = selectedEntity.data;\r\n\r\n if (this._selectedJournalListItem) {\r\n this.resetBackgroundColor(this._journalsEx);\r\n selectedEntity.backgroundColor = this.colorSelected;\r\n this._parent.selectedJournalId(this._selectedJournalListItem.journalId);\r\n }\r\n }\r\n\r\n resetBackgroundColor(journals: SelectableEntity[]) {\r\n journals.forEach((element, index) => {\r\n element.backgroundColor = this.colorUnselected;\r\n });\r\n }\r\n\r\n onReset() {\r\n this.clearDisplayData();\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n get resultsCount() {\r\n return (this._journalsEx == null) ? 0 : this._journalsEx.length;\r\n }\r\n\r\n get userMessage() {\r\n return this._userMessage;\r\n }\r\n\r\n showFoundIn() {\r\n return (this._searchType == SearchType.Journal);\r\n }\r\n\r\n showPublishers() {\r\n return (this._searchType == SearchType.Publisher);\r\n }\r\n\r\n // ******************************************************\r\n // *Tooltip Display *\r\n // ******************************************************\r\n toggleTooltip(whichTip: number) {\r\n switch (whichTip) {\r\n case 1: {\r\n this.toggleShowJournalIdTip = !this.toggleShowJournalIdTip;\r\n break;\r\n }\r\n case 2: {\r\n this.toggleShowJournalNameTip = !this.toggleShowJournalNameTip;\r\n break;\r\n }\r\n case 3: {\r\n this.toggleShowJournalReservesTip = !this.toggleShowJournalReservesTip;\r\n break;\r\n }\r\n case 4: {\r\n this.toggleShowJournalSubscriptionsTip = !this.toggleShowJournalSubscriptionsTip;\r\n break;\r\n }\r\n case 5: {\r\n this.toggleShowJournalSubscriptionTypeTip = !this.toggleShowJournalSubscriptionTypeTip;\r\n break;\r\n }\r\n case 6: {\r\n this.toggleShowJournalNotesTip = !this.toggleShowJournalNotesTip;\r\n break;\r\n }\r\n case 7: {\r\n this.toggleShowJournalRelatedNamesTip = !this.toggleShowJournalRelatedNamesTip;\r\n break;\r\n }\r\n case 8: {\r\n this.toggleShowJournalFoundInTip = !this.toggleShowJournalFoundInTip;\r\n break;\r\n }\r\n case 9: {\r\n this.toggleShowJournalSubscriptionPublishersTip = !this.toggleShowJournalSubscriptionPublishersTip;\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n formatTooltipContent(whichTip: number) {\r\n\r\n let hcode = '';\r\n\r\n switch (whichTip) {\r\n case 1: {\r\n // tslint:disable-next-line:max-line-length\r\n hcode = '
Searchable, primary Journal Identifier.
';\r\n break;\r\n }\r\n case 2: {\r\n // tslint:disable-next-line:max-line-length\r\n hcode = '
Journal Name associated with the displayed Journal Id.
';\r\n break;\r\n }\r\n case 3: {\r\n // tslint:disable-next-line:max-line-length\r\n hcode = '
A \"Yes\" in this column indicates that physical copies of a Journal are available in the RIFM Library.
';\r\n break;\r\n }\r\n case 4: {\r\n // tslint:disable-next-line:max-line-length\r\n hcode = '
Journals with Subscriptions that do not have an end date are marked as \"Active\". Subscriptions that have an end date are marked as \"Inactive\".
';\r\n break;\r\n }\r\n case 5: {\r\n // tslint:disable-next-line:max-line-length\r\n hcode = '
If the Journal has an active or inactive Subscription, the type is displayed.
';\r\n break;\r\n }\r\n case 6: {\r\n // tslint:disable-next-line:max-line-length\r\n hcode = '
Notes writen by Staff for the Journal.
';\r\n break;\r\n }\r\n case 7: {\r\n // tslint:disable-next-line:max-line-length\r\n hcode = '
The list of former Journal names and any Journal name changes.
';\r\n break;\r\n }\r\n case 8: {\r\n // tslint:disable-next-line:max-line-length\r\n hcode = '
The Journal data that matched the search term and filters.
';\r\n break;\r\n }\r\n case 9: {\r\n // tslint:disable-next-line:max-line-length\r\n hcode = '
The Publisher data that matched the search term.
';\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n return hcode;\r\n }\r\n}\r\n\r\n","
\r\n
\r\n
\r\n
\r\n\r\n \r\n\r\n

Journal Search

\r\n\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n

{{_userMessage}}

\r\n\r\n
\r\n
\r\n
\r\n Journal Search Term:\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n Starts With:\r\n \r\n
\r\n
\r\n Has Journal Reserves:\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n Restrict to Publishers:\r\n \r\n
\r\n
\r\n Active Subscriptions:\r\n \r\n
\r\n
\r\n
\r\n Subscription Type:\r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n {{'Data for Journal: ' + _journal.journalName}}\r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n","import { AfterViewInit, Component, ViewChild, Inject, forwardRef, OnInit, ElementRef } from '@angular/core';\r\n\r\nimport {UnitOfWork, provideParent, UserManager} from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport {ModalDialog, PageState, TabContainer} from '../../controls/common';\r\n\r\nimport {Journal, JournalReserve, JournalSubscription, TypeJournalSubscription} from '../../entities/EntityModels';\r\nimport { JournalSearchComponent } from '../staff/journal-search.component';\r\nimport * as _ from 'lodash';\r\n\r\nexport class JournalSearchData {\r\n entity: Journal;\r\n currentTab: number;\r\n onResetMap: { [key: string]: () => void } = {};\r\n}\r\n\r\n@Component({\r\n selector: 'journal-selector',\r\n templateUrl: './journal-selector.html',\r\n})export class JournalSelectorComponent extends ModalDialog implements AfterViewInit, OnInit {\r\n @ViewChild(JournalSearchComponent, { static: true }) _journalSearchComponent: JournalSearchComponent;\r\n @ViewChild(TabContainer) _tabContainer: TabContainer;\r\n\r\n _pageState = new PageState('Journals');\r\n _showJournalData = true;\r\n _tab = 2;\r\n _userMessage: string;\r\n\r\n _journal: Journal;\r\n _searchTerm: string;\r\n\r\n _activeSubscriptionsOnly = false;\r\n _hasJournalReservesInLibrary = false;\r\n _publishersOnly = false;\r\n _startsWith = false;\r\n\r\n _data: JournalSearchData = new JournalSearchData();\r\n _journalDataIsPrepared = false;\r\n\r\n _typeJournalSubscriptions: TypeJournalSubscription[] = [];\r\n _selectedJournalSubscriptionType = 'Any';\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork, public _userManager: UserManager) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n return this._uow.typeJournalSubscriptionRepository.all().then(types => {\r\n if (types != null) {\r\n this._typeJournalSubscriptions = _.sortBy(types, t => t.sortOrder);\r\n }\r\n });\r\n }\r\n\r\n ngAfterViewInit() {\r\n // this.setTab(0);\r\n }\r\n\r\n canSearch() {\r\n\r\n if (this._activeSubscriptionsOnly || this._hasJournalReservesInLibrary || this.selectedJournalSubscriptionType.toLowerCase() != 'any') {\r\n return true;\r\n }\r\n\r\n return this._searchTerm && this._searchTerm.length > 0 && !this._publishersOnly;\r\n }\r\n\r\n canSearchPublications() {\r\n return this._searchTerm && this._searchTerm.length > 0 && this._publishersOnly;\r\n }\r\n\r\n canDownloadPublisherSearchResults() {\r\n if (!this.canSearchPublications() || this._journalSearchComponent === null) { return false; }\r\n\r\n return (this._journalSearchComponent._journalsEx != null && this._journalSearchComponent._journalsEx.length > 0);\r\n }\r\n\r\n canSelect() {\r\n return this._journal != null;\r\n }\r\n\r\n // event handlers\r\n onOk() {\r\n UtilFns.returnModal(this, this._journal);\r\n }\r\n\r\n onCancel() {\r\n UtilFns.returnModal(this, null);\r\n }\r\n\r\n search() {\r\n this.clearDisplayData();\r\n\r\n if (this._journalSearchComponent != null && this._journalSearchComponent != undefined) {\r\n this._journalSearchComponent._selectOnlyMode = !this._showJournalData;\r\n const subType = (this.selectedJournalSubscriptionType != null && this.selectedJournalSubscriptionType.toLowerCase() != 'any') ? this.selectedJournalSubscriptionType : '';\r\n this._journalSearchComponent.search(this._searchTerm, this._hasJournalReservesInLibrary, this._startsWith, this._activeSubscriptionsOnly, subType);\r\n }\r\n }\r\n\r\n searchPublications() {\r\n this.clearDisplayData();\r\n\r\n if (this._journalSearchComponent != null && this._journalSearchComponent != undefined) {\r\n this._journalSearchComponent._selectOnlyMode = !this._showJournalData;\r\n this._journalSearchComponent.searchPublications(this._searchTerm);\r\n }\r\n }\r\n\r\n // Set by child component: JournalSearchComponent\r\n selectedJournalId(journalId: number) {\r\n this.resetJournalDataDisplay();\r\n this.fetchJournal(journalId);\r\n }\r\n\r\n fetchJournal(journalId: number) {\r\n\r\n this._pageState.isLoading = true;\r\n\r\n return this._uow.fetchTyped('Misc/JournalById', Journal, { journalId: journalId }).then(r => {\r\n const j = r && (r.length > 0) && r[0];\r\n if (j) {\r\n this._journal = j;\r\n\r\n if (this._showJournalData) {\r\n this.prepareData();\r\n this.setTab(this._tab);\r\n }\r\n }\r\n this._pageState.isLoading = false;\r\n }).catch(() => {\r\n this._pageState.isLoading = false;\r\n });\r\n }\r\n\r\n prepareData() {\r\n\r\n this._data.entity = _.clone(this._journal);\r\n\r\n this._data.entity.prepareJournalData();\r\n\r\n this._journalDataIsPrepared = true;\r\n\r\n }\r\n\r\n clearDisplayData() {\r\n this._userMessage = null;\r\n this._journal = null;\r\n this._data.entity = null;\r\n\r\n this.resetJournalDataDisplay();\r\n }\r\n\r\n resetJournalDataDisplay() {\r\n const data = this._data;\r\n\r\n // tslint:disable-next-line:forin\r\n for (const k in data.onResetMap) {\r\n data.onResetMap[k]();\r\n }\r\n\r\n this._journalDataIsPrepared = false;\r\n\r\n }\r\n\r\n clearSearchResults() {\r\n if (this._journalSearchComponent != null) {\r\n this._journalSearchComponent.clearDisplayData();\r\n }\r\n }\r\n\r\n setShowJournalData(show: boolean) {\r\n this._showJournalData = show;\r\n }\r\n\r\n setTab(tabNumber: number) {\r\n setTimeout(() => {\r\n this._tabContainer.selectTab(tabNumber);\r\n }, 1);\r\n }\r\n\r\n onRestrictSearchToPublishersChange(restrictToPublishers: boolean) {\r\n if (!restrictToPublishers) {\r\n }\r\n }\r\n\r\n downloadPublisherSearchResults() {\r\n if (this._journalSearchComponent == null) { return; }\r\n\r\n const params: { key: string, value: string }[] = [];\r\n\r\n params.push({ key: 'reporttype', value: 'journalpublisher' });\r\n params.push({ key: 'publisherfilter', value: this._searchTerm });\r\n\r\n const url = this._userManager.getReportUrl(params);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n public get selectedJournalSubscriptionType(): string {\r\n return this._selectedJournalSubscriptionType;\r\n }\r\n\r\n public set selectedJournalSubscriptionType(subTypeId: string) {\r\n this._selectedJournalSubscriptionType = (this.isValidString(subTypeId)) ? subTypeId : 'Any';\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n return (teststring.trim().length > 0);\r\n }\r\n}\r\n\r\n","
\r\n
\r\n
\r\n
\r\n \r\n

{{_title}}

\r\n
\r\n
\r\n
0\" class=\"bold\">Reasons why the Reference is not finished:
\r\n
\r\n
    0\">\r\n
  • \r\n {{r}}\r\n
  • \r\n
\r\n
\r\n
{{_message}}
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'confirm-finish-override-dialog',\r\n templateUrl: './confirm-finish-override.html'\r\n})\r\nexport class ConfirmFinishOverrideComponent implements OnInit {\r\n _title: string;\r\n _message: string;\r\n _reasons: string[];\r\n _buttonNames: string[];\r\n _result: boolean;\r\n\r\n ngOnInit() {\r\n\r\n }\r\n\r\n select(isYes: boolean) {\r\n this._result = isYes;\r\n this.getModalEle().modal('hide');\r\n }\r\n\r\n showModal(title: string, message: string, reasons: string[], buttonNames?: string[]): Promise {\r\n this._title = title;\r\n this._message = message;\r\n this._reasons = reasons;\r\n this._buttonNames = buttonNames || ['Yes', 'No'];\r\n const ele = this.getModalEle();\r\n const p = new Promise((resolve, reject) => {\r\n ele.modal({ backdrop: 'static', keyboard: false }).on('hidden.bs.modal', () => {\r\n resolve(this._result);\r\n });\r\n });\r\n return p;\r\n }\r\n\r\n getModalEle(): any {\r\n return jQuery('#confirm-finish-override-modal');\r\n }\r\n}\r\n\r\n","
\r\n
\r\n\r\n
\r\n \r\n 0\" class=\"form-control\" disabled=\"true\" type=\"number\" [ngModel]=\"reference.referenceId\">\r\n \r\n \r\n
\r\n
\r\n \r\n Hold Reason:\r\n {{holdReason}}\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n Finished\r\n \r\n
\r\n
\r\n \r\n \r\n Reference Proofed\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n Reference No.\r\n Brief Reference\r\n Title\r\n \r\n \r\n \r\n \r\n {{b.referenceId}}\r\n {{b.briefReference}}\r\n {{b.title}}\r\n \r\n \r\n \r\n No matching brief references found.\r\n
\r\n
\r\n
0\">\r\n Select a matching Author\r\n \r\n \r\n \r\n Author Name\r\n Initials\r\n Attach\r\n \r\n \r\n \r\n \r\n {{a.author.authorName}}\r\n {{a.author.initials}}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n No matching authors found.\r\n Loading matching authors.\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n Journal Id:\r\n {{reference.journal?.journalId}}\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n 0\" isChild label=\"Send To\" szs=\"2,2\">\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n 0\" isChild label=\"Notify Staff\" szs=\"2,2\">\r\n
\r\n
\r\n
\r\n \r\n {{contact._contactName}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n Hold Reason\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import { Component, forwardRef, Inject, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, ReferenceState, StateMap, UnitOfWork, WorkflowEmailService } from '../../services/common';\r\nimport { LocationFns, UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\n\r\nimport { Author, Reference, TypeKlimisch, TypePublication, TypeSearchService, TypeWorkflowContact } from '../../entities/EntityModels';\r\nimport { IBriefReferenceParts } from '../../entities/Reference';\r\nimport { ReferenceListItem } from '../../entities/projections/ReferenceListItem';\r\n\r\nimport { ReferenceSelectorComponent } from '../reference/reference-selector.component';\r\nimport { JournalSelectorComponent } from '../staff/journal-selector.component';\r\nimport { ReferenceResultsComponent } from '../reference/reference-results.component';\r\nimport { ConfirmFinishOverrideComponent } from './confirm-finish-override.component';\r\nimport { WorkflowHistoryComponent } from './workflow-history.component';\r\nimport { ReferenceEditorComponent } from './reference-editor.component';\r\nimport {ROUTES} from '../routes';\r\n\r\ninterface AuthorSelector {\r\n author: Author;\r\n selected: boolean;\r\n}\r\n\r\nexport class NotifyContact {\r\n public _contactId: number;\r\n public _contactName: string;\r\n public _selected: boolean;\r\n\r\n constructor(contactId?: number, contactName?: string, selected?: boolean) {\r\n this._contactId = contactId || null;\r\n this._contactName = contactName || null;\r\n this._selected = selected || false;\r\n }\r\n}\r\n\r\n@Component({\r\n selector: 'reference-editor-base',\r\n templateUrl: './reference-editor-base.html',\r\n providers: [provideParent(ReferenceEditorBaseComponent, EditPropParent)]\r\n})\r\nexport class ReferenceEditorBaseComponent implements OnInit, EditPropParent {\r\n @ViewChild(ReferenceSelectorComponent, { static: true }) _referenceSelectorComponent: ReferenceSelectorComponent;\r\n @ViewChild(ReferenceResultsComponent) _referenceResultsComponent: ReferenceResultsComponent;\r\n @ViewChild(JournalSelectorComponent, { static: true }) _journalSelectorComponent: JournalSelectorComponent;\r\n @ViewChild(ConfirmFinishOverrideComponent, { static: true }) _confirmFinishOverrideComponent: ConfirmFinishOverrideComponent;\r\n @ViewChild(WorkflowHistoryComponent) _workflowHistoryComponent: WorkflowHistoryComponent;\r\n\r\n _data: {\r\n entity: Reference,\r\n adding: boolean,\r\n // maxReferenceId: number,\r\n inSubEditor: boolean,\r\n onCancelMap: { [key: string]: () => void };\r\n otherErrorMap: { [key: string]: string }\r\n\r\n origRefId?: number,\r\n // testRefId?: number,\r\n isEditingRef?: boolean\r\n briefRefKey?: string;\r\n briefRefMatches?: ReferenceListItem[];\r\n showBriefRefMatches?: boolean;\r\n };\r\n\r\n private _allContacts: TypeWorkflowContact[] = [];\r\n private _sendToContacts: TypeWorkflowContact[];\r\n private _selectedContactId = 0;\r\n private _canSaveHold = false;\r\n private _isOnHold = false;\r\n private _holdReason: string;\r\n private _showHoldReasonInput = false;\r\n public _notifyContacts: NotifyContact[] = [];\r\n public _loadingAuthors: boolean;\r\n\r\n _typePublications: TypePublication[];\r\n _typeKlimischs: TypeKlimisch[];\r\n _typeSearchServices: TypeSearchService[];\r\n\r\n _matchingAuthors: AuthorSelector[];\r\n _showAuthorMatches: boolean;\r\n\r\n constructor(@Inject(forwardRef(() => ReferenceEditorComponent)) _parent: ReferenceEditorComponent,\r\n public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location,\r\n private _referenceState: ReferenceState, private _workflowEmailService: WorkflowEmailService) {\r\n this._data = _parent.data;\r\n this._data.onCancelMap['base'] = this.onCancel.bind(this);\r\n\r\n }\r\n\r\n ngOnInit() {\r\n LocationFns.setTab(this._location, 0);\r\n\r\n this._uow.typePublicationRepository.all().then(tps => {\r\n this._typePublications = tps;\r\n });\r\n this._uow.typeKlimischRepository.all().then(tks => {\r\n this._typeKlimischs = tks;\r\n });\r\n\r\n this._uow.typeSearchServiceRepository.all().then(ss => {\r\n this._typeSearchServices = ss;\r\n });\r\n\r\n this._uow.typeWorkflowContactRepository.all().then(c => {\r\n this._allContacts = c;\r\n\r\n const sendTos = c.filter(w => w.workflowStaff == true);\r\n this._sendToContacts = _.sortBy(sendTos, s => s.firstName);\r\n\r\n const notifies = c.filter(w => w.notifyOnAddReference == true).map(function (contact) {\r\n const notify = new NotifyContact(contact.workflowContactId, contact.firstName + ' ' + contact.lastName, false);\r\n return notify;\r\n });\r\n\r\n this._notifyContacts = _.sortBy(notifies, n => n._contactName);\r\n });\r\n\r\n const holdData = this._referenceState.getHoldAction(this._data.entity);\r\n this.holdReason = holdData.holdReason;\r\n this.isOnHold = holdData.isOnHold;\r\n }\r\n\r\n get reference() {\r\n return this._data.entity;\r\n }\r\n\r\n getError(propName: string) {\r\n const otherError = this._data.otherErrorMap[propName];\r\n const r = otherError || this._data.entity.getErrorFor(propName);\r\n return r;\r\n }\r\n\r\n onCaptivePaperChange(captivePaper: boolean) {\r\n if (!captivePaper) {\r\n this.reference.captiveCompany = null;\r\n }\r\n }\r\n\r\n onRestrictedDistributionChange(restrictedDistribution: boolean) {\r\n if (!restrictedDistribution) {\r\n this.reference.sponsoringCompany = null;\r\n }\r\n }\r\n\r\n onCancel() {\r\n if (!this._data) {\r\n return;\r\n }\r\n this._data.otherErrorMap = {};\r\n this._data.isEditingRef = false;\r\n\r\n this.resetSelections();\r\n\r\n this.refreshWorkflowHistory();\r\n }\r\n\r\n onEditRefId() {\r\n const data = this._data;\r\n data.origRefId = data.entity.referenceId;\r\n // data.testRefId = data.entity.referenceId;\r\n data.isEditingRef = true;\r\n }\r\n\r\n onShowHideMatches() {\r\n const data = this._data;\r\n data.showBriefRefMatches = !data.showBriefRefMatches;\r\n if (data.showBriefRefMatches) {\r\n return this.getMatchingBriefRefs(this._data.entity.briefReference);\r\n }\r\n }\r\n\r\n onSuggestNext(): void {\r\n const data = this._data;\r\n this.getMatchingBriefRefs(data.entity.briefReference).then(r => {\r\n const newBr = this.getNextBriefRef(r);\r\n if (newBr) {\r\n data.entity.briefReference = newBr;\r\n this.onCheckBriefRef();\r\n }\r\n });\r\n }\r\n\r\n onSelectJournal() {\r\n UtilFns.showModal(this._journalSelectorComponent, this, null).then(journal => {\r\n if (journal == null) {\r\n return;\r\n }\r\n // will also assign 'journalId'\r\n this._data.entity.journal = journal;\r\n });\r\n }\r\n\r\n // code to wrap binding to reference.abstract.text because the abstract record\r\n // may not exist.\r\n get _abstractText() {\r\n const ref = this._data.entity;\r\n if (ref.abstract == null) {\r\n return '';\r\n }\r\n return ref.abstract.text;\r\n }\r\n\r\n set _abstractText(value: string) {\r\n if (this.reference.abstract == null) {\r\n // exit if no abstract and no value\r\n if (!(value && value.trim().length)) {\r\n return;\r\n }\r\n const abstract = this._uow.abstractFactory.create({\r\n referenceId: this._data.entity.referenceId\r\n });\r\n this._data.entity.abstract = abstract;\r\n } else {\r\n // because abstract.text is required if the abstract record exists.\r\n if (!(value && value.trim().length)) {\r\n value = '-';\r\n }\r\n }\r\n this.reference.abstract.text = value;\r\n }\r\n\r\n onInputBriefRef() {\r\n setTimeout(() => {\r\n this._data.otherErrorMap['briefReference'] = 'BriefReference will be validated when you leave this field';\r\n });\r\n\r\n if (this._data.adding) {\r\n // Reset reference author data created from the Brief Reference when it is changed\r\n this._data.showBriefRefMatches = false;\r\n this._matchingAuthors = null;\r\n this._showAuthorMatches = false;\r\n\r\n this.onDetachNewReferenceAuthors();\r\n }\r\n }\r\n\r\n onCheckBriefRef() {\r\n const e = this.reference;\r\n e.setYearOfPublicationFromBriefReference();\r\n this.getMatchingBriefRefs(this._data.entity.briefReference).then((r) => {\r\n this._data.otherErrorMap['briefReference'] = '';\r\n if (!r) {\r\n return;\r\n }\r\n const collision = r.some(x => x.briefReference == e.briefReference && x.referenceId != e.referenceId);\r\n if (collision) {\r\n setTimeout(() => {\r\n this._data.otherErrorMap['briefReference'] = 'This BriefReference has already been used.';\r\n }, 0);\r\n return;\r\n }\r\n });\r\n }\r\n\r\n getNextBriefRef(matches: ReferenceListItem[]) {\r\n if (matches == null || matches.length == 0) {\r\n return null;\r\n }\r\n const lastMatch = matches[matches.length - 1];\r\n const parts = Reference.extractBriefRefParts(lastMatch.briefReference);\r\n if (parts.suffix == null) {\r\n return null;\r\n }\r\n let suffix: string;\r\n if (parts.suffix.length == 0) {\r\n suffix = 'a';\r\n } else {\r\n suffix = parts.suffix;\r\n const ascii = suffix[suffix.length - 1].charCodeAt(0) + 1;\r\n if ('z'.charCodeAt(0) >= ascii) {\r\n suffix = suffix.substr(0, suffix.length - 1) + String.fromCharCode(ascii);\r\n } else {\r\n suffix = suffix.substr(0, suffix.length - 1);\r\n if (suffix.length == 0) {\r\n suffix = 'aa';\r\n } else {\r\n const asciiData = suffix[suffix.length - 1].charCodeAt(0) + 1;\r\n if ('z'.charCodeAt(0) >= asciiData) {\r\n suffix = String.fromCharCode(asciiData) + 'a';\r\n } else {\r\n // past zz ... pick a simpler method\r\n suffix = suffix.substr(0, suffix.length - 1) + 'aa';\r\n }\r\n }\r\n }\r\n }\r\n parts.suffix = suffix;\r\n const newBr = this.toBriefRef(parts);\r\n return newBr;\r\n }\r\n\r\n getMatchingBriefRefs(briefRef: string): Promise {\r\n const data = this._data;\r\n briefRef = briefRef.trim();\r\n if (!briefRef) {\r\n data.briefRefMatches = null;\r\n data.briefRefKey = null;\r\n return Promise.resolve(null);\r\n }\r\n\r\n if (briefRef == data.briefRefKey) {\r\n return Promise.resolve(data.briefRefMatches);\r\n }\r\n\r\n const parts = Reference.extractBriefRefParts(briefRef);\r\n return this._uow.fetch('References/ReferencesByRootBriefReference', { briefReference: UtilFns.encodeHackForAnd(parts.search) }).then(r => {\r\n const brMatches = r;\r\n data.briefRefMatches = _.sortBy(brMatches, m => {\r\n const briefParts = Reference.extractBriefRefParts(m.briefReference);\r\n const result = (briefParts.author ? briefParts.author.toLocaleUpperCase() : '')\r\n + (briefParts.year || '')\r\n + (briefParts.suffix ? briefParts.suffix.length.toString() + briefParts.suffix : '');\r\n return result;\r\n });\r\n data.briefRefKey = briefRef;\r\n\r\n return data.briefRefMatches;\r\n });\r\n }\r\n\r\n toBriefRef(parts: IBriefReferenceParts) {\r\n return parts.author + ',' + parts.year + parts.suffix;\r\n }\r\n\r\n hasBriefReferenceMatches(): boolean {\r\n return (this._data.briefRefMatches != null && this._data.briefRefMatches.length > 0);\r\n }\r\n\r\n // Authors\r\n canShowAuthors(): boolean {\r\n\r\n if (!this._data.adding) {\r\n return false;\r\n }\r\n\r\n if (!this._data.entity.briefReference) {\r\n return false;\r\n }\r\n\r\n const parts = Reference.extractBriefRefParts(this._data.entity.briefReference);\r\n return (parts.author != null);\r\n }\r\n\r\n hasAuthorMatches(): boolean {\r\n return ((this._matchingAuthors != null && this._matchingAuthors.length > 0) ||\r\n (this._data.entity.referenceAuthors != null && this._data.entity.referenceAuthors.length > 0));\r\n }\r\n\r\n onShowHideAuthorMatches() {\r\n if (!this._data.adding) {\r\n return false;\r\n }\r\n\r\n this._showAuthorMatches = !this._showAuthorMatches;\r\n if (this._showAuthorMatches && this._matchingAuthors == null) {\r\n this.getMatchingAuthors();\r\n }\r\n }\r\n\r\n getMatchingAuthors() {\r\n this._matchingAuthors = null;\r\n\r\n if (!this._data.entity.briefReference) {\r\n return;\r\n }\r\n\r\n const parts = Reference.extractBriefRefParts(this._data.entity.briefReference);\r\n if (parts.author) {\r\n this._loadingAuthors = true;\r\n const params = { authorName: parts.author };\r\n this._uow.fetchTyped('Misc/AuthorsByNameAndBriefReference', Author, params).then(r => {\r\n if (r != null && r.length > 0) {\r\n\r\n r = _.sortBy(r, a => a.authorName);\r\n this._matchingAuthors = r.map(item => {\r\n author: item,\r\n selected: false\r\n });\r\n }\r\n this._loadingAuthors = false;\r\n });\r\n }\r\n }\r\n\r\n onAttachSelectedAuthor(author: Author) {\r\n\r\n if (this._data.entity.referenceAuthors == null) {\r\n this._data.entity.referenceAuthors = [];\r\n }\r\n\r\n const maxCounter = _.max(this._data.entity.referenceAuthors.map(x => x.counter)) || 0;\r\n\r\n const refauthdata = {\r\n referenceId: this._data.entity.referenceId,\r\n authorId: author.authorId,\r\n counter: maxCounter + 1\r\n };\r\n\r\n const ra = this._uow.referenceAuthorFactory.create(refauthdata);\r\n this._data.entity.referenceAuthors.push(ra);\r\n\r\n }\r\n\r\n onChangeAuthorSelection(selectedAuthor: AuthorSelector) {\r\n if (selectedAuthor.selected) {\r\n this.onAttachSelectedAuthor(selectedAuthor.author);\r\n } else {\r\n this.onDetachReferenceAuthors(selectedAuthor.author);\r\n }\r\n }\r\n\r\n onDetachNewReferenceAuthors() {\r\n if (this._data.entity.referenceAuthors) {\r\n this._data.entity.referenceAuthors.forEach(ra => {\r\n if (ra.author.entityAspect.entityState.isAdded()) {\r\n ra.author.entityAspect.rejectChanges();\r\n }\r\n if (ra.entityAspect.entityState.isAdded()) {\r\n ra.entityAspect.rejectChanges();\r\n }\r\n });\r\n }\r\n }\r\n\r\n onDetachReferenceAuthors(author: Author) {\r\n if (this._data.entity.referenceAuthors) {\r\n\r\n const ra = this._data.entity.referenceAuthors.filter(a => a.author.authorName == author.authorName);\r\n\r\n if (ra != null && ra.length > 0) {\r\n\r\n if (ra[0].author.entityAspect.entityState.isAdded()) {\r\n ra[0].author.entityAspect.rejectChanges();\r\n }\r\n if (ra[0].entityAspect.entityState.isAdded()) {\r\n ra[0].entityAspect.rejectChanges();\r\n }\r\n }\r\n }\r\n }\r\n\r\n onCreateAuthor() {\r\n const parts = Reference.extractBriefRefParts(this._data.entity.briefReference);\r\n let author: Author;\r\n\r\n if (parts.author) {\r\n author = this._uow.authorFactory.create();\r\n author.authorName = parts.author;\r\n } else {\r\n return;\r\n }\r\n\r\n if (this._data.entity.referenceAuthors == null) {\r\n this._data.entity.referenceAuthors = [];\r\n }\r\n\r\n const maxCounter = _.max(this._data.entity.referenceAuthors.map(x => x.counter)) || 0;\r\n\r\n const refAuthorData = {\r\n referenceId: this._data.entity.referenceId,\r\n authorId: author == null ? null : author.authorId,\r\n counter: maxCounter + 1\r\n };\r\n\r\n const ra = this._uow.referenceAuthorFactory.create(refAuthorData);\r\n this._data.entity.referenceAuthors.push(ra);\r\n\r\n }\r\n\r\n canShowAuthorMatches(): boolean {\r\n if (!this._data.adding) {\r\n return false;\r\n }\r\n\r\n return (this._showAuthorMatches);\r\n }\r\n\r\n // Workflow Related\r\n public isProofable(): boolean {\r\n if (this._data.entity.abstract == null || this._data.entity.abstract.text == '-' || this._data.entity.abstract.entityAspect.entityState.isAdded()) {\r\n return false;\r\n }\r\n\r\n return !this._data.entity.complete;\r\n }\r\n\r\n private abstractProofed() {\r\n return this._data.entity.complete;\r\n }\r\n\r\n private proofAbstract() {\r\n this._data.entity.complete = true;\r\n }\r\n\r\n // Workflow On Hold\r\n public get holdReason(): string {\r\n return this._holdReason;\r\n }\r\n\r\n public set holdReason(value: string) {\r\n this._holdReason = value;\r\n\r\n this.canSaveHold = (this._holdReason && this._holdReason.length > 0) ? true : false;\r\n }\r\n\r\n public get isOnHold(): boolean {\r\n return this._isOnHold;\r\n }\r\n\r\n public set isOnHold(value: boolean) {\r\n this._isOnHold = value;\r\n }\r\n\r\n public get showHoldReasonInput(): boolean {\r\n return this._showHoldReasonInput;\r\n }\r\n\r\n public set showHoldReasonInput(value: boolean) {\r\n this._showHoldReasonInput = value;\r\n }\r\n\r\n public get canSaveHold(): boolean {\r\n return this._canSaveHold;\r\n }\r\n\r\n public set canSaveHold(value: boolean) {\r\n this._canSaveHold = value;\r\n }\r\n\r\n public addHold() {\r\n this.showHoldReasonInput = true;\r\n }\r\n\r\n public cancelAddHold() {\r\n this.showHoldReasonInput = false;\r\n this.holdReason = '';\r\n this.isOnHold = false;\r\n }\r\n\r\n public saveHold() {\r\n this._referenceState.recordAddHold(this._data.entity, this.holdReason);\r\n this.isOnHold = true;\r\n this.showHoldReasonInput = false;\r\n }\r\n\r\n public removeHold() {\r\n this._referenceState.recordRemoveHold(this._data.entity);\r\n this.holdReason = '';\r\n this.isOnHold = false;\r\n }\r\n\r\n // The \"Finished\" state is normally derived from the state of the data and workflow history but it can be overridden by staff here.\r\n finishReference() {\r\n this.confirmFinishOverride();\r\n }\r\n\r\n private confirmFinishOverride() {\r\n\r\n this._referenceState.enumerateMissingData(this._data.entity).then(c => {\r\n if (c == 0) { // Number of missing data elements = 0\r\n this._data.entity.finished = true;\r\n this._referenceState.finishOverride(this._data.entity);\r\n }\r\n\r\n\r\n this._confirmFinishOverrideComponent.showModal('Attempt to Finish a Reference with Missing Data',\r\n 'Do you still want to Finish this reference?', this._referenceState.unfinishedReasons).then(ok => {\r\n if (ok) {\r\n this._data.entity.finished = true;\r\n this._referenceState.finishOverride(this._data.entity);\r\n }\r\n });\r\n });\r\n }\r\n\r\n // SendTo Workflow\r\n public sendToStaff(r: number) {\r\n if (this._selectedContactId != r) {\r\n if (this._selectedContactId != 0) {\r\n this._workflowEmailService.removeEmailFromSendToList(this._selectedContactId, this._data.entity);\r\n }\r\n\r\n this._selectedContactId = r;\r\n\r\n if (this._selectedContactId != 0) {\r\n\r\n this.recordSendTo(this._selectedContactId);\r\n }\r\n }\r\n }\r\n\r\n private recordSendTo(contactId: number) {\r\n\r\n const contact = this._sendToContacts.filter(c => c.workflowContactId == this._selectedContactId);\r\n\r\n if (contact == null || contact.length == 0) {\r\n return;\r\n }\r\n\r\n const resend = this._workflowEmailService.isResend(this._data.entity);\r\n\r\n if (resend) {\r\n this._workflowEmailService.reassignPreviousSentTo(this._data.entity).then(w => {\r\n this._workflowEmailService.addEmailToSendToList(contact[0], this._data.entity, resend);\r\n });\r\n } else {\r\n this._workflowEmailService.addEmailToSendToList(contact[0], this._data.entity, resend);\r\n }\r\n }\r\n\r\n public notifyContact(notifyContact: NotifyContact) {\r\n const workflowContact = this._allContacts.filter(a => a.workflowContactId == notifyContact._contactId);\r\n\r\n if (workflowContact == null || workflowContact.length == 0) {\r\n return;\r\n }\r\n\r\n if (notifyContact._selected) {\r\n this._workflowEmailService.addEmailToNotifyList(workflowContact[0], this._data.entity);\r\n } else {\r\n this._workflowEmailService.removeEmailFromNotifyList(workflowContact[0].workflowContactId, this._data.entity);\r\n }\r\n }\r\n\r\n // Reset Send To and Notify selections and refresh On Hold values\r\n resetSelections() {\r\n this._selectedContactId = 0;\r\n\r\n if (this._notifyContacts != null && this._notifyContacts.length > 0) {\r\n this._notifyContacts.forEach(n => n._selected = false);\r\n }\r\n\r\n const holdData = this._referenceState.getHoldAction(this._data.entity);\r\n this.holdReason = holdData.holdReason;\r\n this.isOnHold = holdData.isOnHold;\r\n }\r\n\r\n // Government Publication logic\r\n onSetPublicationType(val: number) {\r\n\r\n this.reference.publicationTypeId = val;\r\n\r\n if (this.reference.publicationTypeId != 7) {\r\n this.reference.govDocNumbers = null;\r\n this.reference.govSponsors = null;\r\n }\r\n }\r\n\r\n isGovernmentDocument(): boolean {\r\n return (this.reference.publicationTypeId == 7);\r\n }\r\n\r\n refreshWorkflowHistory() {\r\n if (this._workflowHistoryComponent) {\r\n if (this._workflowHistoryComponent.currentReferenceId == null || this._workflowHistoryComponent.currentReferenceId != this._data.entity.referenceId) {\r\n this._workflowHistoryComponent.onReferenceChange(this._data.entity);\r\n } else {\r\n this._workflowHistoryComponent.loadData();\r\n }\r\n }\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n

(Still Loading Filter Settings...)

\r\n
\r\n
\r\n
\r\n Pending Action:\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n

(Still Loading Reference Assignments for Selected Pending Action...)

\r\n
\r\n
\r\n

{{_filterSettingsDescription}}

\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
ReferenceBrief ReferenceTypeRIFM/FEMAPrioritySent ToTitle
{{ref.referenceId}}{{ref.briefReference}} R M{{ref.articleType}}{{ref.precedence}}{{ref.workflowContactFirstName}}\r\n {{ref.title}}\r\n {{\"Hold Reason: \" + ref.holdReason}}\r\n
\r\n
\r\n
\r\n \r\n \r\n {{\"Page \" + _searchParams.pageNumber + \" of \" + _pages.length}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
","import { Component, ElementRef, OnInit } from '@angular/core';\r\nimport { UnitOfWork, UserManager } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { TypeWorkflowContact, WorkflowPendingAction, WorkflowReferenceAssignment } from '../../entities/EntityModels';\r\nimport { ModalDialog } from '../../controls/common';\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'workflow-reference-assignments',\r\n templateUrl: './workflow-reference-assignments.html'\r\n})\r\n\r\nexport class WorkflowReferenceAssignmentsComponent extends ModalDialog implements OnInit {\r\n _currentWorkflowContact: TypeWorkflowContact = null;\r\n _isCollapsed = false;\r\n _hasNextPages = false;\r\n _hasPreviousPages = false;\r\n _isTypeDataLoading: boolean;\r\n _isPendingActionDataLoading: boolean;\r\n _filterPrecedence = '0';\r\n _filterToCompleteDescription: string = null;\r\n _filterSettingsDescription: string;\r\n\r\n _workflowPendingActions: WorkflowPendingAction[] = [];\r\n _workflowPendingActionTypes: string[] = [];\r\n\r\n public _pages: number[] = [];\r\n public _paginationTotalItems = 0;\r\n public _searchParams: { pageNumber: number, pageSize: number } = { pageNumber: 1, pageSize: 20 };\r\n\r\n constructor(public elementRef: ElementRef, private _uow: UnitOfWork, private _userManager: UserManager) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.typeWorkflowContactRepository.all().then(w => {\r\n const contacts = w.filter(c => c.emailAddress.toUpperCase() == this._userManager.currentUser.name.toUpperCase());\r\n\r\n if (contacts != null && contacts.length > 0) {\r\n this._currentWorkflowContact = contacts[0];\r\n }\r\n\r\n if (this._currentWorkflowContact == null) {\r\n return;\r\n }\r\n\r\n this.fetchTypesOfPendingWorkflowRecordedActions();\r\n\r\n return;\r\n });\r\n\r\n }\r\n\r\n public refreshData() {\r\n this.fetchTypesOfPendingWorkflowRecordedActions();\r\n }\r\n\r\n public fetchTypesOfPendingWorkflowRecordedActions() {\r\n\r\n //Clear paging and display data\r\n this._workflowPendingActionTypes = [];\r\n this._workflowPendingActions = [];\r\n this._filterToCompleteDescription = null;\r\n this._filterSettingsDescription = null;\r\n this._hasNextPages = false;\r\n this._hasPreviousPages = false;\r\n this._pages = [];\r\n this._paginationTotalItems = 0;\r\n this._searchParams.pageNumber = 1;\r\n //*\r\n\r\n this._isTypeDataLoading = true;\r\n\r\n let params: {} = null;\r\n if (this._currentWorkflowContact.consultant) {\r\n params = {\r\n workflowContactId: this._currentWorkflowContact.workflowContactId\r\n };\r\n } else {\r\n params = {};\r\n }\r\n\r\n this._uow.fetch('Workflow/FetchTypesOfPendingWorkflowRecordedActions', params)\r\n .then(r => {\r\n if (r == null || r.length < 1) {\r\n this._isTypeDataLoading = false;\r\n return;\r\n }\r\n\r\n this._workflowPendingActionTypes = _.sortBy(r, a => (a).toCompleteDescription);\r\n this._isTypeDataLoading = false;\r\n return;\r\n });\r\n }\r\n\r\n private getWorkflowReferenceAssignmentCounts(): Promise {\r\n\r\n let params: {} = null;\r\n\r\n if (this._currentWorkflowContact.consultant) {\r\n params = {\r\n toCompleteDescription: this._filterToCompleteDescription,\r\n workflowContactId: this._currentWorkflowContact.workflowContactId\r\n };\r\n } else {\r\n params = {\r\n toCompleteDescription: this._filterToCompleteDescription\r\n };\r\n }\r\n\r\n return this._uow.fetch('Workflow/FetchPendingWorkflowActionsByToCompleteDescriptionCount', params);\r\n }\r\n\r\n public fetchAllWorkflowReferenceAssignments() {\r\n\r\n this._filterSettingsDescription = 'Pending Action \"' + this._filterToCompleteDescription + '\" displayed';\r\n this._workflowPendingActions = [];\r\n\r\n let params: {} = null;\r\n\r\n if (this._currentWorkflowContact.consultant) {\r\n params = {\r\n pageNumber: this._searchParams.pageNumber,\r\n pageSize: this._searchParams.pageSize,\r\n toCompleteDescription: this._filterToCompleteDescription,\r\n workflowContactId: this._currentWorkflowContact.workflowContactId\r\n };\r\n } else {\r\n params = {\r\n pageNumber: this._searchParams.pageNumber,\r\n pageSize: this._searchParams.pageSize,\r\n toCompleteDescription: this._filterToCompleteDescription,\r\n };\r\n }\r\n\r\n this._isPendingActionDataLoading = true;\r\n\r\n this._uow.fetch('Workflow/FetchPendingWorkflowActionsByToCompleteDescription', params).then(r => {\r\n this._workflowPendingActions = r;\r\n this._hasNextPages = this._searchParams.pageNumber < this._pages.length;\r\n this._hasPreviousPages = this._searchParams.pageNumber > 1;\r\n this._isPendingActionDataLoading = false;\r\n return;\r\n });\r\n }\r\n\r\n hasData(): boolean {\r\n return (this._workflowPendingActions != null && this._workflowPendingActions.length > 0);\r\n }\r\n\r\n public hasPages(): boolean {\r\n return (this._paginationTotalItems > 1);\r\n }\r\n\r\n public nextPage() {\r\n if (this._searchParams.pageNumber < this._pages.length) {\r\n this._searchParams.pageNumber = this._searchParams.pageNumber + 1;\r\n return this.fetchAllWorkflowReferenceAssignments();\r\n }\r\n }\r\n\r\n public previousPage() {\r\n if (this._searchParams.pageNumber > 1) {\r\n this._searchParams.pageNumber = this._searchParams.pageNumber - 1;\r\n return this.fetchAllWorkflowReferenceAssignments();\r\n }\r\n }\r\n\r\n public missingContactInformation(): boolean {\r\n return (this._currentWorkflowContact == null);\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n public canFilter(): boolean {\r\n return (this._filterToCompleteDescription != null);\r\n }\r\n\r\n public filterResults(event: any) {\r\n\r\n this._searchParams.pageNumber = 1;\r\n\r\n const ix = event.currentTarget.selectedIndex;\r\n this._filterToCompleteDescription = this._workflowPendingActionTypes[ix];\r\n\r\n this.getWorkflowReferenceAssignmentCounts().then(c => {\r\n\r\n if (c != null && c.length > 0) {\r\n this._paginationTotalItems = c[0];\r\n }\r\n\r\n if (this._paginationTotalItems == 0) {\r\n return;\r\n }\r\n\r\n if (this.hasPages()) {\r\n let count = this._paginationTotalItems / this._searchParams.pageSize;\r\n if ((this._paginationTotalItems % this._searchParams.pageSize) > 0) {\r\n count = count + 1;\r\n }\r\n\r\n this._pages = _.range(1, count);\r\n } else {\r\n this._pages = _.range(1, 1);\r\n }\r\n\r\n return this.fetchAllWorkflowReferenceAssignments();\r\n });\r\n }\r\n\r\n // Navigate to selected reference\r\n onSelectReferenceAssignment(ra: WorkflowReferenceAssignment) {\r\n UtilFns.returnModal(this, ra);\r\n }\r\n}\r\n","
\r\n
{{data.adding ? \"Adding a Reference\" : \"Editing a Reference\" }}
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{_finishedMessage}}\r\n \r\n \r\n \r\n
\r\n \r\n {{data.entity.referenceId}}\r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport {EditorService, ReferenceFinishState, ReferenceState, StateMap, UnitOfWork, UserManager, WorkflowEmailService} from '../../services/common';\r\nimport { EditManager, LocationFns, UtilFns } from '../../utils/common';\r\nimport { PageState, TabContainer } from '../../controls/common';\r\n\r\nimport {DocUniqReference, Project, Reference, ReferenceRelation} from '../../entities/EntityModels';\r\nimport { ShowAndDownloadPDFComponent } from '../docmanagement/show-and-download-pdf.component';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { STAFF_ROUTES } from './staff.routes';\r\n\r\nimport { ReferenceSelectorComponent } from '../reference/reference-selector.component';\r\nimport { ReferenceResultsComponent } from '../reference/reference-results.component';\r\nimport { ReferenceEditorBaseComponent } from './reference-editor-base.component';\r\nimport { WorkflowReferenceAssignmentsComponent } from './workflow-reference-assignments.component';\r\n\r\nexport class ReferenceEditData {\r\n edm: EditManager;\r\n entity: Reference;\r\n adding: boolean;\r\n inSubEditor: boolean;\r\n otherErrorMap: { [key: string]: string } = {};\r\n onCancelMap: { [key: string]: () => void } = {};\r\n projects: Project[];\r\n}\r\n\r\nclass PageStateExt extends PageState {\r\n // referenceId: number;\r\n}\r\n\r\n@Component({\r\n selector: 'reference-editor',\r\n templateUrl: './reference-editor.html',\r\n})\r\nexport class ReferenceEditorComponent implements OnInit, AfterViewInit {\r\n @ViewChild(TabContainer) _tabContainer: TabContainer;\r\n @ViewChild(ReferenceSelectorComponent, { static: true }) _referenceSelectorComponent: ReferenceSelectorComponent;\r\n @ViewChild(ReferenceResultsComponent) _referenceResultsComponent: ReferenceResultsComponent;\r\n @ViewChild(ReferenceEditorBaseComponent) _referenceEditorBaseComponent: ReferenceEditorBaseComponent;\r\n @ViewChild(WorkflowReferenceAssignmentsComponent) _workflowReferenceAssignmentsComponent: WorkflowReferenceAssignmentsComponent;\r\n @ViewChild(ShowAndDownloadPDFComponent, { static: true }) _showAndDownloadPDFComponent: ShowAndDownloadPDFComponent;\r\n\r\n data: ReferenceEditData = new ReferenceEditData();\r\n _referenceObservations: {\r\n minReferenceId: number,\r\n maxReferenceId: number;\r\n };\r\n\r\n _tab: number;\r\n _edm: EditManager;\r\n\r\n _hasReferenceDocumentFile = false;\r\n _referenceFileName = '';\r\n\r\n // this is not the same pageState that the _edm is using.\r\n _pageState = new PageStateExt('Reference editor');\r\n\r\n _finishedMessage: string;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService,\r\n private _location: Location, private _router: Router,\r\n private _referenceState: ReferenceState, private _workflowEmailService: WorkflowEmailService,\r\n private route: ActivatedRoute) {\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = STAFF_ROUTES.Reference.name;\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n\r\n this._edm = this._editorService.createEditManager(this, 'Reference');\r\n this.data.edm = this._edm;\r\n\r\n // this.fetchMaxReferenceId();\r\n\r\n this.setReferenceMinAndMax();\r\n\r\n this._uow.projectRepository.all().then(r => {\r\n this.data.projects = _.sortBy(r, p => p.projectName);\r\n });\r\n\r\n this.route.params\r\n .subscribe(params => {\r\n if (params['referenceId']) {\r\n return this.fetchThenEditReference(params['referenceId'])\r\n .then(() => {\r\n this.fetchReferenceDocumentFileStatus();\r\n if (this._referenceEditorBaseComponent) {\r\n this.resetPageDisplay();\r\n }\r\n });\r\n } else {\r\n this.data.edm.editing = false;\r\n }\r\n });\r\n }\r\n\r\n canDeactivateEditor() {\r\n return this.data.inSubEditor != true;\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.focusInitialTab();\r\n }\r\n\r\n focusInitialTab() {\r\n setTimeout(() => {\r\n if (this._tabContainer) {\r\n this._tabContainer.selectTab(this._tab);\r\n }\r\n }, 1);\r\n }\r\n\r\n canDeactivate() {\r\n return !this.data.edm.hasEdits();\r\n }\r\n\r\n canShowBack() {\r\n return !this.data.edm.hasEdits();\r\n }\r\n\r\n onSelectReference() {\r\n UtilFns.showModal(this._referenceSelectorComponent, this, null).then(rli => {\r\n if (rli == null) {\r\n return;\r\n }\r\n return this._router.navigate(['/staff/reference/', rli.referenceId, 'info']);\r\n });\r\n }\r\n\r\n onSelectAssignedReference() {\r\n UtilFns.showModal(this._workflowReferenceAssignmentsComponent, this, null).then(ra => {\r\n if (ra == null) {\r\n return;\r\n }\r\n return this._router.navigate(['/staff/reference/', ra.referenceId, 'info']);\r\n });\r\n }\r\n\r\n onMore() {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, this.data.entity.referenceId));\r\n }\r\n\r\n onNext() {\r\n const params = { referenceId: this.data.entity.referenceId };\r\n this._uow.fetch('References/NextReferenceId', params)\r\n .then(r => {\r\n if (r && r > 0) {\r\n const refId = r[0];\r\n return this._router.navigate(['/staff/reference/', refId, 'info']);\r\n }\r\n });\r\n }\r\n\r\n onPrev() {\r\n const params = { referenceId: this.data.entity.referenceId };\r\n this._uow.fetch('References/PreviousReferenceId', params)\r\n .then(r => {\r\n if (r && r > 0) {\r\n const refId = r[0];\r\n return this._router.navigate(['/staff/reference/', refId, 'info']);\r\n }\r\n });\r\n }\r\n\r\n canShowPrev(): boolean {\r\n if (this.data.edm.hasEdits()) {\r\n return false;\r\n }\r\n return ((this._referenceObservations) && (this.data.entity.referenceId > this._referenceObservations.minReferenceId));\r\n }\r\n\r\n canShowNext(): boolean {\r\n if (this.data.edm.hasEdits()) {\r\n return false;\r\n }\r\n return ((this._referenceObservations) && (this.data.entity.referenceId < this._referenceObservations.maxReferenceId));\r\n }\r\n\r\n isFEMA() {\r\n // FEMA role members can only edit Protocol data\r\n return (this._stateMap.currentUser.isInRole('fema'));\r\n }\r\n\r\n isReady() {\r\n return (this.data.projects != null);\r\n // && (this.data.maxReferenceId != null);\r\n }\r\n\r\n fetchReferenceDocumentFileStatus() {\r\n this._hasReferenceDocumentFile = false;\r\n\r\n if (this.data.entity == null) {\r\n return false;\r\n }\r\n\r\n return this._uow.fetch('DocumentManagement/RIFMDocumentByReferenceId', {referenceId: this.data.entity.referenceId}).then(rd => {\r\n const doc = (rd && rd.length) ? rd[0] : null;\r\n if (doc != null) {\r\n this._referenceFileName = doc.fileName;\r\n this._hasReferenceDocumentFile = (doc.fileName != null && doc.fileName.length > 0);\r\n }\r\n });\r\n }\r\n\r\n fetchThenEditReference(referenceId: number) {\r\n let reference: Reference;\r\n this._pageState.isLoading = true;\r\n\r\n return this._uow.fetch('References/GetForEdit', { referenceId: referenceId }).then(refs => {\r\n reference = (refs && refs.length) ? refs[0] : null;\r\n if (reference) {\r\n this.editReference(reference);\r\n this._stateMap.currentReference = reference;\r\n }\r\n this._pageState.isLoaded = true;\r\n return reference;\r\n });\r\n }\r\n\r\n editReference(r: Reference) {\r\n if (r == null) {\r\n return;\r\n }\r\n\r\n const data = this.data;\r\n data.adding = false;\r\n data.entity = r;\r\n data.edm.onlyEntity = r;\r\n data.edm.editing = true;\r\n this.focusInitialTab();\r\n return r;\r\n }\r\n\r\n createReference() {\r\n const params = {};\r\n\r\n const reference = this._uow.referenceFactory.create(params);\r\n reference.typeKlimischId = 'None';\r\n reference.precedence = 1; // Default changed September, 2017\r\n reference.publicationTypeId = 0; // None\r\n reference.typeSearchServiceId = 'Not Sent';\r\n return reference;\r\n }\r\n\r\n // EditManager overrides\r\n\r\n canAdd() {\r\n return ((this._stateMap.currentUser.isStaff) && (this._stateMap.currentUser.isInRole('fema') == false));\r\n }\r\n\r\n onAdd() {\r\n this._finishedMessage = '';\r\n\r\n const data = this.data;\r\n data.adding = true;\r\n data.entity = this.createReference();\r\n this._stateMap.currentReference = null;\r\n\r\n // next line is only really needed when a reference is added immediately after another\r\n // reference is saved because this error would normally have been triggered by\r\n // loading the 'base' editor which will have already occurred.\r\n // this.data.otherErrorMap['abstract'] = \"An Abstract is required.\";\r\n data.edm.onlyEntity = data.entity;\r\n data.edm.editing = true;\r\n\r\n if (this._referenceEditorBaseComponent) {\r\n this._referenceEditorBaseComponent.cancelAddHold();\r\n }\r\n\r\n this.focusInitialTab();\r\n }\r\n\r\n canSave() {\r\n const data = this.data;\r\n if (!data.edm.hasEdits()) {\r\n return false;\r\n }\r\n if (!data.edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n const errMap = data.otherErrorMap;\r\n for (const key in errMap) {\r\n if (errMap[key]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n onSave() {\r\n if (!this.canSave()) {\r\n return Promise.resolve();\r\n }\r\n\r\n this._finishedMessage = '';\r\n this.recordWorkflowChanges();\r\n\r\n // Check if the modifications change the Reference state to Finished\r\n // If the finished state has changed, record this workflow action\r\n // The workflow transition mappings won't match the finished property change event so the action won't be recorded twice.\r\n return this._referenceState.isReferenceFinished(this.data.entity).then(f => {\r\n const finished: boolean = (f != ReferenceFinishState.MissingData);\r\n if (finished != this.data.entity.finished) {\r\n this._finishedMessage = (finished) ?\r\n 'The Reference is now marked complete, you may need to Save again to confirm.' :\r\n 'The Reference has been Unfinished as a result of these edits.';\r\n this.data.entity.finished = finished;\r\n this._referenceState.recordReferenceFinishedStateChange(this.data.entity);\r\n }\r\n\r\n return this.data.edm.commitSave()\r\n .then(() => {\r\n if (this.data.adding) {\r\n return this._router.navigate(['/staff/reference/', this.data.entity.referenceId, 'info']);\r\n }\r\n\r\n const reference = this.data.entity;\r\n this.editReference(reference);\r\n if (this._referenceEditorBaseComponent) {\r\n this._referenceEditorBaseComponent.resetSelections();\r\n this._referenceEditorBaseComponent.refreshWorkflowHistory();\r\n }\r\n\r\n if (this.data.entity.referenceId > this._referenceObservations.maxReferenceId) {\r\n this.setReferenceMinAndMax();\r\n }\r\n });\r\n\r\n });\r\n }\r\n\r\n onDelete() {\r\n return this._stateMap.yesNoComponent.showModal('Delete entire reference',\r\n 'Are you sure?').then(ok => {\r\n if (ok) {\r\n this.deleteReference();\r\n }\r\n });\r\n }\r\n\r\n onCancel() {\r\n const data = this.data;\r\n const hadEdits = data.edm.hasEdits();\r\n this._uow.rollback();\r\n data.edm.clearErrors();\r\n data.edm.pageState.loadStatusMsg = null;\r\n\r\n // tslint:disable-next-line:forin\r\n for (const k in data.onCancelMap) {\r\n data.onCancelMap[k]();\r\n }\r\n\r\n // if in edit mode (not adding and already some edits then cancel will just rollback the edits)\r\n if (data.adding || !hadEdits) {\r\n data.edm.editing = false;\r\n }\r\n }\r\n\r\n deleteReference() {\r\n // TODO: check that all entries in related tables are deleted.\r\n // this is done on the db with a cascade delete.\r\n const data = this.data;\r\n\r\n const params = { referenceId: data.entity.referenceId };\r\n return this._uow.fetch('References/AllReferenceRelations', params).then(r => {\r\n const rrs: ReferenceRelation[] = r;\r\n rrs.forEach(rr => rr.entityAspect.setDeleted());\r\n return this._uow.commitSelected(rrs);\r\n }).then(() => {\r\n data.edm.onDeleteCore();\r\n return this._uow.commitSelected([data.entity]);\r\n }).then(() => {\r\n data.edm.setSavedStatus('Deleted');\r\n // Next line is needed because the onDeleteCore above will have modified all\r\n // entities in cache that ref'd this material.\r\n this._uow.rollback();\r\n }).catch((e) => {\r\n data.edm.setSaveFailedStatus('Delete failed: ' + e);\r\n throw e;\r\n });\r\n }\r\n\r\n resetPageDisplay() {\r\n this._referenceEditorBaseComponent.resetSelections();\r\n this._referenceEditorBaseComponent.refreshWorkflowHistory();\r\n this._finishedMessage = '';\r\n }\r\n\r\n setReferenceMinAndMax() {\r\n return this._uow.fetch('References/ReferenceIdMinAndMax', {}).then(r => {\r\n this._referenceObservations = r[0];\r\n });\r\n }\r\n\r\n // Workflow related logic\r\n private recordWorkflowChanges() {\r\n const reference = this.data.entity;\r\n\r\n // First record specific changes tracked for the Reference then for the related tables of interest\r\n if (reference.entityAspect.entityState.isAdded() || reference.entityAspect.entityState.isModified()) {\r\n this._referenceState.recordEntityChange(reference, reference);\r\n }\r\n\r\n // Abstract\r\n const abstract = reference.abstract;\r\n if (abstract != null && abstract.entityAspect.entityState.isAdded()) {\r\n this._referenceState.recordEntityChange(abstract, reference, String(abstract.referenceId)); // Not every table has a primary key defined as an int\r\n }\r\n\r\n // Special Link\r\n if (reference.specialLinks != null && reference.specialLinks.length > 0) {\r\n const addedlinks = reference.specialLinks.filter(s => s.entityAspect.entityState.isAdded());\r\n if (addedlinks != null && addedlinks.length > 0 && abstract != null) {\r\n this._referenceState.recordEntityChange(addedlinks[0], reference, String(abstract.referenceId)); // Only needs to be recorded once, not for every added special link\r\n }\r\n }\r\n\r\n // SentTo, Notify\r\n this._workflowEmailService.sendEmails(reference); // If any staff notifications are in the list they will be sent now that the user has saved their changes.\r\n\r\n }\r\n\r\n public referenceFinishedStatesHaveChanged(): boolean {\r\n return (this._finishedMessage && this._finishedMessage.length > 0);\r\n }\r\n\r\n canDownloadReferenceDocument(): boolean {\r\n\r\n if (this._stateMap.currentUser.isStaff || this._stateMap.currentUser.isInRole('fema')) {\r\n return true;\r\n }\r\n\r\n if (this.data.entity) {\r\n if (this._stateMap.currentUser.isInRole('iff') && (this.matchDocumentToRole('iff') || this.matchDocumentToRole('bba'))) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n canEditReferenceDocument() {\r\n if (this._stateMap.currentUser.isStaff) {\r\n if (this._stateMap.currentUser.isInRole('consultant')) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n matchDocumentToRole(role: string) {\r\n if (this.data.entity.briefReference.length < role.length) {\r\n return false;\r\n }\r\n\r\n return (this.data.entity.briefReference.substring(0, role.length).toUpperCase() == role.toUpperCase());\r\n }\r\n\r\n showReferenceDocument() {\r\n this._showAndDownloadPDFComponent.fileName = this._referenceFileName;\r\n UtilFns.showModal(this._showAndDownloadPDFComponent, this).then(m => {\r\n return;\r\n });\r\n }\r\n\r\n onNavToReferenceDocument() {\r\n this._stateMap.documentManagementReferenceId = this.data.entity.referenceId;\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.DocumentManagement, ROUTES.DocumentManagement.childRoutes.RIFMDocuments));\r\n }\r\n}\r\n","\r\n \r\n \r\n Material\r\n CAS No\r\n RIFM ID\r\n FEMA No.\r\n \r\n \r\n \r\n \r\n \r\n {{material.realCASNumber}}\r\n {{material.monographNumber}}\r\n {{material.fEMANumber}}\r\n \r\n \r\n","import { Component, Input } from '@angular/core';\r\nimport { Material } from '../../entities/Material';\r\n\r\n@Component({\r\n selector: 'material-summary',\r\n templateUrl: './material-summary.html',\r\n})\r\nexport class MaterialSummaryComponent {\r\n @Input() material: Material;\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n {{_bd.subReference}}\r\n
\r\n
\r\n \r\n {{_bd.typeStudy?.studyLong}}\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n {{_bd.protocol || '-'}}\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n","import { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, ReferenceState, StateMap, UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport {\r\n BiologicalData,\r\n ExperimentalMaterial,\r\n ExperimentalResult,\r\n ExperimentalToxicEffect,\r\n Material,\r\n TypeExperimentVehicle,\r\n TypeStudyMixture,\r\n TypeToxicEffect,\r\n TypeUnit\r\n} from '../../entities/EntityModels';\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\n\r\n@Component({\r\n selector: 'exp-material-editor',\r\n templateUrl: './exp-material-editor.html',\r\n providers: [provideParent(ExpMaterialEditorComponent, EditPropParent)]\r\n})\r\nexport class ExpMaterialEditorComponent implements OnInit, EditPropParent {\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n\r\n @Input() expMaterial: ExperimentalMaterial;\r\n\r\n public compOps: { compOp: string; desc: string }[] = [\r\n { compOp: '0', desc: 'None' },\r\n { compOp: '=', desc: '=' },\r\n { compOp: '>', desc: '>' },\r\n { compOp: '>=', desc: '>=' },\r\n { compOp: '<', desc: '<' },\r\n { compOp: '<=', desc: '<=' },\r\n ];\r\n\r\n _bd: BiologicalData;\r\n _material: Material;\r\n _typeUnits: TypeUnit[];\r\n _typeToxicEffects: TypeToxicEffect[];\r\n _typeToxicEffectIdCandidate = '';\r\n\r\n _calculatedToxicEffects: TypeToxicEffect[];\r\n _typeExperimentVehicles: TypeExperimentVehicle[];\r\n _isAddingVehicle: boolean;\r\n _addedVehicleCode: string;\r\n _addedVehicleDescription: string;\r\n _defaultProps: { compOp: string, typeUnitId: string };\r\n\r\n _typeStudyMixtures: TypeStudyMixture[];\r\n\r\n expandProtocol: boolean;\r\n expandExpMaterial: boolean;\r\n expandExpResults: boolean;\r\n\r\n _sortedExperimentalResults: ExperimentalResult[];\r\n\r\n // StateMap is used in html\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, private _referenceState: ReferenceState) {\r\n }\r\n\r\n ngOnInit() {\r\n // keep track of any deleted subentities.\r\n this._bd = this.expMaterial.biologicalData;\r\n this._uow.typeUnitRepository.all().then(r => this._typeUnits = r);\r\n this._uow.typeToxicEffectRepository.all().then(r => {\r\n this._typeToxicEffects = _.sortBy(r, function (t) { return t.sortDescription.toLowerCase(); });\r\n this._calculatedToxicEffects = r.filter(tte => tte.calculated);\r\n });\r\n this._uow.typeExperimentVehicleRepository.all().then(r => {\r\n this._typeExperimentVehicles = _.sortBy(r, tev => tev.vehicle);\r\n });\r\n this._uow.typeStudyMixtureRepository.all().then(r => this._typeStudyMixtures = r);\r\n this.expandProtocol = false;\r\n this.expandExpMaterial = !!this.expMaterial.material;\r\n this.expandExpResults = true;\r\n\r\n if (this.expMaterial.experimentalResults != null) {\r\n this._sortedExperimentalResults = _.sortBy(this.expMaterial.experimentalResults, e => e.dose);\r\n }\r\n }\r\n\r\n getError(propName: string, id: string) {\r\n if (id != null) {\r\n const ix = parseInt(id, 10);\r\n if (ix != null) {\r\n return this.expMaterial.experimentalResults[ix].getErrorFor(propName);\r\n }\r\n } else {\r\n return this.expMaterial.getErrorFor(propName);\r\n }\r\n\r\n }\r\n\r\n onAddVehicle() {\r\n this._isAddingVehicle = true;\r\n }\r\n\r\n canAcceptVehicle() {\r\n // check if valid lengths.\r\n return this._addedVehicleCode && (this._addedVehicleCode.length > 0 && this._addedVehicleCode.length <= 8)\r\n && this._addedVehicleDescription && (this._addedVehicleDescription.length > 0 && this._addedVehicleDescription.length <= 50)\r\n && this._typeExperimentVehicles.find(v => v.typeExperimentVehicleId == this._addedVehicleCode) == null;\r\n }\r\n\r\n onAcceptVehicle() {\r\n const formattedVehicleCode = this._addedVehicleDescription.charAt(0).toUpperCase() + this._addedVehicleDescription.slice(1);\r\n\r\n const p = {\r\n typeExperimentVehicleId: this._addedVehicleCode,\r\n vehicle: formattedVehicleCode\r\n };\r\n try {\r\n const expVehicle = this._uow.typeExperimentVehicleFactory.create(p);\r\n this._typeExperimentVehicles.push(expVehicle);\r\n this.expMaterial.typeExperimentVehicleId = this._addedVehicleCode;\r\n this._addedVehicleCode = null;\r\n this._addedVehicleDescription = null;\r\n this._isAddingVehicle = false;\r\n } catch (e) {\r\n\r\n }\r\n\r\n }\r\n\r\n onCancelVehicle() {\r\n this._isAddingVehicle = false;\r\n }\r\n\r\n parseVehicle(v: string) {\r\n if (v == 'undefined' || v == '') {\r\n return null;\r\n } else {\r\n return v;\r\n }\r\n }\r\n\r\n onSelectMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this).then(mli => {\r\n if (mli == null) {\r\n return;\r\n }\r\n return this._uow.materialRepository.withId(mli.materialId);\r\n }).then(m => {\r\n if (m) {\r\n this.expMaterial.material = m;\r\n this.expandExpMaterial = true;\r\n }\r\n });\r\n }\r\n\r\n onAddExperimentalResult() {\r\n\r\n this.getPreviousDoseAndUnitType();\r\n\r\n const params = {\r\n experimentalMaterialId: this.expMaterial.experimentalMaterialId,\r\n compOp: this._defaultProps.compOp,\r\n typeUnitId: this._defaultProps.typeUnitId,\r\n typeExperimentVehicleId: 'NONE'\r\n };\r\n const expResult = this._uow.experimentalResultFactory.create(params);\r\n // Default typetoxiceffect to 'no effects'\r\n this.onAddExperimentalToxicEffect(expResult, 'NOE');\r\n this.expandExpResults = true;\r\n // TODO: set focus on the expResult just added.\r\n }\r\n\r\n onDeleteExperimentalResult(er: ExperimentalResult) {\r\n if (er.entityAspect.entityState.isAdded() == false) {\r\n this._referenceState.recordToxDataDelete(this._stateMap.currentReference);\r\n }\r\n\r\n this.expMaterial.addDeletedChild(er);\r\n er.cascadeDelete();\r\n }\r\n\r\n onAddExperimentalToxicEffect(er: ExperimentalResult, typeToxicEffectId: string) {\r\n if (typeToxicEffectId == '') {\r\n return;\r\n }\r\n // clear the field for next use.\r\n\r\n setTimeout(() => {\r\n this._typeToxicEffectIdCandidate = '';\r\n }, 0);\r\n if (!typeToxicEffectId) {\r\n return;\r\n }\r\n if (er.experimentalToxicEffects.find(ete => ete.typeToxicEffectId == typeToxicEffectId)) {\r\n return;\r\n }\r\n const params = {\r\n experimentalResultId: er.experimentalResultId,\r\n typeToxicEffectId: typeToxicEffectId\r\n };\r\n const expToxicEffect = this._uow.experimentalToxicEffectFactory.create(params);\r\n\r\n }\r\n\r\n onDeleteExperimentalToxicEffect(ete: ExperimentalToxicEffect) {\r\n this.expMaterial.addDeletedChild(ete);\r\n ete.cascadeDelete();\r\n\r\n }\r\n\r\n onCancel() {\r\n this._uow.typeExperimentVehicleRepository.all().then(r => {\r\n let tevs = r.filter(tev => {\r\n const ok = tev.entityAspect.entityState.isUnchanged();\r\n if ((!ok) && (!tev.entityAspect.entityState.isDetached())) {\r\n tev.entityAspect.rejectChanges();\r\n }\r\n\r\n return ok;\r\n });\r\n tevs = _.sortBy(tevs, tev => tev.vehicle);\r\n tevs.unshift(new TypeExperimentVehicle());\r\n this._typeExperimentVehicles = tevs;\r\n });\r\n }\r\n\r\n // Null out empty strings\r\n onSetCalculatedResult(val: string) {\r\n if (val != null && val === '') {\r\n this.expMaterial.calculatedResult = null;\r\n }\r\n }\r\n\r\n onSetTypeToxicEffectId(val: string) {\r\n if (val != null && val === '') {\r\n this.expMaterial.typeToxicEffectId = null;\r\n } else {\r\n this.expMaterial.typeToxicEffectId = val;\r\n }\r\n }\r\n\r\n // Default a new Experimental Result CompOp and Unit Type to the previous (if any) Experimental Result's values for a given Experimental Material.\r\n // Addresses a Usability Issue when entering many results.\r\n private getPreviousDoseAndUnitType() {\r\n\r\n if (this.expMaterial && this.expMaterial.experimentalResults) {\r\n if (this.expMaterial.experimentalResults.length > 0) {\r\n const lastexpres = this.expMaterial.experimentalResults[this.expMaterial.experimentalResults.length - 1];\r\n this._defaultProps = { compOp: lastexpres.compOp, typeUnitId: lastexpres.typeUnitId };\r\n return;\r\n }\r\n }\r\n\r\n this._defaultProps = { compOp: '=', typeUnitId: 'NONE' };\r\n\r\n return;\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n Select From Experimental Materials\r\n
\r\n
\r\n
\r\n\r\n {{_userNotifications}}\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
0\" style=\"margin-left: 16px; margin-top: 6px; max-height: 500px; overflow-y: auto; overflow-x: hidden;\">\r\n

{{'Materials assigned to Protocol: ' + _subReference}}

\r\n \r\n \r\n \r\n Select\r\n Protocol Sub-reference\r\n MaterialId\r\n CAS No.\r\n Captive\r\n RIFM ID\r\n FEMA No.\r\n Principal Synonym\r\n \r\n \r\n \r\n \r\n \r\n {{m.data.fileReference}}\r\n {{m.data.materialId}}\r\n {{m.data.realCASNumber}}\r\n {{captiveLabel(m.data.confidential)}}\r\n {{m.data.formattedRIFMId}}\r\n {{m.data.fEMANumber}}\r\n }\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n\r\n\r\n","import {Component, ElementRef, Input} from '@angular/core';\r\nimport {UnitOfWork} from '../../services/common';\r\nimport {UtilFns} from '../../utils/common';\r\n\r\nimport {ModalDialog} from '../../controls/common';\r\n\r\nimport {Material} from '../../entities/EntityModels';\r\n\r\nimport {MaterialIdentifiersItem} from '../../entities/projections/MaterialIdentifiersItem';\r\nimport {ProtocolExperimentalMaterialItem} from '../../entities/projections/ProtocolExperimentalMaterialItem';\r\nimport {SelectableEntity} from '../../entities/projections/SelectableEntity';\r\n\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'protocol-material-selector',\r\n templateUrl: './protocol-material-selector.html',\r\n})\r\nexport class ProtocolMaterialSelectorComponent extends ModalDialog {\r\n\r\n _protocolExperimentalMaterialItems: ProtocolExperimentalMaterialItem[] = [];\r\n _protocolExperimentalMaterialsEx: SelectableEntity[] = [];\r\n\r\n _expMaterialIdsForSortOrder: number[] = [];\r\n\r\n _isLoading = false;\r\n\r\n _biologicalDataId: number;\r\n _subReference: string;\r\n\r\n _selectedMaterialIdentifiersItems: MaterialIdentifiersItem[] = [];\r\n _userNotifications = '';\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork) {\r\n super(elementRef);\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n captiveLabel(confidential: boolean): string {\r\n return (confidential) ? 'captive' : '';\r\n }\r\n\r\n // ***************************************************************************************************\r\n // Close Modal\r\n // ***************************************************************************************************\r\n onCancel() {\r\n UtilFns.returnModal(this, false);\r\n }\r\n\r\n onSave() {\r\n UtilFns.returnModal(this, true);\r\n }\r\n\r\n canSave(): boolean {\r\n\r\n if (this._isLoading == true) {\r\n return false;\r\n }\r\n\r\n return (this._selectedMaterialIdentifiersItems.length > 0);\r\n }\r\n\r\n public get SelectedMaterials(): MaterialIdentifiersItem[] {\r\n return this._selectedMaterialIdentifiersItems;\r\n }\r\n\r\n // ***************************************************************************************************\r\n // Interactions\r\n // ***************************************************************************************************\r\n onSelectExperimentalMaterial(event: any, mex: SelectableEntity) {\r\n const currentSelectedMaterials = _.clone(this._selectedMaterialIdentifiersItems);\r\n\r\n const selected = event.target.checked;\r\n const idx = currentSelectedMaterials.findIndex(s => s.materialId == mex.data.materialId);\r\n\r\n if (idx < 0) {\r\n if (selected) {\r\n const item = this.convertMaterialToMaterialIdentifiersItem(mex);\r\n this._selectedMaterialIdentifiersItems.push(item);\r\n }\r\n } else {\r\n if (selected == false) {\r\n this._selectedMaterialIdentifiersItems.splice(idx, 1);\r\n }\r\n }\r\n\r\n if (this._selectedMaterialIdentifiersItems.length > 0) {\r\n this._userNotifications = 'There are ' + this._selectedMaterialIdentifiersItems.length + ' Materials selected.';\r\n } else {\r\n this._userNotifications = '';\r\n }\r\n }\r\n\r\n onUnselectAll() {\r\n if (this._protocolExperimentalMaterialsEx != null && this._protocolExperimentalMaterialsEx.length > 0) {\r\n this._protocolExperimentalMaterialsEx.map(function(s) {\r\n s.selected = false;\r\n return s;\r\n });\r\n this._selectedMaterialIdentifiersItems = [];\r\n this._userNotifications = '';\r\n }\r\n }\r\n\r\n // ***************************************************************************************************\r\n // Load Data\r\n // ***************************************************************************************************\r\n loadExperimentalMaterials(biologicalDataId: number, subReference: string, excludedMaterialIds: number[], expMaterialIdsForSortOrder: number[]) {\r\n this._isLoading = true;\r\n this._userNotifications = '';\r\n\r\n this._biologicalDataId = biologicalDataId;\r\n this._expMaterialIdsForSortOrder = expMaterialIdsForSortOrder;\r\n this._subReference = subReference;\r\n\r\n this._protocolExperimentalMaterialItems = [];\r\n\r\n const params = { biologicalDataId: biologicalDataId, excludedMaterialIds: excludedMaterialIds };\r\n this._uow.fetch('BiologicalDatas/GetExperimentalMaterialsByBiologicalDataId', params).then(em => {\r\n if (em != null && em.length > 0) {\r\n this._protocolExperimentalMaterialItems = _.sortBy(em, e => e.realCASNumber);\r\n this.formatSelectableEntities();\r\n } else {\r\n this._userNotifications = 'No other Experimental Materials found that are assigned to this Protocol.';\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._protocolExperimentalMaterialsEx = [];\r\n if (this._protocolExperimentalMaterialItems == null || this._protocolExperimentalMaterialItems.length < 1) { return; }\r\n\r\n const data: SelectableEntity[] = [];\r\n\r\n _.clone(this._protocolExperimentalMaterialItems).forEach(element => {\r\n\r\n // workaround to establish sort order from order retrieved via navQuery in the protocol editor component.\r\n const idx = this._expMaterialIdsForSortOrder.indexOf(element.materialId);\r\n element.sortOrder = idx;\r\n\r\n const pem = new SelectableEntity(element, '#FFFFFF');\r\n if (this.isSelected(element.materialId)) { // maintain previously selected items\r\n pem.selected = true;\r\n }\r\n data.push(pem);\r\n });\r\n\r\n this._protocolExperimentalMaterialsEx = _.sortBy(data, s => s.data.sortOrder);\r\n }\r\n\r\n // convert Material to MaterialListItem\r\n convertMaterialToMaterialIdentifiersItem(mex: SelectableEntity): MaterialIdentifiersItem {\r\n return {\r\n materialId: mex.data.materialId,\r\n realCASNumber: mex.data.realCASNumber,\r\n fEMANumber: mex.data.fEMANumber,\r\n monographNumber: mex.data.monographNumber,\r\n confidential: mex.data.confidential,\r\n synonymWordOrWebVersion: mex.data.synonymWordOrWebVersion,\r\n typeEssentialOilId: mex.data.typeEssentialOilId,\r\n typeBotanicalSubdivisionId: mex.data.typeBotanicalSubdivisionId,\r\n formattedRifmId: mex.data.formattedRIFMId,\r\n experimentalMaterialId: mex.data.experimentalMaterialId,\r\n sortOrder: mex.data.sortOrder\r\n };\r\n }\r\n\r\n getselectedMaterialIdentifiersItems() {\r\n return _.sortBy(this._selectedMaterialIdentifiersItems, pem => pem.sortOrder);\r\n }\r\n\r\n isSelected(materialId: number) {\r\n if (this._selectedMaterialIdentifiersItems.some(m => m.materialId == materialId)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n removeFromSelectedList(materialId: number) {\r\n if (this._selectedMaterialIdentifiersItems == null || this._selectedMaterialIdentifiersItems.length == 0) {\r\n return;\r\n }\r\n\r\n const items = _.clone(this._selectedMaterialIdentifiersItems);\r\n const idx = items.findIndex(m => m.materialId == materialId);\r\n\r\n this._selectedMaterialIdentifiersItems.splice(idx, 1);\r\n }\r\n}\r\n","
\r\n \r\n
\r\n

'Please wait while the Reference is being updated'

\r\n

{{_informationalMessage}}

\r\n
\r\n
\r\n

You chose this material as the Experimental Material template:

\r\n
\r\n
\r\n
\r\n CAS No:\r\n {{expMaterial.material?.realCASNumber}}\r\n
\r\n
\r\n RIFM ID:\r\n {{expMaterial.material?.formattedRIFMId}}\r\n
\r\n
\r\n Name:\r\n {{expMaterial.material?.principalSynonym().synonymWordOrWebVersion()}}\r\n
\r\n
\r\n\r\n
\r\n {{'There are (' + experimentalResultsTemplateCount() + ') Experimental Results assigned to this Experimental Material.'}}\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n \"Step\r\n \"Step\r\n {{_userMessage}}\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n

Selected Materials for New Experimental Materials

\r\n

{{_materialWarning}}

\r\n\r\n 0\">\r\n
\r\n \r\n \r\n \r\n CAS No.\r\n RIFM ID\r\n Principal Synonym\r\n \r\n \r\n \r\n \r\n Remove\r\n {{m.realCASNumber}}\r\n {{m.formattedRifmId}}\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n\r\n
\r\n

Selected Experimental Materials to be Updated

\r\n\r\n

{{_expMaterialWarning1}}

\r\n

{{_expMaterialWarning2}}

\r\n\r\n 0\">\r\n
\r\n \r\n \r\n \r\n CAS No.\r\n RIFM ID\r\n Principal Synonym\r\n \r\n \r\n \r\n \r\n Remove\r\n {{em.material?.realCASNumber}}\r\n {{em.material?.formattedRIFMId}}\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n \"Step\r\n {{_userMessage}}\r\n
\r\n
\r\n
\r\n 0\">\r\n
\r\n \r\n \r\n CAS No.\r\n RIFM ID\r\n Principal Synonym\r\n \r\n \r\n \r\n \r\n {{em.material?.realCASNumber}}\r\n {{em.material?.formattedRIFMId}}\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
    \r\n
  • \r\n
    \r\n \"Step\r\n {{_userMessage}}\r\n
    \r\n
  • \r\n
  • \r\n \r\n \t\t*\r\n\t\t\t\t\t\t\t{{_finalEMCountMessage}}\r\n \r\n
  • \r\n
  • \r\n \r\n \t\t*\r\n {{_finalERCountMessage}}\r\n \r\n
  • \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n","import {Component, Input, Output, OnInit, ViewChild, EventEmitter, Inject, forwardRef} from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport {EditorService, provideParent, StateMap, UnitOfWork} from '../../services/common';\r\nimport {EditManager, UtilFns} from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { ProtocolMaterialSelectorComponent } from './protocol-material-selector.component';\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\n\r\nimport {\r\n ExperimentalMaterial,\r\n ExperimentalResult,\r\n} from '../../entities/EntityModels';\r\n\r\nimport {MaterialIdentifiersItem} from '../../entities/projections/MaterialIdentifiersItem';\r\nimport { MaterialListItem} from '../../entities/projections/MaterialListItem';\r\n\r\nimport { ProtocolData, ProtocolEditorComponent } from './protocol-editor.component';\r\n\r\n// tslint:disable-next-line:max-line-length\r\nexport enum CopyStatus { STARTCOPY, MATERIALSSELECTED, EXPERIMENTALMATERIALSCREATED, EXPERIMENTALMATERIALSAPPLIED, EXPERIMENTALMATERIALSSAVED, EXPERIMENTALRESULTSCREATED, EXPERIMENTALRESULTSAPPLIED, EXPERIMENTALRESULTSSAVED, COPYCOMPLETE }\r\n\r\n@Component({\r\n selector: 'exp-material-from-template',\r\n templateUrl: './exp-material-from-template.html',\r\n providers: [provideParent(ExpMaterialFromTemplateComponent, EditPropParent)]\r\n})\r\nexport class ExpMaterialFromTemplateComponent implements OnInit, EditPropParent {\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n @ViewChild(ProtocolMaterialSelectorComponent, { static: true }) _protocolMaterialSelectorComponent: ProtocolMaterialSelectorComponent;\r\n\r\n @Input() expMaterial: ExperimentalMaterial;\r\n @Input() referenceId: number;\r\n @Output() stateChange = new EventEmitter();\r\n\r\n public _edmExpMat: EditManager;\r\n public _edmExpRes: EditManager;\r\n\r\n public _selectedMaterialIdentifiersItems: MaterialIdentifiersItem[] = [];\r\n\r\n public _expMaterialWarning1 = '';\r\n public _expMaterialWarning2 = '';\r\n public _materialWarning = '';\r\n\r\n public _informationalMessage = '';\r\n public _userMessage = '';\r\n public _userMessage2 = '';\r\n\r\n _step1Message = 'Choose the Material(s) to be added as Experimental Materials or updated.';\r\n _step2Message = 'Select more materials or click the \"Create Experimental Materials\" button. The template data will be copied over for each material.';\r\n _step3Message = 'The Experimental Materials have been created. The next step is to add the Experimental Results by clicking the button below.';\r\n _step4Message = 'The creation and/or update of Experimental Materials with the data and Experimental Results from the template is complete.';\r\n\r\n _finalEMCountMessage = '';\r\n _finalERCountMessage = '';\r\n\r\n public _copyStatus: CopyStatus = CopyStatus.STARTCOPY;\r\n\r\n public _isLoading = false;\r\n public _madeDataChanges = false;\r\n\r\n public _savingUnfinishedReferenceDuringCopy = false;\r\n public _sharedProtocolData: ProtocolData;\r\n\r\n // StateMap is used in html\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService,\r\n @Inject(forwardRef(() => ProtocolEditorComponent)) _parent: ProtocolEditorComponent) {\r\n this._sharedProtocolData = _parent._sharedProtocolData;\r\n }\r\n\r\n ngOnInit() {\r\n this._edmExpMat = this._editorService.createEditManager(this, 'Experimental Material');\r\n this._edmExpRes = this._editorService.createEditManager(this, 'Experimental Results');\r\n\r\n this._userMessage = this._step1Message;\r\n }\r\n\r\n getError(propName: string, id: string) {\r\n if (id != null) {\r\n const ix = parseInt(id, 10);\r\n if (ix != null) {\r\n return this.expMaterial.experimentalResults[ix].getErrorFor(propName);\r\n }\r\n } else {\r\n return this.expMaterial.getErrorFor(propName);\r\n }\r\n }\r\n\r\n fetchSelectedExperimentalMaterials(materialIds: number[]) {\r\n this._isLoading = true;\r\n\r\n this._edmExpMat.entities = [];\r\n\r\n const params = {\r\n biologicalDataId: this.expMaterial.biologicalDataId,\r\n materialIds: materialIds\r\n };\r\n\r\n return this._uow.fetch('BiologicalDatas/ExperimentalMaterialsByBioDataIdAndMaterialIds', params).then(em => {\r\n if (em != null) {\r\n this._edmExpMat.entities = _.sortBy(em, s => s.material.realCASNumber);\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n onSelectingMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this).then(mli => {\r\n if (mli == null) { return; }\r\n\r\n this._materialWarning = '';\r\n\r\n if (mli.materialId == this.expMaterial.materialId ) {\r\n this._materialWarning = 'The Material you selected is the same as the selected template Material.';\r\n return;\r\n }\r\n\r\n if (this.checkForMaterialDuplicates(mli.materialId)) {\r\n this._materialWarning = 'The Material you selected is already in the selected Materials list';\r\n return;\r\n }\r\n\r\n if (this.checkForExperimentalMaterialDuplicates(mli.materialId)) {\r\n this._materialWarning = 'The Material you selected is already in the selected Experimental Materials list';\r\n return;\r\n }\r\n\r\n this._selectedMaterialIdentifiersItems.push(this.convertMaterialListItemToMaterialIdentifiersItem(mli));\r\n this._selectedMaterialIdentifiersItems = _.sortBy(this._selectedMaterialIdentifiersItems, m => m.synonymWordOrWebVersion);\r\n\r\n this._userMessage = this._step2Message;\r\n this._copyStatus = CopyStatus.MATERIALSSELECTED;\r\n });\r\n }\r\n\r\n // **************************************************************************\r\n // *Show dialog to select materials from existing Experimental Materials\r\n // **************************************************************************\r\n public onSelectingExperimentalMaterial() {\r\n if (this._protocolMaterialSelectorComponent == null) {\r\n return;\r\n }\r\n\r\n const excludedMaterialIds: number[] = [];\r\n excludedMaterialIds.push(this.expMaterial.materialId); // don't include the template Experimental Material\r\n\r\n // tslint:disable-next-line:max-line-length\r\n this._protocolMaterialSelectorComponent.loadExperimentalMaterials(this.expMaterial.biologicalDataId, this._sharedProtocolData.subReference, excludedMaterialIds, this._sharedProtocolData.expMaterialIdsForSorting);\r\n\r\n UtilFns.showModal(this._protocolMaterialSelectorComponent, this).then(r => {\r\n if (r == false) { return; }\r\n\r\n // fetch the selected existing Experimental Materials into the edm and check to see if any of them already have Exp. Results or details entered.\r\n const items = this._protocolMaterialSelectorComponent.getselectedMaterialIdentifiersItems();\r\n\r\n // make sure the selected exp material is not already in the new material list\r\n let duplicatesFound = false;\r\n let matchesTemplateMaterial = false;\r\n if (this._selectedMaterialIdentifiersItems != null && this._selectedMaterialIdentifiersItems.length > 0) {\r\n items.forEach((m) => {\r\n if (this.checkForMaterialDuplicates(m.materialId)) {\r\n duplicatesFound = true;\r\n }\r\n\r\n if (m.materialId == this.expMaterial.materialId) {\r\n matchesTemplateMaterial = true;\r\n }\r\n });\r\n }\r\n\r\n if (duplicatesFound) {\r\n this._expMaterialWarning1 = 'An Experimental Material you selected is already in the selected Materials list.';\r\n this._expMaterialWarning2 = '';\r\n return Promise.resolve();\r\n }\r\n\r\n if (matchesTemplateMaterial) {\r\n this._expMaterialWarning1 = 'An Experimental Material you selected is the same as the selected template Material.';\r\n this._expMaterialWarning2 = '';\r\n return Promise.resolve();\r\n }\r\n\r\n const materialIds = items.map(m => m.materialId);\r\n return this.fetchSelectedExperimentalMaterials(materialIds).then (() => { // load selected into edm\r\n\r\n this.validateExperimentalMaterial(); // check to see if any already have data entered, since the details would be overwritten\r\n\r\n this._userMessage = this._step2Message;\r\n this._copyStatus = CopyStatus.MATERIALSSELECTED;\r\n });\r\n });\r\n }\r\n\r\n convertMaterialListItemToMaterialIdentifiersItem(mli: MaterialListItem): MaterialIdentifiersItem {\r\n return {\r\n materialId: mli.materialId,\r\n realCASNumber: mli.realCASNumber,\r\n fEMANumber: mli.fEMANumber,\r\n monographNumber: mli.monographNumber,\r\n confidential: mli.confidential,\r\n synonymWordOrWebVersion: mli.synonymWordOrWebVersion,\r\n typeEssentialOilId: mli.typeEssentialOilId,\r\n typeBotanicalSubdivisionId: mli.typeBotanicalSubdivisionId,\r\n formattedRifmId: mli.formattedRifmId,\r\n experimentalMaterialId: null,\r\n sortOrder: 0\r\n };\r\n }\r\n\r\n removeMaterial(mi: MaterialIdentifiersItem) {\r\n _.remove(this._selectedMaterialIdentifiersItems, mi);\r\n\r\n const mcount = (this._selectedMaterialIdentifiersItems != null) ? this._selectedMaterialIdentifiersItems.length : 0;\r\n const emcount = (this._edmExpMat.entities != null) ? this._edmExpMat.entities.length : 0;\r\n\r\n if ((mcount + emcount) == 0) { // no selected materials so return to Step 1\r\n this._copyStatus = CopyStatus.STARTCOPY;\r\n this._userMessage = this._step1Message;\r\n }\r\n }\r\n\r\n removeExperimentalMaterial(em: ExperimentalMaterial) {\r\n const idx = this._edmExpMat.entities.findIndex(m => m.experimentalMaterialId == em.experimentalMaterialId);\r\n this._edmExpMat.entities.splice(idx, 1);\r\n\r\n if (this._protocolMaterialSelectorComponent != null) {\r\n this._protocolMaterialSelectorComponent.removeFromSelectedList(em.materialId); // keep the two components in sync\r\n }\r\n\r\n const mcount = (this._selectedMaterialIdentifiersItems != null) ? this._selectedMaterialIdentifiersItems.length : 0;\r\n const emcount = (this._edmExpMat.entities != null) ? this._edmExpMat.entities.length : 0;\r\n\r\n if ((mcount + emcount) == 0) { // no selected materials so return to Step 1\r\n this._copyStatus = CopyStatus.STARTCOPY;\r\n this._userMessage = this._step1Message;\r\n\r\n this._expMaterialWarning1 = '';\r\n this._expMaterialWarning2 = '';\r\n } else {\r\n this.validateExperimentalMaterial();\r\n }\r\n }\r\n\r\n canCreateExperimentalMaterials() {\r\n return (this._copyStatus == CopyStatus.MATERIALSSELECTED);\r\n }\r\n\r\n canRemoveSelectedMaterials() {\r\n return (this._copyStatus == CopyStatus.MATERIALSSELECTED);\r\n }\r\n\r\n canSaveOrCancelExperimentalMaterials() {\r\n return this._copyStatus == CopyStatus.EXPERIMENTALMATERIALSAPPLIED;\r\n }\r\n\r\n canCreateExperimentalResults() {\r\n return (this._copyStatus == CopyStatus.EXPERIMENTALMATERIALSSAVED);\r\n }\r\n\r\n canSaveOrCancelExperimentalResults() {\r\n return (this._copyStatus == CopyStatus.EXPERIMENTALRESULTSAPPLIED);\r\n }\r\n\r\n canSelectMaterials() {\r\n return (this._copyStatus == CopyStatus.STARTCOPY || this._copyStatus == CopyStatus.MATERIALSSELECTED);\r\n }\r\n\r\n showStep1() {\r\n return (this._copyStatus == CopyStatus.STARTCOPY);\r\n }\r\n\r\n showStep2() {\r\n return (this._copyStatus == CopyStatus.MATERIALSSELECTED || this._copyStatus == CopyStatus.EXPERIMENTALMATERIALSCREATED || this._copyStatus == CopyStatus.EXPERIMENTALMATERIALSAPPLIED);\r\n }\r\n\r\n showStep3() {\r\n return (this._copyStatus == CopyStatus.EXPERIMENTALMATERIALSSAVED || this._copyStatus == CopyStatus.EXPERIMENTALRESULTSCREATED || this._copyStatus == CopyStatus.EXPERIMENTALRESULTSAPPLIED);\r\n }\r\n\r\n showStep4() {\r\n return (this._copyStatus == CopyStatus.EXPERIMENTALRESULTSSAVED);\r\n }\r\n\r\n onBack() {\r\n this._edmExpMat.entities = null;\r\n this._edmExpRes.entities = null;\r\n this._savingUnfinishedReferenceDuringCopy = false;\r\n }\r\n\r\n // notify parent component to save/commit the new experimental materials\r\n onSaveExperimentalMaterials() {\r\n this.stateChange.emit('savechanges');\r\n }\r\n\r\n onCancelExperimentalMaterials() {\r\n if (this._edmExpMat.entities != null && this._edmExpMat.entities.length > 0) {\r\n this._edmExpMat.entities.forEach( em => {\r\n this._edmExpMat.onSelect(em);\r\n\r\n if (this._edmExpMat.currentEntity.entityAspect.entityState.isAdded() || this._edmExpMat.currentEntity.entityAspect.entityState.isModified()) {\r\n this._edmExpMat.currentEntity.entityAspect.rejectChanges();\r\n }\r\n });\r\n\r\n this._edmExpMat.clearErrors();\r\n }\r\n\r\n this._copyStatus = CopyStatus.MATERIALSSELECTED;\r\n }\r\n\r\n onSaveExperimentalResults() {\r\n this.stateChange.emit('savechanges');\r\n }\r\n\r\n onCancelExperimentalResults() {\r\n this._uow.rollback();\r\n this._edmExpRes.clearErrors();\r\n\r\n _.remove(this._edmExpRes.entities, er => er.entityAspect.entityState.isDetached());\r\n\r\n this._copyStatus = CopyStatus.EXPERIMENTALMATERIALSSAVED;\r\n }\r\n\r\n\r\n // October 2022\r\n // Change request to allow staff to add multiple experimental materials at once and to copy over all the existing experimental results of the template\r\n // material for each added Experimental Material.\r\n // Additional change request to allow staff to copy Experimental Materials details to existing Experimental Materials assigned to the same Protocol\r\n createExperimentalMaterialsFromTemplate() {\r\n // if there are selected existing Exp. Materials, then copy over the details from the template entity\r\n // they should already be in the edm, they are loaded after they are selected from the dialog\r\n if (this._edmExpMat.entities != null && this._edmExpMat.entities.length > 0) {\r\n this.copyDetailsToExperimentalMaterials();\r\n }\r\n\r\n // create new entities and push onto edm\r\n if (this._selectedMaterialIdentifiersItems != null && this._selectedMaterialIdentifiersItems.length > 0) {\r\n this.createNewExperimentalMaterials();\r\n }\r\n\r\n this._copyStatus = CopyStatus.EXPERIMENTALMATERIALSCREATED;\r\n\r\n // notify parent component to apply the new experimental materials\r\n this.stateChange.emit('applychanges');\r\n }\r\n\r\n createNewExperimentalMaterials() {\r\n this._selectedMaterialIdentifiersItems.forEach(m => {\r\n this.addExperimentalMaterials(m.materialId);\r\n });\r\n }\r\n\r\n copyDetailsToExperimentalMaterials() {\r\n if (this._edmExpMat.entities != null && this._edmExpMat.entities.length > 0) {\r\n this._edmExpMat.entities.forEach( em => {\r\n this._edmExpMat.onSelect(em);\r\n this._edmExpMat.currentEntity.sampleText\t\t = this.expMaterial.sampleText;\r\n this._edmExpMat.currentEntity.typeToxicEffectId\t\t = this.expMaterial.typeToxicEffectId;\r\n this._edmExpMat.currentEntity.calculatedResult\t\t = this.expMaterial.calculatedResult;\r\n this._edmExpMat.currentEntity.experimentalDetails\t = this.expMaterial.experimentalDetails;\r\n this._edmExpMat.currentEntity.experimentalSummary\t = this.expMaterial.experimentalSummary;\r\n this._edmExpMat.currentEntity.typeStudyMixtureId\t = this.expMaterial.typeStudyMixtureId;\r\n this._edmExpMat.currentEntity.typeExperimentVehicleId\t= this.expMaterial.typeExperimentVehicleId;\r\n });\r\n } else {\r\n this._expMaterialWarning1 = 'Unexpected error. Please contact the database team.';\r\n }\r\n }\r\n\r\n public addExperimentalMaterials(materialId: number) {\r\n\r\n if (this._edmExpMat.entities == null) { this._edmExpMat.entities = []; }\r\n\r\n const newEM = this._uow.experimentalMaterialFactory.create();\r\n\r\n newEM.biologicalDataId = this.expMaterial.biologicalDataId;\r\n newEM.materialId\t\t = materialId;\r\n newEM.sampleText\t\t = this.expMaterial.sampleText;\r\n newEM.typeToxicEffectId\t\t = this.expMaterial.typeToxicEffectId;\r\n newEM.calculatedResult\t\t = this.expMaterial.calculatedResult;\r\n newEM.fFDSShortVersion\t\t = this.expMaterial.fFDSShortVersion;\r\n newEM.fFDSSequenceNo\t\t = this.expMaterial.fFDSSequenceNo;\r\n newEM.fFDSModified\t\t = this.expMaterial.fFDSModified;\r\n newEM.experimentalDetails\t = this.expMaterial.experimentalDetails;\r\n newEM.experimentalSummary\t = this.expMaterial.experimentalSummary;\r\n newEM.fFDSStatement\t\t = this.expMaterial.fFDSStatement;\r\n newEM.typeStudyMixtureId\t = this.expMaterial.typeStudyMixtureId;\r\n newEM.typeExperimentVehicleId\t= this.expMaterial.typeExperimentVehicleId;\r\n\r\n this._edmExpMat.entities.push(newEM);\r\n }\r\n\r\n // add a copy of each experimental results assigned to the template experimental material to the newly created experimental material.\r\n createExperimentalResultsFromTemplate() {\r\n this._edmExpMat.entities.forEach(em => {\r\n this.expMaterial.experimentalResults.forEach(er => {\r\n this.addExperimentalResults(em.experimentalMaterialId, er);\r\n });\r\n });\r\n\r\n this._copyStatus = CopyStatus.EXPERIMENTALRESULTSCREATED;\r\n\r\n this.stateChange.emit('applychanges');\r\n }\r\n\r\n addExperimentalResults(expMaterialId: number, er: ExperimentalResult) {\r\n\r\n if (this._edmExpRes.entities == null) { this._edmExpRes.entities = []; }\r\n\r\n const newER = this._uow.experimentalResultFactory.create();\r\n\r\n newER.experimentalMaterialId\t= expMaterialId;\r\n newER.compOp\t\t\t =\ter.compOp;\r\n newER.dose\t\t\t\t =\ter.dose;\r\n newER.dPMperLymphNode\t\t =\ter.dPMperLymphNode;\r\n newER.resultNote\t\t\t =\ter.resultNote;\r\n newER.stimulationIndex\t\t =\ter.stimulationIndex;\r\n newER.typeExperimentVehicleId\t=\ter.typeExperimentVehicleId;\r\n newER.typeUnitId\t\t\t =\ter.typeUnitId;\r\n\r\n this._edmExpRes.entities.push(newER);\r\n\r\n if (er.experimentalToxicEffects != null) {\r\n this._edmExpRes.onSelect(newER);\r\n er.experimentalToxicEffects.forEach(te => {\r\n this.addExperimentalToxicEffect(this._edmExpRes.currentEntity, te.typeToxicEffectId);\r\n });\r\n }\r\n }\r\n\r\n addExperimentalToxicEffect(er: ExperimentalResult, typeToxicEffectId: string) {\r\n if (typeToxicEffectId == null || typeToxicEffectId == '') {\r\n return;\r\n }\r\n\r\n const params = {\r\n experimentalResultId: er.experimentalResultId,\r\n typeToxicEffectId: typeToxicEffectId\r\n };\r\n const expToxicEffect = this._uow.experimentalToxicEffectFactory.create(params);\r\n }\r\n\r\n experimentalMaterialsAddedCount() {\r\n return (this._edmExpMat == null || this._edmExpMat.entities == null) ? 0 : this._edmExpMat.entities.length;\r\n }\r\n\r\n experimentalResultsAddedCount() {\r\n return (this._edmExpRes == null || this._edmExpRes.entities == null) ? 0 : this._edmExpRes.entities.length;\r\n }\r\n\r\n experimentalResultsTemplateCount() {\r\n return (this.expMaterial == null || this.expMaterial.experimentalResults == null) ? 0 : this.expMaterial.experimentalResults.length;\r\n }\r\n\r\n // ******************************************************************\r\n // called from Parent component after receiving event notification\r\n // ******************************************************************\r\n applyComplete() {\r\n if (this._copyStatus == CopyStatus.EXPERIMENTALMATERIALSCREATED) {\r\n this._copyStatus = CopyStatus.EXPERIMENTALMATERIALSAPPLIED;\r\n } else if (this._copyStatus == CopyStatus.EXPERIMENTALRESULTSCREATED) {\r\n this._copyStatus = CopyStatus.EXPERIMENTALRESULTSAPPLIED;\r\n }\r\n }\r\n\r\n saveComplete() {\r\n this._madeDataChanges = true;\r\n\r\n this._userMessage = '';\r\n this._finalEMCountMessage = '';\r\n this._finalERCountMessage = '';\r\n\r\n if (this._copyStatus == CopyStatus.EXPERIMENTALMATERIALSAPPLIED) {\r\n this._isLoading = true;\r\n\r\n const materialIds = this.allSelectedMaterialIds();\r\n\r\n return this.fetchSelectedExperimentalMaterials(materialIds).then ( () => {\r\n if (this.expMaterial.experimentalResults == null || this.expMaterial.experimentalResults.length == 0) {\r\n this._copyStatus = CopyStatus.COPYCOMPLETE;\r\n this._informationalMessage = 'There are no Experimental Results assigned to the template Experimental Material so the copy process is complete.';\r\n this._informationalMessage = this._informationalMessage + ' There were (' + this.experimentalMaterialsAddedCount() + ') Experimental Materials added or updated.';\r\n } else {\r\n this._copyStatus = CopyStatus.EXPERIMENTALMATERIALSSAVED;\r\n this._userMessage = this._step3Message;\r\n }\r\n this._isLoading = false;\r\n });\r\n } else if (this._copyStatus == CopyStatus.EXPERIMENTALRESULTSAPPLIED) {\r\n this._copyStatus = CopyStatus.EXPERIMENTALRESULTSSAVED;\r\n\r\n this._userMessage = this._step4Message;\r\n this._finalEMCountMessage = 'There were (' + this.experimentalMaterialsAddedCount() + ') Experimental Materials added or updated.';\r\n this._finalERCountMessage = 'There were (' + this.experimentalResultsAddedCount() + ') Experimental Results added, (' + this.experimentalResultsTemplateCount() + ') for each added Experimental Material.';\r\n }\r\n }\r\n\r\n allSelectedMaterialIds() {\r\n return this._edmExpMat.entities.map(m => m.materialId);\r\n }\r\n\r\n public get viewableExperimentalMaterials(): ExperimentalMaterial[] {\r\n if (this._edmExpMat.entities == null || this._edmExpMat.entities.length == 0) { return []; }\r\n\r\n return this._edmExpMat.entities.filter(em => em.experimentalMaterialId > 0);\r\n }\r\n\r\n // *************************************************************************************************\r\n // Validation\r\n // *************************************************************************************************\r\n // check to see if selected Experimental Materials already have details or Experimental Materials\r\n validateExperimentalMaterial() {\r\n\r\n this._expMaterialWarning1 = '';\r\n this._expMaterialWarning2 = '';\r\n\r\n if (this._edmExpMat.entities.some(em => em.experimentalResults != null && em.experimentalResults.length > 0)) {\r\n this._expMaterialWarning1 = 'At least one of the selected Experimental Materials already has an Experimental Results.';\r\n }\r\n\r\n if (this._edmExpMat.entities.some(em => this.isValidString(em.sampleText)\r\n || em.typeToxicEffectId != null\r\n || this.isValidString(em.calculatedResult)\r\n || this.isValidString(em.experimentalDetails)\r\n || this.isValidString(em.experimentalSummary)\r\n || em.typeStudyMixtureId != 'Not Evaluated'\r\n || em.typeExperimentVehicleId.toLowerCase() != 'none')) {\r\n\r\n this._expMaterialWarning2 = 'At least one of the selected Experimental Materials has details entered.';\r\n }\r\n\r\n return;\r\n }\r\n\r\n // check to see if the material was selected already.\r\n checkForMaterialDuplicates(materialId: number): boolean {\r\n if (this._selectedMaterialIdentifiersItems == null || this._selectedMaterialIdentifiersItems.length == 0) {\r\n return false;\r\n }\r\n\r\n if (this._selectedMaterialIdentifiersItems.some(m => m.materialId == materialId)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n checkForExperimentalMaterialDuplicates(materialId: number): boolean {\r\n if (this._edmExpMat.entities == null || this._edmExpMat.entities.length == 0) {\r\n return false;\r\n }\r\n\r\n if (this._edmExpMat.entities.some(m => m.materialId == materialId)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n askUserToConfirm(): Promise {\r\n return this._stateMap.yesNoComponent.showModal('At least one of the Experimental Materials you selected already has data.',\r\n 'Continue with the update?').then(ok => {\r\n if (ok) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n });\r\n }\r\n}\r\n","import { UnitOfWork } from '../../../services/unit-of-work';\r\nimport { StateMap } from '../../../services/state-map';\r\nimport { BusyService } from '../../../services/busy.service';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable()\r\nexport class ReferenceLoader {\r\n\tconstructor(private uow: UnitOfWork, private stateMap: StateMap, private busyService: BusyService) {\r\n\t}\r\n\r\n\tload(referenceId: number) {\r\n\t\tif (referenceId == null) {\r\n\t\t\treturn Promise.resolve(null);\r\n\t\t}\r\n\r\n\t\tlet shouldLoad = false;\r\n\t\tif (this.stateMap.currentReference == null) {\r\n\t\t\tshouldLoad = true;\r\n\t\t} else if (this.stateMap.currentReference.referenceId != referenceId) {\r\n\t\t\tshouldLoad = true;\r\n\t\t}\r\n\r\n\t\tif (!shouldLoad) {\r\n\t\t\treturn Promise.resolve(this.stateMap.currentReference);\r\n\t\t}\r\n\r\n\t\tconst promise = this.uow.referenceRepository\r\n\t\t\t.withId(referenceId)\r\n\t\t\t.then(r => {\r\n\t\t\t\tthis.stateMap.currentReference = r;\r\n\t\t\t\treturn r;\r\n\t\t\t});\r\n\r\n\t\treturn this.busyService.busy(promise);\r\n\t}\r\n}","
\r\n
Editing Protocols
\r\n \r\n \r\n \r\n
\r\n\r\n

{{_errorMessage}}

\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n {{_finishedMessage}}\r\n \r\n \r\n
\r\n
\r\n
\r\n Protocols\r\n \r\n Select a row to display its Experimental Materials\r\n
\r\n \r\n \r\n \r\n Sub-reference\r\n Study\r\n Route\r\n Species\r\n \r\n \r\n \r\n \r\n \r\n \r\n {{bd.subReference}}\r\n {{bd.typeStudy?.studyLong}}\r\n \r\n \r\n Edit\r\n Delete\r\n \r\n \r\n\r\n \r\n
\r\n
\r\n
\r\n Experimental Materials\r\n \r\n
\r\n \r\n \r\n \r\n Material\r\n CAS No\r\n RIFM ID\r\n FEMA No.\r\n Use as Template\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{em?.material?.realCASNumber}}\r\n {{em?.material?.formattedRIFMId}}\r\n {{em?.material?.fEMANumber}}\r\n \r\n Copy\r\n \r\n Edit\r\n Delete\r\n \r\n \r\n\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n\r\n","import {Component, OnInit, ViewChild} from '@angular/core';\r\nimport {Location} from '@angular/common';\r\nimport {ActivatedRoute, Router} from '@angular/router';\r\n\r\nimport {EditorService, ReferenceFinishState, ReferenceState, StateMap, UnitOfWork} from '../../services/common';\r\nimport {EditManager, IEditHost, UtilFns} from '../../utils/common';\r\nimport {TabContainer} from '../../controls/common';\r\n\r\nimport {BiologicalData, ExperimentalMaterial, Reference} from '../../entities/EntityModels';\r\n\r\nimport {ReferenceSelectorComponent} from '../reference/reference-selector.component';\r\nimport {ROUTES} from '../routes';\r\nimport {STAFF_ROUTES} from './staff.routes';\r\n\r\nimport {ExpMaterialEditorComponent} from './exp-material-editor.component';\r\nimport {CopyStatus, ExpMaterialFromTemplateComponent} from './exp-material-from-template.component';\r\nimport {ReferenceLoader} from './services/reference-loader';\r\nimport * as _ from 'lodash';\r\n\r\nexport class ProtocolData {\r\n expMaterialIdsForSorting: number[];\r\n subReference: string;\r\n}\r\n\r\n@Component({\r\n selector: 'protocol-editor',\r\n templateUrl: './protocol-editor.html',\r\n})\r\nexport class ProtocolEditorComponent implements OnInit, IEditHost {\r\n @ViewChild(TabContainer) _tabContainer: TabContainer;\r\n @ViewChild(ReferenceSelectorComponent, { static: true }) _referenceSelectorComponent: ReferenceSelectorComponent;\r\n @ViewChild(ExpMaterialEditorComponent) _expMaterialEditorComponent: ExpMaterialEditorComponent;\r\n @ViewChild(ExpMaterialFromTemplateComponent) _expMaterialFromTemplateComponent: ExpMaterialFromTemplateComponent;\r\n\r\n _edm: EditManager;\r\n _edmExpMat: EditManager;\r\n _reference: Reference;\r\n // _nextBioDataId: number = 0;\r\n _currentIx = -1;\r\n // Workflow\r\n _errorMessage = '';\r\n _hasAddsOrDeletes = true;\r\n _finishedMessage: string;\r\n\r\n _copyingExperimentalMaterial = false;\r\n _sharedProtocolData = new ProtocolData();\r\n _templateExperimentalMaterial: ExperimentalMaterial;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService,\r\n public _location: Location, public _router: Router,\r\n private _referenceState: ReferenceState,\r\n private route: ActivatedRoute,\r\n private referenceLoader: ReferenceLoader) {\r\n\r\n this._stateMap.currentRouteName = STAFF_ROUTES.Protocol.name;\r\n }\r\n\r\n ngOnInit() {\r\n this._edm = this._editorService.createEditManager(this, 'Protocol');\r\n this._edm.pageState.canShowMessage = false; // never show pageState messages.\r\n this._edmExpMat = this._editorService.createEditManager(this, 'Experimental Material');\r\n\r\n this.route.params\r\n .subscribe(params => {\r\n const referenceId: number = params['referenceId'];\r\n if (referenceId) {\r\n this.referenceLoader.load(referenceId)\r\n .then(() => {\r\n this.fetchBiologicalData(this._stateMap.currentReference);\r\n });\r\n }\r\n });\r\n }\r\n\r\n focusInitialTab() {\r\n setTimeout(() => {\r\n if (this._tabContainer) {\r\n this._tabContainer.selectTab(0);\r\n }\r\n }, 1);\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n get _currentBd() {\r\n return this._edm.currentEntity;\r\n }\r\n\r\n hasChanges() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n onSelect(bd: BiologicalData) {\r\n this._edm.currentEntity = bd;\r\n\r\n this.updateExpMats();\r\n }\r\n\r\n onEditBiologicalData(bd: BiologicalData) {\r\n this._edm.onSelect(bd);\r\n this.focusInitialTab();\r\n }\r\n\r\n updateExpMats() {\r\n const bd = this._edm.currentEntity;\r\n if (bd) {\r\n this._edmExpMat.entities = bd.experimentalMaterials;\r\n this._sharedProtocolData.expMaterialIdsForSorting = this._edmExpMat.entities.map(m => m.materialId);\r\n this._sharedProtocolData.subReference = bd.subReference;\r\n } else {\r\n this._edmExpMat.entities = [];\r\n this._sharedProtocolData.expMaterialIdsForSorting = [];\r\n this._sharedProtocolData.subReference = '';\r\n }\r\n }\r\n\r\n onKeyDown(event: any) {\r\n if (event.keyIdentifier == 'Up') {\r\n this._edm.movePrev();\r\n } else if (event.keyIdentifier == 'Down') {\r\n this._edm.moveNext();\r\n }\r\n this.updateExpMats();\r\n }\r\n\r\n onSelectReference() {\r\n UtilFns.showModal(this._referenceSelectorComponent, this, null).then(rli => {\r\n if (rli == null) {\r\n return;\r\n }\r\n return this.fetchReference(rli.referenceId);\r\n });\r\n }\r\n\r\n onMore() {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, this._edm.currentEntity.referenceId));\r\n }\r\n\r\n canSelectReference() {\r\n if (this._reference && this.hasChanges()) {\r\n return false;\r\n }\r\n if (this._edm && this._edm.editing) {\r\n return false;\r\n }\r\n if (this._edmExpMat && this._edmExpMat.editing) {\r\n return false;\r\n }\r\n\r\n return (this._copyingExperimentalMaterial) ? false : true;\r\n }\r\n\r\n\r\n fetchReference(referenceId: number) {\r\n this.clearEdms();\r\n this._edm.pageState.isLoading = true;\r\n\r\n return this._uow.fetch('References/GetForEdit', { referenceId: referenceId }).then(refs => {\r\n const ref: Reference = (refs && refs.length) ? refs[0] : null;\r\n return this.fetchBiologicalData(ref);\r\n });\r\n }\r\n\r\n fetchBiologicalData(reference: Reference) {\r\n this._edm.pageState.isLoading = true;\r\n this._reference = reference;\r\n this._stateMap.staffReferenceId = reference.referenceId;\r\n this._stateMap.currentReference = reference;\r\n if (!reference) {\r\n return;\r\n }\r\n this._uow.referenceRepository.populateBiologicalData(reference).then(() => {\r\n const r = reference.biologicalDatas;\r\n this._edm.entities = UtilFns.sort(r, true, (bd: BiologicalData) => bd.subReference || '');\r\n if (this._edm.entities.length) {\r\n this.onSelect(this._edm.entities[0]);\r\n this.sortExperimentalResults();\r\n }\r\n this._edm.pageState.isLoading = false;\r\n }).catch(() => {\r\n this._edm.pageState.isLoading = false;\r\n });\r\n }\r\n\r\n sortExperimentalResults() {\r\n this._edm.entities.forEach(bd => {\r\n bd.experimentalMaterials.forEach(em => {\r\n UtilFns.sortNumeric(em.experimentalResults, true, (expRes) => {\r\n return expRes.dose;\r\n });\r\n });\r\n });\r\n\r\n }\r\n\r\n // invoked after EM/ER copy\r\n refreshBioData() {\r\n this._edm.pageState.isLoading = true;\r\n return this._uow.referenceRepository.populateBiologicalData(this._reference).then(() => {\r\n const r = this._reference.biologicalDatas;\r\n this._edm.entities = UtilFns.sort(r, true, (bd: BiologicalData) => bd.subReference || '');\r\n if (this._edm.entities.length) {\r\n this.onSelect(this._edm.entities[0]);\r\n this.sortExperimentalResults();\r\n }\r\n this._edm.pageState.isLoading = false;\r\n }).catch(() => {\r\n this._edm.pageState.isLoading = false;\r\n });\r\n }\r\n\r\n onAddBioData() {\r\n const params = {\r\n referenceId: this._reference.referenceId,\r\n typeTimeUnitId: 'none',\r\n typeUsefulnessId: 'NA'\r\n };\r\n\r\n const biodata = this._uow.biologicalDataFactory.create(params);\r\n // biodata.typeStudyId = null;\r\n if (!biodata.entityAspect.entityState.isAdded()) {\r\n this._edm.setStatus({ message: 'Add failed - validation error on current entity', classes: 'label-danger', isTemp: true });\r\n }\r\n this._edm.currentEntity = biodata;\r\n\r\n this.updateExpMats();\r\n this._edm.onSelect(biodata);\r\n }\r\n\r\n onAddExpMat() {\r\n if (!this._currentBd) {\r\n return;\r\n }\r\n const params = {\r\n biologicalDataId: this._currentBd.biologicalDataId,\r\n typeExperimentVehicleId: 'NONE',\r\n typeStudyMixtureId: 'Not Evaluated'\r\n };\r\n const expMat = this._uow.experimentalMaterialFactory.create(params);\r\n // this._edmExpMat.entities.push(expMat);\r\n this._edmExpMat.onSelect(expMat);\r\n }\r\n\r\n onCopyExpMat(expMat: ExperimentalMaterial) {\r\n this._templateExperimentalMaterial = expMat;\r\n this._copyingExperimentalMaterial = true;\r\n }\r\n\r\n onDeleteBioData(bd: BiologicalData) {\r\n return this._stateMap.yesNoComponent.showModal('Delete entire protocol',\r\n 'Are you sure?').then(ok => {\r\n if (ok) {\r\n if (bd.entityAspect.entityState.isAdded() == false) {\r\n this._referenceState.recordProtocolDelete(this._reference);\r\n }\r\n bd.cascadeDelete();\r\n this.updateExpMats();\r\n }\r\n });\r\n }\r\n\r\n onDeleteExpMat(expMat: ExperimentalMaterial) {\r\n if (expMat.entityAspect.entityState.isAdded() == false) {\r\n this._referenceState.recordMaterialLinkDelete(this._stateMap.currentReference);\r\n }\r\n expMat.cascadeDelete();\r\n\r\n }\r\n\r\n isEditing() {\r\n return this._edm.editing || this._edmExpMat.editing;\r\n }\r\n\r\n canShowSave() {\r\n if (this._copyingExperimentalMaterial) { return false; }\r\n\r\n return !this.isEditing();\r\n }\r\n\r\n // public because part of IEditHost\r\n canSave() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n onSave() {\r\n if (!this._edm.validateBeforeSave()) {\r\n return Promise.resolve();\r\n }\r\n\r\n this._finishedMessage = '';\r\n\r\n return this.recordWorkflowChanges()\r\n .then(() => {\r\n this._referenceState.isReferenceFinished(this._reference).then(f => {\r\n\r\n const finished: boolean = (f != ReferenceFinishState.MissingData);\r\n\r\n // Leave previously finished References finished unless there is bio/tox data added or deleted\r\n if (finished != this._reference.finished) {\r\n // if the reference will be finished or, the reference is going to be unfinished as a result of bio/tox data add/deletes\r\n if (finished || this._hasAddsOrDeletes == true) {\r\n this._finishedMessage = (finished) ?\r\n 'The Reference is now marked complete, you may need to Save again to confirm.' :\r\n 'The Reference has been Unfinished as a result of these edits.';\r\n\r\n if (this._copyingExperimentalMaterial) {\r\n this._expMaterialFromTemplateComponent._savingUnfinishedReferenceDuringCopy = true;\r\n }\r\n\r\n this._reference.finished = finished;\r\n this._referenceState.recordReferenceFinishedStateChange(this._reference);\r\n }\r\n }\r\n\r\n return this._edm.commitSave()\r\n .then(() => {\r\n this._edmExpMat.entities.forEach(expMat => expMat.clearDeletedChildren());\r\n this.sortExperimentalResults();\r\n\r\n if (this._edm.currentEntity != null && this._edm.currentEntity.experimentalMaterials != null && this._edm.currentEntity.experimentalMaterials.length > 0) {\r\n this._sharedProtocolData.expMaterialIdsForSorting = this._edm.currentEntity.experimentalMaterials.map(m => m.materialId);\r\n this._sharedProtocolData.subReference = this._edm.currentEntity.subReference;\r\n } else {\r\n this._sharedProtocolData.expMaterialIdsForSorting = [];\r\n this._sharedProtocolData.subReference = '';\r\n }\r\n if (this._copyingExperimentalMaterial) {\r\n this._expMaterialFromTemplateComponent._savingUnfinishedReferenceDuringCopy = false;\r\n }\r\n });\r\n });\r\n });\r\n }\r\n\r\n canShowBack() {\r\n if (this._edm.editing) {\r\n return (this._edm.canShowBack() && !this._uow.hasChanges()); // changed December,2022. Changes to Sub Study changes weren't being detected.\r\n } else if (this._edmExpMat.editing) {\r\n return !this.expMatHasChanges();\r\n } else if (this._uow.hasChanges()) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n onBack() {\r\n if (this._edm.editing) {\r\n return this._edm.editing = false;\r\n } else if (this._edmExpMat.editing) {\r\n return this._edmExpMat.editing = false;\r\n } else if (this._copyingExperimentalMaterial) {\r\n // needs refreshed if the user stops midway, after Step 2, without creating Experimental Results\r\n if (this._expMaterialFromTemplateComponent._copyStatus == CopyStatus.EXPERIMENTALMATERIALSSAVED) {\r\n this.refreshBioData().then(r => {\r\n this._expMaterialFromTemplateComponent.onBack();\r\n this._copyingExperimentalMaterial = false;\r\n });\r\n } else {\r\n this._expMaterialFromTemplateComponent.onBack();\r\n this._copyingExperimentalMaterial = false;\r\n }\r\n } else {\r\n this.clearEdms();\r\n }\r\n }\r\n\r\n clearEdms() {\r\n this._reference = null;\r\n this._edm.entities = null;\r\n this._edmExpMat.entities = null;\r\n }\r\n\r\n canShowApply() {\r\n return this.isEditing();\r\n }\r\n\r\n canApply() {\r\n if (this._edm.editing) {\r\n return this._uow.hasChanges() && !this._edm.currentEntity.entityAspect.hasValidationErrors;\r\n } else if (this._edmExpMat.editing) {\r\n return this.expMatHasChanges() && this.expMatValidate();\r\n\r\n }\r\n }\r\n\r\n expMatValidate() {\r\n const currentExpMat = this._edmExpMat.currentEntity;\r\n if (!currentExpMat) {\r\n return true;\r\n }\r\n if (!currentExpMat.entityAspect.validateEntity()) {\r\n return false;\r\n }\r\n if (currentExpMat.materialId == null || currentExpMat.materialId < 1) {\r\n return false;\r\n }\r\n return currentExpMat.experimentalResults.every(er => er.entityAspect.validateEntity());\r\n // no need to validate experimentalToxicEffects because no errors are possible with current interface.\r\n }\r\n\r\n expMatHasChanges() {\r\n const currentExpMat = this._edmExpMat.currentEntity;\r\n if (!currentExpMat) {\r\n return false;\r\n }\r\n if (currentExpMat.getDeletedChildren().length) {\r\n return true;\r\n }\r\n return currentExpMat.entityAspect.entityState.isAddedModifiedOrDeleted() ||\r\n (currentExpMat.experimentalResults.some(er =>\r\n er.entityAspect.entityState.isAddedModifiedOrDeleted() ||\r\n er.experimentalToxicEffects.some(et => et.entityAspect.entityState.isAddedModifiedOrDeleted())\r\n ));\r\n }\r\n\r\n expMatCancel() {\r\n const currentExpMat = this._edmExpMat.currentEntity;\r\n if (!currentExpMat) {\r\n return false;\r\n }\r\n\r\n currentExpMat.getDeletedChildren().forEach(e => e.entityAspect.rejectChanges());\r\n currentExpMat.clearDeletedChildren();\r\n\r\n currentExpMat.experimentalResults\r\n .forEach(er => {\r\n er.experimentalToxicEffects\r\n .map(et => et)\r\n .forEach(et => et.entityAspect.rejectChanges());\r\n });\r\n\r\n currentExpMat.experimentalResults\r\n .map(er => er)\r\n .forEach(er => er.entityAspect.rejectChanges());\r\n\r\n currentExpMat.entityAspect.rejectChanges();\r\n this._edmExpMat.clearErrors();\r\n if (currentExpMat.entityAspect.entityState.isDetached()) {\r\n this._edmExpMat.editing = false;\r\n }\r\n\r\n if (this._expMaterialEditorComponent) {\r\n this._expMaterialEditorComponent.onCancel();\r\n }\r\n }\r\n\r\n onApply() {\r\n if (this._edm.editing) {\r\n return this._edm.onApplyCore();\r\n } else if (this._edmExpMat.editing) {\r\n if (!this.expMatValidate()) {\r\n return;\r\n }\r\n return this._edmExpMat.onApplyCore();\r\n }\r\n }\r\n\r\n canShowCancel() {\r\n if (this._copyingExperimentalMaterial) { return false; }\r\n\r\n return !this.canShowBack();\r\n }\r\n\r\n canCancel() {\r\n if (this._edm.editing) {\r\n return this._edm.canCancel();\r\n } else if (this._edmExpMat.editing) {\r\n return this.expMatHasChanges();\r\n } else if (this._uow.hasChanges()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n onCancel() {\r\n if (this._edm.editing) {\r\n if (this._edm.currentEntity.entityAspect.entityState.isAdded()) {\r\n // this gets rid of any entities attached to an added then rolled back protocol/biodata.\r\n this._edm.currentEntity.cascadeDelete();\r\n this._edm.editing = false;\r\n }\r\n\r\n this._edm.onCancelCore();\r\n this.updateExpMats();\r\n\r\n } else if (this._edmExpMat.editing) {\r\n this.expMatCancel();\r\n } else if (this._uow.hasChanges()) {\r\n this._edm.onCancelCore();\r\n this.expMatCancel();\r\n this.updateExpMats();\r\n }\r\n this._copyingExperimentalMaterial = false;\r\n\r\n if (this._copyingExperimentalMaterial) {\r\n this._expMaterialFromTemplateComponent._savingUnfinishedReferenceDuringCopy = false;\r\n }\r\n }\r\n\r\n private recordWorkflowChanges(): Promise {\r\n\r\n this._hasAddsOrDeletes = false;\r\n\r\n // Handle deletion of pending workflow tasks that are no longer relevant when data is deleted first, then add new actions\r\n if (this._referenceState.hasBioDataDeletionsToProcess(this._reference)) {\r\n this._referenceState.reconcileProtocolDeletesWithPendingActions(this._reference, this._edmExpMat.entities);\r\n this._hasAddsOrDeletes = true;\r\n }\r\n\r\n const changedEntities = this._edm.entities;\r\n\r\n if (changedEntities == null || changedEntities.length == 0) {\r\n return Promise.resolve(true);\r\n }\r\n\r\n let stateChangeNewBioData = false;\r\n let stateChangeNewMaterialLink = false;\r\n let stateChangeNewToxData = false;\r\n\r\n\r\n changedEntities.forEach(e => {\r\n\r\n if (e.entityType.name.indexOf('BiologicalData') > -1) {\r\n\r\n if (e.entityAspect.entityState.isAdded()) {\r\n stateChangeNewBioData = true;\r\n }\r\n\r\n if (e.experimentalMaterials != null && e.experimentalMaterials.length > 0) {\r\n const matLink = e.experimentalMaterials.filter(em => em.entityAspect.entityState.isAdded());\r\n if (matLink != null && matLink.length > 0) {\r\n stateChangeNewMaterialLink = true;\r\n }\r\n\r\n e.experimentalMaterials.forEach(em => {\r\n if (em.experimentalResults != null && em.experimentalResults.length > 0) {\r\n const toxAdd = em.experimentalResults.filter(er => er.entityAspect.entityState.isAdded());\r\n if (toxAdd != null && toxAdd.length > 0) {\r\n stateChangeNewToxData = true;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n if (stateChangeNewBioData) {\r\n this._referenceState.recordProtocolAdd(this._reference);\r\n }\r\n\r\n if (stateChangeNewMaterialLink) {\r\n this._referenceState.recordMaterialLinkAdd(this._reference);\r\n }\r\n\r\n if (stateChangeNewToxData) {\r\n this._referenceState.recordToxDataAdd(this._reference);\r\n }\r\n\r\n // Check if added tox data satisfies the Finished state for the Reference\r\n if (stateChangeNewBioData || stateChangeNewMaterialLink || stateChangeNewToxData) {\r\n this._hasAddsOrDeletes = true;\r\n }\r\n return Promise.resolve(true);\r\n }\r\n\r\n public referenceFinishedStatesHaveChanged(): boolean {\r\n return (this._finishedMessage && this._finishedMessage.length > 0);\r\n }\r\n\r\n // getBioDataIndex(bd: BiologicalData) {\r\n // return this._edm.entities.indexOf(bd);\r\n // }\r\n\r\n // setBioDataIndex(ix: number) {\r\n // ix = Math.max(ix, 0);\r\n // var entities = this._edm.entities;\r\n // if (entities) {\r\n // this.onSelect(entities[ Math.min(ix, entities.length-1)]);\r\n // } else {\r\n // this.onSelect(null);\r\n // }\r\n // }\r\n\r\n copyExperimentalMaterialEventHandler(event: string) {\r\n // @ts-ignore\r\n switch (event) {\r\n case 'applychanges': {\r\n this._edmExpMat.onApplyCore();\r\n this._expMaterialFromTemplateComponent.applyComplete();\r\n break;\r\n }\r\n case 'savechanges': {\r\n\r\n const bioDataId = this._currentBd.biologicalDataId;\r\n const expMatId = this._templateExperimentalMaterial.experimentalMaterialId;\r\n\r\n this.onSave().then(() => {\r\n this.refreshBioData().then(r => {\r\n // reset original editing selections so the copy can continue\r\n\r\n const bioDataIdx = this.findBiologicalDataIndex(bioDataId);\r\n const expMaterialIdx = this.findExperimentalMaterialIndex(bioDataIdx, expMatId);\r\n\r\n if (bioDataIdx < 0 || expMaterialIdx < 0) {\r\n this._copyingExperimentalMaterial = false;\r\n this._errorMessage = 'Unexpected error occurred. The copy process cannot continue.';\r\n return;\r\n }\r\n\r\n this.onSelect(this._edm.entities[bioDataIdx]);\r\n this.onCopyExpMat(this._edm.entities[bioDataIdx].experimentalMaterials[expMaterialIdx]);\r\n\r\n this._expMaterialFromTemplateComponent.saveComplete();\r\n });\r\n });\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n findBiologicalDataIndex(id: number): number {\r\n return this._edm.entities.findIndex(bd => bd.biologicalDataId == id);\r\n }\r\n\r\n findExperimentalMaterialIndex(bioDataIdx: number, expMatId: number): number {\r\n return this._edm.entities[bioDataIdx].experimentalMaterials.findIndex(em => em.experimentalMaterialId == expMatId);\r\n }\r\n}\r\n","
\r\n {{pageTitle()}}\r\n  \r\n {{journal.journalName}}\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n

{{_validationMessage}}

\r\n

{{_journalNameCollisionDesc}}

\r\n\r\n
\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n YYYY\r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n YYYY\r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n Former Journal Name:\r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n","import {Component, ElementRef, EventEmitter, forwardRef, Inject, Input, Output, OnInit, ViewChild} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { Router } from '@angular/router';\r\nimport { Entity } from 'breeze-client';\r\nimport { EditorService, ErrorLogger, provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent, PageState } from '../../controls/common';\r\n\r\nimport {Journal} from '../../entities/EntityModels';\r\n\r\nimport { JournalEditData, JournalsComponent} from './journals.component';\r\nimport { JournalSelectorComponent } from './journal-selector.component';\r\nimport {UtilFns} from '../../utils/util-fns';\r\nimport {EditManager} from '../../utils/edit-manager';\r\n\r\nimport * as pluralize from 'pluralize';\r\nimport * as _ from 'lodash';\r\n\r\nclass PageStateExt extends PageState {\r\n journalId: number;\r\n}\r\n\r\n@Component({\r\n selector: 'journal-editor',\r\n templateUrl: './journal-editor.html',\r\n providers: [provideParent(JournalEditorComponent, EditPropParent)]\r\n})\r\nexport class JournalEditorComponent implements OnInit, EditPropParent {\r\n @ViewChild(JournalSelectorComponent, { static: true }) _journalSelectorComponent: JournalSelectorComponent;\r\n\r\n @Output() stateChange = new EventEmitter();\r\n\r\n _data: JournalEditData;\r\n _edm: EditManager;\r\n _edmNextJournalName: EditManager; // only used if journal is deleted\r\n\r\n _previousJournal: Journal;\r\n _nextJournal: Journal;\r\n\r\n _pageState = new PageStateExt('Journal editor');\r\n _validationMessage: string;\r\n\r\n _hasBeenDeleted = false;\r\n _hasJournalNameCollision = false;\r\n _journalNameCollisionDesc: string;\r\n\r\n _journalNameStartYear: string;\r\n _journalNameEndYear: string;\r\n _selectedNameStartMonthIndex = 0;\r\n _selectedNameEndMonthIndex = 0;\r\n\r\n _dateErrMsg = 'The Journal Name Start Date is equal to or later than the Journal Name End Date.';\r\n\r\n public _monthNames = [{ month: 'None' }, { month: 'January' }, { month: 'February' }, { month: 'March' },\r\n { month: 'April' }, { month: 'May' }, { month: 'June' },\r\n { month: 'July' }, { month: 'August' }, { month: 'September' },\r\n { month: 'October' }, { month: 'November' }, { month: 'December' }];\r\n\r\n constructor(@Inject(forwardRef(() => JournalsComponent)) public _parent: JournalsComponent,\r\n public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService,\r\n public _location: Location, public _errorLogger: ErrorLogger, public _router: Router) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Journal');\r\n this._edmNextJournalName = new EditManager(this, this._uow, this._stateMap, 'Journal');\r\n\r\n if (this._data == null) {\r\n return;\r\n }\r\n\r\n if (this._data.adding) {\r\n const j = this._edm.uow.journalFactory.create();\r\n this._data.entity = j;\r\n this._edm.onlyEntity = this._data.entity;\r\n this._edm.editing = true;\r\n\r\n } else {\r\n this._edm.onlyEntity = this._data.entity;\r\n this._edm.editing = true;\r\n\r\n this._journalNameStartYear = (this._edm.currentEntity.journalNameStartYear != null) ? this._edm.currentEntity.journalNameStartYear.toString() : null;\r\n this._journalNameEndYear = (this._edm.currentEntity.journalNameEndYear != null) ? this._edm.currentEntity.journalNameEndYear.toString() : null;\r\n this._selectedNameStartMonthIndex = (this._edm.currentEntity.journalNameStartMonth != null) ? this._edm.currentEntity.journalNameStartMonth : 0;\r\n this._selectedNameEndMonthIndex = (this._edm.currentEntity.journalNameEndMonth != null) ? this._edm.currentEntity.journalNameEndMonth : 0;\r\n\r\n return this.fetchJournalWithPreviousName().then(r => {\r\n // if the journal is to be deleted, remove references to the journal in the rootjournalid of the subsequent journal name\r\n if (this._data.deleting) {\r\n return this.fetchJournalNextName().then( n => {\r\n if (this._nextJournal != null) {\r\n this._edmNextJournalName.onlyEntity = this._nextJournal;\r\n this._edmNextJournalName.editing = true;\r\n this._edmNextJournalName.currentEntity.rootJournalId = null;\r\n }\r\n });\r\n }\r\n return;\r\n });\r\n }\r\n }\r\n\r\n get journal() {\r\n return this._edm.currentEntity;\r\n }\r\n\r\n fetchJournalNextName() {\r\n\r\n this._nextJournal = null;\r\n\r\n const params = {\r\n journalId: this._data.entity.journalId,\r\n };\r\n\r\n return this._uow.fetch('Misc/FetchJournalWithNextName', params).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._nextJournal = r[0];\r\n }\r\n });\r\n }\r\n\r\n fetchJournalWithPreviousName() {\r\n\r\n this._previousJournal = null;\r\n\r\n if (this._data.entity.rootJournalId == null) {\r\n return Promise.resolve(null);\r\n }\r\n\r\n const params = {\r\n journalId: this._data.entity.journalId,\r\n rootJournalId: this._data.entity.rootJournalId\r\n };\r\n\r\n return this._uow.fetch('Misc/FetchJournalWithPreviousName', params).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._previousJournal = r[0];\r\n }\r\n });\r\n }\r\n\r\n onSearchForRelatedJournal() {\r\n const invalidFormerJournal = 'The selected former journal is the same as the current journal. Please select another.';\r\n\r\n this._previousJournal = null;\r\n if (this._validationMessage) {\r\n if (this._validationMessage == invalidFormerJournal || this._validationMessage.indexOf('is already marked as the former journal name of') != -1) {\r\n this._validationMessage = '';\r\n }\r\n }\r\n\r\n this._journalSelectorComponent.setShowJournalData(true);\r\n UtilFns.showModal(this._journalSelectorComponent, this, null).then((j: Journal) => {\r\n if (!j) {\r\n return;\r\n }\r\n\r\n if (this._data.entity.journalId == j.journalId) {\r\n this._validationMessage = invalidFormerJournal;\r\n } else if (this._data.entity.journalId == j.rootJournalId) {\r\n this._validationMessage = 'The journal ' + this._data.entity.journalName + ' is already marked as the former journal name of ' + j.journalName;\r\n }\r\n else {\r\n this._previousJournal = j;\r\n this._data.entity.rootJournalId = this._previousJournal.journalId;\r\n }\r\n });\r\n }\r\n\r\n removeRelatedJournal() {\r\n if (this._data.entity == null) {\r\n return;\r\n }\r\n this._data.entity.rootJournalId = null;\r\n this._previousJournal = null;\r\n }\r\n\r\n // Not really needed but in case this editor is ever used by non-staff.\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n // dates\r\n onChangeJournalNameStartYear(yearString: string) {\r\n this._validationMessage = '';\r\n\r\n if (this.isStringNullOrEmpty(yearString)) {\r\n this._edm.currentEntity.journalNameStartYear = null;\r\n this._edm.currentEntity.journalNameStartMonth = null; // a year value is required for a month value\r\n this._journalNameStartYear = null;\r\n return;\r\n }\r\n\r\n if (this.isValidYear(yearString)) {\r\n this._edm.currentEntity.journalNameStartYear = parseInt(yearString, 10);\r\n this._journalNameStartYear = parseInt(yearString, 10).toString();\r\n } else {\r\n this._validationMessage = 'An incorrect Year has been entered in the Journal Name Start Year field.';\r\n }\r\n }\r\n\r\n onChangeJournalNameEndYear(yearString: string) {\r\n this._validationMessage = '';\r\n\r\n if (this.isStringNullOrEmpty(yearString)) {\r\n this._edm.currentEntity.journalNameEndYear = null;\r\n this._edm.currentEntity.journalNameEndMonth = null; // a year value is required for a month value\r\n this._journalNameEndYear = null;\r\n return;\r\n }\r\n\r\n if (this.isValidYear(yearString)) {\r\n this._edm.currentEntity.journalNameEndYear = parseInt(yearString, 10);\r\n this._journalNameEndYear = parseInt(yearString, 10).toString();\r\n } else {\r\n this._validationMessage = 'An incorrect Year has been entered in the Journal Name End Year field.';\r\n }\r\n }\r\n\r\n checkDate(dateString: string): boolean {\r\n const d = Date.parse(dateString);\r\n\r\n return (!isNaN(d));\r\n }\r\n\r\n onSelectNameStartMonth(monthidx: number) {\r\n this._selectedNameStartMonthIndex = monthidx;\r\n this._edm.currentEntity.journalNameStartMonth = (monthidx > 0) ? monthidx : null;\r\n\r\n if (this._validationMessage == this._dateErrMsg) {\r\n this._validationMessage = '';\r\n }\r\n this.hasValidJournalNameDates();\r\n }\r\n\r\n onSelectNameEndMonth(monthidx: number) {\r\n this._selectedNameEndMonthIndex = monthidx;\r\n this._edm.currentEntity.journalNameEndMonth = (monthidx > 0) ? monthidx : null;\r\n\r\n if (this._validationMessage == this._dateErrMsg) {\r\n this._validationMessage = '';\r\n }\r\n this.hasValidJournalNameDates();\r\n }\r\n\r\n isStringNullOrEmpty(s: string): boolean {\r\n return (s == null || s.trim() === '');\r\n }\r\n\r\n isValidYear(yearString: string) {\r\n const year = parseInt(yearString, 10);\r\n return !isNaN(year) && year > 1900 && year < 2100;\r\n }\r\n\r\n pageTitle() {\r\n return (this._data.adding ? 'Adding a Journal' : this._data.deleting ? 'Deleting Journal' : 'Editing Journal');\r\n }\r\n\r\n // *******************************************************\r\n // edit interactions\r\n // *******************************************************\r\n canApply() {\r\n\r\n if (this._data == null) {\r\n return false;\r\n }\r\n\r\n if (this._data.deleting) {\r\n return false;\r\n }\r\n\r\n if (!this.hasValidJournalNameDates()) {\r\n return false;\r\n }\r\n\r\n if (this._edm.editing && this._uow.hasChanges()) {\r\n if (this._edm.currentEntity != null) {\r\n return (!this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n\r\n this.isDuplicateJournalName().then( r => {\r\n if (!this._hasJournalNameCollision) {\r\n if (this._edm.editing) {\r\n this._edm.onApplyCore();\r\n }\r\n }\r\n });\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (this._data.deleting) {\r\n return false;\r\n }\r\n\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n onBack() {\r\n this._data.adding = false;\r\n this._edm.editing = false;\r\n this._data.inSubEditor = false;\r\n\r\n this.stateChange.emit('Back');\r\n }\r\n\r\n canCancel() {\r\n if (this._data.deleting) {\r\n return true;\r\n }\r\n\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._uow.rollback();\r\n\r\n this._edm.clearErrors();\r\n this._edm.editing = false;\r\n this._edm.pageState.loadStatusMsg = null;\r\n\r\n this._edmNextJournalName.clearErrors();\r\n this._edmNextJournalName.editing = false;\r\n\r\n const data = this._data;\r\n data.inSubEditor = false;\r\n\r\n this.stateChange.emit('Cancel');\r\n }\r\n\r\n canDelete() {\r\n\r\n if (this._hasBeenDeleted) {\r\n return false;\r\n }\r\n\r\n if (this._data == null || this._edm == null) {\r\n return false;\r\n }\r\n\r\n return (this._data.deleting && this._edm.currentEntity != null);\r\n }\r\n\r\n onDelete() {\r\n return this._stateMap.yesNoComponent.showModal('Delete entire Journal',\r\n 'Are you sure you want to delete this Journal?').then(ok => {\r\n if (ok) {\r\n\r\n if (this._data.entity.entityAspect.entityState.isAdded()) {\r\n this._data.entity.entityAspect.rejectChanges();\r\n } else {\r\n this._data.entity.entityAspect.setDeleted();\r\n }\r\n\r\n this._edmNextJournalName.onApplyCore();\r\n\r\n if (this._edmNextJournalName.currentEntity != null) {\r\n this._edmNextJournalName.onApplyCore();\r\n }\r\n\r\n this._hasBeenDeleted = true;\r\n }\r\n });\r\n }\r\n\r\n canSave(): boolean {\r\n if (this._hasBeenDeleted) { return true; }\r\n if (this._edm.editing) { return false; }\r\n if (!this._edm.hasEdits()) { return false; }\r\n if (!this._edm.validateBeforeSave()) { return false; }\r\n\r\n return true;\r\n }\r\n\r\n onSave() {\r\n // journal\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n this._edm.editing = false;\r\n\r\n const data = this._data;\r\n data.inSubEditor = false;\r\n if (data.adding) {\r\n data.entity = this._edm.currentEntity;\r\n data.journalId = this._edm.currentEntity.journalId;\r\n }\r\n\r\n if (this._hasBeenDeleted) {\r\n this._edmNextJournalName.editing = false;\r\n this.stateChange.emit('Delete');\r\n } else {\r\n this.stateChange.emit('Save');\r\n }\r\n });\r\n }\r\n }\r\n\r\n hasRelatedJournalName() {\r\n if (this.journal == null) {\r\n return false;\r\n }\r\n\r\n return (this.journal.rootJournalId != null && this.journal.rootJournalId != this.journal.journalId);\r\n }\r\n\r\n isDuplicateJournalName(): Promise {\r\n if (this.journal == null) {\r\n return Promise.resolve(false);\r\n }\r\n this._hasJournalNameCollision = false;\r\n this._journalNameCollisionDesc = '';\r\n\r\n const params = { name: UtilFns.encodeHackForAnd(this.journal.journalName), journalId: this.journal.journalId };\r\n return this._uow.fetchTyped('Misc/JournalMatchByRootName', Journal, params).then(r => {\r\n if (r && r.length > 0) {\r\n this._hasJournalNameCollision = true;\r\n if (this.journal.journalName == r[0].journalName) {\r\n this._journalNameCollisionDesc = 'A journal with the same name already exists.';\r\n } else {\r\n this._journalNameCollisionDesc = 'A journal name that differs only by spaces and case exists.';\r\n }\r\n }\r\n return this._hasJournalNameCollision;\r\n });\r\n }\r\n\r\n getError(propName: string) {\r\n if (this._edm == null || this._edm.currentEntity == null) {\r\n return;\r\n }\r\n\r\n const r = this._edm.currentEntity.getErrorFor(propName);\r\n return r;\r\n }\r\n\r\n hasValidJournalNameDates() {\r\n if (this._edm.currentEntity.journalNameStartYear == null || this._edm.currentEntity.journalNameEndYear == null) {\r\n return true;\r\n }\r\n\r\n if (this._edm.currentEntity.journalNameStartDateForSort >= this._edm.currentEntity.journalNameEndDateForSort) {\r\n this._validationMessage = 'The Journal Name Start Date is equal to or later than the Journal Name End Date.';\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n Find a Journal\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n Reports\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n\r\n

{{_validationMessage}}

\r\n\r\n
\r\n
\r\n Journal Details\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n

Active Subscription

\r\n \r\n
\r\n
\r\n
\r\n
\r\n

Has Journal Reserves

\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n

{{_userMessage}}

\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n \r\n {{journal.journalId}}\r\n
\r\n\r\n
\r\n \r\n {{journal.journalName}}\r\n
\r\n\r\n
\r\n \r\n {{journal.journalNameStartYearAndMonth}}\r\n
\r\n\r\n
\r\n \r\n {{journal.journalNameEndYearAndMonth}}\r\n
\r\n\r\n
\r\n \r\n {{formerJournalName()}}\r\n
\r\n\r\n
\r\n \r\n {{journal.notes}}\r\n
\r\n\r\n
\r\n\r\n
\r\n

\r\n Journal Data\r\n

\r\n\r\n
\r\n \r\n \r\n
\r\n

No related names for the selected journal.

\r\n\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n Journal Id\r\n Journal Name\r\n Journal Name Start Date\r\n Journal Name End Date\r\n Relationship\r\n Switch To\r\n \r\n \r\n \r\n \r\n {{n.journalId}}\r\n {{n.journalName}}\r\n {{n.displayStartDate}}\r\n {{n.displayEndDate}}\r\n {{n.relationship}}\r\n Switch\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n

No reserves for journal.

\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
Edit
\r\n
Delete
\r\n
Year
\r\n
Volume
\r\n
Issue
\r\n
Notes
\r\n
\r\n
\r\n
\r\n \r\n \r\n
{{h.journalYear}}
\r\n
{{h.volume}}
\r\n
{{h.issue}}
\r\n
{{h.notes}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n

No subscriptions for the selected journal.

\r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
View / Edit
\r\n
Delete
\r\n
Subscription Type
\r\n
Start Date
\r\n
End Date
\r\n
Issues per Year
\r\n
Publisher
\r\n
Notes
\r\n
\r\n
\r\n
\r\n \r\n \r\n
{{s.typeJournalSubscription.description}}
\r\n
{{formatDate(s.subscriptionStartYear, s.subscriptionStartMonth)}}
\r\n
{{formatDate(s.subscriptionEndYear, s.subscriptionEndMonth)}}
\r\n
{{s.issuesPerYear}}
\r\n
{{s.publisher}}
\r\n
{{s.notes}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n
\r\n

No assigned reference for journal.

\r\n\r\n
\r\n\r\n
\r\n
\r\n

{{getReferenceCountText()}} - Select to reassign

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Edit Reference\r\n Select\r\n Reference No.\r\n Brief Reference\r\n Title\r\n \r\n \r\n \r\n \r\n Edit\r\n \r\n {{r.data.referenceId}}\r\n {{r.data.briefRef(isStaff()) }}\r\n {{r.data.title}}\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n\r\n","import { Location } from '@angular/common';\r\nimport { Component, Input, OnInit, AfterViewInit, ViewChild } from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport {PageState, TabContainer} from '../../controls/common';\r\nimport { UnitOfWork, StateMap, UserManager, ErrorLogger, EditorService } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/edit-prop.component';\r\nimport { UtilFns, IEditHost, EditManager, LocationFns } from '../../utils/common';\r\n\r\nimport { JournalSelectorComponent } from './journal-selector.component';\r\n\r\nimport {Journal, JournalReserve, JournalSubscription, Reference, TypeJournalSubscription} from '../../entities/EntityModels';\r\nimport { JournalEditorComponent } from './journal-editor.component';\r\nimport { JournalReserveEditorComponent } from './journal-reserve-editor.component';\r\nimport { JournalSubscriptionEditorComponent } from './journal-subscription-editor.component';\r\n\r\nimport { RelatedJournalNameItem } from '../../entities/projections/RelatedJournalNameItem';\r\nimport { JournalSubscriptionItem } from '../../entities/projections/JournalSubscriptionItem';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport * as _ from 'lodash';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { STAFF_ROUTES } from './staff.routes';\r\nimport {Entity} from 'breeze-client';\r\nimport * as pluralize from 'pluralize';\r\n\r\nexport enum JournalEditState {\r\n None,\r\n Journal = 1,\r\n Reserve,\r\n Name,\r\n Subscription,\r\n Reassign\r\n}\r\n\r\nexport class JournalEditData {\r\n journalEditState: JournalEditState = JournalEditState.None;\r\n inSubEditor: boolean;\r\n adding: boolean;\r\n deleting: boolean;\r\n entity: Journal;\r\n journalId: number;\r\n journalReserveId: number;\r\n journalSubscriptionId: number;\r\n selectedReferenceIds: number[] = [];\r\n}\r\n\r\n@Component({\r\n selector: 'journals',\r\n templateUrl: './journals.html',\r\n})\r\n\r\nexport class JournalsComponent implements OnInit, AfterViewInit {\r\n @ViewChild(JournalEditorComponent) _journalEditComponent: JournalEditorComponent;\r\n @ViewChild(JournalSelectorComponent, { static: true }) _journalSelectorComponent: JournalSelectorComponent;\r\n @ViewChild(TabContainer) _tabContainer: TabContainer;\r\n\r\n JournalEditState = JournalEditState;\r\n\r\n _isLoading: boolean;\r\n _userMessage: string;\r\n\r\n _data: JournalEditData = new JournalEditData();\r\n\r\n _referencesEx: SelectableEntity[] = [];\r\n _relatedJournals: RelatedJournalNameItem[];\r\n _reserves: JournalReserve[];\r\n _subscriptions: JournalSubscription[];\r\n\r\n _hasActiveSubscription = false;\r\n\r\n _sub: any;\r\n _tab = 2;\r\n _validationMessage: string;\r\n\r\n _monthFullNames = [\r\n 'January', 'February', 'March',\r\n 'April', 'May', 'June', 'July',\r\n 'August', 'September', 'October',\r\n 'November', 'December'\r\n ];\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n public _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._stateMap.currentRouteName = STAFF_ROUTES.Journals.name;\r\n\r\n this._data.inSubEditor = false;\r\n\r\n const tabnum = (this._stateMap.getJournalDataFor('tabNumber'));\r\n this._tab = (tabnum == undefined) ? 2 : tabnum;\r\n\r\n const id = this._stateMap.staffJournalId;\r\n if (id != null) {\r\n return this.fetchJournal((id)).then(r => {\r\n this.setTab(this._tab);\r\n });\r\n }\r\n }\r\n\r\n ngAfterViewInit() {\r\n }\r\n\r\n canDeactivate() {\r\n return !this._data.inSubEditor && !this._uow.hasChanges();\r\n }\r\n\r\n get isLoading() {\r\n return this._isLoading;\r\n }\r\n\r\n set isLoading(value) {\r\n this._isLoading = value;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get journal() {\r\n return this._data.entity;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n onSearchForJournal() {\r\n this._journalSelectorComponent.setShowJournalData(false);\r\n UtilFns.showModal(this._journalSelectorComponent, this, null).then((j: Journal) => {\r\n if (!j) {\r\n return;\r\n }\r\n\r\n this._tab = 2;\r\n return this.fetchJournal((j.journalId)).then(r => {\r\n this.setTab(this._tab);\r\n });\r\n });\r\n }\r\n\r\n fetchJournal(journalId: number) {\r\n this._data.entity = null;\r\n this._referencesEx = [];\r\n\r\n this.isLoading = true;\r\n\r\n return this._uow.fetchTyped('Misc/JournalById', Journal, { journalId: journalId }).then(r => {\r\n const j = r && (r.length > 0) && r[0];\r\n if (j) {\r\n this._data.journalId = j.journalId;\r\n this._data.entity = j;\r\n this._stateMap.staffJournalId = j.journalId;\r\n\r\n this.prepareData();\r\n } else {\r\n this.onReset();\r\n }\r\n this.isLoading = false;\r\n }).catch(() => {\r\n this._validationMessage = 'Unexpected error occurred. Please contact support.';\r\n this.isLoading = false;\r\n });\r\n }\r\n\r\n prepareData() {\r\n this.onReset();\r\n\r\n this.fetchJournalsRelatedByName();\r\n\r\n this.formatReferenceSelectableEntities();\r\n\r\n // reserves\r\n if (this._data.entity.journalReserves != null && this._data.entity.journalReserves.length > 0) {\r\n this._reserves = _.orderBy(this._data.entity.journalReserves, ['journalName', 'journalYear', 'volume'], ['asc', 'desc', 'desc']);\r\n }\r\n\r\n // subscriptions\r\n if (this._data.entity.journalSubscriptions != null && this._data.entity.journalSubscriptions.length > 0) {\r\n this._subscriptions = _.orderBy(this._data.entity.journalSubscriptions, ['subscriptionStartYear', 'subscriptionStartMonth'], ['desc', 'desc']);\r\n\r\n try {\r\n const activeSubs = this._subscriptions.filter(s => s.subscriptionEndYear === null || s.subscriptionEndYear === undefined);\r\n this._hasActiveSubscription = (activeSubs != null && activeSubs.length > 0);\r\n } catch (error) {\r\n alert(error);\r\n }\r\n\r\n }\r\n }\r\n\r\n fetchJournalsRelatedByName() {\r\n this.onReset();\r\n\r\n const params = {\r\n journalId: this._data.entity.journalId,\r\n rootJournalId: this._data.entity.rootJournalId,\r\n journalName: UtilFns.encodeHackForAnd(this._data.entity.journalName)\r\n };\r\n\r\n return this._uow.fetch('Misc/FetchJournalsRelatedByName', params).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._relatedJournals = r;\r\n }\r\n });\r\n }\r\n\r\n refreshData(event: string) {\r\n const data = this._data;\r\n\r\n switch (data.journalEditState) {\r\n case JournalEditState.Reserve: {\r\n this._tab = 1;\r\n break;\r\n }\r\n case JournalEditState.Reassign: {\r\n this._tab = 0;\r\n this._userMessage = (event == 'Save') ? 'References reassigned successfully.' : '';\r\n break;\r\n }\r\n case JournalEditState.Subscription: {\r\n this._tab = 2;\r\n break;\r\n }\r\n default: {\r\n this._tab = 2;\r\n break;\r\n }\r\n }\r\n\r\n if (event == 'Save' || (event == 'Cancel' && !this._data.adding)) {\r\n if (this._data.entity != null) {\r\n this.fetchJournal((this._data.entity.journalId)).then (r => {\r\n this.setTab(this._tab);\r\n });\r\n }\r\n } else if ((event == 'Cancel' && this._data.adding && this._data.journalEditState == JournalEditState.Journal) || (event == 'Delete')) {\r\n\r\n this.onReset();\r\n\r\n data.entity = null;\r\n data.journalId = null;\r\n data.journalEditState = JournalEditState.None;\r\n\r\n if (event == 'Delete') {\r\n this._userMessage = 'Journal Deleted';\r\n }\r\n }\r\n\r\n if (event == 'Save' || event == 'Delete') {\r\n if (this._journalSelectorComponent != null) {\r\n this._journalSelectorComponent.clearSearchResults();\r\n }\r\n }\r\n\r\n data.adding = false;\r\n data.deleting = false;\r\n data.inSubEditor = false;\r\n this.setTab(this._tab);\r\n }\r\n\r\n hasFormerJournalName() {\r\n if (this._data.entity == null || this._relatedJournals == null) {\r\n return false;\r\n }\r\n\r\n const journal = _.find(this._relatedJournals, j => j.journalId == this._data.entity.rootJournalId);\r\n\r\n return (journal != null ? true : false);\r\n }\r\n\r\n formerJournalName() {\r\n if (this._data.entity == null || this._relatedJournals == null) {\r\n return false;\r\n }\r\n\r\n const journal = _.find(this._relatedJournals, j => j.journalId == this._data.entity.rootJournalId);\r\n return (journal != null ? journal.journalName : '');\r\n }\r\n\r\n onReset() {\r\n this._userMessage = null;\r\n this._validationMessage = '';\r\n\r\n this._relatedJournals = null;\r\n this._reserves = null;\r\n this._subscriptions = null;\r\n\r\n this._hasActiveSubscription = false;\r\n this._data.journalReserveId = null;\r\n this._data.journalSubscriptionId = null;\r\n }\r\n\r\n onAddJournal() {\r\n this._validationMessage = '';\r\n\r\n const data = this._data;\r\n\r\n data.journalEditState = JournalEditState.Journal;\r\n data.adding = true;\r\n data.inSubEditor = true;\r\n\r\n this._stateMap.staffJournalId = null;\r\n\r\n }\r\n\r\n onDownloadJournalSubscriptionReport() {\r\n const params: { key: string, value: string }[] = [];\r\n\r\n params.push({ key: 'reporttype', value: 'journalsubscription' });\r\n\r\n const url = this._userManager.getReportUrl(params);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n onDownloadJournalActiveSubscriptionReport() {\r\n const params: { key: string, value: string }[] = [];\r\n\r\n params.push({ key: 'reporttype', value: 'journalsubscription' });\r\n params.push({ key: 'reportfilter', value: 'active' });\r\n\r\n const url = this._userManager.getReportUrl(params);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n onDownloadJournalInactiveSubscriptionReport() {\r\n const params: { key: string, value: string }[] = [];\r\n\r\n params.push({ key: 'reporttype', value: 'journalsubscription' });\r\n params.push({ key: 'reportfilter', value: 'inactive' });\r\n\r\n const url = this._userManager.getReportUrl(params);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n onDownloadJournalReserveReport() {\r\n const params: { key: string, value: string }[] = [];\r\n\r\n params.push({ key: 'reporttype', value: 'journalreserve' });\r\n\r\n const url = this._userManager.getReportUrl(params);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n onEditJournal() {\r\n if (this._data.entity == null) {\r\n return;\r\n }\r\n\r\n this._validationMessage = '';\r\n\r\n const data = this._data;\r\n\r\n data.adding = false;\r\n data.deleting = false;\r\n data.inSubEditor = true;\r\n data.journalEditState = JournalEditState.Journal;\r\n }\r\n\r\n canDelete() {\r\n // !_data.inSubEditor && journal != null\r\n if (this.journal == null) {\r\n return false;\r\n }\r\n\r\n if (this.hasAssignedReferences()) {\r\n return false;\r\n }\r\n\r\n return (!this._data.inSubEditor);\r\n }\r\n\r\n onDeleteJournal() {\r\n this._validationMessage = '';\r\n\r\n if (this._data.entity == null) {\r\n return;\r\n }\r\n\r\n if (this.hasRelatedJournalData()) {\r\n this._validationMessage = 'Please delete all Journal Reserves and Subscriptions before deleting this Journal.';\r\n return;\r\n }\r\n\r\n const data = this._data;\r\n\r\n data.adding = false;\r\n data.deleting = true;\r\n data.inSubEditor = true;\r\n data.journalEditState = JournalEditState.Journal;\r\n }\r\n\r\n // Journal Names\r\n hasRelatedJournals() {\r\n return (this._relatedJournals != null && this._relatedJournals.length > 0);\r\n }\r\n\r\n // Journal Reserves\r\n hasReservesData() {\r\n return (this._reserves != null && this._reserves.length > 0);\r\n }\r\n\r\n onAddJournalReserve() {\r\n this._validationMessage = '';\r\n\r\n const data = this._data;\r\n\r\n data.journalEditState = JournalEditState.Reserve;\r\n data.adding = true;\r\n data.inSubEditor = true;\r\n }\r\n\r\n onEditJournalReserve(h: JournalReserve) {\r\n this._validationMessage = '';\r\n\r\n if (h == null) {\r\n return;\r\n }\r\n\r\n const data = this._data;\r\n\r\n this._data.journalReserveId = h.journalReserveId;\r\n\r\n data.journalEditState = JournalEditState.Reserve;\r\n data.adding = false;\r\n data.deleting = false;\r\n data.inSubEditor = true;\r\n }\r\n\r\n onDeleteJournalReserve(h: JournalReserve) {\r\n this._validationMessage = '';\r\n\r\n const data = this._data;\r\n\r\n data.journalReserveId = h.journalReserveId;\r\n data.journalEditState = JournalEditState.Reserve;\r\n\r\n data.adding = false;\r\n data.deleting = true;\r\n data.inSubEditor = true;\r\n }\r\n\r\n // Journal Subscriptions\r\n hasSubscriptionsData() {\r\n return (this._subscriptions != null && this._subscriptions.length > 0);\r\n }\r\n\r\n onAddJournalSubscription() {\r\n this._validationMessage = '';\r\n\r\n const data = this._data;\r\n\r\n data.journalEditState = JournalEditState.Subscription;\r\n data.adding = true;\r\n data.inSubEditor = true;\r\n }\r\n\r\n onEditJournalSubscription(s: JournalSubscription) {\r\n this._validationMessage = '';\r\n\r\n if (s == null) {\r\n return;\r\n }\r\n\r\n const data = this._data;\r\n\r\n this._data.journalSubscriptionId = s.journalSubscriptionId;\r\n\r\n data.adding = false;\r\n data.deleting = false;\r\n data.inSubEditor = true;\r\n data.journalEditState = JournalEditState.Subscription;\r\n }\r\n\r\n onDeleteJournalSubscription(s: JournalSubscription) {\r\n this._validationMessage = '';\r\n\r\n const data = this._data;\r\n\r\n data.journalSubscriptionId = s.journalSubscriptionId;\r\n data.journalEditState = JournalEditState.Subscription;\r\n\r\n data.adding = false;\r\n data.deleting = true;\r\n data.inSubEditor = true;\r\n }\r\n\r\n // interaction logic\r\n setTab(tabNumber: number) {\r\n setTimeout(() => {\r\n if (this._tabContainer != null) {\r\n this._tabContainer.selectTab(tabNumber);\r\n }\r\n }, 1);\r\n\r\n this._stateMap.setJournalDataFor('tabNumber', tabNumber);\r\n }\r\n\r\n onTabChange(tabNumber: number) {\r\n this._tab = tabNumber;\r\n this._stateMap.setJournalDataFor('tabNumber', tabNumber);\r\n }\r\n\r\n onNavigateToJournal(n: RelatedJournalNameItem) {\r\n if (n == null) {\r\n return;\r\n }\r\n\r\n this._tab = 2;\r\n return this.fetchJournal(n.journalId).then(r => {\r\n this.setTab(this._tab);\r\n });\r\n }\r\n\r\n hasRelatedJournalData() {\r\n if (this._data == null || this._data.entity == null) {\r\n return false;\r\n }\r\n\r\n if (this._data.entity.journalReserves != null && this._data.entity.journalReserves.length > 0 ) {\r\n return true;\r\n }\r\n\r\n if (this._data.entity.journalSubscriptions != null && this._data.entity.journalSubscriptions.length > 0 ) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n // *******************************************************\r\n // related references\r\n // *******************************************************\r\n formatReferenceSelectableEntities() {\r\n this._referencesEx = [];\r\n if (this._data.entity.references == null || this._data.entity.references.length < 1) { return; }\r\n\r\n _.clone(this._data.entity.references).forEach(element => {\r\n this._referencesEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n\r\n this._referencesEx = _.sortBy(this._referencesEx, e => e.data.referenceId);\r\n }\r\n\r\n onSelectReferences(check: boolean) {\r\n\r\n this._referencesEx.map(function(r) {\r\n r.selected = check;\r\n return r\r\n });\r\n }\r\n\r\n canReassignReferences() {\r\n if (this.hasAssignedReferences() == false) {\r\n return false;\r\n }\r\n\r\n const selected = this._referencesEx.filter(r => r.selected);\r\n return (selected != null && selected.length > 0);\r\n }\r\n\r\n hasAssignedReferences() {\r\n if (this._data == null || this._data.entity == null) {\r\n return false;\r\n }\r\n\r\n return (this._data.entity.references != null && this._data.entity.references.length > 0);\r\n }\r\n\r\n onReassignReference() {\r\n this._validationMessage = '';\r\n\r\n const selectedRefIds = this._referencesEx.filter(r => r.selected).map(s => s.data.referenceId);\r\n\r\n const data = this._data;\r\n\r\n data.journalEditState = JournalEditState.Reassign;\r\n data.inSubEditor = true;\r\n data.selectedReferenceIds = selectedRefIds;\r\n }\r\n\r\n getReferenceCountText() {\r\n if (this._data.entity.references != null) {\r\n const l = this._data.entity.references.length;\r\n return `${l} ${pluralize('reference', l)} found`;\r\n }\r\n }\r\n\r\n get referenceTabTitle(): string {\r\n const title = 'Assigned References';\r\n let cnt = 0;\r\n\r\n if (this._data.entity.references != null) {\r\n cnt = this._data.entity.references.length;\r\n }\r\n return title + ' (' + cnt + ')';\r\n }\r\n\r\n selectReference(r: Reference) {\r\n this._stateMap.currentReference = r;\r\n this._router.navigate(['staff/reference', r.referenceId, 'info']);\r\n }\r\n\r\n formatDate(year: number, month: number): string {\r\n if (year == null) {\r\n return '';\r\n }\r\n\r\n const m = (month == null) ? '' : ', ' + this._monthFullNames[month - 1];\r\n\r\n return (year + m);\r\n }\r\n\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
Now select a row from below or click 'Cancel'
\r\n
\r\n \r\n \r\n \r\n Project Name\r\n Created by\r\n \r\n \r\n \r\n \r\n {{a.projectName}}\r\n {{a.createdUser}}\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
","import { Component, ElementRef, OnInit } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { Project } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'project-selector',\r\n templateUrl: './project-selector.html',\r\n})\r\nexport class ProjectSelectorComponent extends ModalDialog implements OnInit {\r\n _searchTerm: string;\r\n _entities: Project[] = [];\r\n _pageState = new PageState('Journals');\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n this.refresh();\r\n }\r\n\r\n refresh() {\r\n this._pageState.isLoading = true;\r\n this._uow.projectRepository.all().then(r => {\r\n this._pageState.isLoaded = r;\r\n this._entities = _.sortBy(r, p => p.projectName.toLocaleLowerCase());\r\n });\r\n }\r\n\r\n onSelect(project: Project) {\r\n UtilFns.returnModal(this, project);\r\n }\r\n}\r\n\r\n","
\r\n
{{_adding ? \"Adding a Project\" : \"Editing a Project\" }}
\r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { EditorService, ErrorLogger, provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, LocationFns, UtilFns } from '../../utils/common';\r\nimport { EditPropParent, PageState } from '../../controls/common';\r\n\r\nimport { ProjectSelectorComponent } from './project-selector.component';\r\n\r\nimport { Project } from '../../entities/EntityModels';\r\n\r\nimport { STAFF_ROUTES } from './staff.routes';\r\n\r\nclass PageStateExt extends PageState {\r\n projectId: number;\r\n}\r\n\r\n@Component({\r\n selector: 'project-editor',\r\n templateUrl: './project-editor.html',\r\n providers: [provideParent(ProjectEditorComponent, EditPropParent)]\r\n})\r\nexport class ProjectEditorComponent implements OnInit, EditPropParent {\r\n @ViewChild(ProjectSelectorComponent, { static: true }) _projectSelectorComponent: ProjectSelectorComponent;\r\n\r\n _projects: Project[];\r\n _maxProjectId: number;\r\n _edm: EditManager;\r\n _adding: boolean;\r\n // this is not the same pageState that the _edm is using.\r\n _pageState = new PageStateExt('Project editor');\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService,\r\n public _location: Location, public _errorLogger: ErrorLogger, public _router: Router) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = STAFF_ROUTES.Project.name;\r\n this._edm = this._editorService.createEditManager(this, 'Project');\r\n this._edm.pageState.canShowMessage = false; // no page state messages.\r\n\r\n // setTimeout needed because of Angular RC5 bug where Location is not set correctly until\r\n // after timeout resolves.\r\n setTimeout(() => {\r\n const returned = LocationFns.updatePageState(this._location, this._stateMap, this._pageState, (state: PageStateExt) => {\r\n this._pageState.isLoading = true;\r\n this.getProjects().then((projects) => {\r\n const project = projects.find(p => p.projectId == state.projectId);\r\n if (project) {\r\n this.editProject(project);\r\n }\r\n });\r\n });\r\n if (!returned) {\r\n this._edm.editing = false;\r\n }\r\n }, 0);\r\n }\r\n\r\n getProjects() {\r\n if (this._projects) {\r\n return Promise.resolve(this._projects);\r\n }\r\n this._pageState.isLoading = true;\r\n return this._uow.projectRepository.all().then(r => {\r\n this._pageState.isLoaded = r;\r\n this._projects = r;\r\n this._maxProjectId = _.maxBy(r, item => item.projectId).projectId;\r\n return r;\r\n });\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n get entity() {\r\n return this._edm.currentEntity;\r\n }\r\n\r\n // Not really needed but in case this editor is ever used by non-staff.\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n\r\n onEdit() {\r\n UtilFns.showModal(this._projectSelectorComponent, this, null).then((p: Project) => {\r\n if (!p) {\r\n return;\r\n }\r\n this.editProject(p);\r\n });\r\n }\r\n\r\n editProject(p: Project) {\r\n if (p == null) {\r\n return;\r\n }\r\n this._adding = false;\r\n this._edm.onlyEntity = p;\r\n this._pageState.projectId = p.projectId;\r\n this._edm.editing = true;\r\n\r\n return p;\r\n }\r\n\r\n getError(propName: string) {\r\n const r = this.entity.getErrorFor(propName);\r\n return r;\r\n }\r\n\r\n\r\n // EditManager overrides\r\n\r\n onAddPromise() {\r\n\r\n return this.getProjects().then(() => {\r\n this._maxProjectId++;\r\n const project = this._edm.uow.projectFactory.create({ projectId: this._maxProjectId });\r\n this._adding = true;\r\n this._edm.onlyEntity = project;\r\n this._edm.editing = true;\r\n });\r\n }\r\n\r\n onDelete() {\r\n return this._stateMap.yesNoComponent.showModal('Delete entire Project',\r\n 'Are you sure?').then(ok => {\r\n if (ok) {\r\n this.deleteProject();\r\n }\r\n });\r\n }\r\n\r\n canSave() {\r\n if (!this._edm.hasEdits()) {\r\n return false;\r\n }\r\n // this._edm.canSaveCore does not include next line.\r\n if (!this._edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n onSave() {\r\n this._edm.onSaveCore().then(() => {\r\n this._pageState.projectId = this._edm.currentEntity.projectId;\r\n // refreshes the list of projects.\r\n this._projectSelectorComponent.refresh();\r\n this._adding = false;\r\n });\r\n }\r\n\r\n deleteProject() {\r\n const entitiesToSave = [this.entity];\r\n this._edm.onDeleteCore();\r\n\r\n return this._uow.commitSelected(entitiesToSave)\r\n .then(() => {\r\n this._edm.setSavedStatus('Deleted');\r\n // Next line is needed because the onDeleteCore above will have modified all\r\n // entities in cache that ref'd this material.\r\n this._uow.rollback();\r\n this._projectSelectorComponent.refresh();\r\n })\r\n .catch((e) => {\r\n this._edm.setSaveFailedStatus('Delete failed: ' + e);\r\n this._uow.rollback();\r\n });\r\n\r\n }\r\n\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
Now select a row from below or click 'Cancel'
\r\n
\r\n
\r\n

{{validationMessage}}

\r\n
\r\n \r\n \r\n \r\n Note\r\n Priority\r\n SAG\r\n \r\n \r\n \r\n \r\n {{e.note}}\r\n {{e.priority}}\r\n {{e.sAG}}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
","import { Component, ElementRef, Input, OnInit } from '@angular/core';\r\n\r\nimport { UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { FSAG } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'fsag-selector',\r\n templateUrl: './fsag-selector.html',\r\n})\r\nexport class FSAGSelectorComponent extends ModalDialog implements OnInit {\r\n @Input() FSAGs: FSAG[];\r\n _searchTerm: string;\r\n _entities: FSAG[] = [];\r\n _pageState = new PageState('Fragrance Structure Activity Groups');\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n this._entities = this.FSAGs;\r\n }\r\n\r\n canSearch() {\r\n // return this._searchTerm && this._searchTerm.length > 1;\r\n return true;\r\n }\r\n\r\n search() {\r\n this.validationMessage = null;\r\n\r\n this._entities = null;\r\n const term = (this._searchTerm || '').toLowerCase();\r\n this._entities = this.FSAGs.filter(f => f.normNote.indexOf(term) > -1);\r\n }\r\n\r\n reset() {\r\n this._entities = [];\r\n this._searchTerm = '';\r\n }\r\n\r\n onSelect(fsag: FSAG) {\r\n UtilFns.returnModal(this, fsag);\r\n }\r\n\r\n\r\n}\r\n\r\n","
\r\n
{{_adding ? \"Adding an FSAG\" : \"Editing an FSAG\" }}
\r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n
\r\n {{getMaterialsCountText()}}\r\n \r\n
\r\n
\r\n \r\n Show images\r\n
\r\n \r\n \r\n \r\n CAS #\r\n RIFM ID\r\n Principal Name\r\n Structure\r\n \r\n \r\n \r\n \r\n \r\n \r\n {{e.material.realCASNumber}}\r\n \r\n {{e.material.formattedRIFMId}}\r\n {{e.material.principalSynonym().synonymWordOrWebVersion()}}\r\n \r\n Detach\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n\r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { EntityState } from 'breeze-client';\r\nimport * as _ from 'lodash';\r\n\r\nimport { EditorService, ErrorLogger, MolImageService, provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, LocationFns, UtilFns } from '../../utils/common';\r\nimport { EditPropParent, PageState, } from '../../controls/common';\r\n\r\nimport { FSAGSelectorComponent } from './fsag-selector.component';\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\n\r\nimport { FSAG, MaterialFSAG } from '../../entities/EntityModels';\r\nimport { MaterialListItem } from '../../entities/projections/MaterialListItem';\r\n\r\nimport { STAFF_ROUTES } from './staff.routes';\r\nimport * as pluralize from 'pluralize';\r\n\r\nclass PageStateExt extends PageState {\r\n sAGID: number;\r\n}\r\n\r\n@Component({\r\n selector: 'fsag-editor',\r\n templateUrl: './fsag-editor.html',\r\n providers: [provideParent(FSAGEditorComponent, EditPropParent)]\r\n})\r\nexport class FSAGEditorComponent implements OnInit, EditPropParent {\r\n @ViewChild(FSAGSelectorComponent) _fsagSelectorComponent: FSAGSelectorComponent;\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n\r\n _FSAGs: FSAG[];\r\n _maxId: number;\r\n _materialFSAGs: MaterialFSAG[];\r\n _edm: EditManager;\r\n _adding: boolean;\r\n // this is not the same pageState that the _edm is using.\r\n _pageState = new PageStateExt('FSAG editor');\r\n\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService,\r\n public _molImageService: MolImageService, public _location: Location,\r\n public _errorLogger: ErrorLogger) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = STAFF_ROUTES.FSAG.name;\r\n this._edm = this._editorService.createEditManager(this, 'FSAG');\r\n this._edm.pageState.canShowMessage = false; // no page state messages.\r\n this._maxId = 0;\r\n this._pageState.isLoading = true;\r\n this._uow.fSAGRepository.all().then(r => {\r\n r.forEach(f => {\r\n this._maxId = Math.max(this._maxId, f.sAGID);\r\n });\r\n this._FSAGs = r;\r\n this.sortFSAGs();\r\n this._pageState.isLoaded = true;\r\n\r\n const returned = LocationFns.updatePageState(this._location, this._stateMap, this._pageState, (state: PageStateExt) => {\r\n this.fetchFSAG(state.sAGID);\r\n });\r\n\r\n if (!returned) {\r\n this._edm.editing = false;\r\n }\r\n });\r\n\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n get entity() {\r\n return this._edm.currentEntity;\r\n }\r\n\r\n // Not really needed but in case this editor is ever used by non-staff.\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n getDescription(sAGID: number) {\r\n const fsag = this.findFSAG(sAGID);\r\n return fsag ? fsag.note : '';\r\n }\r\n\r\n findFSAG(sAGID: number) {\r\n if (sAGID == null) {\r\n return null;\r\n }\r\n return this._FSAGs.find(fsag => fsag.sAGID == sAGID);\r\n }\r\n\r\n onNoteChange() {\r\n const parts = this.entity.note.split('/');\r\n this.entity.sAG = parts[parts.length - 1];\r\n }\r\n\r\n onSelectParent() {\r\n UtilFns.showModal(this._fsagSelectorComponent, this, this.validateParent).then((fsag: FSAG) => {\r\n if (!fsag) {\r\n return;\r\n }\r\n const prevParent = this.findFSAG(this.entity.parent);\r\n this.entity.parent = fsag.sAGID;\r\n if (fsag.child == null) {\r\n fsag.child = this.entity.sAGID;\r\n }\r\n if (prevParent.child == this.entity.sAGID) {\r\n prevParent.child = null;\r\n }\r\n\r\n });\r\n }\r\n\r\n validateParent(fsag: FSAG): string {\r\n if (this.entity.sAGID == fsag.sAGID) {\r\n return `FSAG cannot have itself as a parent`;\r\n }\r\n if (this.entity.child == fsag.parent) {\r\n return `'Cannot select this FSAG's child as a parent`;\r\n }\r\n }\r\n\r\n onEdit() {\r\n UtilFns.showModal(this._fsagSelectorComponent, this, null).then((fsag: FSAG) => {\r\n if (!fsag) {\r\n return;\r\n }\r\n this.editFSAG(fsag);\r\n\r\n });\r\n }\r\n\r\n onAttachMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this, this.validateMaterial).then(mli => {\r\n if (mli == null) {\r\n return;\r\n }\r\n const config = {\r\n materialId: mli.materialId,\r\n sAGID: this.entity.sAGID\r\n };\r\n\r\n const fsag = this._uow.materialFSAGFactory.create(config);\r\n // fetch the material so that it can appear in table\r\n this._uow.materialRepository.withId(mli.materialId).then(m => {\r\n if (this.entity.entityAspect.entityState.isUnchanged()) {\r\n this.entity.entityAspect.setEntityState(EntityState.Modified);\r\n }\r\n this._materialFSAGs.push(fsag);\r\n });\r\n\r\n });\r\n }\r\n\r\n onDetachMaterial(mf: MaterialFSAG) {\r\n if (mf.entityAspect.entityState.isAdded()) {\r\n mf.entityAspect.rejectChanges();\r\n } else {\r\n this.entity.entityAspect.setEntityState(EntityState.Modified);\r\n mf.entityAspect.setDeleted();\r\n }\r\n // this._materialFSAGs = this._materialFSAGs.filter(item => item != mf);\r\n _.remove(this._materialFSAGs, item => item == mf);\r\n }\r\n\r\n validateMaterial(mli: MaterialListItem): string {\r\n if (this._materialFSAGs.some(m => m.materialId == mli.materialId)) {\r\n return `Material: ${mli.realCASNumber} has already been referenced`;\r\n }\r\n }\r\n\r\n fetchFSAG(sAGID: number) {\r\n const fsag = this._FSAGs.find(f => f.sAGID == sAGID);\r\n if (fsag) {\r\n this.editFSAG(fsag);\r\n }\r\n }\r\n\r\n\r\n editFSAG(fsag: FSAG) {\r\n if (fsag == null) {\r\n return;\r\n }\r\n this._adding = false;\r\n this._edm.onlyEntity = fsag;\r\n this._pageState.sAGID = fsag.sAGID;\r\n this._edm.editing = true;\r\n this._materialFSAGs = null;\r\n const p = { materialId: null, sagId: fsag.sAGID };\r\n this._uow.materialFSAGRepository.whereWithParams(p).then(r => {\r\n this._materialFSAGs = r;\r\n });\r\n return fsag;\r\n }\r\n\r\n createFSAG() {\r\n this._maxId = this._maxId + 1;\r\n const p = {\r\n sAGID: this._maxId\r\n };\r\n const fsag = this._edm.uow.fSAGFactory.create(p);\r\n return fsag;\r\n }\r\n\r\n getMaterialsCountText() {\r\n const l = this._materialFSAGs.length;\r\n return `${l} ${pluralize('material', l)} found`;\r\n }\r\n\r\n getError(propName: string) {\r\n const r = this.entity.getErrorFor(propName);\r\n return r;\r\n }\r\n\r\n getMaterialImageUrl(m: MaterialFSAG) {\r\n return this._molImageService.getImageUrlForMaterial(m.material.materialId);\r\n }\r\n\r\n\r\n // EditManager overrides\r\n\r\n onAdd() {\r\n this._adding = true;\r\n const e = this.createFSAG();\r\n this._edm.onlyEntity = e;\r\n this._edm.editing = true;\r\n this._materialFSAGs = [];\r\n\r\n }\r\n\r\n onDelete() {\r\n return this._stateMap.yesNoComponent.showModal('Delete entire FSAG',\r\n 'Are you sure?').then(ok => {\r\n if (ok) {\r\n this.deleteFSAG();\r\n }\r\n });\r\n }\r\n\r\n onCancel() {\r\n const wasAdding = this.entity.entityAspect.entityState.isAdded();\r\n this._uow.rollback();\r\n if (wasAdding) {\r\n this._edm.editing = false;\r\n } else {\r\n this.editFSAG(this.entity);\r\n }\r\n\r\n }\r\n\r\n canSave() {\r\n if (!this._edm.hasEdits()) {\r\n return false;\r\n }\r\n // this._edm.canSaveCore does not include next line.\r\n if (!this._edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n onSave() {\r\n const wasAdded = this.entity.entityAspect.entityState.isAdded();\r\n this._edm.onSaveCore().then(() => {\r\n this._pageState.sAGID = this._edm.currentEntity.sAGID;\r\n if (wasAdded) {\r\n this._FSAGs.push(this.entity);\r\n this._fsagSelectorComponent.reset();\r\n this.sortFSAGs();\r\n }\r\n });\r\n }\r\n\r\n sortFSAGs() {\r\n UtilFns.sort(this._FSAGs, true, f => (f.note || '').toLowerCase());\r\n }\r\n\r\n deleteFSAG() {\r\n if (this.entity.entityAspect.entityState.isAdded()) {\r\n this._uow.rollback();\r\n this._edm.editing = false;\r\n return;\r\n }\r\n _.remove(this._FSAGs, this.entity);\r\n this._fsagSelectorComponent.reset();\r\n this._materialFSAGs.forEach(mf => {\r\n if (mf.entityAspect.entityState.isAdded()) {\r\n mf.entityAspect.rejectChanges();\r\n } else {\r\n mf.entityAspect.setDeleted();\r\n }\r\n });\r\n this._edm.onDeleteCore();\r\n return this._uow.commit().then(() => {\r\n this._edm.setSavedStatus('Deleted');\r\n // Next line is needed because the onDeleteCore above will have modified all\r\n // entities in cache that ref'd this material.\r\n this._uow.rollback();\r\n this._edm.editing = false;\r\n }).catch((e) => {\r\n this._edm.setSaveFailedStatus('Delete failed: ' + e);\r\n });\r\n\r\n }\r\n\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
Now select a row from below or click 'Cancel'
\r\n
\r\n
\r\n

{{validationMessage}}

\r\n
\r\n \r\n \r\n \r\n Id\r\n Label\r\n Description\r\n Inverse Id\r\n \r\n \r\n \r\n \r\n {{e.typeReferenceRelationId}}\r\n {{e.label}}\r\n {{e.description}}\r\n {{e.inverseTypeReferenceRelationId}}\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
","import { Component, ElementRef, Input, OnInit } from '@angular/core';\r\n\r\nimport { UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { TypeReferenceRelation } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'type-reference-relation-selector',\r\n templateUrl: './type-reference-relation-selector.html',\r\n})\r\nexport class TypeReferenceRelationSelectorComponent extends ModalDialog implements OnInit {\r\n @Input() typeReferenceRelations: TypeReferenceRelation[] = [];\r\n _searchTerm: string;\r\n _entities: TypeReferenceRelation[] = [];\r\n _pageState = new PageState('Reference Relation Types');\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n this._entities = this.typeReferenceRelations;\r\n }\r\n\r\n canSearch() {\r\n return true;\r\n }\r\n\r\n search() {\r\n this.validationMessage = null;\r\n\r\n this._entities = null;\r\n const term = (this._searchTerm || '').toLowerCase();\r\n this._entities = this.typeReferenceRelations.filter(f => f.label.toLowerCase().indexOf(term) > -1);\r\n }\r\n\r\n\r\n onSelect(typeReferenceRelation: TypeReferenceRelation) {\r\n UtilFns.returnModal(this, typeReferenceRelation);\r\n }\r\n\r\n\r\n}\r\n\r\n","
\r\n
{{_adding ? \"Adding an Reference Relation Type\" : \"Editing an Reference Relation Type\" }}
\r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n
\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n
\r\n\r\n\r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport { EditorService, provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, LocationFns, UtilFns } from '../../utils/common';\r\nimport { EditPropParent, PageState } from '../../controls/common';\r\n\r\nimport { TypeReferenceRelationSelectorComponent } from './type-reference-relation-selector.component';\r\n\r\nimport { TypeReferenceRelation } from '../../entities/EntityModels';\r\n\r\nimport { STAFF_ROUTES } from './staff.routes';\r\n\r\nclass PageStateExt extends PageState {\r\n typeReferenceRelationId: string;\r\n}\r\n\r\n// TODO: Review this later - discuss removing foreign key check\r\n// NOTE: This component is complicated by two issues.\r\n// 1) The TypeReferenceRelations table has a inverse reference id that points to the same table that has a foreign key check on it.\r\n// This means that we cannot save a record and its inverse in a single transaction because the first will fail the fk check.\r\n// So instead we have to insert the first record with a null inv id and then in a 2nd trx update the inv id and create the\r\n// inverse entity.\r\n// 2) The primary key is a user defined string - the problem is that we can't allow this field to be edited directly\r\n// like with other editors because we need to check if the key collides with other pks.\r\n\r\n@Component({\r\n selector: 'type-reference-relation-editor',\r\n templateUrl: './type-reference-relation-editor.html',\r\n providers: [provideParent(TypeReferenceRelationEditorComponent, EditPropParent)]\r\n})\r\nexport class TypeReferenceRelationEditorComponent implements OnInit, EditPropParent {\r\n @ViewChild(TypeReferenceRelationSelectorComponent) _selectorComponent: TypeReferenceRelationSelectorComponent;\r\n\r\n _entities: TypeReferenceRelation[];\r\n _adding = false;\r\n _edm: EditManager;\r\n _inverseId: string;\r\n _inverseLabel: string;\r\n _inverseDescription: string;\r\n\r\n\r\n _pageState = new PageStateExt('Reference Relation Type editor');\r\n\r\n // can't actually create an entity in this editor until both sides are known ( entity and invEntity)\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location,\r\n private _editorService: EditorService) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = STAFF_ROUTES.TypeReferenceRelation.name;\r\n this._edm = this._editorService.createEditManager(this, 'TypeReferenceRelation');\r\n this._pageState.isLoading = true;\r\n this.refresh()\r\n .then(() => {\r\n this._pageState.isLoaded = true;\r\n\r\n const returned = LocationFns.updatePageState(this._location, this._stateMap, this._pageState, (state: PageStateExt) => {\r\n this.fetch(state.typeReferenceRelationId);\r\n });\r\n\r\n if (!returned) {\r\n this._edm.editing = false;\r\n }\r\n });\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.editing;\r\n }\r\n\r\n get entity() {\r\n return this._edm.currentEntity;\r\n }\r\n\r\n refresh() {\r\n return this._uow.typeReferenceRelationRepository.all().then(r => {\r\n this._entities = r;\r\n return r;\r\n });\r\n }\r\n\r\n\r\n // Not really needed but in case this editor is ever used by non-staff.\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n onEdit() {\r\n UtilFns.showModal(this._selectorComponent, this, null).then((entity: TypeReferenceRelation) => {\r\n this.editEntity(entity);\r\n\r\n });\r\n }\r\n\r\n findEntity(typeReferenceRelationId: string) {\r\n if (typeReferenceRelationId == null) {\r\n return null;\r\n }\r\n return this._entities.find(f => f.typeReferenceRelationId == typeReferenceRelationId);\r\n }\r\n\r\n\r\n fetch(typeReferenceRelationId: string) {\r\n const entity = this.findEntity(typeReferenceRelationId);\r\n if (entity) {\r\n this.editEntity(entity);\r\n }\r\n }\r\n\r\n editEntity(entity: TypeReferenceRelation) {\r\n if (entity == null) {\r\n return;\r\n }\r\n this._adding = false;\r\n this._edm.onlyEntity = entity;\r\n this._pageState.typeReferenceRelationId = entity.typeReferenceRelationId;\r\n let inv = this.entity.inverseTypeReferenceRelation;\r\n if (!inv) {\r\n inv = this.entity;\r\n } // if no inverse - make it its own inverse\r\n this._inverseId = inv.typeReferenceRelationId;\r\n this._inverseLabel = inv.label;\r\n this._inverseDescription = inv.description;\r\n this._edm.editing = true;\r\n return entity;\r\n }\r\n\r\n getError(propName: string) {\r\n let val: any;\r\n if (propName.substr(0, 1) == '_') {\r\n val = this[propName] && this[propName].trim();\r\n } else {\r\n val = this.entity[propName] && this.entity[propName].trim();\r\n }\r\n\r\n if (this._adding && (propName == 'typeReferenceRelationId' || propName == '_inverseId')) {\r\n if (this._entities.find(e => e.typeReferenceRelationId == val) != null) {\r\n return 'This id has already been used';\r\n }\r\n }\r\n\r\n if (propName == 'typeReferenceRelationId' || propName == '_inverseId' || propName == '_inverseLabel') {\r\n return (val && val.length) ? null : 'This is a required field';\r\n }\r\n const r = this.entity.getErrorFor(propName);\r\n\r\n return r;\r\n\r\n }\r\n\r\n setId(id: string) {\r\n try {\r\n id = this.entity.typeReferenceRelationId = id && id.trim().toUpperCase();\r\n this.entity.typeReferenceRelationId = id;\r\n if (id.indexOf('HAS') == 0) {\r\n this._inverseId = id.substr(3);\r\n } else {\r\n this._inverseId = 'HAS' + id;\r\n }\r\n } catch (e) {\r\n // will fail if this collides with an existing id;\r\n this.entity.typeReferenceRelationId = ' ';\r\n\r\n }\r\n }\r\n\r\n onAdd() {\r\n this._adding = true;\r\n const e = this.createEntity();\r\n this._edm.onlyEntity = e;\r\n this._edm.editing = true;\r\n this._inverseId = '';\r\n this._inverseLabel = '';\r\n this._inverseDescription = '';\r\n\r\n }\r\n\r\n\r\n onDelete() {\r\n const id = this.entity.typeReferenceRelationId;\r\n return this._uow.fetch('References/CountReferenceRelationsByType', { typeReferenceRelationId: id }).then(r => {\r\n if (r.length == 0 || r[0] != 0) {\r\n this._stateMap.yesNoComponent.showModal('Cannot delete',\r\n `There are ${r.length && r[0]} ReferenceRelations that still reference this type, you must change these references before you can delete this type.`, ['Ok']);\r\n return;\r\n }\r\n return this._stateMap.yesNoComponent.showModal('Delete entire Reference Relation Type', 'Are you sure?');\r\n }).then(ok => {\r\n if (ok) {\r\n this.deleteEntity();\r\n }\r\n });\r\n }\r\n\r\n onCancel() {\r\n const wasAdding = this.entity.entityAspect.entityState.isAdded();\r\n this._uow.rollback();\r\n if (wasAdding) {\r\n this._edm.editing = false;\r\n } else {\r\n this.editEntity(this.entity);\r\n }\r\n\r\n }\r\n\r\n canSave() {\r\n if (!this._edm.hasEdits()) {\r\n return false;\r\n }\r\n // this._edm.canSaveCore does not include next line.\r\n if (!this._edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n updateInv() {\r\n if (!this._adding) {\r\n const inv = this.entity.inverseTypeReferenceRelation;\r\n inv.label = this._inverseLabel;\r\n inv.description = this._inverseDescription;\r\n }\r\n }\r\n\r\n onSave() {\r\n const wasAdded = this.entity.entityAspect.entityState.isAdded();\r\n\r\n return this._uow.commit().then(() => {\r\n if (wasAdded) {\r\n this.entity.inverseTypeReferenceRelationId = this._inverseId;\r\n const p = {\r\n typeReferenceRelationId: this.entity.inverseTypeReferenceRelationId,\r\n label: this._inverseLabel,\r\n description: this._inverseDescription,\r\n inverseTypeReferenceRelationId: this.entity.typeReferenceRelationId\r\n };\r\n this._uow.typeReferenceRelationFactory.create(p);\r\n return this._uow.commit();\r\n }\r\n }).then(() => {\r\n this._edm.setSavedStatus();\r\n this._pageState.typeReferenceRelationId = this._edm.currentEntity.typeReferenceRelationId;\r\n\r\n if (wasAdded) {\r\n this._entities.push(this.entity);\r\n this._entities.push(this.entity.inverseTypeReferenceRelation);\r\n this.refresh();\r\n this.sortEntities();\r\n this._selectorComponent.search();\r\n }\r\n this._adding = false;\r\n }).catch(e => {\r\n this._edm.handleSaveError(e);\r\n });\r\n\r\n }\r\n\r\n createEntity() {\r\n const p1 = {\r\n typeReferenceRelationId: ' ' // blank\r\n };\r\n const entity = this._uow.typeReferenceRelationFactory.create(p1);\r\n return entity;\r\n }\r\n\r\n\r\n deleteEntity() {\r\n const entity = this.entity;\r\n if (entity.entityAspect.entityState.isAdded()) {\r\n this._uow.rollback();\r\n this._edm.editing = false;\r\n return;\r\n }\r\n const inv = entity.inverseTypeReferenceRelation;\r\n entity.inverseTypeReferenceRelationId = null;\r\n if (inv) {\r\n inv.inverseTypeReferenceRelationId = null;\r\n }\r\n return this._uow.commit().then(() => {\r\n entity.entityAspect.setDeleted();\r\n _.remove(this._entities, e => e == entity);\r\n if (inv) {\r\n inv.entityAspect.setDeleted();\r\n _.remove(this._entities, e => inv == e);\r\n }\r\n return this._uow.commit();\r\n }).then(() => {\r\n this._edm.setSavedStatus('Deleted');\r\n this._edm.editing = false;\r\n this.refresh();\r\n this._selectorComponent.search();\r\n }).catch((e) => {\r\n this._edm.setSaveFailedStatus('Delete failed: ' + e);\r\n });\r\n\r\n }\r\n\r\n sortEntities() {\r\n UtilFns.sort(this._entities, true, f => (f.label).toLowerCase());\r\n }\r\n\r\n toUpperCase(s: string) {\r\n if (!s) {\r\n return s;\r\n }\r\n return s.toUpperCase();\r\n }\r\n\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
Now select a row from below or click 'Cancel'
\r\n
\r\n \r\n \r\n \r\n Title\r\n Content\r\n Enabled\r\n Created\r\n \r\n \r\n \r\n \r\n {{e.title}}\r\n {{e.content}}\r\n \r\n {{_stateMap.utilFns.formatDate(e.created)}}\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
","import { Component, ElementRef, OnInit } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { Announcement } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'whats-new-selector',\r\n templateUrl: './whats-new-selector.html'\r\n})\r\nexport class WhatsNewSelectorComponent extends ModalDialog implements OnInit {\r\n _searchTerm: string;\r\n _entities: Announcement[] = [];\r\n _pageState = new PageState('What\\'s New items');\r\n\r\n // stateMap is used within the html\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork, public _stateMap: StateMap) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n this.refresh();\r\n }\r\n\r\n refresh() {\r\n this._pageState.isLoading = true;\r\n this._uow.announcementRepository.all().then(r => {\r\n this._pageState.isLoaded = r;\r\n this._entities = _.orderBy(r, a => a.created, 'desc');\r\n });\r\n }\r\n\r\n onSelect(announcement: Announcement) {\r\n UtilFns.returnModal(this, announcement);\r\n }\r\n\r\n\r\n}\r\n\r\n","
\r\n
{{_adding ? \"Adding a What's New item'\" : \"Editing a What's New item\" }}
\r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\n\r\nimport { EditorService, ErrorLogger, provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, UtilFns } from '../../utils/common';\r\nimport { EditPropParent, PageState } from '../../controls/common';\r\n\r\nimport { WhatsNewSelectorComponent } from './whats-new-selector.component';\r\n\r\nimport { Announcement } from '../../entities/EntityModels';\r\nimport { STAFF_ROUTES } from './staff.routes';\r\n\r\n\r\n@Component({\r\n selector: 'whats-new-editor',\r\n templateUrl: './whats-new-editor.html',\r\n providers: [provideParent(WhatsNewEditorComponent, EditPropParent)]\r\n})\r\nexport class WhatsNewEditorComponent implements OnInit, EditPropParent {\r\n @ViewChild(WhatsNewSelectorComponent, { static: true }) _whatsNewSelectorComponent: WhatsNewSelectorComponent;\r\n\r\n\r\n _maxProjectId: number;\r\n _edm: EditManager;\r\n _adding: boolean;\r\n // this is not the same pageState that the _edm is using.\r\n _pageState = new PageState(`What's New editor`);\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService,\r\n public _errorLogger: ErrorLogger) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = STAFF_ROUTES.WhatsNew.name;\r\n this._edm = this._editorService.createEditManager(this, 'Announcement');\r\n this._edm.pageState.canShowMessage = false; // no page state messages.\r\n this._edm.editing = false;\r\n\r\n }\r\n\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n get entity() {\r\n return this._edm.currentEntity;\r\n }\r\n\r\n // Not really needed but in case this editor is ever used by non-staff.\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n\r\n onEdit() {\r\n UtilFns.showModal(this._whatsNewSelectorComponent, this, null).then((ann: Announcement) => {\r\n if (!ann) {\r\n return;\r\n }\r\n this.editAnnouncement(ann);\r\n });\r\n }\r\n\r\n editAnnouncement(ann: Announcement) {\r\n if (ann == null) {\r\n return;\r\n }\r\n this._adding = false;\r\n this._edm.onlyEntity = ann;\r\n\r\n this._edm.editing = true;\r\n\r\n return ann;\r\n }\r\n\r\n getError(propName: string) {\r\n const r = this.entity.getErrorFor(propName);\r\n return r;\r\n }\r\n\r\n\r\n // EditManager overrides\r\n\r\n onAdd() {\r\n const ann = this._edm.uow.announcementFactory.create();\r\n this._adding = true;\r\n this._edm.onlyEntity = ann;\r\n this._edm.editing = true;\r\n\r\n }\r\n\r\n onDelete() {\r\n return this._stateMap.yesNoComponent.showModal('Delete entire Announcement',\r\n 'Are you sure?').then(ok => {\r\n if (ok) {\r\n this.deleteAnnouncement();\r\n }\r\n });\r\n }\r\n\r\n canSave() {\r\n if (!this._edm.hasEdits()) {\r\n return false;\r\n }\r\n // this._edm.canSaveCore does not include next line.\r\n if (!this._edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n onSave() {\r\n this._edm.onSaveCore().then(() => {\r\n // refreshes the list of projects.\r\n this._whatsNewSelectorComponent.refresh();\r\n this._adding = false;\r\n });\r\n }\r\n\r\n deleteAnnouncement() {\r\n // delete children\r\n this.entity.announcementDetails.map(ad => ad).forEach(ad => {\r\n if (ad.entityAspect.entityState.isAdded()) {\r\n ad.entityAspect.rejectChanges();\r\n } else {\r\n ad.entityAspect.setDeleted();\r\n }\r\n });\r\n this._edm.onDeleteCore();\r\n return this._uow.commit().then(() => {\r\n }).then(() => {\r\n this._edm.setSavedStatus('Deleted');\r\n // Next line is needed because the onDeleteCore above will have modified all\r\n // entities in cache that ref'd this material.\r\n this._uow.rollback();\r\n this._whatsNewSelectorComponent.refresh();\r\n }).catch((e) => {\r\n this._uow.rollback();\r\n this._edm.setSaveFailedStatus('Delete failed: ' + e);\r\n });\r\n\r\n }\r\n\r\n}\r\n","import { Directive } from '@angular/core';\r\n\r\n// This is a NOOP directive - it is there simply to insure that Angular does not throw an\r\n// error when it discovers an 'unknown' tag 'datepicker'. This is a HACK.\r\n\r\n// Example:\r\n// \r\n@Directive({\r\n selector: 'datepicker',\r\n})\r\nexport class DatePickerDirective {\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n Workflow Activity Report\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
ActionCompleted CountBothRIFMFEMA
\r\n \r\n \r\n \r\n \r\n \r\n {{group.name}}\r\n
{{actions.typeWorkflowActionId}}{{actions.count}}{{actions.countBoth}}{{actions.countRIFM}}{{actions.countFEMA}}
\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n\r\n\r\n","import { Component, Input, OnChanges, OnInit, ViewChild } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { WorkflowActivityReportItem } from '../../entities/projections/WorkflowActivityReportItem';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PrintToPdfDocComponent } from '../main/print-to-pdf-doc.component';\r\n\r\n\r\n@Component({\r\n selector: 'workflow-activity-report',\r\n templateUrl: './workflow-activity-report.html',\r\n})\r\nexport class WorkflowActivityReportComponent implements OnInit, OnChanges {\r\n _groups: {};\r\n _activityGroups: { name: string, workflowCompletedActions: WorkflowActivityReportItem[], collapsed?: boolean }[] = [];\r\n\r\n @ViewChild(PrintToPdfDocComponent, { static: true }) _printToPdfDocComponent: PrintToPdfDocComponent;\r\n\r\n @Input() reportItems: WorkflowActivityReportItem[];\r\n\r\n ngOnInit() {\r\n }\r\n\r\n ngOnChanges() {\r\n this.groupData();\r\n }\r\n\r\n expandAll(expand: boolean) {\r\n setTimeout(() => {\r\n this._activityGroups.forEach(g => g.collapsed = !expand);\r\n }, 0);\r\n }\r\n\r\n expCollapse(ix: number) {\r\n this._activityGroups[ix].collapsed = !this._activityGroups[ix].collapsed;\r\n }\r\n\r\n groupData() {\r\n\r\n const groups = _.groupBy(this.reportItems, a => a.staffFirstName);\r\n\r\n this._activityGroups = _.map(groups, (v, k) => {\r\n return { name: k, workflowCompletedActions: v, isCollapsed: false };\r\n });\r\n\r\n this._activityGroups = _.sortBy(this._activityGroups, (g) => g.name);\r\n\r\n }\r\n\r\n hasReportData(): boolean {\r\n return (this.reportItems != null && this.reportItems.length > 0);\r\n }\r\n\r\n printWorkflowActivityReport() {\r\n const ele = document.querySelector('#WorkflowActivityReport .modal-content');\r\n UtilFns.printElement(ele);\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n Assigned To: \r\n \r\n
\r\n\r\n
\r\n Created By:\r\n \r\n
\r\n\r\n
\r\n Created Date:\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n From date\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n To date\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n {{_filterErrorMsg}}\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n {{stillLoadingMsg}}\r\n
\r\n\r\n
\r\n
\r\n {{'Summary Counts for ' + filterName}}\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n {{lc.label + \" (\" + lc.count + \")\"}}\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n {{'Pending Task Details for ' + filterName}}\r\n
\r\n
\r\n \r\n \r\n \r\n \t\t*\r\n\t \tindicates a reference with tox data that is still unproofed.\r\n \t\tH\r\n\t \tindicates a reference that is marked as On Hold.\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n {{group.name}} {{'(' + group.pendingWorkflowRecordedActions.length + ')'}}\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Ref IdBrief ReferenceTypeRIFM/FEMAPriorityCreated ByTitle
{{action.referenceId}}*H{{action.briefReference}}R M{{action.articleType}}{{action.precedence}}{{action.createdContactFirstName}}\r\n {{action.title}}\r\n {{\"Hold Reason: \" + action.holdReason}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { TypeWorkflowContact, WorkflowRecordedAction } from '../../entities/EntityModels';\r\nimport { LabelAndCount } from '../../entities/projections/LabelAndCount';\r\nimport { WorkflowActionFilters } from '../../entities/projections/WorkflowActionFilters';\r\nimport { WorkflowActivityReportItem } from '../../entities/projections/WorkflowActivityReportItem';\r\nimport { WorkflowPendingReportItem } from '../../entities/projections/WorkflowPendingReportItem';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ROUTES } from '../routes';\r\nimport { STAFF_ROUTES } from './staff.routes';\r\n\r\n@Component({\r\n selector: 'reference-workflow-stats',\r\n templateUrl: './reference-workflow-stats.html',\r\n})\r\nexport class ReferenceWorkflowStatsComponent implements OnInit {\r\n _filterWorkflowContact: TypeWorkflowContact = null;\r\n _filterTaskCompletedByContact: TypeWorkflowContact = null;\r\n _fromDateString: string; // workaround for datepicker flicker\r\n _toDateString: string;\r\n _staffContact: TypeWorkflowContact;\r\n _pendingTasks: WorkflowPendingReportItem[] = [];\r\n _groups: {};\r\n _workflowGroups: { name: string, pendingWorkflowRecordedActions: WorkflowPendingReportItem[], collapsed?: boolean }[] = [];\r\n _pendingTaskCounts: LabelAndCount[];\r\n _typeWorkflowContacts: TypeWorkflowContact[];\r\n _typeCompletedByContacts: TypeWorkflowContact[];\r\n _isLoading = false;\r\n _hasWorkflowData = false;\r\n _showFinishDataActions = false;\r\n _currentFilters: WorkflowActionFilters;\r\n _filterErrorMsg: string;\r\n _reportItems: WorkflowActivityReportItem[];\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._isLoading = true;\r\n\r\n // Initialize the combined filters variable\r\n this._currentFilters = {\r\n fromDate: null,\r\n toDate: null,\r\n workflowContactId: 0,\r\n createdContactId: 0,\r\n createdUser: null,\r\n actionIds: null\r\n };\r\n\r\n this._stateMap.currentRouteName = STAFF_ROUTES.RefWorkflowStats.name;\r\n\r\n // Load Staff/Contact information then Workflow data\r\n // Remote consultants should only see their own work\r\n this._uow.typeWorkflowContactRepository.all()\r\n .then(c => {\r\n\r\n this._typeWorkflowContacts = c.filter(s => s.workflowStaff == true);\r\n this._typeCompletedByContacts = c.filter(s => s.workflowStaff == true);\r\n\r\n this._typeWorkflowContacts = _.sortBy(this._typeWorkflowContacts, x => x.firstName);\r\n this._typeCompletedByContacts = _.sortBy(this._typeCompletedByContacts, x => x.firstName);\r\n\r\n // Check to see if the current user is a workflow staff and a consultant\r\n const contact = this._typeWorkflowContacts.filter(x => x.emailAddress.toUpperCase() === this._userManager.currentUser.name.toUpperCase());\r\n if (contact != null && contact.length > 0) {\r\n this._staffContact = contact[0];\r\n }\r\n\r\n // Default item for all staff records, workflow staff can see any action completed/created by any staff member, as long as they are assigned to the reference.\r\n const allFilter = new TypeWorkflowContact();\r\n allFilter.firstName = 'All Staff';\r\n allFilter.workflowContactId = 0;\r\n\r\n this._typeCompletedByContacts.unshift(allFilter);\r\n this._filterTaskCompletedByContact = this._typeCompletedByContacts[0];\r\n this._currentFilters.createdContactId = 0;\r\n\r\n if (this._staffContact != null && this._staffContact.consultant) { // Then only show Consultants their own assigned tasks\r\n\r\n this._filterWorkflowContact = this._staffContact;\r\n this._currentFilters.workflowContactId = this._filterWorkflowContact.workflowContactId;\r\n\r\n this.fetchFilteredPendingTaskCounts();\r\n\r\n this._typeWorkflowContacts = []; // Clear list\r\n this._typeWorkflowContacts.push(this._staffContact); // Only show the consultant in the drop down list of staff\r\n this._isLoading = false;\r\n\r\n } else {\r\n this.fetchPendingTaskCounts(); // All staff assignments\r\n this._typeWorkflowContacts.unshift(allFilter);\r\n this._filterWorkflowContact = this._typeWorkflowContacts[0];\r\n this._currentFilters.workflowContactId = 0;\r\n }\r\n });\r\n }\r\n\r\n private fetchPendingTaskCounts() {\r\n\r\n this._filterErrorMsg = '';\r\n this._pendingTaskCounts = [];\r\n this._isLoading = true;\r\n this._hasWorkflowData = false;\r\n this._workflowGroups = [];\r\n\r\n this._uow.fetch('Workflow/FetchWorkflowTaskCounts', {}).then(r => {\r\n this._pendingTaskCounts = r;\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n private fetchFilteredPendingTaskCounts() {\r\n\r\n this._pendingTaskCounts = [];\r\n this._isLoading = true;\r\n this._hasWorkflowData = false;\r\n this._workflowGroups = [];\r\n\r\n\r\n const params = {\r\n actionIds: (this._currentFilters.actionIds != null && this._currentFilters.actionIds.length > 0) ? this._currentFilters.actionIds : null,\r\n fromDate: (this._currentFilters.fromDate != null) ? this.formatDateToString(this._currentFilters.fromDate) : null,\r\n toDate: (this._currentFilters.toDate != null) ? this.formatDateToString(this._currentFilters.toDate) : null,\r\n workflowContactId: this._currentFilters.workflowContactId,\r\n createdContactId: this._currentFilters.createdContactId,\r\n createdUser: this._currentFilters.createdUser\r\n };\r\n\r\n this._uow.fetch('Workflow/FetchFilteredWorkflowTaskCounts', params).then(r => {\r\n this._pendingTaskCounts = r;\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n private fetchFilteredPendingActions() {\r\n\r\n this._filterErrorMsg = '';\r\n this._workflowGroups = [];\r\n\r\n this._isLoading = true;\r\n\r\n const params = {\r\n actionIds: (this._currentFilters.actionIds != null && this._currentFilters.actionIds.length > 0) ? this._currentFilters.actionIds : null,\r\n fromDate: (this._currentFilters.fromDate != null) ? this.formatDateToString(this._currentFilters.fromDate) : null,\r\n toDate: (this._currentFilters.toDate != null) ? this.formatDateToString(this._currentFilters.toDate) : null,\r\n workflowContactId: this._currentFilters.workflowContactId,\r\n createdContactId: this._currentFilters.createdContactId,\r\n createdUser: this._currentFilters.createdUser\r\n };\r\n\r\n this._uow.fetch('Workflow/FetchFilteredWorkflowRecordedActions', params).then(r => {\r\n this._pendingTasks = r;\r\n if (this._pendingTasks == null || this._pendingTasks.length == 0) {\r\n this._hasWorkflowData = false;\r\n this._isLoading = false;\r\n return;\r\n }\r\n\r\n this._hasWorkflowData = true;\r\n\r\n const groups = _.groupBy(this._pendingTasks, a => a.toCompleteDescription);\r\n\r\n this._workflowGroups = _.map(groups, (v, k) => {\r\n return { name: k, pendingWorkflowRecordedActions: v, isCollapsed: false };\r\n });\r\n\r\n this._workflowGroups = _.sortBy(this._workflowGroups, (g) => g.name);\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n private workflowGroupCollapse(ix: number) {\r\n this._workflowGroups[ix].collapsed = !this._workflowGroups[ix].collapsed;\r\n }\r\n\r\n public get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n public isLoading(): boolean {\r\n return (this._isLoading);\r\n }\r\n\r\n public get stillLoadingMsg(): string {\r\n return 'The Workflow data is still loading.';\r\n }\r\n\r\n public showEmptyResultsMessage(): boolean {\r\n\r\n if (this.isLoading()) {\r\n return false;\r\n }\r\n\r\n return (!this._hasWorkflowData);\r\n }\r\n\r\n public isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n public canViewStaffReport() {\r\n return (this._staffContact != null && this._staffContact.consultant == false);\r\n }\r\n\r\n public get filterName() {\r\n if (this._filterWorkflowContact != null) {\r\n return this._filterWorkflowContact.firstName;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n public get filterCompletedByName() {\r\n if (this._filterTaskCompletedByContact != null) {\r\n return this._filterTaskCompletedByContact.firstName;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n public get fromDate(): string {\r\n return this._fromDateString;\r\n }\r\n\r\n public set fromDate(value: string) {\r\n this._fromDateString = value;\r\n }\r\n\r\n public get toDate(): string {\r\n return this._toDateString;\r\n }\r\n\r\n public set toDate(value: string) {\r\n this._toDateString = value;\r\n }\r\n\r\n public filterContactChange(event: any) {\r\n const ix = event.currentTarget.selectedIndex;\r\n this._filterWorkflowContact = this._typeWorkflowContacts[ix];\r\n }\r\n\r\n public filterCompletedByContactChange(event: any) {\r\n const ix = event.currentTarget.selectedIndex;\r\n this._filterTaskCompletedByContact = this._typeCompletedByContacts[ix];\r\n }\r\n\r\n public onDisplayAction(index: number) {\r\n const selectedActions = this._pendingTaskCounts.filter(a => a.selected == true);\r\n\r\n if (selectedActions == null || selectedActions.length == 0) {\r\n this._hasWorkflowData = false;\r\n return;\r\n }\r\n\r\n this._currentFilters.actionIds = selectedActions.map(function (a) {\r\n return a.id;\r\n });\r\n this.fetchFilteredPendingActions();\r\n }\r\n\r\n public showFinishActionsFilter() {\r\n return (this._filterWorkflowContact == null || this._filterWorkflowContact.firstName == 'All Staff');\r\n }\r\n\r\n filterResults() {\r\n\r\n this._currentFilters.workflowContactId = this._filterWorkflowContact.workflowContactId;\r\n\r\n this._currentFilters.createdContactId = this._filterTaskCompletedByContact.workflowContactId;\r\n\r\n if (this._fromDateString) {\r\n // UTC conversion issue resolution\r\n const dateValue = this._fromDateString.toString().replace(/-/, '/').replace(/-/, '/');\r\n this._currentFilters.fromDate = new Date(dateValue);\r\n } else {\r\n this._currentFilters.fromDate = null;\r\n }\r\n\r\n if (this._toDateString) {\r\n // UTC conversion issue resolution\r\n const dateValue = this._toDateString.toString().replace(/-/, '/').replace(/-/, '/');\r\n this._currentFilters.toDate = new Date(dateValue);\r\n } else {\r\n this._currentFilters.toDate = null;\r\n }\r\n\r\n if (this.anyFilters() == false) {\r\n this._filterErrorMsg = 'No filters have been set yet!';\r\n return;\r\n }\r\n\r\n this.fetchFilteredPendingTaskCounts();\r\n }\r\n\r\n filterClear() {\r\n this.resetFilterBindings();\r\n this.resetFilterProperties();\r\n\r\n // Reload summary data\r\n if (this._currentFilters.workflowContactId > 0) { // The only filter not cleared is the one where consultant staff can only view their own reference assignments\r\n this.fetchFilteredPendingTaskCounts();\r\n } else {\r\n this.fetchPendingTaskCounts();\r\n }\r\n }\r\n\r\n public expandAll(expand: boolean) {\r\n setTimeout(() => {\r\n this._workflowGroups.forEach(g => g.collapsed = !expand);\r\n }, 0);\r\n }\r\n\r\n private formatDateToString(objDate: Date): string {\r\n return ((objDate.getMonth() + 1) + '/' + objDate.getDate() + '/' + objDate.getFullYear());\r\n }\r\n\r\n private resetFilterProperties() {\r\n const contactId = (this._staffContact != null && this._staffContact.consultant) ? this._staffContact.workflowContactId : 0;\r\n this._currentFilters = {\r\n fromDate: null,\r\n toDate: null,\r\n workflowContactId: contactId,\r\n createdContactId: 0,\r\n createdUser: null,\r\n actionIds: null\r\n };\r\n }\r\n\r\n private resetFilterBindings() {\r\n this._filterWorkflowContact = this._typeWorkflowContacts[0];\r\n this._filterTaskCompletedByContact = this._typeCompletedByContacts[0];\r\n this.fromDate = null;\r\n this.toDate = null;\r\n }\r\n\r\n private anyFilters(): boolean {\r\n\r\n if (this._currentFilters.actionIds != null) {\r\n return true;\r\n }\r\n\r\n if (this._currentFilters.createdContactId != 0) {\r\n return true;\r\n }\r\n\r\n if (this._currentFilters.createdUser != null) {\r\n return true;\r\n }\r\n\r\n if (this._currentFilters.fromDate != null) {\r\n return true;\r\n }\r\n\r\n if (this._currentFilters.toDate != null) {\r\n return true;\r\n }\r\n\r\n if (this._currentFilters.workflowContactId != 0) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private navToRef(assigned: WorkflowPendingReportItem) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, assigned.referenceId));\r\n }\r\n\r\n showSearchServiceReport() {\r\n const url = this._userManager.getSearchServiceReportUrl();\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n showWorkflowActivityReport() {\r\n\r\n this._isLoading = true;\r\n\r\n if (this.anyReportFilters()) {\r\n this.fetchFilteredWorkflowActivityReport();\r\n } else {\r\n this.fetchWorkflowActivityReport();\r\n }\r\n\r\n this._isLoading = false;\r\n }\r\n\r\n anyReportFilters(): boolean {\r\n\r\n if (this._fromDateString) {\r\n return true;\r\n }\r\n\r\n if (this._toDateString) {\r\n return true;\r\n }\r\n\r\n if (this._filterTaskCompletedByContact.workflowContactId != 0) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n fetchWorkflowActivityReport() {\r\n\r\n return this._uow.fetch('Workflow/FetchWorkflowActivitySummaryReport', {}).then(r => {\r\n this._reportItems = r;\r\n if (this._reportItems != null && this._reportItems.length > 0) {\r\n this._isLoading = false;\r\n setTimeout(() => {\r\n const ele = $('#WorkflowActivityReport');\r\n (ele).modal('show');\r\n }, 0);\r\n return;\r\n }\r\n });\r\n\r\n }\r\n\r\n fetchFilteredWorkflowActivityReport() {\r\n\r\n let filterFromDate: string = null;\r\n let filterToDate: string = null;\r\n\r\n if (this._fromDateString) {\r\n filterFromDate = this._fromDateString.toString();\r\n }\r\n\r\n if (this._toDateString) {\r\n filterToDate = this._toDateString.toString();\r\n }\r\n\r\n const params = {\r\n workflowContactId: this._filterTaskCompletedByContact.workflowContactId,\r\n fromDate: filterFromDate,\r\n toDate: filterToDate\r\n };\r\n\r\n return this._uow.fetch('Workflow/FetchFilteredWorkflowActivitySummaryReport', params).then(r => {\r\n this._reportItems = r;\r\n if (this._reportItems != null && this._reportItems.length > 0) {\r\n this._isLoading = false;\r\n setTimeout(() => {\r\n const ele = $('#WorkflowActivityReport');\r\n (ele).modal('show');\r\n }, 0);\r\n return;\r\n }\r\n });\r\n }\r\n}\r\n","
\r\n
\r\n \r\n \r\n \r\n \r\n {{_finishedMessage}}\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
","import { Component, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\n\r\nimport { EditorService, ReferenceFinishState, ReferenceState, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, IEditHost } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\nimport { Reference, WorkflowRecordedAction } from '../../entities/EntityModels';\r\n\r\nimport { STAFF_ROUTES } from './staff.routes';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport { ReferenceLoader } from './services/reference-loader';\r\n\r\nclass PageStateExt extends PageState {\r\n referenceId: number;\r\n}\r\n\r\n@Component({\r\n selector: 'reference-audit',\r\n templateUrl: './reference-audit.html',\r\n})\r\nexport class ReferenceAuditComponent implements OnInit, IEditHost {\r\n _toxAlreadyAudited: boolean;\r\n _toxPendingAudit: boolean;\r\n\r\n _canLoad = false;\r\n _edm: EditManager;\r\n _pageState = new PageStateExt('Reference Audit');\r\n _finishedMessage: string;\r\n reference: Reference;\r\n\r\n constructor(public _uow: UnitOfWork, private _stateMap: StateMap, public _location: Location, public _editorService: EditorService,\r\n private _referenceState: ReferenceState, private route: ActivatedRoute,\r\n private referenceLoader: ReferenceLoader) {\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = STAFF_ROUTES.ReferenceAudit.name;\r\n\r\n this.route.params\r\n .subscribe(params => {\r\n const referenceId: number = params['referenceId'];\r\n if (referenceId) {\r\n // For Workflow\r\n this._edm = this._editorService.createEditManager(this, 'Workflow');\r\n this._edm.pageState.canShowMessage = false;\r\n\r\n this._edm.editing = this._toxPendingAudit;\r\n\r\n this.referenceLoader.load(referenceId)\r\n .then(r => {\r\n this.reference = r;\r\n if (r.workflowRecordedActions != null) {\r\n this._toxAlreadyAudited = this.hasAuditedToxData();\r\n this._toxPendingAudit = this.hasUnauditedToxData();\r\n this._edm.entities = r.workflowRecordedActions;\r\n }\r\n this._canLoad = true;\r\n });\r\n } else {\r\n return;\r\n }\r\n });\r\n }\r\n\r\n canDeactivate() {\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n // Workflow Related\r\n hasChanges() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n isEditing() {\r\n return this._edm.editing;\r\n }\r\n\r\n canShowCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n onCancel() {\r\n this._uow.rollback();\r\n\r\n this._toxAlreadyAudited = this.hasAuditedToxData();\r\n this._toxPendingAudit = this.hasUnauditedToxData();\r\n }\r\n\r\n clearEdms() {\r\n }\r\n\r\n canShowSave() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n canSave() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n onSave() {\r\n this._referenceState.isReferenceFinished(this.reference).then(f => {\r\n const finished: boolean = (f != ReferenceFinishState.MissingData);\r\n\r\n if (finished != this.reference.finished) {\r\n this._finishedMessage = finished ?\r\n 'The Reference is now marked complete, you may need to Save again to confirm.' :\r\n 'The Reference has been Unfinished as a result of these edits.';\r\n\r\n this.reference.finished = finished;\r\n this._referenceState.recordReferenceFinishedStateChange(this.reference);\r\n }\r\n\r\n return (this._edm.commitSave());\r\n });\r\n }\r\n\r\n private hasAuditedToxData() {\r\n return (this._referenceState.hasAuditedToxData(this.reference));\r\n }\r\n\r\n private hasUnauditedToxData() {\r\n return (this._referenceState.hasUnauditedToxData(this.reference));\r\n }\r\n\r\n public onAuditComplete() {\r\n this._referenceState.recordToxAudit(this.reference);\r\n this._edm.entities = this.reference.workflowRecordedActions;\r\n this._toxPendingAudit = false;\r\n this._toxAlreadyAudited = true;\r\n }\r\n\r\n public referenceFinishedStatesHaveChanged(): boolean {\r\n return (this._finishedMessage && this._finishedMessage.length > 0);\r\n }\r\n\r\n}\r\n","
\r\n\t
\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
{{'Reported Use for Material ' + displayCAS + ', Ordered from Most to Least.'}}
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
Survey YearOrganization NameUse Kgs
{{use.surveyYear}}{{use.organizationName}}{{utilFns.formatNumber(use.materialUseKgs, 12, 3)}}
\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t

{{validationMessage}}

\r\n\t\t\t\t
\r\n\r\n\t\t\t\t

{{_userMessage}}

\r\n\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
\r\n","import { Component, ElementRef } from '@angular/core';\r\n\r\nimport { UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { SurveyWhoUsedMostMaterial } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'survey-whousedmost',\r\n templateUrl: './survey-whousedmost.html',\r\n})\r\n\r\nexport class SurveyWhoUsedMostComponent extends ModalDialog {\r\n public _searchTerm: string;\r\n public _entities: SurveyWhoUsedMostMaterial[] = [];\r\n public _pageState = new PageState('SurveyWhoUsedMostMaterial');\r\n public _userMessage = '';\r\n\r\n private _displayCAS: string;\r\n private _materialId: number;\r\n private _formattedRIFMId: string;\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork) {\r\n super(elementRef);\r\n }\r\n\r\n public loadData(year: string) {\r\n this._userMessage = '';\r\n this.validationMessage = null;\r\n this._pageState.isLoading = true;\r\n this._entities = null;\r\n\r\n this._uow.fetchTyped('MaterialReportedUses/SurveyWhoUsedMostMaterials', SurveyWhoUsedMostMaterial, {\r\n displayCAS: this._displayCAS,\r\n surveyYear: year,\r\n materialId: this._materialId\r\n }).then(r => {\r\n this._pageState.isLoaded = true;\r\n this._entities = r;\r\n\r\n if (this._entities == null || this._entities.length == 0) {\r\n this._userMessage = 'No organizations reported a use greater than zero for this material and survey year.';\r\n }\r\n });\r\n }\r\n\r\n onSelect(surveyWhoUsedMost: SurveyWhoUsedMostMaterial) {\r\n UtilFns.returnModal(this, surveyWhoUsedMost);\r\n }\r\n\r\n public set displayCAS(cas: string) {\r\n this._displayCAS = cas;\r\n }\r\n\r\n public get displayCAS(): string {\r\n return this._displayCAS;\r\n }\r\n\r\n public set materialId(id: number) {\r\n this._materialId = id;\r\n }\r\n\r\n public get materialId(): number {\r\n return this._materialId;\r\n }\r\n\r\n public set formattedRIFMId(rifmId: string) {\r\n this._formattedRIFMId = rifmId;\r\n }\r\n\r\n public get formattedRIFMId(): string {\r\n return this._formattedRIFMId;\r\n }\r\n\r\n public hasData(): boolean {\r\n return (this._entities != null && this._entities.length > 0);\r\n }\r\n\r\n public get utilFns() {\r\n return UtilFns;\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n Survey Year\r\n
\r\n
\r\n Survey Material\r\n
\r\n
\r\n Survey Companies\r\n
\r\n
\r\n {{\"Unit of Measure: \" + _unitOfMeasure}}\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n {{_selectedCASDisplay}}\r\n X\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n \r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n\r\n

{{_reportTitle}}

\r\n
\r\n Pages:\r\n
    \r\n
  • \r\n \r\n
  • \r\n
\r\n
\r\n\r\n
Click the CAS No. link to show the list of all companies reporting the material
\r\n\r\n
0)\" style=\"width: 75%\">\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.china, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.china, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.asiaPacific, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.asiaPacific, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.japan, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.japan, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.europe, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.europe, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.northAmerica, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.northAmerica, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.southAmerica, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.southAmerica, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.other, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.other, 1000, 10, 4) }}\r\n
\r\n
\r\n
\r\n\r\n
0)\" style=\"width: 75%\">\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.china, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.china, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.asiaPacific, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.asiaPacific, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.japan, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.japan, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.europe, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.europe, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.northAmerica, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.northAmerica, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.southAmerica, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.southAmerica, 1000, 10, 4) }}\r\n
\r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.other, 12, 3) }}\r\n {{ utilFns.scaleNumber(cell.data.other, 1000, 10, 4) }}\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n","import { Location } from '@angular/common';\r\nimport { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport {ReportingOrganization, Survey, SurveyUsesByCompanyAndMaterialAndYear, SurveyUsesByMaterialAndYear} from '../../entities/EntityModels';\r\nimport { CompanyAndSurveyYear, GeographicalAreaAndSurveyYear, SurveyFilters, SurveyReportedUseListItem } from '../../entities/projections/SurveyProjections';\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\nimport { SurveyWhoUsedMostComponent } from './survey-whousedmost.component';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { STAFF_ROUTES } from './staff.routes';\r\n\r\n@Component({\r\n selector: 'survey-reported-use',\r\n templateUrl: './survey-reported-use.html',\r\n})\r\n\r\nexport class SurveyReportedUseComponent implements OnInit {\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n @ViewChild(SurveyWhoUsedMostComponent, { static: true }) _surveyWhoUsedMostComponent: SurveyWhoUsedMostComponent;\r\n\r\n public _hasLinks = false;\r\n public _isLoading = true;\r\n public _pageSize = 100;\r\n public _paginationTotalItems = 0;\r\n public _paginationCurrentPage = 0;\r\n public _pages: number[] = [];\r\n public _searchParams: { pageNumber: number, pageSize: number, sortField: string, sortDescending: boolean } = {\r\n pageNumber: 1,\r\n pageSize: 100,\r\n sortField: '',\r\n sortDescending: false\r\n };\r\n\r\n public _reportTitle: string;\r\n public _organizationNames: string[];\r\n public _reportingOrganizations: ReportingOrganization[];\r\n public _surveys: Survey[];\r\n public _surveyYears: string[];\r\n\r\n public _filterOrganizationName: string;\r\n public _filterSurveyYear: string;\r\n\r\n public _unitOfMeasure: string;\r\n\r\n private _selectedYears: string[] = [];\r\n public _selectedCASDisplay: string;\r\n private _selectedMaterialId: number;\r\n\r\n public _surveyReportedUseByMaterialAndYears: SurveyUsesByMaterialAndYear[];\r\n public _surveyReportedUseByCompany: SurveyUsesByCompanyAndMaterialAndYear[];\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._stateMap.currentRouteName = STAFF_ROUTES.SurveyReportedUse.name;\r\n\r\n this._unitOfMeasure = 'Kilograms';\r\n\r\n this._isLoading = true;\r\n\r\n this._uow.fetchTyped('MaterialReportedUses/ReportingOrganizations', ReportingOrganization, { }).then(r => {\r\n\r\n this._reportingOrganizations = r;\r\n\r\n const names = this._reportingOrganizations.map(n => n.organizationName);\r\n\r\n this._organizationNames = names.sort();\r\n this._organizationNames.unshift('All');\r\n\r\n this._filterOrganizationName = 'All';\r\n\r\n this._uow.fetchTyped('MaterialReportedUses/SurveysByMinYear', Survey, { minYear: 2011 }).then(s => {\r\n\r\n this._surveys = _.sortBy(s, y => y.surveyYear).reverse();\r\n\r\n this._surveyYears = this._surveys.map(sy => sy.surveyYear).filter((value, index, self) => self.indexOf(value) === index);\r\n\r\n this._selectedYears[0] = this._surveyYears[0];\r\n\r\n this._filterSurveyYear = this._surveyYears[0];\r\n\r\n this.generateReport();\r\n\r\n this._isLoading = false;\r\n });\r\n });\r\n }\r\n\r\n // load data\r\n public generateReport() {\r\n\r\n this.clearReportData();\r\n\r\n this._isLoading = true;\r\n\r\n if (this._filterOrganizationName != null && this._filterOrganizationName != 'All') {\r\n this.generateReportByCompany();\r\n } else {\r\n this.generateReportByMaterialAndYear();\r\n }\r\n }\r\n\r\n // This method cam be invoked when the only filter selected is the Survey Year.\r\n // In this case the _selectedMaterialId is set to null.\r\n // The web api has the materialId as an optional parameter.\r\n private generateReportByMaterialAndYear() {\r\n this._reportTitle = (this._selectedMaterialId != null) ? 'Report By Year and Material for Each Reported Geographical Area' : 'Report By Year for Each Reported Geographical Area';\r\n this._pages = [];\r\n\r\n this._searchParams.pageSize = 100;\r\n this._searchParams.pageNumber = 1;\r\n this._searchParams.sortField = 'DisplayCAS';\r\n this._searchParams.sortDescending = false;\r\n\r\n // Get counts for pagination first\r\n const paramsCount = {\r\n years: this._selectedYears,\r\n casNumber: '',\r\n materialId: this._selectedMaterialId // This param may be null\r\n };\r\n\r\n this._uow.fetch('MaterialReportedUses/FetchSurveyReportedUsesCount', paramsCount).then(c => {\r\n\r\n if (c != null && c.length > 0) {\r\n console.log('paginationTotalItems: ' + c[0]);\r\n this._paginationTotalItems = c[0];\r\n } else { console.log('No pagination items.'); }\r\n\r\n const paramsReport = {\r\n years: this._selectedYears,\r\n casNumber: '', // Search is by material id not cas number\r\n pageNumber: this._searchParams.pageNumber,\r\n pageSize: this._searchParams.pageSize,\r\n sortField: this._searchParams.sortField,\r\n sortDescending: this._searchParams.sortDescending,\r\n materialId: this._selectedMaterialId // This param may be null\r\n };\r\n\r\n this._uow.fetch('MaterialReportedUses/FetchSurveyReportedUses', paramsReport).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._searchParams.pageNumber = 1;\r\n this._surveyReportedUseByMaterialAndYears = r;\r\n this.hasLinks = true;\r\n } else {\r\n this._reportTitle = 'No data found';\r\n this.hasLinks = false;\r\n }\r\n\r\n if (this.hasPages()) {\r\n let count = this._paginationTotalItems / this._searchParams.pageSize;\r\n if ((this._paginationTotalItems % this._searchParams.pageSize) > 0) {\r\n count = count + 1;\r\n }\r\n\r\n this._pages = _.range(1, count);\r\n }\r\n\r\n this._isLoading = false;\r\n\r\n });\r\n\r\n });\r\n }\r\n\r\n private generateReportByCompany() {\r\n\r\n this._reportTitle = 'Reported Use for ' + this._filterOrganizationName;\r\n this.hasLinks = false;\r\n\r\n this._pages = [];\r\n\r\n this._searchParams.pageSize = 100;\r\n this._searchParams.pageNumber = 1;\r\n this._searchParams.sortField = 'DisplayCAS';\r\n this._searchParams.sortDescending = false;\r\n\r\n // Get counts for pagination first\r\n const paramsCount = {\r\n years: this._selectedYears,\r\n companyName: this._filterOrganizationName,\r\n casNumber: '', // Search is by material id not cas number\r\n materialId: this._selectedMaterialId\r\n };\r\n\r\n this._uow.fetch('MaterialReportedUses/FetchSurveyReportedUsesByCompanyAndMaterialAndYearCount', paramsCount).then(c => {\r\n\r\n if (c != null && c.length > 0) {\r\n console.log('paginationTotalItems: ' + c[0]);\r\n this._paginationTotalItems = c[0];\r\n } else { console.log('No pagination items.'); }\r\n\r\n const paramsReport = {\r\n years: this._selectedYears,\r\n companyName: this._filterOrganizationName,\r\n casNumber: '', // Search is by material id not cas number\r\n pageNumber: this._searchParams.pageNumber,\r\n pageSize: this._searchParams.pageSize,\r\n sortField: this._searchParams.sortField,\r\n sortDescending: this._searchParams.sortDescending,\r\n materialId: this._selectedMaterialId // This param may be null\r\n };\r\n\r\n this._uow.fetch('MaterialReportedUses/FetchSurveyReportedUsesByCompany', paramsReport).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._searchParams.pageNumber = 1;\r\n this._surveyReportedUseByCompany = r;\r\n } else {\r\n this._reportTitle = 'No data found';\r\n }\r\n\r\n if (this.hasPages()) {\r\n let count = this._paginationTotalItems / this._searchParams.pageSize;\r\n if ((this._paginationTotalItems % this._searchParams.pageSize) > 0) {\r\n count = count + 1;\r\n }\r\n\r\n this._pages = _.range(1, count);\r\n }\r\n\r\n this._isLoading = false;\r\n\r\n });\r\n });\r\n }\r\n\r\n private clearReportData() {\r\n this._paginationTotalItems = 0;\r\n this._surveyReportedUseByMaterialAndYears = [];\r\n this._surveyReportedUseByCompany = [];\r\n\r\n this._reportTitle = '';\r\n this._hasLinks = false;\r\n }\r\n\r\n public fetchNextPage(pageNumber: number) {\r\n if (this._surveyReportedUseByMaterialAndYears != null && this._surveyReportedUseByMaterialAndYears.length > 1) {\r\n return this.fetchSurveyUsesPage(pageNumber);\r\n } else {\r\n return this.fetchSurveyUsesByCompanyPage(pageNumber);\r\n }\r\n }\r\n\r\n public fetchSurveyUsesPage(pageNumber: number): Promise {\r\n\r\n this._isLoading = true;\r\n\r\n this._searchParams.pageNumber = pageNumber;\r\n\r\n const paramsReport = {\r\n years: this._selectedYears,\r\n casNumber: '',\r\n pageNumber: this._searchParams.pageNumber,\r\n pageSize: this._searchParams.pageSize,\r\n sortField: this._searchParams.sortField,\r\n sortDescending: this._searchParams.sortDescending,\r\n materialId: this._selectedMaterialId\r\n };\r\n\r\n this._surveyReportedUseByMaterialAndYears = [];\r\n return this._uow.fetch('MaterialReportedUses/FetchSurveyReportedUses', paramsReport).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._surveyReportedUseByMaterialAndYears = r;\r\n this._searchParams.pageNumber = pageNumber;\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n public fetchSurveyUsesByCompanyPage(pageNumber: number): Promise {\r\n\r\n this._isLoading = true;\r\n\r\n this._searchParams.pageNumber = pageNumber;\r\n\r\n const paramsReport = {\r\n years: this._selectedYears,\r\n companyName: this._filterOrganizationName,\r\n casNumber: '', // Search is by material id not cas number\r\n pageNumber: this._searchParams.pageNumber,\r\n pageSize: this._searchParams.pageSize,\r\n sortField: this._searchParams.sortField,\r\n sortDescending: this._searchParams.sortDescending,\r\n materialId: this._selectedMaterialId // This param may be null\r\n };\r\n\r\n this._surveyReportedUseByCompany = [];\r\n return this._uow.fetch('MaterialReportedUses/FetchSurveyReportedUsesByCompany', paramsReport).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._surveyReportedUseByCompany = r;\r\n this._searchParams.pageNumber = pageNumber;\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n public get hasLinks(): boolean {\r\n return this._hasLinks;\r\n }\r\n\r\n public set hasLinks(value: boolean) {\r\n this._hasLinks = value;\r\n }\r\n\r\n public hasPages(): boolean {\r\n return (this._paginationTotalItems > 1);\r\n }\r\n\r\n public isActive(index: number): boolean {\r\n return (index == this._searchParams.pageNumber);\r\n }\r\n\r\n public isInactive(index: number): boolean {\r\n return (!this.isActive(index));\r\n }\r\n\r\n public get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n public clearSelectedMaterial() {\r\n this._selectedCASDisplay = '';\r\n this._selectedMaterialId = null;\r\n\r\n this.generateReport();\r\n\r\n }\r\n\r\n // Different organizations report each survey year so update the list with each year change.\r\n public filterSurveyYearChange(event: any) {\r\n const ix = event.currentTarget.selectedIndex;\r\n\r\n this._selectedYears = [];\r\n this._selectedYears[0] = this._filterSurveyYear;\r\n\r\n this.generateReport();\r\n }\r\n\r\n public filterOrganizationChange(event: any) {\r\n this.generateReport();\r\n }\r\n\r\n public setUnitOfMeasure(uom: string) {\r\n this._unitOfMeasure = uom;\r\n }\r\n\r\n public onSelectMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this).then(mli => {\r\n if (mli == null) {\r\n return;\r\n }\r\n return this._uow.materialRepository.withId(mli.materialId);\r\n }).then(m => {\r\n if (m) {\r\n this._selectedCASDisplay = (m.realCASNumber || '') + ' RIFM Id: ' + m.formattedRIFMId;\r\n this._selectedMaterialId = m.materialId;\r\n\r\n this.generateReport();\r\n }\r\n });\r\n }\r\n\r\n public onShowWhoUsedMost(use: SurveyReportedUseListItem) {\r\n this._surveyWhoUsedMostComponent.displayCAS = use.displayCAS;\r\n this._surveyWhoUsedMostComponent.materialId = use.materialId;\r\n this._surveyWhoUsedMostComponent.formattedRIFMId = use.formattedRifmId;\r\n\r\n this._surveyWhoUsedMostComponent.loadData(this._selectedYears[0]);\r\n\r\n UtilFns.showModal(this._surveyWhoUsedMostComponent, this).then(wum => {\r\n return;\r\n });\r\n }\r\n}\r\n\r\n","
\r\n \r\n \r\n \r\n \r\n \r\n You cannot leave the Assessment Categories tab until you either 'Save' or 'Cancel'\r\n \r\n {{_status.message}}\r\n
\r\n\r\n
\r\n \r\n
\r\n

Safety assessment categories can only be deleted after all SAs have been unassigned.

\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n \r\n Name\r\n SA Count\r\n \r\n \r\n \r\n \r\n {{c.name}}\r\n {{getAssessmentCount(c.assessmentCategoryId)}}\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
","import { Component, OnInit } from '@angular/core';\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditManager, HashMap } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { AssessmentCategory } from '../../entities/AssessmentCategory';\r\n\r\nexport interface IAssessmentCategoryCount {\r\n assessmentCategoryId: number;\r\n assessmentsCount: number;\r\n}\r\n\r\n@Component({\r\n selector: 'safety-assessment-category-editor',\r\n templateUrl: './safety-assessment-category-editor.html',\r\n providers: [provideParent(SafetyAssessmentCategoryEditorComponent, EditPropParent)]\r\n})\r\nexport class SafetyAssessmentCategoryEditorComponent implements OnInit, EditPropParent {\r\n assessmentCategories: AssessmentCategory[];\r\n assessmentCounts: HashMap = {};\r\n entity: AssessmentCategory;\r\n edm: EditManager;\r\n _status: any;\r\n\r\n constructor(public _uow: UnitOfWork) {\r\n }\r\n\r\n get isEditing(): boolean {\r\n return !!this.entity;\r\n }\r\n\r\n ngOnInit() {\r\n this.load();\r\n }\r\n\r\n load() {\r\n return this._uow.assessmentCategoryRepository.all()\r\n .then(r => {\r\n return this._uow.fetch('Misc/AssessmentCategoryCounts', {}).then(c => {\r\n this.assessmentCategories = r;\r\n for (const count of c) {\r\n this.assessmentCounts[count.assessmentCategoryId] = count.assessmentsCount;\r\n }\r\n });\r\n });\r\n }\r\n\r\n canAdd() {\r\n return !this.isEditing;\r\n }\r\n\r\n onAdd() {\r\n this.entity = this._uow.assessmentCategoryFactory.create({ name: '' });\r\n }\r\n\r\n canSave() {\r\n return this.isEditing && !this.entity.entityAspect.entityState.isUnchanged() && this.isValid();\r\n }\r\n\r\n onSave() {\r\n this._uow.commit()\r\n .then(() => {\r\n this.entity = null;\r\n return this.load();\r\n });\r\n }\r\n\r\n canDelete() {\r\n return this.isEditing\r\n && this.entity.entityAspect.entityState.isUnchangedOrModified()\r\n && this.getAssessmentCount(this.entity.assessmentCategoryId) === 0;\r\n }\r\n\r\n onDelete() {\r\n this.entity.entityAspect.setDeleted();\r\n }\r\n\r\n canCancel() {\r\n return true;\r\n }\r\n\r\n onCancel() {\r\n this.entity.entityAspect.rejectChanges();\r\n this.entity = null;\r\n }\r\n\r\n isAdded() {\r\n return this.entity.entityAspect.entityState.isAdded();\r\n }\r\n\r\n isDeleted() {\r\n return this.entity.entityAspect.entityState.isDeleted();\r\n }\r\n\r\n isValid() {\r\n const ok = this.entity.entityAspect.validateEntity();\r\n return ok && !this.hasUniqueError;\r\n }\r\n\r\n getError(propName: string) {\r\n if (propName == 'name') {\r\n this.hasUniqueError = false;\r\n for (const ac of this.assessmentCategories) {\r\n if (ac !== this.entity && ac.name.trim() === this.entity.name.trim()) {\r\n this.hasUniqueError = true;\r\n return 'Assessment category Name needs to be unique';\r\n\r\n }\r\n }\r\n }\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n hasEdits() {\r\n return this.isEditing && this.entity.entityAspect.entityState.isAddedModifiedOrDeleted();\r\n }\r\n\r\n onCategorySelected(c: AssessmentCategory) {\r\n this.entity = c;\r\n }\r\n\r\n getAssessmentCount(assessmentCategoryId: number) {\r\n return this.assessmentCounts[assessmentCategoryId];\r\n }\r\n\r\n hasUniqueError: boolean;\r\n}\r\n","

Prediction Types and Classes

\r\n\r\n
\r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { LocationFns } from '../../utils/common';\r\nimport { TabContainer } from '../../controls/common';\r\nimport { STAFF_ROUTES } from './staff.routes';\r\n\r\nexport class PredictionEditData {\r\n inSubEditor: boolean;\r\n currentTab: number;\r\n}\r\n\r\n@Component({\r\n selector: 'type-prediction-editor-base',\r\n templateUrl: './type-prediction-editor-base.html',\r\n})\r\nexport class TypePredictionEditorBaseComponent implements OnInit, AfterViewInit {\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n\r\n _data: PredictionEditData = new PredictionEditData();\r\n\r\n _tab: number;\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, public _location: Location) {\r\n this._data.inSubEditor = false;\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._stateMap.currentRouteName = STAFF_ROUTES.TypePredictionEditorBaseComponent.name;\r\n\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.focusInitialTab();\r\n }\r\n\r\n canDeactivate() {\r\n return !this._data.inSubEditor && !this._uow.hasChanges();\r\n }\r\n\r\n focusInitialTab() {\r\n setTimeout(() => {\r\n if (this._tabContainer) {\r\n this._tabContainer.selectTab(this._tab);\r\n }\r\n }, 1);\r\n }\r\n}\r\n","
\r\n {{pageTitle()}}\r\n
\r\n\r\n
\r\n \r\n Organization Name: \r\n {{_data.selectedReportingOrganization.organizationName}}\r\n \r\n\r\n \r\n Survey Year: \r\n {{_data.selectedSurveyYear}}\r\n \r\n
\r\n\r\n
\r\n {{_validationMessage}}\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n Reporting Organization\r\n Survey Year\r\n\r\n \r\n\r\n \r\n\r\n {{_userMessage}}\r\n\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n \r\n MaterialId:\r\n {{_data.selectedMaterial.materialId}}\r\n\r\n CAS #:\r\n {{_data.selectedMaterial.realCASNumber}}\r\n\r\n RIFM ID:\r\n {{_data.selectedMaterial.formattedRIFMId}}\r\n\r\n \r\n Principal Name:\r\n {{_data.selectedMaterial.principalSynonymText()}}\r\n\r\n
\r\n\r\n
\r\n\r\n Reported Use by Geographic Region\r\n\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{sru.survey.typeGeographicalArea.geographicalArea}}\r\n \r\n
\r\n
\r\n Reported Kgs:\r\n
\r\n
\r\n \r\n
\r\n
\r\n Staff Notes:\r\n
\r\n
\r\n \r\n
\r\n
\r\n Remove\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n","import {Location} from '@angular/common';\r\nimport {Component, forwardRef, Inject, OnInit} from '@angular/core';\r\n\r\nimport {provideParent, StateMap, UnitOfWork} from '../../services/common';\r\nimport {EditPropParent, PageState} from '../../controls/common';\r\nimport {MaterialConsumption, ReportingOrganization, Survey, SurveyReportedUse, TypeGeographicalArea} from '../../entities/EntityModels';\r\nimport {MaterialReportedUseEditData, MaterialReportedUseEditState, MaterialReportedUsesComponent} from './material-reported-uses.component';\r\n\r\nimport { MaterialWorkflowService } from '../../services/material-workflow-service';\r\nimport { WorkflowEntityState, WorkflowState } from '../../services/workflow-state';\r\n\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'material-reported-use-editor',\r\n templateUrl: './material-reported-use-editor.html',\r\n providers: [provideParent(MaterialReportedUseEditorComponent, EditPropParent)]\r\n})\r\n\r\nexport class MaterialReportedUseEditorComponent implements OnInit {\r\n\r\n public _data: MaterialReportedUseEditData = new MaterialReportedUseEditData();\r\n public _pageState = new PageState('Material Reported Use Edit Data');\r\n\r\n public _filterOrganizationName: string;\r\n public _filterSurveyYear: string;\r\n\r\n public _surveyYears: string[];\r\n public _typeGeographicalAreas: TypeGeographicalArea[];\r\n public _unreportedTypeGeographicalAreas: TypeGeographicalArea[];\r\n\r\n public _originalKgs: { surveyReportedUseId: number, surveyId: number, kilogramsConsumed: number}[];\r\n\r\n public _materialWorkflowService: MaterialWorkflowService;\r\n public _isLoading = false;\r\n public _userMessage: string;\r\n public _validationMessage: string;\r\n\r\n public _dictNotes: { [key: number]: string } = {};\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location, materialWorkflowService: MaterialWorkflowService,\r\n @Inject(forwardRef(() => MaterialReportedUsesComponent)) public _parent: MaterialReportedUsesComponent) {\r\n\r\n this._data = _parent._data;\r\n this._materialWorkflowService = materialWorkflowService;\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.fetch('MaterialReportedUses/FetchTypeGeographicalAreasByYear', { surveyYear: this._data.selectedSurveyYear }).then(r => {\r\n this._typeGeographicalAreas = r;\r\n this.setUnreportedGeographicAreas();\r\n\r\n this.createNotesDictionary(); // notes for each reported use by region\r\n });\r\n\r\n if (this._data.edm.entities != []) {\r\n this._originalKgs = this._data.edm.entities.map(obj => ({\r\n surveyReportedUseId: obj.surveyReportedUseId,\r\n surveyId: obj.surveyId,\r\n kilogramsConsumed: obj.kilogramsConsumed\r\n }));\r\n }\r\n\r\n if (this._data.materialReportedUseEditState == MaterialReportedUseEditState.Add) {\r\n this._filterSurveyYear = this._data.selectedSurveyYear;\r\n\r\n if (this._data.selectedReportingOrganization != null) {\r\n this._filterOrganizationName = this._data.selectedReportingOrganization.organizationName;\r\n\r\n } else {\r\n this._filterOrganizationName = 'All';\r\n this._userMessage = 'Please select a Reporting Organization';\r\n }\r\n }\r\n\r\n this._surveyYears = this._data.surveys.map(s => s.surveyYear).filter((value, index, self) => self.indexOf(value) === index);\r\n }\r\n\r\n // load data\r\n public setUnreportedGeographicAreas() {\r\n if (this._data.edm.entities == []) {\r\n this._unreportedTypeGeographicalAreas = _.clone(this._typeGeographicalAreas);\r\n return;\r\n }\r\n\r\n const currentTypeGeoAreas = this._data.edm.entities.filter(e => e.survey != null).map(t => t.survey.typeGeographicalAreaId);\r\n\r\n this._unreportedTypeGeographicalAreas = this._typeGeographicalAreas.filter(function(ga) {\r\n return currentTypeGeoAreas.findIndex(t => t == ga.typeGeographicalAreaId) == -1;\r\n });\r\n }\r\n\r\n createNotesDictionary() {\r\n this._dictNotes = {};\r\n\r\n this._typeGeographicalAreas.forEach(g => {\r\n this._dictNotes[g.typeGeographicalAreaId] = '';\r\n });\r\n }\r\n\r\n // style binding\r\n public rowColor(ix: number): string {\r\n const rem = ix % 2;\r\n if (rem == 0) {\r\n return '#D1E5EE';\r\n }\r\n return '#FFFFFF';\r\n }\r\n\r\n public backgroundGeo(ix: number): string {\r\n const rem = ix % 2;\r\n if (rem == 0) {\r\n return '#E3F7F6';\r\n }\r\n return '#E3F7F6';\r\n }\r\n\r\n // interactions\r\n public addSurveyReportedUse(typeGeographicalAreaId: number) {\r\n\r\n const survey = this.findSurvey(this._data.selectedSurveyYear, typeGeographicalAreaId);\r\n\r\n const newUse: SurveyReportedUse = this._uow.surveyReportedUseFactory.create();\r\n\r\n newUse.materialId \t\t\t = this._data.selectedMaterial.materialId;\r\n newUse.reportedCASNumber = this._data.selectedMaterial.realCASNumber;\r\n newUse.submitter \t\t\t = this._data.userName;\r\n newUse.unmapped \t\t\t = false;\r\n\r\n newUse.reportingOrganizationId = this._data.selectedReportingOrganization.reportingOrganizationId;\r\n newUse.surveyId = survey.surveyId;\r\n\r\n this._data.edm.entities.push(newUse);\r\n\r\n this.setUnreportedGeographicAreas();\r\n }\r\n\r\n public removeSurveyReportedUse(sru: SurveyReportedUse) {\r\n\r\n const materialUseIdx = this._data.edm.entities.findIndex(u => u.surveyReportedUseId == sru.surveyReportedUseId);\r\n\r\n if (materialUseIdx < 0) {\r\n this._validationMessage = 'Unexpected error trying to remove a survey reported use.';\r\n return;\r\n }\r\n\r\n if (this._data.edm.entities[materialUseIdx].entityAspect.entityState.isAdded()) {\r\n this._data.edm.entities[materialUseIdx].entityAspect.rejectChanges();\r\n this._data.edm.entities.splice(materialUseIdx, 1);\r\n this.setUnreportedGeographicAreas();\r\n } else {\r\n this._data.edm.entities[materialUseIdx].entityAspect.setDeleted();\r\n }\r\n }\r\n\r\n public pageTitle(): string {\r\n if (this._data.materialReportedUseEditState == MaterialReportedUseEditState.Edit) {\r\n return 'Editing Survey Reported Use';\r\n } if (this._data.materialReportedUseEditState == MaterialReportedUseEditState.Add) {\r\n return 'Adding New Survey Reported Use';\r\n } else {\r\n return 'Please confirm removal of all reported use data for this Company, Survey Year and Material:';\r\n }\r\n }\r\n\r\n // sync tblMaterialConsumptions\r\n public processEdits(): boolean {\r\n let diffKgs = 0;\r\n let notes = '';\r\n let userNote: string;\r\n let originalSurveyReportedUsesIdx: number;\r\n let survey: Survey;\r\n\r\n this._data.edm.entities.forEach(e => {\r\n\r\n survey = this.findSurveyById(e.surveyId);\r\n\r\n userNote = null;\r\n if (survey.typeGeographicalAreaId in this._dictNotes) {\r\n userNote = this._dictNotes[survey.typeGeographicalAreaId];\r\n\r\n if (!this.isValidString(userNote)) { // replace empty strings with null\r\n userNote = null;\r\n }\r\n }\r\n\r\n if (e.entityAspect.entityState.isAdded()) {\r\n diffKgs = _.round(e.kilogramsConsumed, 4);\r\n notes = this.buildWorkflowNotes(survey);\r\n\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialSurveyReportedUseChange(this._data.selectedMaterial.materialId, WorkflowEntityState.Added, diffKgs, e.surveyId, notes, userNote, this._data.userName);\r\n\r\n } else if (e.entityAspect.entityState.isDeleted()) {\r\n diffKgs = _.round(e.kilogramsConsumed * -1, 4);\r\n notes = this.buildWorkflowNotes(survey);\r\n\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialSurveyReportedUseChange(this._data.selectedMaterial.materialId, WorkflowEntityState.Deleted, diffKgs, e.surveyId, notes, userNote, this._data.userName);\r\n\r\n } else if (e.entityAspect.entityState.isModified()) {\r\n originalSurveyReportedUsesIdx\t= this._originalKgs.findIndex(o => o.surveyReportedUseId == e.surveyReportedUseId);\r\n\r\n diffKgs = _.round(e.kilogramsConsumed - this._originalKgs[originalSurveyReportedUsesIdx].kilogramsConsumed, 4);\r\n\r\n notes = this.buildWorkflowNotes(survey);\r\n\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialSurveyReportedUseChange(this._data.selectedMaterial.materialId, WorkflowEntityState.Modified, diffKgs, e.surveyId, notes, userNote, this._data.userName);\r\n\r\n } else { // only the notes have been modified\r\n if (this.isValidString(userNote)) {\r\n notes = this.buildWorkflowNotes(survey);\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialSurveyReportedUseUserNotesOnlyChange(this._data.selectedMaterial.materialId, WorkflowEntityState.Modified, e.surveyId, notes, userNote, this._data.userName);\r\n }\r\n\r\n diffKgs = 0;\r\n }\r\n\r\n if (diffKgs != 0) {\r\n this.updateMaterialConsumptions(survey.surveyId, diffKgs);\r\n }\r\n });\r\n\r\n return true;\r\n }\r\n\r\n public findReportingOrganizationByName(organizationName: string): ReportingOrganization {\r\n const orgIdx = this._data.reportingOrganizations.findIndex(o => o.organizationName == organizationName);\r\n return this._data.reportingOrganizations[orgIdx];\r\n }\r\n\r\n public findSurvey(surveyYear: string, typeGeographicalAreaId: number): Survey {\r\n const surveyIdx = this._data.surveys.findIndex(s => s.surveyYear == surveyYear && s.typeGeographicalAreaId == typeGeographicalAreaId);\r\n return this._data.surveys[surveyIdx];\r\n }\r\n\r\n public findSurveyById(surveyId: number): Survey {\r\n const surveyIdx = this._data.surveys.findIndex(s => s.surveyId == surveyId);\r\n return this._data.surveys[surveyIdx];\r\n }\r\n\r\n public buildWorkflowNotes(survey: Survey): string {\r\n // tslint:disable-next-line:max-line-length\r\n return 'Survey Year: ' + this._data.selectedSurveyYear + ', Organization Name: ' + this._data.selectedReportingOrganization.organizationName + ', Geographical Area: ' + survey.typeGeographicalArea.geographicalArea;\r\n }\r\n\r\n public processRemoveAll(): boolean {\r\n let diffKgs = 0;\r\n let notes: string;\r\n let userNote: string;\r\n let survey: Survey;\r\n\r\n this._data.edm.entities.forEach(e => {\r\n\r\n survey = this.findSurveyById(e.surveyId);\r\n\r\n userNote = null;\r\n if (survey.typeGeographicalAreaId in this._dictNotes) {\r\n userNote = this._dictNotes[survey.typeGeographicalAreaId];\r\n\r\n if (!this.isValidString(userNote)) { // replace empty strings with null\r\n userNote = null;\r\n }\r\n }\r\n\r\n diffKgs = e.kilogramsConsumed * -1;\r\n\r\n e.entityAspect.setDeleted();\r\n\r\n if (diffKgs != 0) {\r\n this.updateMaterialConsumptions(survey.surveyId, diffKgs);\r\n }\r\n\r\n notes = this.buildWorkflowNotes(survey);\r\n\r\n // tslint:disable-next-line:max-line-length\r\n this._materialWorkflowService.recordMaterialSurveyReportedUseChange(this._data.selectedMaterial.materialId, WorkflowEntityState.Deleted, diffKgs, e.surveyId, notes, userNote, this._data.userName);\r\n });\r\n\r\n return true;\r\n }\r\n\r\n public validateSurveyReportedUseData(): boolean {\r\n if (this._filterOrganizationName == '' || this._data.selectedReportingOrganization == null) {\r\n this._validationMessage = 'Please select a Reporting Organization from the list.';\r\n return false;\r\n }\r\n\r\n let isValid = true;\r\n this._data.edm.entities.forEach(e => {\r\n if (e.kilogramsConsumed == null) {\r\n this._validationMessage = 'Please enter a number into all the Kilograms Consumed fields.';\r\n isValid = false;\r\n }\r\n });\r\n\r\n return isValid;\r\n }\r\n\r\n updateMaterialConsumptions(surveyId: number, diffKgs: number) {\r\n let add = false;\r\n let materialConsumptionIdx = -1;\r\n\r\n if (this._data.edmMaterialConsumption.entities == []) {\r\n add = true;\r\n } else {\r\n materialConsumptionIdx = this._data.edmMaterialConsumption.entities.findIndex(mc => mc.surveyId == surveyId); // surveys are related to a particular geographic area (region)\r\n if (materialConsumptionIdx == -1) { add = true; }\r\n }\r\n\r\n // console.log('diffKgs');\r\n // console.log(diffKgs);\r\n\r\n if (add) {\r\n this.addMaterialConsumptions(this._data.selectedMaterial.materialId, surveyId, diffKgs);\r\n } else {\r\n // console.log('mc kgs before');\r\n // console.log(this._data.edmMaterialConsumption.entities[materialConsumptionIdx].kilogramsConsumed);\r\n\r\n const newKgs = _.round(this._data.edmMaterialConsumption.entities[materialConsumptionIdx].kilogramsConsumed + diffKgs, 4);\r\n\r\n this._data.edmMaterialConsumption.entities[materialConsumptionIdx].kilogramsConsumed = newKgs;\r\n\r\n // console.log('mc kgs after');\r\n // console.log(this._data.edmMaterialConsumption.entities[materialConsumptionIdx].kilogramsConsumed);\r\n }\r\n }\r\n\r\n addMaterialConsumptions(materialId: number, surveyId: number, newKgs: number) {\r\n const newMaterialConsumption: MaterialConsumption = this._uow.materialConsumptionFactory.create();\r\n\r\n newMaterialConsumption.materialId = materialId;\r\n newMaterialConsumption.surveyId = surveyId;\r\n newMaterialConsumption.kilogramsConsumed = newKgs;\r\n\r\n this._data.edmMaterialConsumption.entities.push(newMaterialConsumption);\r\n }\r\n\r\n // #############################################################################\r\n // interactions\r\n // #############################################################################\r\n public filterOrganizationChange(event: any) {\r\n this._userMessage = '';\r\n this._data.selectedReportingOrganization = this.findReportingOrganizationByName(this._filterOrganizationName);\r\n }\r\n\r\n filterSurveyYearChange(event: any) {\r\n this._data.selectedSurveyYear = this._filterSurveyYear;\r\n\r\n // reset records created for different year\r\n if (this._data.materialReportedUseEditState == MaterialReportedUseEditState.Add) {\r\n this._data.edm.entities = [];\r\n this._data.edm.clearErrors();\r\n }\r\n }\r\n\r\n canAddNewGeoRegion(): boolean {\r\n if (this._data.materialReportedUseEditState != MaterialReportedUseEditState.Add) {\r\n return true;\r\n }\r\n\r\n return (this._filterOrganizationName != 'All' && this._filterSurveyYear != 'All');\r\n }\r\n\r\n isAdding(): boolean {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.Add);\r\n }\r\n\r\n isEditing(): boolean {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.Edit);\r\n }\r\n\r\n isRemoving(): boolean {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.Delete);\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n hasUserNotes() {\r\n if (Object.keys(this._dictNotes).length == 0) { return false; }\r\n\r\n const userNotes = Object.keys(this._dictNotes).map(s => this._dictNotes[s]).filter(n => this.isValidString(n));\r\n\r\n return (userNotes != null && userNotes.length > 0);\r\n }\r\n}\r\n","
\r\n {{pageTitle()}}\r\n
\r\n\r\n
\r\n {{_validationMessage}}\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n
These Organization Names are similar to the one you entered.
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Organization NameDifference ScorePercent Difference
{{dist.comparedString}}{{dist.distance}}{{utilFns.formatNumber(dist.percentDifference, 3, 2)}}
\r\n
\r\n\r\n
\r\n\r\n
\r\n","import {Location} from '@angular/common';\r\nimport {Component, forwardRef, Inject, OnInit} from '@angular/core';\r\n\r\nimport {provideParent, StateMap, UnitOfWork, WorkflowEntityState} from '../../services/common';\r\nimport {EditPropParent, PageState} from '../../controls/common';\r\nimport {ReportingOrganization} from '../../entities/EntityModels';\r\nimport {StringDistance} from '../../entities/projections/StringDistance';\r\n\r\nimport {MaterialReportedUseEditData, MaterialReportedUseEditState, MaterialReportedUsesComponent} from './material-reported-uses.component';\r\n\r\nimport {MaterialWorkflowService} from '../../services/material-workflow-service';\r\nimport {UtilFns} from '../../utils/util-fns';\r\n\r\n@Component({\r\n selector: 'reporting-organization-editor',\r\n templateUrl: './reporting-organization-editor.html',\r\n providers: [provideParent(ReportingOrganizationEditorComponent, EditPropParent)]\r\n})\r\n\r\nexport class ReportingOrganizationEditorComponent implements OnInit {\r\n\r\n public _data: MaterialReportedUseEditData = new MaterialReportedUseEditData();\r\n public _pageState = new PageState('Material Reported Use Edit Data');\r\n\r\n public _saveOrganizationName: string;\r\n public _searchedOrganizationName: string;\r\n public _organizationNameChanged = false;\r\n public _filterSurveyYear: string;\r\n\r\n public _reportingOrganizations: ReportingOrganization[];\r\n public _organizationNameStringDistances: StringDistance[];\r\n\r\n public _materialWorkflowService: MaterialWorkflowService;\r\n public _isLoading = false;\r\n public _validationMessage: string;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location, materialWorkflowService: MaterialWorkflowService,\r\n @Inject(forwardRef(() => MaterialReportedUsesComponent)) public _parent: MaterialReportedUsesComponent) {\r\n\r\n this._data = _parent._data;\r\n this._materialWorkflowService = materialWorkflowService;\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._uow.fetchTyped('MaterialReportedUses/ReportingOrganizations', ReportingOrganization, { }).then(r => {\r\n this._isLoading = true;\r\n\r\n this._reportingOrganizations = r;\r\n\r\n this._isLoading = false;\r\n });\r\n\r\n if (this._data.edmReportingOrganization.currentEntity != null) {\r\n this._searchedOrganizationName = this._data.edmReportingOrganization.currentEntity.organizationName;\r\n }\r\n\r\n if (this._data.materialReportedUseEditState == MaterialReportedUseEditState.EditReportingOrganization) {\r\n this._saveOrganizationName = this.entity.organizationName;\r\n }\r\n }\r\n\r\n // interactions\r\n public pageTitle(): string {\r\n if (this._data.materialReportedUseEditState == MaterialReportedUseEditState.AddReportingOrganization) {\r\n return 'Adding Reporting Organization';\r\n }\r\n }\r\n\r\n isAdding(): boolean {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.AddReportingOrganization);\r\n }\r\n\r\n isEditing(): boolean {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.EditReportingOrganization);\r\n }\r\n\r\n onChangeOrganizationName(name: string) {\r\n\r\n if (!this.isValidString(name)) { // typically the user clears the textbox\r\n this._organizationNameStringDistances = [];\r\n this._searchedOrganizationName = '';\r\n return;\r\n }\r\n\r\n if (!this._organizationNameChanged) {\r\n return;\r\n }\r\n\r\n if (this._searchedOrganizationName == name) {\r\n return;\r\n }\r\n\r\n this._organizationNameChanged = false;\r\n this._searchedOrganizationName = name;\r\n\r\n this._isLoading = true;\r\n\r\n if (this._data.materialReportedUseEditState == MaterialReportedUseEditState.AddReportingOrganization) {\r\n // tslint:disable-next-line:max-line-length\r\n this._uow.fetch('MaterialReportedUses/FetchReportingOrganizationNameStringDistances', { organizationName: this.entity.organizationName, distThreshold: 4, pctThreshold: 50.00 }).then(r => {\r\n this._organizationNameStringDistances = r;\r\n this._isLoading = false;\r\n });\r\n } else { // in edit mode, exclude the name of the reporting organization being edited\r\n // tslint:disable-next-line:max-line-length\r\n this._uow.fetch('MaterialReportedUses/FetchReportingOrganizationNameStringDistancesExcludeById', { organizationName: this.entity.organizationName, distThreshold: 4, pctThreshold: 50.00, reportingOrganizationId: this.entity.reportingOrganizationId }).then(r => {\r\n this._organizationNameStringDistances = r;\r\n this._isLoading = false;\r\n });\r\n }\r\n }\r\n\r\n get entity(): ReportingOrganization {\r\n return this._data.edmReportingOrganization.currentEntity;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n public validateReportingOrganization(): boolean {\r\n if (this.entity == null || !this.isValidString(this.entity.organizationName)) {\r\n this._validationMessage = 'Please enter a valid organization name.';\r\n return false;\r\n }\r\n\r\n // check to see if the organization name already exists\r\n if (this.hasCalculatedDistances()) {\r\n if (this._organizationNameStringDistances.findIndex(o => o.distance == 0) > -1) {\r\n this._validationMessage = 'An organization with this name already exists.';\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n hasCalculatedDistances(): boolean {\r\n return (this._organizationNameStringDistances != null && this._organizationNameStringDistances.length > 0);\r\n }\r\n\r\n isValidString(teststring: string) {\r\n\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n // workflow\r\n public recordReportingOrganizationWorkflowAction() {\r\n let notes: string;\r\n\r\n if (this._data.materialReportedUseEditState == MaterialReportedUseEditState.AddReportingOrganization) {\r\n notes = 'New Reporting Organization name: ' + this.entity.organizationName;\r\n this._materialWorkflowService.recordNewReportingOrganization(WorkflowEntityState.Added, notes, this._data.userName);\r\n } else {\r\n if (this.entity.organizationName != this._saveOrganizationName) {\r\n notes = 'Reporting organization name changed from ' + this._saveOrganizationName + ' to ' + this.entity.organizationName;\r\n this._materialWorkflowService.recordChangedReportingOrganizationName(WorkflowEntityState.Modified, notes, this._data.userName);\r\n }\r\n }\r\n }\r\n}\r\n","\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n
\r\n {{_saveMessage}}\r\n
\r\n{{_validationMessage}}\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n Reporting Organization\r\n Survey Year\r\n Survey Material\r\n\r\n \r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n {{_selectedCASDisplay}}\r\n X\r\n
\r\n
\r\n \r\n
\r\n\r\n \r\n\r\n \r\n \r\n\r\n
\r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n \r\n {{_reportTitle}}\r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
Edit
\r\n
Remove All
\r\n
Organization
\r\n
Survey Year
\r\n
MaterialId
\r\n
CAS #
\r\n
RIFM ID
\r\n\r\n
Asia-Pacific
\r\n
Europe
\r\n
Japan
\r\n
North America
\r\n
South America
\r\n
Other
\r\n
\r\n
\r\n
\r\n \r\n \r\n
{{msu.data.organizationName}}
\r\n
{{msu.data.surveyYear}}
\r\n \r\n
{{msu.data.realCASNumber}}
\r\n
{{msu.data.rIFMId}}
\r\n
{{ utilFns.formatNumber(msu.data.asiaPacific, 14, 4) }}
\r\n
{{ utilFns.formatNumber(msu.data.europe, 14, 4) }}
\r\n
{{ utilFns.formatNumber(msu.data.japan, 14, 4) }}
\r\n
{{ utilFns.formatNumber(msu.data.northAmerica, 14, 4) }}
\r\n
{{ utilFns.formatNumber(msu.data.southAmerica, 14, 4) }}
\r\n
{{ utilFns.formatNumber(msu.data.other, 14, 4) }}
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, ViewChild, OnInit, } from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport * as _ from 'lodash';\r\nimport { UnitOfWork, StateMap, UserManager, ErrorLogger } from '../../services/common';\r\nimport { UtilFns, IEditHost, EditManager } from '../../utils/common';\r\nimport {\r\n Material,\r\n MaterialConsumption, ReportingOrganization, Survey,\r\n SurveyReportedUse,\r\n SurveyUsesByCompanyAndMaterialAndYear,\r\n} from '../../entities/EntityModels';\r\nimport { GeographicalAreaAndSurveyYear, SurveyFilters } from '../../entities/projections/SurveyProjections';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { STAFF_ROUTES } from './staff.routes';\r\nimport {MaterialReportedUseEditorComponent} from './material-reported-use-editor.component';\r\nimport {MaterialWorkflowHistoryComponent} from './material-workflow-history.component';\r\nimport {ReportingOrganizationEditorComponent} from './reporting-organization-editor.component';\r\nimport { MaterialWorkflowService } from '../../services/material-workflow-service';\r\n\r\nexport enum MaterialReportedUseEditState {\r\n None,\r\n Add = 1,\r\n Edit,\r\n Delete,\r\n AddReportingOrganization,\r\n EditReportingOrganization\r\n}\r\n\r\nexport class MaterialReportedUseEditData {\r\n materialReportedUseEditState: MaterialReportedUseEditState = MaterialReportedUseEditState.None;\r\n selectedMaterial: Material;\r\n selectedReportingOrganization: ReportingOrganization;\r\n selectedSurveyYear: string;\r\n edm: EditManager;\r\n edmMaterialConsumption: EditManager;\r\n edmReportingOrganization: EditManager;\r\n reportingOrganizations: ReportingOrganization[];\r\n surveys: Survey[];\r\n userName: string;\r\n}\r\n\r\n@Component({\r\n selector: 'material-reported-uses',\r\n templateUrl: './material-reported-uses.html',\r\n providers: [MaterialWorkflowService],\r\n})\r\n\r\nexport class MaterialReportedUsesComponent implements OnInit, IEditHost {\r\n @ViewChild(MaterialReportedUseEditorComponent) _materialReportedUseEditorComponent: MaterialReportedUseEditorComponent;\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n @ViewChild(MaterialWorkflowHistoryComponent) _materialWorkflowHistoryComponent: MaterialWorkflowHistoryComponent;\r\n @ViewChild(ReportingOrganizationEditorComponent) _reportingOrganizationEditorComponent: ReportingOrganizationEditorComponent;\r\n\r\n public _data: MaterialReportedUseEditData;\r\n\r\n public _surveyReportedUsesByCompanyAndMaterialAndYear: SurveyUsesByCompanyAndMaterialAndYear[];\r\n public _selectedSurveyUsesByCompanyAndMaterialAndYear: SurveyUsesByCompanyAndMaterialAndYear;\r\n public _surveyReportedUsesByCompanyAndMaterialAndYearEx: SelectableEntity[] = [];\r\n\r\n public _unreportedMaterial = false;\r\n public _geographicalAreaAndSurveyYears: GeographicalAreaAndSurveyYear[];\r\n public _organizationNames: string[];\r\n public _surveyYears: string[];\r\n\r\n public _filterOrganizationName: string;\r\n public _filterSurveyYear: string;\r\n\r\n public _selectedCASDisplay: string;\r\n private _selectedYears: string[];\r\n\r\n public _canShowWorkflowModal = false;\r\n public _isLoading = false;\r\n public _materialWasSelected = false; // used to determine how to refresh the display after saving changes\r\n public _refreshReportingOrganizations = false;\r\n public _reportTitle: string;\r\n public _saveMessage: string;\r\n public _validationMessage: string;\r\n public _workflowActivityType = 'reporteduse';\r\n\r\n private colorSelected = '#ddd';\r\n private colorUnselected = '#FFFFFF';\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n private _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n }\r\n\r\n ngOnInit() {\r\n this._data = new MaterialReportedUseEditData();\r\n\r\n this._stateMap.currentRouteName = STAFF_ROUTES.MaterialReportedUses.name;\r\n\r\n this._data.edm = new EditManager(this, this._uow, this._stateMap, 'Survey Reported Uses');\r\n this._data.edm.entities = [];\r\n this._data.edm.editing = false;\r\n this._data.edm.pageState.canShowMessage = false;\r\n\r\n this._data.edmMaterialConsumption = new EditManager(this, this._uow, this._stateMap, 'Material Consumptions');\r\n this._data.edmMaterialConsumption.editing = false;\r\n this._data.edmMaterialConsumption.pageState.canShowMessage = false;\r\n\r\n this._data.edmReportingOrganization = new EditManager(this, this._uow, this._stateMap, 'Reporting Organization');\r\n this._data.edmReportingOrganization.editing = false;\r\n this._data.edmReportingOrganization.pageState.canShowMessage = false;\r\n\r\n this._data.userName = this._userManager.currentUser.name;\r\n\r\n this.fetchFilterData();\r\n }\r\n\r\n // #############################################################################\r\n // load data\r\n // #############################################################################\r\n private fetchFilterData() {\r\n this._isLoading = true;\r\n\r\n this._uow.fetchTyped('MaterialReportedUses/ReportingOrganizations', ReportingOrganization, { }).then(r => {\r\n\r\n this._data.reportingOrganizations = r;\r\n\r\n const names = this._data.reportingOrganizations.map(n => n.organizationName);\r\n\r\n this._organizationNames = _.sortBy(names);\r\n this._organizationNames.unshift('All');\r\n this._filterOrganizationName = 'All';\r\n\r\n this._uow.fetchTyped('MaterialReportedUses/SurveysByMinYear', Survey, { minYear: 2015 }).then(s => {\r\n\r\n this._data.surveys = _.sortBy(s, y => y.surveyYear).reverse();\r\n\r\n this._surveyYears = this._data.surveys.map(sy => sy.surveyYear).filter((value, index, self) => self.indexOf(value) === index);\r\n\r\n this._filterSurveyYear = this._surveyYears[0];\r\n\r\n this._isLoading = false;\r\n });\r\n });\r\n }\r\n\r\n private fetchMaterialReportedUses() { // fetch projections for grid display\r\n let params = {};\r\n\r\n if (this._data.selectedMaterial != null) {\r\n params = {\r\n companyName: this._filterOrganizationName,\r\n year: this._filterSurveyYear,\r\n materialId: this._data.selectedMaterial.materialId\r\n };\r\n } else {\r\n params = {\r\n companyName: this._filterOrganizationName,\r\n year: this._filterSurveyYear\r\n };\r\n }\r\n\r\n this._isLoading = true;\r\n this._reportTitle = 'Loading data...';\r\n\r\n this._uow.fetch('MaterialReportedUses/FetchMaterialSurveyReportedUse', params).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._surveyReportedUsesByCompanyAndMaterialAndYear = r;\r\n this.formatSelectableEntities();\r\n this._reportTitle = this._surveyReportedUsesByCompanyAndMaterialAndYear.length + ' Matches found';\r\n\r\n this._unreportedMaterial = false;\r\n\r\n } else {\r\n this._reportTitle = 'No VoU reported data found for the selected filters.';\r\n this._surveyReportedUsesByCompanyAndMaterialAndYear = [];\r\n this._surveyReportedUsesByCompanyAndMaterialAndYearEx = [];\r\n\r\n this._unreportedMaterial = true;\r\n }\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n // #############################################################################\r\n // format and filter data\r\n // #############################################################################\r\n formatSelectableEntities() {\r\n this._surveyReportedUsesByCompanyAndMaterialAndYearEx = [];\r\n\r\n if (this._surveyReportedUsesByCompanyAndMaterialAndYear == null || this._surveyReportedUsesByCompanyAndMaterialAndYear.length < 1) { return; }\r\n\r\n const data: SelectableEntity[] = [];\r\n\r\n _.clone(this._surveyReportedUsesByCompanyAndMaterialAndYear).forEach(element => {\r\n data.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n\r\n this._surveyReportedUsesByCompanyAndMaterialAndYearEx = _.orderBy(data, ['companyName', 'surveyYear', 'realCASNumber', 'rIFMId'], ['asc', 'desc', 'asc', 'asc']);\r\n }\r\n\r\n filterToMaterialSurveyUseById(id: number): SurveyUsesByCompanyAndMaterialAndYear {\r\n if (this._surveyReportedUsesByCompanyAndMaterialAndYear == null || this._surveyReportedUsesByCompanyAndMaterialAndYear.length < 1) {\r\n return null;\r\n }\r\n\r\n const materialUses = this._surveyReportedUsesByCompanyAndMaterialAndYear.filter(u => u.id == id);\r\n if (materialUses != null && materialUses.length > 0) {\r\n return materialUses[0];\r\n }\r\n }\r\n\r\n public findReportingOrganizationByName(organizationName: string): ReportingOrganization {\r\n const orgIdx = this._data.reportingOrganizations.findIndex(o => o.organizationName == organizationName);\r\n return this._data.reportingOrganizations[orgIdx];\r\n }\r\n\r\n // #############################################################################\r\n // interactions\r\n // ############################################################################\r\n applyFilter() {\r\n this.fetchMaterialReportedUses();\r\n }\r\n\r\n clearSelectedMaterial() {\r\n this._materialWasSelected = false;\r\n this._selectedCASDisplay = '';\r\n this._data.selectedMaterial = null;\r\n\r\n this.resetMaterialWorkflowModal();\r\n\r\n this._reportTitle = '';\r\n this._surveyReportedUsesByCompanyAndMaterialAndYear = [];\r\n this._surveyReportedUsesByCompanyAndMaterialAndYearEx = [];\r\n this._unreportedMaterial = false;\r\n }\r\n\r\n canApplyFilter(): boolean {\r\n return (this._data.selectedMaterial != null || this._filterOrganizationName != 'All');\r\n }\r\n\r\n canDeactivate() {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.None && !this._uow.hasChanges());\r\n }\r\n\r\n canShowNotes() {\r\n return (this._data.selectedMaterial != null);\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n onSelectMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this).then(mli => {\r\n if (mli == null) {\r\n return;\r\n }\r\n this._isLoading = true;\r\n return this._uow.materialRepository.withId(mli.materialId);\r\n }).then(m => {\r\n if (m) {\r\n this._materialWasSelected = true;\r\n this._selectedCASDisplay = (m.realCASNumber || '') + ' RIFM Id: ' + m.formattedRIFMId;\r\n this._data.selectedMaterial = m;\r\n\r\n this.resetMaterialWorkflowModal();\r\n\r\n this._reportTitle = '';\r\n this._surveyReportedUsesByCompanyAndMaterialAndYear = [];\r\n this._surveyReportedUsesByCompanyAndMaterialAndYearEx = [];\r\n this._unreportedMaterial = false; // this is not known until resported uses are queried\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n onSelectMaterialFromList(msux: SelectableEntity) {\r\n\r\n if (msux == null) { return; }\r\n\r\n this._uow.materialRepository.withId(msux.data.materialId).then(m => {\r\n if (m) {\r\n this._materialWasSelected = true;\r\n this._selectedCASDisplay = (m.realCASNumber || '') + ' RIFM Id: ' + m.formattedRIFMId;\r\n this._data.selectedMaterial = m;\r\n\r\n this._reportTitle = '';\r\n this._surveyReportedUsesByCompanyAndMaterialAndYear = [];\r\n this._surveyReportedUsesByCompanyAndMaterialAndYearEx = [];\r\n this._unreportedMaterial = false; // this is not known until resported uses are queried\r\n\r\n this.fetchMaterialReportedUses();\r\n }\r\n });\r\n }\r\n\r\n onShowNotes() {\r\n\r\n if (this._materialWorkflowHistoryComponent == null || this._data.selectedMaterial == null) {\r\n return;\r\n }\r\n\r\n UtilFns.showModal(this._materialWorkflowHistoryComponent, this).then(mrun => {\r\n this.resetMaterialWorkflowModal();\r\n return;\r\n });\r\n\r\n }\r\n\r\n resetMaterialWorkflowModal() {\r\n this._canShowWorkflowModal = false;\r\n\r\n setTimeout(() => {\r\n this._canShowWorkflowModal = true;\r\n }, 1);\r\n }\r\n\r\n resetBackgroundColor(materialSurveyUses: SelectableEntity[]) {\r\n materialSurveyUses.forEach((element, index) => {\r\n element.backgroundColor = this.colorUnselected;\r\n });\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n // #############################################################################\r\n // edit manager overrides\r\n // #############################################################################\r\n canAddUnreportedMaterial() {\r\n return (this._data.selectedMaterial != null && this._unreportedMaterial && !this._uow.hasChanges());\r\n }\r\n\r\n canAddReportingOrganization() {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.None && !this._uow.hasChanges());\r\n }\r\n\r\n canEditReportingOrganization() {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.None && !this._uow.hasChanges() && this._filterOrganizationName != 'All');\r\n }\r\n\r\n canApply() {\r\n\r\n if (this._data.edm.editing) {\r\n if (this._uow.hasChanges()) {\r\n return true;\r\n }\r\n\r\n if (this._materialReportedUseEditorComponent != null && this._materialReportedUseEditorComponent.hasUserNotes()) {\r\n return true;\r\n }\r\n }\r\n\r\n\r\n if (this._data.edmReportingOrganization.editing) {\r\n if (this._uow.hasChanges()) {\r\n return true;\r\n }\r\n\r\n }\r\n\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canEdit() {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.Add || this._data.materialReportedUseEditState == MaterialReportedUseEditState.Edit\r\n || this._data.materialReportedUseEditState == MaterialReportedUseEditState.Delete);\r\n }\r\n\r\n canSave() {\r\n if (this._data.edm.editing || this._data.edmReportingOrganization.editing) { return false; }\r\n if (!this._data.edm.hasEdits()) { return false; }\r\n if (!this._data.edm.validateBeforeSave()) { return false; }\r\n\r\n return true;\r\n }\r\n\r\n canShowApply(): boolean {\r\n return (this._data.edm.editing || this._data.edmReportingOrganization.editing);\r\n }\r\n\r\n canShowBack() {\r\n if (!this._data.edm.editing && !this._data.edmReportingOrganization.editing) { return false; }\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n canShowConfirmDelete() {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.Delete);\r\n }\r\n\r\n canShowEditButtons() {\r\n return (this._data.materialReportedUseEditState != MaterialReportedUseEditState.None || this._uow.hasChanges());\r\n }\r\n\r\n canShowEditReportingOrganizationComponent(): boolean {\r\n // tslint:disable-next-line:max-line-length\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.AddReportingOrganization || this._data.materialReportedUseEditState == MaterialReportedUseEditState.EditReportingOrganization);\r\n }\r\n\r\n canFilterAndView() {\r\n return (this._data.materialReportedUseEditState == MaterialReportedUseEditState.None && this.hasEdits() == false);\r\n }\r\n\r\n hasUseData() {\r\n return (this._surveyReportedUsesByCompanyAndMaterialAndYearEx != null && this._surveyReportedUsesByCompanyAndMaterialAndYearEx.length > 0);\r\n }\r\n\r\n onAdd() {\r\n if (this._filterOrganizationName != 'All') {\r\n this._data.selectedReportingOrganization = this.findReportingOrganizationByName(this._filterOrganizationName);\r\n }\r\n\r\n this._data.selectedSurveyYear = this._filterSurveyYear;\r\n this._data.edm.entities = [];\r\n\r\n const mcparams = {\r\n materialId: this._data.selectedMaterial.materialId,\r\n surveyYear: this._data.selectedSurveyYear\r\n };\r\n\r\n // there may be records in the tblMaterialConsumption table for that survey and material as a result of different organization reporting\r\n this._uow.fetch('MaterialReportedUses/FetchMaterialConsumptionByMaterialIdAndSurveyYear', mcparams).then(m => {\r\n if (m != null && m.length > 0) {\r\n this._data.edmMaterialConsumption.entities = m;\r\n } else {\r\n this._data.edmMaterialConsumption.entities = [];\r\n }\r\n\r\n this._data.edm.editing = true;\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.Add;\r\n\r\n this._isLoading = false;\r\n\r\n });\r\n }\r\n\r\n onAddReportingOrganization() {\r\n const ro = this._uow.reportingOrganizationFactory.create();\r\n\r\n this._data.edmReportingOrganization.onlyEntity = ro;\r\n this._data.edmReportingOrganization.editing = true;\r\n\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.AddReportingOrganization;\r\n }\r\n\r\n onEditReportingOrganization() {\r\n\r\n this._data.edmReportingOrganization.onlyEntity = this.findReportingOrganizationByName(this._filterOrganizationName);\r\n this._data.edmReportingOrganization.editing = true;\r\n\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.EditReportingOrganization;\r\n }\r\n\r\n onApply() {\r\n this._reportTitle = '';\r\n this._saveMessage = '';\r\n this._validationMessage = '';\r\n\r\n if (this.canEdit() && this._data.edm.editing) {\r\n\r\n // Validate\r\n if (!this._materialReportedUseEditorComponent.validateSurveyReportedUseData()) {\r\n return;\r\n }\r\n\r\n this._materialReportedUseEditorComponent.processEdits();\r\n this._data.edm.onApplyCore();\r\n\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.None;\r\n\r\n this._saveMessage = 'Save Survey Reported Use Changes for Material: ' + this._data.selectedMaterial.realCASNumber + ', ' + this._data.selectedMaterial.principalSynonymText();\r\n\r\n } else if (this.canShowEditReportingOrganizationComponent() && this._data.edmReportingOrganization.editing) {\r\n // Validate\r\n if (!this._reportingOrganizationEditorComponent.validateReportingOrganization()) {\r\n return;\r\n }\r\n\r\n // check for similar name\r\n this._data.edmReportingOrganization.onApplyCore();\r\n\r\n this._reportingOrganizationEditorComponent.recordReportingOrganizationWorkflowAction();\r\n\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.None;\r\n\r\n this._refreshReportingOrganizations = true;\r\n\r\n this._saveMessage = 'Save Reporting Organization changes.';\r\n }\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.None;\r\n this._data.edm.editing = false;\r\n }\r\n\r\n onCancel() {\r\n this._saveMessage = '';\r\n this._validationMessage = '';\r\n\r\n // survey reported uses\r\n this._data.edm.onCancelCore();\r\n this._data.edm.entities = [];\r\n this._data.edm.clearErrors();\r\n this._data.edm.editing = false;\r\n\r\n // material consumption\r\n this._data.edmMaterialConsumption.onCancelCore();\r\n this._data.edmMaterialConsumption.entities = [];\r\n this._data.edmMaterialConsumption.clearErrors();\r\n this._data.edmMaterialConsumption.editing = false;\r\n\r\n // reporting organizaiton\r\n this._data.edmReportingOrganization.onCancelCore();\r\n this._data.edmReportingOrganization.clearErrors();\r\n this._data.edmReportingOrganization.editing = false;\r\n this._refreshReportingOrganizations = false;\r\n\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.None;\r\n\r\n // this.fetch();\r\n }\r\n\r\n onConfirmDelete() {\r\n this._materialReportedUseEditorComponent.processRemoveAll();\r\n\r\n this._data.edm.onApplyCore();\r\n this.onSave();\r\n\r\n this._reportTitle = 'Records removed.';\r\n }\r\n\r\n onSave() {\r\n this._saveMessage = '';\r\n this._validationMessage = '';\r\n\r\n if (!this._data.edm.hasEdits()) {\r\n return false;\r\n }\r\n\r\n this._isLoading = true;\r\n this._canShowWorkflowModal = false;\r\n\r\n this._data.edm.onSaveCore().then(() => {\r\n this._isLoading = false;\r\n\r\n // clear survey reported uses edm\r\n this._data.edm.entities = [];\r\n this._data.edm.clearErrors();\r\n this._data.edm.editing = false;\r\n\r\n // clear material consumption edm\r\n this._data.edmMaterialConsumption.entities = [];\r\n this._data.edmMaterialConsumption.clearErrors();\r\n this._data.edmMaterialConsumption.editing = false;\r\n\r\n // clear previous search results\r\n this._reportTitle = '';\r\n this._surveyReportedUsesByCompanyAndMaterialAndYear = [];\r\n this._surveyReportedUsesByCompanyAndMaterialAndYearEx = [];\r\n this._unreportedMaterial = false;\r\n\r\n // reset filters\r\n if (this._materialWasSelected == false) { // must have been a search by organization without selecting for a specific material\r\n this._data.selectedMaterial = null; // reset filters to state before a row was selected for edit\r\n this._selectedCASDisplay = '';\r\n } else {\r\n // change request to show all organizations after saving edits for a selected material\r\n this._filterOrganizationName = 'All';\r\n this._data.selectedReportingOrganization = null;\r\n }\r\n\r\n if (this._refreshReportingOrganizations) {\r\n this._isLoading = true;\r\n\r\n this._uow.fetchTyped('MaterialReportedUses/ReportingOrganizations', ReportingOrganization, { }).then(r => {\r\n\r\n this._data.reportingOrganizations = r;\r\n\r\n const names = this._data.reportingOrganizations.map(n => n.organizationName);\r\n\r\n this._organizationNames = names.sort();\r\n this._organizationNames.unshift('All');\r\n\r\n this._filterOrganizationName = 'All';\r\n this._data.selectedReportingOrganization = null;\r\n\r\n // clear reporting organization edm\r\n this._data.edmReportingOrganization.onCancelCore();\r\n this._data.edmReportingOrganization.clearErrors();\r\n this._data.edmReportingOrganization.editing = false;\r\n\r\n this._refreshReportingOrganizations = false;\r\n\r\n if (this.canApplyFilter()) {\r\n this.fetchMaterialReportedUses();\r\n }\r\n\r\n this._isLoading = false;\r\n\r\n });\r\n } else {\r\n if (this.canApplyFilter()) {\r\n this.fetchMaterialReportedUses();\r\n }\r\n }\r\n\r\n this._canShowWorkflowModal = true;\r\n\r\n }).catch(e => {\r\n this._validationMessage = 'Save failed. Please contact support. Error: ' + e.toString();\r\n this._isLoading = false;\r\n });\r\n\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.None;\r\n }\r\n\r\n onEdit(msux: SelectableEntity) {\r\n if (msux == null) { return; }\r\n\r\n if (this._data.selectedMaterial == null || this._data.selectedMaterial.materialId != msux.data.materialId) {\r\n this._uow.materialRepository.withId(msux.data.materialId).then(m => {\r\n if (m) {\r\n this._selectedCASDisplay = (m.realCASNumber || '') + ' RIFM Id: ' + m.formattedRIFMId;\r\n this._data.selectedMaterial = m;\r\n\r\n this.editReportedUses(msux);\r\n }\r\n });\r\n } else {\r\n this.editReportedUses(msux);\r\n }\r\n }\r\n\r\n // Both the data for the material in the tblSurveyReportedUses and tblMaterialConsumption table need to be retrieved and kept in sync\r\n // Two tables store similar information for legacy reasons.\r\n editReportedUses(msux: SelectableEntity) {\r\n\r\n this._selectedSurveyUsesByCompanyAndMaterialAndYear = this.filterToMaterialSurveyUseById(msux.data.id);\r\n this._data.selectedReportingOrganization = this.findReportingOrganizationByName(this._selectedSurveyUsesByCompanyAndMaterialAndYear.organizationName);\r\n this._data.selectedSurveyYear\t = this._selectedSurveyUsesByCompanyAndMaterialAndYear.surveyYear;\r\n\r\n const params = {\r\n materialId: this._data.selectedMaterial.materialId,\r\n companyName: this._data.selectedReportingOrganization.organizationName,\r\n surveyYear: this._data.selectedSurveyYear\r\n };\r\n\r\n this._isLoading = true;\r\n\r\n this._uow.fetch('MaterialReportedUses/FetchSurveyReportedUsesByYearAndMaterialId', params).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._data.edm.entities = r;\r\n\r\n const mcparams = {\r\n materialId: this._data.selectedMaterial.materialId,\r\n surveyYear: this._data.selectedSurveyYear\r\n };\r\n\r\n this._uow.fetch('MaterialReportedUses/FetchMaterialConsumptionByMaterialIdAndSurveyYear', mcparams).then(m => {\r\n if (m != null && m.length > 0) {\r\n this._data.edmMaterialConsumption.entities = m;\r\n } else {\r\n this._data.edmMaterialConsumption.entities = [];\r\n }\r\n\r\n this._isLoading = false;\r\n\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.Edit;\r\n this._data.edm.editing = true;\r\n });\r\n } else {\r\n this._data.edm.entities = [];\r\n this._validationMessage = 'An error occurred retrieving Survey Reported Use data. Please contact support.';\r\n this._isLoading = false;\r\n return;\r\n }\r\n });\r\n }\r\n\r\n // remove all survey reported use records for the selected material, company and survey year\r\n onRemove(msux: SelectableEntity) {\r\n if (msux == null) { return; }\r\n\r\n if (this._data.selectedMaterial == null || this._data.selectedMaterial.materialId != msux.data.materialId) {\r\n this._uow.materialRepository.withId(msux.data.materialId).then(m => {\r\n if (m) {\r\n this._selectedCASDisplay = (m.realCASNumber || '') + ' RIFM Id: ' + m.formattedRIFMId;\r\n this._data.selectedMaterial = m;\r\n\r\n this.removeAll(msux);\r\n }\r\n });\r\n } else {\r\n this.removeAll(msux);\r\n }\r\n }\r\n\r\n removeAll(msux: SelectableEntity) {\r\n this._selectedSurveyUsesByCompanyAndMaterialAndYear = this.filterToMaterialSurveyUseById(msux.data.id);\r\n this._data.selectedReportingOrganization = this.findReportingOrganizationByName(this._selectedSurveyUsesByCompanyAndMaterialAndYear.organizationName);\r\n this._data.selectedSurveyYear\t = this._selectedSurveyUsesByCompanyAndMaterialAndYear.surveyYear;\r\n\r\n const params = {\r\n materialId: this._data.selectedMaterial.materialId,\r\n companyName: this._data.selectedReportingOrganization.organizationName,\r\n surveyYear: this._data.selectedSurveyYear\r\n };\r\n\r\n this._isLoading = true;\r\n\r\n // fetch survey reported uses\r\n this._uow.fetch('MaterialReportedUses/FetchSurveyReportedUsesByYearAndMaterialId', params).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._data.edm.entities = r;\r\n\r\n const mcparams = {\r\n materialId: this._data.selectedMaterial.materialId,\r\n surveyYear: this._data.selectedSurveyYear\r\n };\r\n\r\n // fetch material consumption data that should be kept in sync\r\n this._uow.fetch('MaterialReportedUses/FetchMaterialConsumptionByMaterialIdAndSurveyYear', mcparams).then(m => {\r\n if (m == null && m.length == 0) {\r\n this._validationMessage = 'An error occurred retrieving Material Consumption data. Please contact support.';\r\n this._isLoading = false;\r\n return;\r\n }\r\n this._data.edmMaterialConsumption.entities = m;\r\n });\r\n\r\n this._isLoading = false;\r\n\r\n } else {\r\n this._validationMessage = 'An error occurred retrieving Survey Reported Use data. Please contact support.';\r\n this._isLoading = false;\r\n return;\r\n }});\r\n\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.Delete;\r\n this._data.edm.editing = true;\r\n }\r\n\r\n public resetFiltersAndData() {\r\n this._filterSurveyYear = 'All';\r\n this._selectedYears[0] = this._data.surveys[0].surveyYear;\r\n\r\n this._data.selectedMaterial = null;\r\n this._data.selectedReportingOrganization = null;\r\n this._data.selectedMaterial = null;\r\n this._data.selectedSurveyYear = '';\r\n this._data.selectedSurveyYear = '';\r\n this._data.edm.entities = [];\r\n this._data.edmMaterialConsumption.entities = [];\r\n\r\n this._reportTitle = '';\r\n this._surveyReportedUsesByCompanyAndMaterialAndYear = [];\r\n this._surveyReportedUsesByCompanyAndMaterialAndYearEx = [];\r\n\r\n this._data.materialReportedUseEditState = MaterialReportedUseEditState.None;\r\n\r\n }\r\n}\r\n","/* tslint:disable:max-line-length */\r\nimport { MaterialEditorComponent } from './material-editor.component';\r\nimport { ReferenceEditorComponent } from './reference-editor.component';\r\nimport { ProtocolEditorComponent } from './protocol-editor.component';\r\nimport { JournalsComponent } from './journals.component';\r\nimport { ProjectEditorComponent } from './project-editor.component';\r\nimport { FSAGEditorComponent } from './fsag-editor.component';\r\nimport { TypeReferenceRelationEditorComponent } from './type-reference-relation-editor.component';\r\nimport { WhatsNewEditorComponent } from './whats-new-editor.component';\r\nimport { ReferenceWorkflowStatsComponent } from './reference-workflow-stats.component';\r\nimport { ReferenceAuditComponent } from './reference-audit.component';\r\nimport { SurveyReportedUseComponent } from './survey-reported-use.component';\r\nimport { SafetyAssessmentCategoryEditorComponent } from './safety-assessment-category-editor.component';\r\nimport { TypePredictionEditorBaseComponent } from './type-prediction-editor-base.component';\r\nimport {MaterialReportedUsesComponent} from './material-reported-uses.component';\r\n\r\nexport const STAFF_ROUTES = {\r\n Material: { name: 'MaterialEditor', title: 'Material', path: 'material', component: MaterialEditorComponent, rolesExcluded: 'FEMA' },\r\n MaterialById: {\r\n name: 'MaterialEditorById',\r\n title: 'Material',\r\n path: 'material/:materialId/info',\r\n component: MaterialEditorComponent,\r\n rolesExcluded: 'FEMA'\r\n },\r\n\r\n Reference: { name: 'ReferenceEditor', title: 'Reference', path: 'reference/info', component: ReferenceEditorComponent },\r\n ReferenceAudit: { name: 'ReferenceAudit', title: 'Reference Audit', path: 'reference/audit', component: ReferenceAuditComponent },\r\n Protocol: { name: 'ProtocolEditor', title: 'Protocol', path: 'reference/protocol', component: ProtocolEditorComponent },\r\n\r\n ReferenceEditor: {\r\n name: 'ReferenceEditorById',\r\n title: 'Reference',\r\n path: 'reference/:referenceId/info',\r\n component: ReferenceEditorComponent\r\n },\r\n ReferenceAuditById: {\r\n name: 'ReferenceAudit',\r\n title: 'Reference Audit',\r\n path: 'reference/:referenceId/audit',\r\n component: ReferenceAuditComponent\r\n },\r\n ProtocolById: {\r\n name: 'ReferenceProtocolEditor',\r\n title: 'Protocol',\r\n path: 'reference/:referenceId/protocol',\r\n component: ProtocolEditorComponent\r\n },\r\n\r\n\r\n Journals: { name: 'Journals', title: 'Journals', path: 'journals', component: JournalsComponent, rolesExcluded: 'FEMA' },\r\n Project: { name: 'ProjectEditor', title: 'Project', path: 'project', component: ProjectEditorComponent, rolesExcluded: 'FEMA' },\r\n FSAG: { name: 'FSAGEditor', title: 'FSAG', path: 'fsag', component: FSAGEditorComponent, rolesExcluded: 'FEMA' },\r\n TypeReferenceRelation: {\r\n name: 'TypeReferenceRelationEditor',\r\n title: 'Reference Relation Types',\r\n path: 'typeReferenceRelation',\r\n component: TypeReferenceRelationEditorComponent,\r\n rolesExcluded: 'FEMA'\r\n },\r\n WhatsNew: {\r\n name: 'WhatsNewEditor',\r\n title: 'What\\'s New',\r\n path: 'whats-new',\r\n component: WhatsNewEditorComponent,\r\n rolesExcluded: 'FEMA'\r\n },\r\n RefWorkflowStats: {\r\n name: 'ReferenceWorkflowStats',\r\n title: 'Workflow',\r\n path: 'ref-workflow',\r\n component: ReferenceWorkflowStatsComponent,\r\n rolesExcluded: 'FEMA'\r\n },\r\n MaterialReportedUses: {\r\n name: 'MaterialReportedUses',\r\n title: 'Edit Survey Uses',\r\n path: 'material-reported-uses',\r\n component: MaterialReportedUsesComponent,\r\n rolesExcluded: 'consultant,FEMA'\r\n },\r\n SurveyReportedUse: {\r\n name: 'SurveyReportedUse',\r\n title: 'Query Survey Uses',\r\n path: 'survey-reported-use',\r\n component: SurveyReportedUseComponent,\r\n rolesExcluded: 'consultant,FEMA'\r\n },\r\n AssessmentCategories: {\r\n name: 'AssessmentCategories',\r\n title: 'SA Categories',\r\n path: 'safety-assessment-categories',\r\n component: SafetyAssessmentCategoryEditorComponent,\r\n rolesExcluded: 'FEMA'\r\n },\r\n TypePredictionEditorBaseComponent: {\r\n name: 'TypePredictionEditorBase',\r\n title: 'Prediction Types',\r\n path: 'type-prediction-editor-base',\r\n component: TypePredictionEditorBaseComponent,\r\n rolesExcluded: 'FEMA'\r\n }\r\n};\r\n","
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
{{getPageTitle()}}
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
","import { Component, OnDestroy, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport * as _ from 'lodash';\r\n\r\nimport { IRouteDefinition, SearchService, StateMap, UnitOfWork } from '../../services/common';\r\nimport { STAFF_ROUTES } from './staff.routes';\r\nimport { environment } from '../../../environments/environment';\r\n\r\n\r\ninterface IRouteInfo {\r\n definition: IRouteDefinition;\r\n canShow?: (state: StateMap) => boolean;\r\n getPath?: (state: StateMap) => string;\r\n}\r\n\r\n@Component({\r\n selector: 'staff-editing',\r\n templateUrl: './staff-editing.html',\r\n})\r\nexport class StaffEditingComponent implements OnInit, OnDestroy {\r\n routes: IRouteInfo[];\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _searchService: SearchService,\r\n public _location: Location, public _http: HttpClient) {\r\n\r\n this.routes = [\r\n { definition: STAFF_ROUTES.Material, canShow: x => x.currentMaterial == null },\r\n {\r\n definition: STAFF_ROUTES.MaterialById,\r\n canShow: x => x.currentMaterial != null,\r\n getPath: x => `material/${x.currentMaterial.materialId}/info`\r\n },\r\n\r\n { definition: STAFF_ROUTES.Reference, canShow: x => x.currentReference == null },\r\n {\r\n definition: STAFF_ROUTES.ReferenceEditor,\r\n canShow: x => x.currentReference != null,\r\n getPath: x => `reference/${x.currentReference.referenceId}/info`\r\n },\r\n\r\n { definition: STAFF_ROUTES.ReferenceAudit, canShow: x => x.currentReference == null },\r\n {\r\n definition: STAFF_ROUTES.ReferenceAuditById,\r\n canShow: x => x.currentReference != null,\r\n getPath: x => `reference/${x.currentReference.referenceId}/audit`\r\n },\r\n\r\n { definition: STAFF_ROUTES.Protocol, canShow: x => x.currentReference == null },\r\n {\r\n definition: STAFF_ROUTES.ProtocolById,\r\n canShow: x => x.currentReference != null,\r\n getPath: x => `reference/${x.currentReference.referenceId}/protocol`\r\n },\r\n\r\n { definition: STAFF_ROUTES.Journals },\r\n { definition: STAFF_ROUTES.TypePredictionEditorBaseComponent },\r\n { definition: STAFF_ROUTES.Project },\r\n { definition: STAFF_ROUTES.FSAG },\r\n { definition: STAFF_ROUTES.TypeReferenceRelation },\r\n { definition: STAFF_ROUTES.WhatsNew },\r\n { definition: STAFF_ROUTES.RefWorkflowStats },\r\n { definition: STAFF_ROUTES.MaterialReportedUses },\r\n { definition: STAFF_ROUTES.SurveyReportedUse },\r\n { definition: STAFF_ROUTES.AssessmentCategories }\r\n ];\r\n }\r\n\r\n getPath(routeInfo: IRouteInfo) {\r\n if (routeInfo.getPath) {\r\n return routeInfo.getPath(this._stateMap);\r\n }\r\n return routeInfo.definition.path;\r\n }\r\n\r\n canShow(routeInfo: IRouteInfo) {\r\n\r\n if (routeInfo.canShow && !routeInfo.canShow(this._stateMap)) {\r\n return false;\r\n }\r\n\r\n const routeDef = routeInfo.definition;\r\n\r\n if (routeDef.name == 'MaterialReportedUses') {\r\n if (!this._stateMap.currentUser.isAdmin) {\r\n return false;\r\n }\r\n }\r\n\r\n if (this._stateMap.currentUser.isStaff) {\r\n // Exception to prevent consultant staff from seeing otherwise staff viewable content.\r\n if (routeDef.rolesExcluded) {\r\n const roles = routeDef.rolesExcluded.split(',').map(item => item.trim());\r\n\r\n if (roles != null && roles.length > 0) {\r\n return (!this.userRoleFound(roles));\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n return !routeDef.staffOnly;\r\n\r\n }\r\n\r\n userRoleFound(roles: string[]): boolean {\r\n for (let idx = 0; idx < roles.length; idx++) {\r\n if (this._stateMap.currentUser.isInRole(roles[idx])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n ngOnDestroy() {\r\n }\r\n\r\n currentRoute() {\r\n const route = _.find(this.routes, r => r.definition.name == this.routeName);\r\n return route == null ? null : route.definition;\r\n }\r\n\r\n get routeName() {\r\n return this._stateMap.currentRouteName;\r\n }\r\n\r\n canUseMaterialHeader() {\r\n return this.routeName == STAFF_ROUTES.Material.name;\r\n }\r\n\r\n canUseReferenceHeader() {\r\n return (this.routeName == STAFF_ROUTES.Reference.name\r\n || this.routeName == STAFF_ROUTES.Protocol.name\r\n || this.routeName == STAFF_ROUTES.ReferenceAudit.name);\r\n }\r\n\r\n canUseDefaultHeader() {\r\n return !(this.canUseMaterialHeader() || this.canUseReferenceHeader());\r\n }\r\n\r\n getPageTitle() {\r\n return 'Staff/' + (this.currentRoute() ? this.currentRoute().title : '') + ': ';\r\n }\r\n\r\n canDeactivate() {\r\n if (this._uow.hasChanges()) {\r\n return this._stateMap.yesNoComponent.showModal(\r\n 'Changes will be lost', 'Do you want to continue?').then(ok => {\r\n if (ok) {\r\n this._uow.rollback();\r\n }\r\n return ok;\r\n });\r\n } else {\r\n return Promise.resolve(true);\r\n }\r\n }\r\n\r\n refreshLookups() {\r\n return this._stateMap.yesNoComponent.showModal('Clear Lookup Cache', 'Clear Cache for Lookup Tables and Reload ?')\r\n .then(ok => {\r\n if (ok) {\r\n this._http.post(`${environment.appUrl}/breeze/lookupReset`, null)\r\n .toPromise()\r\n .then(() => {\r\n document.location.reload();\r\n });\r\n }\r\n return ok;\r\n });\r\n }\r\n}\r\n","
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { UnitOfWork, StateMap, provideParent } from '../../services/common';\r\nimport { PageState, EditPropParent } from '../../controls/common';\r\nimport { ExposureSurvey, TypeExposureSurveyStatus, TypeCremeVersion } from '../../entities/EntityModels';\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'exposure-survey-editor',\r\n templateUrl: './exposure-survey-editor.html',\r\n providers: [provideParent(ExposureSurveyEditorComponent, EditPropParent)]\r\n})\r\n\r\nexport class ExposureSurveyEditorComponent implements OnInit {\r\n\r\n _pageState = new PageState('Exposure Survey Editor');\r\n _typeExposureSurveyStatuses: TypeExposureSurveyStatus[];\r\n _typeCremeVersions: TypeCremeVersion[];\r\n\r\n _selectedMonthIndex: number;\r\n _selectedYearIndex: number;\r\n\r\n public _monthNames = [{ month: 'January' }, { month: 'February' }, { month: 'March' },\r\n { month: 'April' }, { month: 'May' }, { month: 'June' },\r\n { month: 'July' }, { month: 'August' }, { month: 'September' },\r\n { month: 'October' }, { month: 'November' }, { month: 'December' }];\r\n\r\n public _years: { year: number }[] = [];\r\n\r\n @Input() entity: ExposureSurvey;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.typeExposureSurveyStatusRepository.all().then(r => {\r\n this._typeExposureSurveyStatuses = r;\r\n });\r\n\r\n this._uow.typeCremeVersionRepository.all().then(c => {\r\n this._typeCremeVersions = _.sortBy(c, t => t.cremeVersion).reverse();\r\n });\r\n\r\n this._years = this.createYearSequence(2001, this.entity.exposureSurveyDate.getUTCFullYear(), 10);\r\n this._years = _.sortBy(this._years, y => y.year).reverse();\r\n\r\n this._selectedMonthIndex = this.entity.exposureSurveyDate.getUTCMonth();\r\n this._selectedYearIndex = this._years.findIndex(y => y.year == this.entity.exposureSurveyDate.getUTCFullYear());\r\n }\r\n\r\n createYearSequence(minYear: number, currentYear: number, additionalYears: number): {year: number}[] {\r\n const cnt = minYear + (currentYear - minYear) + additionalYears;\r\n const years = _.range(2001, cnt, 1);\r\n\r\n return years.map(function (y) {\r\n return { year: y };\r\n });\r\n }\r\n\r\n isAdded() {\r\n return this.entity.entityAspect.entityState.isAdded();\r\n }\r\n\r\n onSelectMonth(monthidx: number) {\r\n monthidx++;\r\n this.entity.exposureSurveyDate = this.formatExposureSurveyDate(monthidx, this.entity.exposureSurveyDate.getFullYear());\r\n }\r\n\r\n onSelectYear(yearidx: number) {\r\n let monthidx: number = this.entity.exposureSurveyDate.getMonth();\r\n monthidx++;\r\n this.entity.exposureSurveyDate = this.formatExposureSurveyDate(monthidx, this._years[yearidx].year);\r\n }\r\n\r\n formatExposureSurveyDate(month: number, year: number): Date {\r\n const s = '';\r\n const surveydate = s.concat('' + month, '/', '01', '/', '' + year);\r\n return new Date(surveydate);\r\n }\r\n}\r\n","
\r\n \r\n {{_adding ? \"Adding an Exposure Survey\" : \"Editing an Exposure Survey\" }}\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n

{{_validationMessage}}

\r\n
\r\n
\r\n
\r\n
\r\n

Click on a row to view summary statistics.

\r\n
\r\n
\r\n
\r\n
\r\n
Edit
\r\n
Remove
\r\n
Survey Date
\r\n
Survey Number
\r\n
Survey Status
\r\n
Description
\r\n
Creme Version
\r\n
Survey Materials
\r\n
\r\n
\r\n
\r\n \r\n \r\n
{{es.data.exposureSurveyMonthYear}}
\r\n
{{es.data.exposureSurveyNumber}}
\r\n
{{es.data.typeExposureSurveyStatusId}}
\r\n
{{es.data.description}}
\r\n
{{es.data.typeCremeVersion.cremeVersion}}
\r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n Survey Date: \r\n {{_selectedExposureSurvey.exposureSurveyMonthYear}}\r\n
\r\n Survey Number: \r\n {{_selectedExposureSurvey.exposureSurveyNumber}}\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{_exposureSurveyStatistics.numberOfMaterials}}\r\n
\r\n
\r\n \r\n {{_exposureSurveyStatistics.numberOfMaterialsWithStatusChangeHasData}}\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n {{_exposureSurveyStatistics.numberOfMaterialsWithExposureData}}\r\n
\r\n
\r\n \r\n {{_exposureSurveyStatistics.numberOfMaterialsWithStatusChangeNoData}}\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n {{_exposureSurveyStatistics.numberOfMaterialsWithoutExposureData}}\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n","import { Location } from '@angular/common';\r\nimport { Component, ViewChild, OnInit, } from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport * as _ from 'lodash';\r\nimport { UnitOfWork, StateMap, UserManager, ErrorLogger } from '../../services/common';\r\nimport { UtilFns, IEditHost, EditManager } from '../../utils/common';\r\nimport { ExposureSurvey } from '../../entities/EntityModels';\r\nimport { ExposureSurveyStatistics } from '../../entities/projections/ExposureSurveyStatistics';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport { ConfirmFinishOverrideComponent } from '../staff/confirm-finish-override.component';\r\nimport { EXPOSURE_ROUTES } from './exposure.routes';\r\n\r\n@Component({\r\n selector: 'exposure-surveys',\r\n templateUrl: './exposure-surveys.html',\r\n})\r\n\r\nexport class ExposureSurveysComponent implements OnInit, IEditHost {\r\n @ViewChild(ConfirmFinishOverrideComponent, { static: true }) _confirmFinishOverrideComponent: ConfirmFinishOverrideComponent;\r\n\r\n // Default type ids\r\n private _typeCremeVersionId = 0;\r\n private _typeExposureSurveyStatusId: string = null;\r\n\r\n public _edm: EditManager;\r\n public _adding = false;\r\n public _showExposureSurveyMaterialList = false;\r\n private _lastNumber: number;\r\n\r\n private _isLoading = false;\r\n public _selectedExposureSurvey: ExposureSurvey;\r\n public _exposureSurveyStatistics: ExposureSurveyStatistics;\r\n public _exposureSurveysEx: SelectableEntity[] = [];\r\n\r\n public _validationMessage: string;\r\n\r\n private colorSelected = '#ddd';\r\n private colorUnselected = '#FFFFFF';\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n private _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Exposure Surveys');\r\n\r\n this._stateMap.currentRouteName = EXPOSURE_ROUTES.ExposureSurveys.name;\r\n\r\n // var _sub = this._route.params.subscribe(params => {\r\n // this._navparam = +params['id']; //exposure survey id\r\n // });\r\n\r\n this.getDefaultMeasureTypeIds();\r\n\r\n this.fetch();\r\n }\r\n\r\n fetch() {\r\n\r\n this._exposureSurveysEx = [];\r\n\r\n this._isLoading = true;\r\n\r\n this._uow.fetch('ExposureSurveys/ExposureSurveys', {}).then(e => {\r\n this._edm.entities = e;\r\n\r\n if (this._edm.entities != null && this._edm.entities.length > 0) {\r\n this._lastNumber = this._edm.entities[0].exposureSurveyNumber;\r\n }\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._exposureSurveysEx = [];\r\n if (this._edm.entities == null || this._edm.entities.length < 1) { return; }\r\n\r\n _.clone(this._edm.entities).forEach(element => {\r\n this._exposureSurveysEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n\r\n this._exposureSurveysEx = _.sortBy(this._exposureSurveysEx, e => e.data.exposureSurveyDate).reverse();\r\n }\r\n\r\n filterToExposureSurveyById(exposureSurveyId: number): ExposureSurvey {\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return null;\r\n }\r\n\r\n const expSurvey = this._edm.entities.filter(e => e.exposureSurveyId == exposureSurveyId);\r\n if (expSurvey != null && expSurvey.length > 0) {\r\n return expSurvey[0];\r\n }\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n showExposureSurveyStatistics(esx: SelectableEntity) {\r\n if (esx == null) { return; }\r\n\r\n this._selectedExposureSurvey = this.filterToExposureSurveyById(esx.data.exposureSurveyId);\r\n\r\n const params = { exposureSurveyId: esx.data.exposureSurveyId };\r\n\r\n if (this._selectedExposureSurvey) {\r\n this.resetBackgroundColor(this._exposureSurveysEx);\r\n esx.backgroundColor = this.colorSelected;\r\n this._uow.fetch('ExposureSurveys/FetchExposureSurveyStatistics', params).then(es => {\r\n if (es != null && es.length > 0) {\r\n this._exposureSurveyStatistics = es[0];\r\n } else { this._exposureSurveyStatistics = null; }\r\n });\r\n }\r\n }\r\n\r\n resetBackgroundColor(exposureSurveys: SelectableEntity[]) {\r\n exposureSurveys.forEach((element, index) => {\r\n element.backgroundColor = this.colorUnselected;\r\n });\r\n }\r\n\r\n // edit manager overrides\r\n canApply() {\r\n if (this._edm.editing && this._uow.hasChanges()) {\r\n if (this._edm.currentEntity != null) {\r\n return (!this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canSave() {\r\n if (this._edm.editing) { return false; }\r\n if (!this._edm.hasEdits()) { return false; }\r\n if (!this._edm.validateBeforeSave()) { return false; }\r\n\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) { return false; }\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n onAdd() {\r\n if (!this._edm.validateCurrent()) { return; }\r\n\r\n this._adding = true;\r\n const e = this._uow.exposureSurveyFactory.create();\r\n e.typeExposureSurveyStatusId = 'Not Set';\r\n\r\n // Survey Date specified by Month and Year only, set default to current month and year for the first day of the month.\r\n // tslint:disable-next-line:prefer-const\r\n const today = new Date();\r\n const s = '';\r\n const m = today.getMonth() + 1;\r\n const surveydate = s.concat(m.toString(), '/', '01', '/', today.getFullYear().toString());\r\n e.exposureSurveyDate = new Date(surveydate);\r\n e.exposureSurveyNumber = this._lastNumber + 1;\r\n e.typeCremeVersionId = this._typeCremeVersionId;\r\n\r\n if (this._typeExposureSurveyStatusId != null) { // If it is null, the value with default to the defined default value in the database\r\n e.typeExposureSurveyStatusId = this._typeExposureSurveyStatusId;\r\n }\r\n\r\n this._edm.entities.push(e);\r\n this._edm.onSelect(e);\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n\r\n if (this._edm.editing) {\r\n\r\n if (this._edm.currentEntity.typeCremeVersion.cremeVersion.toLowerCase() == 'none') {\r\n this._validationMessage = 'Please select a Creme Version other than None.';\r\n return;\r\n }\r\n\r\n if (this.isDuplicateSurveyEntry(this._edm.currentEntity.exposureSurveyMonthYearNumber)) {\r\n this._validationMessage = 'An exposure survey with the same date and number already exists.';\r\n return;\r\n }\r\n this._edm.onApplyCore();\r\n this._adding = false;\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edm.editing = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._adding = false;\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n\r\n this.fetch();\r\n }\r\n\r\n onEdit(esx: SelectableEntity) {\r\n\r\n if (esx == null) { return; }\r\n\r\n this._selectedExposureSurvey = this.filterToExposureSurveyById(esx.data.exposureSurveyId);\r\n\r\n if (this._selectedExposureSurvey == null) { return; }\r\n\r\n this._edm.onSelect(this._selectedExposureSurvey);\r\n }\r\n\r\n onRemove(esx: SelectableEntity) {\r\n\r\n if (esx == null) { return; }\r\n\r\n this._selectedExposureSurvey = this.filterToExposureSurveyById(esx.data.exposureSurveyId);\r\n\r\n if (this._selectedExposureSurvey == null) {\r\n this._validationMessage = 'Error occurred, could not remove the selected exposure survey from the list.';\r\n return;\r\n }\r\n\r\n const messages: string[] = [];\r\n this._confirmFinishOverrideComponent.showModal('Confirm Deletion of Exposure Survey',\r\n 'If you delete the survey, all related data will be removed. Do you still want to delete this entire Exposure Survey?', messages).then(ok => {\r\n if (ok) {\r\n if (this._selectedExposureSurvey.entityAspect.entityState.isAdded()) {\r\n this._selectedExposureSurvey.entityAspect.rejectChanges();\r\n } else {\r\n this._selectedExposureSurvey.entityAspect.setDeleted();\r\n }\r\n\r\n _.remove(this._edm.entities, this._selectedExposureSurvey);\r\n\r\n this._exposureSurveyStatistics = null;\r\n\r\n this.formatSelectableEntities();\r\n }\r\n });\r\n }\r\n\r\n onSave() {\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n\r\n this._adding = false;\r\n this._edm.editing = false;\r\n\r\n // this.fetch();\r\n });\r\n }\r\n }\r\n\r\n onShowMaterialList(esx: SelectableEntity) {\r\n\r\n if (esx == null) { return; }\r\n\r\n this._selectedExposureSurvey = this.filterToExposureSurveyById(esx.data.exposureSurveyId);\r\n\r\n if (this._selectedExposureSurvey == null) { return; }\r\n\r\n this._showExposureSurveyMaterialList = true;\r\n\r\n this._router.navigate(['../exposure-survey-lists', { id: this._selectedExposureSurvey.exposureSurveyId }], { relativeTo: this._route });\r\n }\r\n\r\n isDuplicateSurveyEntry(dateandnumber: string): boolean {\r\n if (this._edm.entities == null) { return false; }\r\n\r\n const expsurvey = this._edm.entities.filter(e => e.exposureSurveyMonthYearNumber == dateandnumber);\r\n return expsurvey != null && expsurvey.length > 1;\r\n }\r\n\r\n getDefaultMeasureTypeIds() {\r\n this._uow.typeCremeVersionRepository.all().then(c => {\r\n if (c != null && c.length > 0) {\r\n const types = c.filter(t => t.cremeVersion.toLowerCase() == 'none');\r\n if (types != null && types.length > 0) {\r\n this._typeCremeVersionId = types[0].typeCremeVersionId;\r\n }\r\n }\r\n });\r\n\r\n this._uow.typeExposureSurveyStatusRepository.all().then(e => {\r\n if (e != null && e.length > 0) {\r\n const types = e.filter(t => t.typeExposureSurveyStatusId == 'Open for Materials');\r\n if (types != null && types.length > 0) {\r\n this._typeExposureSurveyStatusId = types[0].typeExposureSurveyStatusId;\r\n }\r\n }\r\n });\r\n }\r\n}\r\n","
\r\n\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n {{entity.material?.realCASNumber}}\r\n \r\n\r\n \r\n {{entity.material?.formattedRIFMId}}\r\n \r\n\r\n \r\n {{entity.material?.principalSynonym().synonymWordOrWebVersion()}}\r\n \r\n\r\n
\r\n \r\n {{_previousExposureSurveys}}\r\n \r\n
\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n\r\n","import { Location } from '@angular/common';\r\nimport { Component, Input, OnInit, ViewChild } from '@angular/core';\r\n\r\nimport { UnitOfWork, StateMap, provideParent } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PageState, EditPropParent } from '../../controls/common';\r\nimport { Material, MaterialExposureSurvey, TypeExposureSurveyResponse } from '../../entities/EntityModels';\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\n\r\n@Component({\r\n selector: 'material-exposure-survey-editor',\r\n templateUrl: './material-exposure-survey-editor.html',\r\n providers: [provideParent(MaterialExposureSurveyEditorComponent, EditPropParent)]\r\n})\r\n\r\nexport class MaterialExposureSurveyEditorComponent implements OnInit, EditPropParent {\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n\r\n _isLoading = false;\r\n\r\n _pageState = new PageState('Material Exposure Survey Editor');\r\n _typeExposureSurveyResponses: TypeExposureSurveyResponse[];\r\n _materialExposureSurveys: MaterialExposureSurvey[];\r\n _previousExposureSurveys: string;\r\n\r\n @Input() entity: MaterialExposureSurvey;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.typeExposureSurveyResponseRepository.all().then(r => {\r\n this._typeExposureSurveyResponses = r;\r\n });\r\n }\r\n\r\n getError(propName: string) {\r\n if (this.entity == null) {\r\n return;\r\n }\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n isAdded() {\r\n return this.entity.entityAspect.entityState.isAdded();\r\n }\r\n\r\n selectMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this).then(mli => {\r\n if (mli == null) { return; }\r\n this.entity.materialId = mli.materialId;\r\n return this._uow.materialRepository.withId(mli.materialId);\r\n }).then(m => {\r\n if (m) {\r\n this.entity.material = m;\r\n this.fetchPreviousSurveys(this.entity.material);\r\n }\r\n });\r\n }\r\n\r\n fetchPreviousSurveys(mat: Material) {\r\n\r\n this._materialExposureSurveys = [];\r\n this._previousExposureSurveys = '';\r\n\r\n let params = { materialId: this.entity.material.materialId };\r\n\r\n this._isLoading = true;\r\n\r\n this._uow.fetch('ExposureSurveys/MaterialExposureSurveyByMaterialId', params).then(m => {\r\n this._materialExposureSurveys = m;\r\n if (this._materialExposureSurveys != null && this._materialExposureSurveys.length > 0) {\r\n\r\n this._previousExposureSurveys = $.map(this._materialExposureSurveys, function (obj) {\r\n return obj.exposureSurvey.exposureSurveyMonthYearNumber;\r\n }).join('; ');\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","
\r\n
\r\n

{{_adding ? \"Adding a Material to the Exposure Survey List\" : \"Editing a Material from the Exposure Survey List\" }}

\r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{_validationMessage}}\r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n
No RIFM Materials have been added yet.
\r\n
\r\n\r\n
\r\n
\r\n
\r\n

RIFM Materials Added to the Material List

\r\n
\r\n
\r\n
\r\n Filter list by CAS No. or MaterialId:\r\n\r\n \r\n \r\n Filter the List\r\n \r\n \r\n Clear Filter\r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
Edit
\r\n
Remove
\r\n
CAS No.
\r\n
RIFM Id
\r\n
MaterialId
\r\n
Synonym
\r\n
Isomers
\r\n
Response Type
\r\n
Add Measures
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n
{{mes.data.material?.formattedRIFMId}}
\r\n
{{mes.data.material?.materialId}}
\r\n
\r\n
{{mes.data.isomers}}
\r\n
{{mes.data.typeExposureSurveyResponse.responseType}}
\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n Notes for Material: \r\n {{_selectedMaterialExposureSurvey.material?.realCASNumber}}\r\n {{' RIFM ID: ' + _selectedMaterialExposureSurvey.material?.formattedRIFMId}}\r\n
\r\n
\r\n\r\n
\r\n \r\n

{{_selectedMaterialExposureSurvey.notes}}

\r\n
\r\n\r\n
\r\n \r\n
{{_selectedMaterialExposureSurvey.expectedSACompletion}}
\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, Input, Inject, forwardRef, OnInit } from '@angular/core';\r\n\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport * as _ from 'lodash';\r\nimport { UnitOfWork, StateMap, UserManager, ErrorLogger } from '../../services/common';\r\nimport { UtilFns, IEditHost, EditManager } from '../../utils/common';\r\n\r\nimport { ExposureSurvey, MaterialExposureSurvey, MaterialExposureSurveyMeasure, MaterialExposureSurveyIsomer, Material } from '../../entities/EntityModels';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport { ExposureSurveyListsComponent, ExposureEditData } from './exposure-survey-lists.component';\r\nimport { ROUTES } from '../routes';\r\nimport {EntityBase} from '../../entities/EntityBase';\r\n\r\n@Component({\r\n selector: 'material-exposure-surveys',\r\n templateUrl: './material-exposure-surveys.html',\r\n})\r\n\r\nexport class MaterialExposureSurveysComponent implements IEditHost, OnInit {\r\n\r\n @Input() exposureSurvey: ExposureSurvey;\r\n\r\n public _isLoading = false;\r\n\r\n public _data: ExposureEditData;\r\n public _edm: EditManager;\r\n public _edmMeasures: EditManager;\r\n public _adding: boolean;\r\n\r\n public _selectedMaterialExposureSurvey: MaterialExposureSurvey;\r\n public _materialExposureSurveys: MaterialExposureSurvey[] = [];\r\n public _materialExposureSurveysEx: SelectableEntity[] = [];\r\n\r\n public _materialExposureSurveyIsomers: MaterialExposureSurveyIsomer[] = [];\r\n\r\n public colorSelected = '#ddd';\r\n public colorUnselected = '#FFFFFF';\r\n\r\n public _canClearMaterialFilter = false;\r\n public _materialFilter = '';\r\n public _validationMessage: string;\r\n\r\n constructor(@Inject(forwardRef(() => ExposureSurveyListsComponent)) public _parent: ExposureSurveyListsComponent,\r\n private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n public _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Exposure Survey Materials');\r\n this._edmMeasures = new EditManager(this, this._uow, this._stateMap, 'Exposure Survey Material Measures');\r\n\r\n this.fetch();\r\n }\r\n\r\n fetch() {\r\n this._canClearMaterialFilter = false;\r\n this._materialExposureSurveys = [];\r\n this._edm.entities = [];\r\n this._selectedMaterialExposureSurvey = null;\r\n\r\n this._isLoading = true;\r\n\r\n const params = { exposureSurveyId: this.exposureSurvey.exposureSurveyId };\r\n this._uow.fetch('ExposureSurveys/MaterialExposureSurveyByExposureSurveyId', params).then(e => {\r\n this._materialExposureSurveys = e;\r\n this._edm.entities = _.clone(this._materialExposureSurveys);\r\n this._uow.fetch('ExposureSurveys/MaterialExposureSurveyIsomerByExposureSurveyId', params).then(i => {\r\n this._materialExposureSurveyIsomers = i;\r\n this.formatSelectableEntities();\r\n this._isLoading = false;\r\n });\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._materialExposureSurveysEx = [];\r\n\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return;\r\n }\r\n\r\n _.clone(this._edm.entities).forEach(element => {\r\n element.isomers = this.getIsomersForMaterial(element.materialId);\r\n this._materialExposureSurveysEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n }\r\n\r\n getIsomersForMaterial(materialId: number): string {\r\n if (this._materialExposureSurveyIsomers == null || this._materialExposureSurveyIsomers.length < 1) {\r\n return '';\r\n }\r\n\r\n const isomers = this._materialExposureSurveyIsomers.filter(i => i.materialExposureSurvey.materialId == materialId);\r\n\r\n if (isomers == null || isomers.length < 1) {\r\n return '';\r\n }\r\n\r\n return isomers.map(i => {\r\n return this.formatIsomerIdentifiers(i.material);\r\n }).join('; ');\r\n }\r\n\r\n formatIsomerIdentifiers(material: Material): string {\r\n const rifmId = (material.formattedRIFMId == '-') ? '' : ' (' + material.formattedRIFMId + ')';\r\n return (material.realCASNumber || '') + rifmId;\r\n }\r\n\r\n // filter to the entity for editing purposes\r\n filterToMaterialExposureSurveyById(materialExposureSurveyId: number): MaterialExposureSurvey {\r\n if (this._materialExposureSurveys == null || this._materialExposureSurveys.length < 1) {\r\n return null;\r\n }\r\n\r\n const expsurveymaterial = this._materialExposureSurveys.filter(e => e.materialExposureSurveyId == materialExposureSurveyId);\r\n if (expsurveymaterial != null && expsurveymaterial.length > 0) {\r\n return expsurveymaterial[0];\r\n }\r\n }\r\n\r\n hasData() {\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return false;\r\n }\r\n\r\n if (this._materialExposureSurveysEx == null || this._materialExposureSurveysEx.length < 1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n get isLoading() {\r\n return this._isLoading;\r\n }\r\n\r\n set isLoading(value) {\r\n this._isLoading = value;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n canAddToMaterialList() {\r\n if (this._edm.editing) {\r\n return false;\r\n }\r\n\r\n // Make sure the Exposure Survey status allows materials to be added to the list\r\n if (this.exposureSurvey == null) {\r\n return false;\r\n }\r\n\r\n return (this.exposureSurvey.typeExposureSurveyStatusId == 'Open for Materials');\r\n }\r\n\r\n // edit manager overrides\r\n canApply() {\r\n if (this._edm.editing) {\r\n return (this._uow.hasChanges() && !this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return this._edm.hasEdits();\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n canSave() {\r\n if (this._edm.editing) {\r\n return false;\r\n }\r\n if (!this._edm.hasEdits()) {\r\n return false;\r\n }\r\n if (!this._edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) {\r\n return false;\r\n }\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n onAdd() {\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n\r\n this._adding = true;\r\n const e = this._uow.materialExposureSurveyFactory.create();\r\n\r\n e.exposureSurveyId = this.exposureSurvey.exposureSurveyId;\r\n e.typeExposureSurveyResponseId = 2;\r\n\r\n this._edm.entities.push(e);\r\n this._edm.onSelect(e);\r\n\r\n this._data.inSubEditor = true;\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n if (this._edm.editing) {\r\n\r\n if (this._edm.currentEntity.materialId == null || this._edm.currentEntity.materialId == 0) {\r\n this._validationMessage = 'Please select a material.';\r\n return;\r\n }\r\n\r\n if (this.isDuplicateMaterialEntry(this._edm.currentEntity.materialId)) {\r\n this._validationMessage = 'This material has already been added to the exposure survey list.';\r\n return;\r\n }\r\n\r\n this._edm.onApplyCore();\r\n this._adding = false;\r\n\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n this._data.inSubEditor = false;\r\n\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edm.editing = false;\r\n this._data.inSubEditor = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._adding = false;\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n\r\n this._edmMeasures.onCancelCore();\r\n this._edmMeasures.entities = null;\r\n\r\n this._data.inSubEditor = false;\r\n\r\n this.fetch();\r\n }\r\n\r\n onEdit(mesx: SelectableEntity) {\r\n\r\n if (mesx == null) {\r\n return;\r\n }\r\n\r\n this._selectedMaterialExposureSurvey = this.filterToMaterialExposureSurveyById(mesx.data.materialExposureSurveyId);\r\n\r\n if (this._selectedMaterialExposureSurvey == null) {\r\n return;\r\n }\r\n\r\n this._edm.onSelect(this._selectedMaterialExposureSurvey);\r\n\r\n this._data.inSubEditor = true;\r\n }\r\n\r\n onRemove(mesx: SelectableEntity) {\r\n\r\n if (mesx == null) {\r\n return;\r\n }\r\n\r\n this._selectedMaterialExposureSurvey = this.filterToMaterialExposureSurveyById(mesx.data.materialExposureSurveyId);\r\n\r\n if (this._selectedMaterialExposureSurvey == null) {\r\n this._validationMessage = 'Error occurred, could not remove the selected material from the list.';\r\n return;\r\n }\r\n\r\n if (this._selectedMaterialExposureSurvey.entityAspect.entityState.isAdded()) {\r\n this._selectedMaterialExposureSurvey.entityAspect.rejectChanges();\r\n } else {\r\n this._selectedMaterialExposureSurvey.entityAspect.setDeleted();\r\n this.removeMaterialSurveyMeasures();\r\n }\r\n\r\n _.remove(this._edm.entities, this._selectedMaterialExposureSurvey);\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n removeMaterialSurveyMeasures() {\r\n // Delete the measures associated with removed material exposure survey record.\r\n const params = {\r\n materialId: this._selectedMaterialExposureSurvey.materialId,\r\n exposureSurveyId: this._selectedMaterialExposureSurvey.exposureSurveyId\r\n };\r\n\r\n this._uow.fetchTyped('ExposureSurveys/FetchExposureSurveyMaterialMeasures', MaterialExposureSurveyMeasure, params).then(m => {\r\n this._edmMeasures.entities = m;\r\n\r\n if (this._edmMeasures.entities != null && this._edmMeasures.entities.length > 0) {\r\n this._edmMeasures.entities.forEach(r => r.entityAspect.setDeleted());\r\n }\r\n });\r\n }\r\n\r\n isDeleted(e: EntityBase) {\r\n if (e == null) {\r\n return true;\r\n }\r\n return e.entityAspect.entityState.isDeleted();\r\n }\r\n\r\n onSave() {\r\n\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n\r\n this._adding = false;\r\n this._edm.editing = false;\r\n\r\n this._edmMeasures.editing = false;\r\n\r\n this.fetch();\r\n });\r\n }\r\n }\r\n\r\n onShowMaterialExposureSurveyNotes(mesx: SelectableEntity) {\r\n if (mesx == null) { return; }\r\n\r\n this._selectedMaterialExposureSurvey = this.filterToMaterialExposureSurveyById(mesx.data.materialExposureSurveyId);\r\n\r\n if (this._selectedMaterialExposureSurvey) {\r\n this.resetBackgroundColor(this._materialExposureSurveysEx);\r\n mesx.backgroundColor = this.colorSelected;\r\n }\r\n }\r\n\r\n resetBackgroundColor(materialExposureSurveys: SelectableEntity[]) {\r\n materialExposureSurveys.forEach((element, index) => {\r\n element.backgroundColor = this.colorUnselected;\r\n });\r\n }\r\n\r\n onShowMeasures(mesx: SelectableEntity) {\r\n if (mesx == null) {\r\n return;\r\n }\r\n\r\n this._selectedMaterialExposureSurvey = this.filterToMaterialExposureSurveyById(mesx.data.materialExposureSurveyId);\r\n\r\n if (this._selectedMaterialExposureSurvey == null) {\r\n return;\r\n }\r\n\r\n this._router.navigate(['../record-exposure-survey-measures',\r\n {\r\n materialId: this._selectedMaterialExposureSurvey.materialId,\r\n exposuresurveyid: this.exposureSurvey.exposureSurveyId\r\n }],\r\n { relativeTo: this._parent._route }\r\n );\r\n }\r\n\r\n onShowMaterial(mesx: SelectableEntity) {\r\n if (mesx == null) {\r\n return;\r\n }\r\n\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, mesx.data.materialId, ROUTES.Material.childRoutes.MaterialExposure));\r\n }\r\n\r\n onSurveyChange(es: ExposureSurvey) {\r\n this.exposureSurvey = es;\r\n this.fetch();\r\n }\r\n\r\n isDuplicateMaterialEntry(materialId: number): boolean {\r\n if (this._edm.entities == null) {\r\n return false;\r\n }\r\n\r\n const mat = this._edm.entities.filter(m => m.materialId == materialId);\r\n if (mat != null && mat.length > 1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n onClearFilter() {\r\n this._canClearMaterialFilter = false;\r\n this._materialFilter = '';\r\n this.formatSelectableEntities();\r\n }\r\n\r\n onEnterMaterialFilter() {\r\n this._validationMessage = '';\r\n }\r\n\r\n // filter the materials in the list to a single material\r\n onFilterDisplayedMaterials() {\r\n this._canClearMaterialFilter = true;\r\n\r\n let results: MaterialExposureSurvey[];\r\n const searchMaterial = this._materialFilter.trim();\r\n\r\n this._materialExposureSurveysEx = [];\r\n\r\n // if non-numeric search for a cas match.\r\n // if numeric, it could be a materialid or the first set of numbers in a cas number so look for both\r\n if (isNaN(Number(searchMaterial))) {\r\n results = this._materialExposureSurveys.filter(e => e.material.realCASNumber.startsWith(searchMaterial));\r\n } else {\r\n results = this._materialExposureSurveys.filter(e => e.materialId == Number(searchMaterial));\r\n\r\n if (results == null || results.length == 0) { // try cas substring\r\n results = this._materialExposureSurveys.filter(e => e.material.realCASNumber.startsWith(searchMaterial));\r\n }\r\n }\r\n\r\n if (results == null || results.length < 1) {\r\n this._validationMessage = 'Unable to locate the filter you entered in the list';\r\n this._canClearMaterialFilter = false;\r\n this.formatSelectableEntities();\r\n return;\r\n }\r\n\r\n // this._materialExposureSurveysEx.push(new SelectableEntity(results[0], '#FFFFFF'));\r\n _.clone(results).forEach(element => {\r\n element.isomers = this.getIsomersForMaterial(element.materialId);\r\n this._materialExposureSurveysEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n }\r\n\r\n canFilterMaterialList() {\r\n return this._materialFilter != null && this._materialFilter.trim().length > 0;\r\n }\r\n\r\n}\r\n","
\r\n
\r\n
\r\n List of Materials for the Exposure Survey: \r\n {{_selectedExposureSurvey.exposureSurveyMonthYearNumber}}\r\n
\r\n
\r\n Select Survey: \r\n \r\n
\r\n Survey Status: \r\n {{_selectedExposureSurvey.typeExposureSurveyStatusId}}\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\n\r\nimport { ErrorLogger, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { TabContainer } from '../../controls/common';\r\nimport { LocationFns, UtilFns } from '../../utils/common';\r\nimport { ExposureSurvey } from '../../entities/EntityModels';\r\nimport { MaterialExposureSurveysComponent } from './material-exposure-surveys.component';\r\nimport { EXPOSURE_ROUTES } from './exposure.routes';\r\n\r\nexport class ExposureEditData {\r\n inSubEditor: boolean;\r\n currentTab: number;\r\n}\r\n\r\n@Component({\r\n selector: 'exposure-survey-lists',\r\n templateUrl: './exposure-survey-lists.html',\r\n})\r\n\r\nexport class ExposureSurveyListsComponent implements OnInit {\r\n @ViewChild(MaterialExposureSurveysComponent) _materialExposureSurveysComponent: MaterialExposureSurveysComponent;\r\n @ViewChild(TabContainer) _tabContainer: TabContainer;\r\n _tab: number;\r\n\r\n public _data: ExposureEditData = new ExposureEditData();\r\n private _isLoading: boolean;\r\n private _navparam: number;\r\n\r\n public _selectedExposureSurveyIndex: number;\r\n public _selectedExposureSurvey: ExposureSurvey;\r\n public _exposureSurveys: ExposureSurvey[] = [];\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n public _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._stateMap.currentRouteName = EXPOSURE_ROUTES.ExposureSurveyLists.name;\r\n\r\n this._route.params.subscribe(params => {\r\n this._navparam = +params['id']; // exposure survey id\r\n });\r\n\r\n this.fetch();\r\n\r\n this._tab = LocationFns.getTab(this._location) || 0;\r\n }\r\n\r\n fetch() {\r\n\r\n let filterId = 0;\r\n\r\n this._exposureSurveys = [];\r\n\r\n this._isLoading = true;\r\n\r\n this._uow.fetch('ExposureSurveys/ExposureSurveys', {})\r\n .then(e => {\r\n this._exposureSurveys = e;\r\n if (this._exposureSurveys != null && this._exposureSurveys.length > 0) {\r\n if (!isNaN(this._navparam)) { // Filter to navigation param of exposuresurveyid instead of first in the array.\r\n filterId = this._exposureSurveys.findIndex(x => x.exposureSurveyId == this._navparam);\r\n }\r\n this.filterExposureSurveyByIndex(filterId); // Set default Exposure Survey to the first in the list.\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n // Filters\r\n filterExposureSurveyByIndex(ix: number) {\r\n this._selectedExposureSurveyIndex = ix;\r\n this._selectedExposureSurvey = this._exposureSurveys[ix];\r\n\r\n if (this._materialExposureSurveysComponent != null) {\r\n this._materialExposureSurveysComponent.onSurveyChange(this._selectedExposureSurvey);\r\n }\r\n\r\n setTimeout(() => {\r\n this._tabContainer.selectTab(0);\r\n }, 1);\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return !this._data.inSubEditor && !this._uow.hasChanges();\r\n }\r\n\r\n get isLoading() {\r\n return this._isLoading;\r\n }\r\n\r\n set isLoading(value) {\r\n this._isLoading = value;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // Reports\r\n onExportCremeReport() {\r\n const params: { key: string, value: string }[] = [];\r\n\r\n params.push({ key: 'reporttype', value: 'creme' });\r\n params.push({ key: 'survey', value: '' + this._selectedExposureSurvey.exposureSurveyId });\r\n\r\n const url = this._userManager.getReportUrl(params);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n onExportFullSurveyReport() {\r\n const params: { key: string, value: string }[] = [];\r\n\r\n params.push({ key: 'reporttype', value: 'exposuresurveymaterials' });\r\n params.push({ key: 'survey', value: '' + this._selectedExposureSurvey.exposureSurveyId });\r\n\r\n const url = this._userManager.getReportUrl(params);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n // Navigation\r\n onShowExposureSurvey() {\r\n\r\n if (this._selectedExposureSurvey == null) {\r\n return;\r\n }\r\n\r\n this._router.navigate(['../exposure-surveys', { id: this._selectedExposureSurvey.exposureSurveyId }], { relativeTo: this._route });\r\n }\r\n}\r\n","
\r\n
\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n
\r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { ExposureAdditionalMaterial } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'exposure-additional-material-editor',\r\n templateUrl: './exposure-additional-material-editor.html',\r\n providers: [provideParent(ExposureAdditionalMaterialEditorComponent, EditPropParent)]\r\n})\r\nexport class ExposureAdditionalMaterialEditorComponent implements OnInit {\r\n\r\n @Input() entity: ExposureAdditionalMaterial;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n}\r\n","
\r\n \r\n {{_adding ? \"Adding an External Material\" : \"Editing an Exposure Material\" }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n

{{_validationMessage}}

\r\n
\r\n
\r\n
\r\n
0\" style=\"border-bottom: 1px solid #424242; width: 1121px;\">\r\n
\r\n
\r\n
Edit
\r\n
Remove
\r\n
CAS No.
\r\n
MaterialId
\r\n
Material Name
\r\n
Member Company
\r\n
Notes
\r\n
\r\n
\r\n
\r\n \r\n \r\n
{{am.data.cASNumber}}
\r\n
{{am.data.exposureAdditionalMaterialId}}
\r\n
{{am.data.materialName}}
\r\n
{{am.data.memberCompany}}
\r\n
{{am.data.notes}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component } from '@angular/core';\r\n\r\nimport { UnitOfWork, StateMap, ErrorLogger } from '../../services/common';\r\nimport { UtilFns, IEditHost, EditManager } from '../../utils/common';\r\nimport { ExposureAdditionalMaterial } from '../../entities/EntityModels';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport { EXPOSURE_ROUTES } from './exposure.routes'\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'exposure-additional-materials',\r\n templateUrl: './exposure-additional-materials.html',\r\n})\r\nexport class ExposureAdditionalMaterialsComponent implements IEditHost {\r\n\r\n _isLoading: boolean = false;\r\n\r\n _selectedExposureAdditionalMaterialIndex: number;\r\n _selectedExposureAdditionalMaterial: ExposureAdditionalMaterial;\r\n _exposureAdditionalMaterials: ExposureAdditionalMaterial[] = [];\r\n _exposureAdditionalMaterialsEx: SelectableEntity[] = [];\r\n\r\n _edm: EditManager;\r\n _adding: boolean = false;\r\n\r\n _validationMessage: string;\r\n\r\n colorSelected: string = '#ddd';\r\n colorUnselected: string = '#FFFFFF';\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap,\r\n public _location: Location, public _errorLogger: ErrorLogger) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._edm = new EditManager(this, this._uow, this._stateMap, \"Exposure Additional Materials\");\r\n\r\n this._stateMap.currentRouteName = EXPOSURE_ROUTES.ExposureAdditionalMaterialsComponent.name;\r\n\r\n this.fetch();\r\n }\r\n\r\n fetch() {\r\n\r\n this._isLoading = true;\r\n\r\n this._uow.fetch(\"ExposureSurveys/ExposureAdditionalMaterials\", {}).then(e => {\r\n this._edm.entities = e;\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n getError(propName: string) {\r\n if (this._selectedExposureAdditionalMaterial == null) {\r\n return;\r\n }\r\n\r\n return this._selectedExposureAdditionalMaterial.getErrorFor(propName);\r\n }\r\n\r\n isAdded() {\r\n return this._selectedExposureAdditionalMaterial.entityAspect.entityState.isAdded();\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._exposureAdditionalMaterialsEx = [];\r\n if (this._edm.entities == null || this._edm.entities.length < 1) return;\r\n\r\n _.clone(this._edm.entities).forEach(element => {\r\n this._exposureAdditionalMaterialsEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n this._exposureAdditionalMaterialsEx = _.sortBy(this._exposureAdditionalMaterialsEx, a => a.data.cASNumber);\r\n });\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n //edit manager overrides\r\n canApply() {\r\n if (this._edm.editing) {\r\n return (this._uow.hasChanges() && !this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canSave() {\r\n\r\n if (this._edm.editing) return false;\r\n\r\n if (!this._edm.hasEdits()) return false;\r\n\r\n if (!this._edm.validateBeforeSave()) return false;\r\n\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) return false;\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n onAdd() {\r\n\r\n this._adding = true;\r\n\r\n if (this._edm.entities == null) {\r\n this._edm.entities = [];\r\n }\r\n\r\n let e = this._uow.exposureAdditionalMaterialFactory.create();\r\n\r\n this._edm.entities.push(e);\r\n this._edm.onSelect(e);\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n\r\n if (this._edm.editing) {\r\n if (this.isDuplicateAdditionalMaterialEntry(this._edm.currentEntity.exposureAdditionalMaterialId, this._edm.currentEntity.cASNumber)) {\r\n this._validationMessage = 'This external material has already been created.';\r\n return;\r\n }\r\n this._edm.onApplyCore();\r\n this._adding = false;\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edm.editing = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._adding = false;\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n\r\n this.fetch();\r\n }\r\n\r\n onEdit(amx: SelectableEntity) {\r\n\r\n if (amx == null) { return; }\r\n\r\n this._selectedExposureAdditionalMaterial = this.filterToExposureAdditionalMaterialById(amx.data.exposureAdditionalMaterialId);\r\n\r\n if (this._selectedExposureAdditionalMaterial == null) { return; }\r\n\r\n this._edm.onSelect(this._selectedExposureAdditionalMaterial);\r\n }\r\n\r\n onRemove(amx: SelectableEntity) {\r\n\r\n if (amx == null) { return; }\r\n\r\n this._selectedExposureAdditionalMaterial = this.filterToExposureAdditionalMaterialById(amx.data.exposureAdditionalMaterialId);\r\n\r\n if (this._selectedExposureAdditionalMaterial == null) {\r\n this._validationMessage = 'Error occurred, could not remove the selected external material from the list.';\r\n return;\r\n }\r\n\r\n if (this._selectedExposureAdditionalMaterial.entityAspect.entityState.isAdded()) {\r\n this._selectedExposureAdditionalMaterial.entityAspect.rejectChanges();\r\n } else {\r\n this._selectedExposureAdditionalMaterial.entityAspect.setDeleted();\r\n }\r\n\r\n _.remove(this._edm.entities, this._selectedExposureAdditionalMaterial);\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n onSave() {\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n\r\n this._adding = false;\r\n this._edm.editing = false;\r\n });\r\n }\r\n }\r\n\r\n //Filters\r\n filterToExposureAdditionalMaterialById(exposureAdditionalMaterialId: number): ExposureAdditionalMaterial {\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return null;\r\n }\r\n\r\n const expAdditionalMaterial = this._edm.entities.filter(a => a.exposureAdditionalMaterialId == exposureAdditionalMaterialId);\r\n if (expAdditionalMaterial != null && expAdditionalMaterial.length > 0) {\r\n return expAdditionalMaterial[0];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n //Validation\r\n isDuplicateAdditionalMaterialEntry(exposureAdditionalMaterialId: number, casNumber: string): boolean {\r\n if (this._edm.entities == null) return false;\r\n\r\n const mat = this._edm.entities.filter(m => m.exposureAdditionalMaterialId == exposureAdditionalMaterialId);\r\n if (mat != null && mat.length > 1) return true;\r\n\r\n const casMat = this._edm.entities.filter(m => m.cASNumber == casNumber);\r\n if (casMat != null && casMat.length > 1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n return (teststring.trim().length > 0);\r\n }\r\n}\r\n","
\r\n\r\n \r\n {{entity.exposureAdditionalMaterial?.cASNumber}}\r\n \r\n\r\n \r\n {{entity.exposureAdditionalMaterial?.materialName}}\r\n \r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n {{entity.typeExposureMeasure.measureDescription}}\r\n \r\n
\r\n\r\n
\r\n \r\n {{_currentTypeExposureMeasure.typeExposureMeasureValue?.measureValueType}}\r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { UnitOfWork, provideParent} from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { ExposureAdditionalMaterialSurveyMeasure, TypeExposureMeasure, TypeExposureMeasureValue, TypeCremeVersion } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'exposure-additional-material-survey-measure-editor',\r\n templateUrl: './exposure-additional-material-survey-measure-editor.html',\r\n providers: [provideParent(ExposureAdditionalMaterialSurveyMeasureEditorComponent, EditPropParent)]\r\n})\r\nexport class ExposureAdditionalMaterialSurveyMeasureEditorComponent implements OnInit, EditPropParent {\r\n @Input() entity: ExposureAdditionalMaterialSurveyMeasure;\r\n\r\n _currentTypeExposureMeasure: TypeExposureMeasure;\r\n _typeExposureMeasures: TypeExposureMeasure[];\r\n _typeExposureMeasureValues: TypeExposureMeasureValue[];\r\n\r\n _typeCremeVersions: TypeCremeVersion[];\r\n\r\n constructor(public uow: UnitOfWork) {\r\n }\r\n\r\n ngOnInit() {\r\n this.uow.typeExposureMeasureRepository.all().then(m => {\r\n this._typeExposureMeasures = m;\r\n\r\n if (m == null || m.length < 1) return;\r\n\r\n if (!this.entity.entityAspect.entityState.isAdded()) {\r\n this.setCurrentMeasureType(this.entity.typeExposureMeasure.typeExposureMeasureValueId);\r\n }\r\n });\r\n\r\n this.uow.typeExposureMeasureValueRepository.all().then(v => {\r\n this._typeExposureMeasureValues = v;\r\n });\r\n\r\n this.uow.typeCremeVersionRepository.all().then(c => {\r\n this._typeCremeVersions = c;\r\n });\r\n }\r\n\r\n checkIfNull(value: string) {\r\n if (value == '') return null;\r\n else return value;\r\n }\r\n\r\n getError(propName: string) {\r\n if (this.entity == null) {\r\n return;\r\n }\r\n\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n hasQualitativeValue(): boolean {\r\n if (this._currentTypeExposureMeasure == null || this._currentTypeExposureMeasure.typeExposureMeasureValue == null) return false;\r\n\r\n return (this._currentTypeExposureMeasure.typeExposureMeasureValue.measureValueType == 'Qualitative');\r\n }\r\n\r\n hasQuantitativeValue(): boolean {\r\n if (this._currentTypeExposureMeasure == null || this._currentTypeExposureMeasure.typeExposureMeasureValue == null) return false;\r\n\r\n return (this._currentTypeExposureMeasure.typeExposureMeasureValue.measureValueType == 'Quantitative' || this._currentTypeExposureMeasure.typeExposureMeasureValue.measureValueType == 'Percentage');\r\n }\r\n\r\n isAdded() {\r\n return this.entity.entityAspect.entityState.isAdded();\r\n }\r\n\r\n onSelectMeasure(ix: number) {\r\n this.setCurrentMeasureType(ix);\r\n\r\n this.entity.typeExposureMeasureId = this._currentTypeExposureMeasure.typeExposureMeasureId;\r\n this.entity.typeExposureMeasureValueId = this._currentTypeExposureMeasure.typeExposureMeasureValueId;\r\n }\r\n\r\n setCurrentMeasureType(ix: number) {\r\n var x = this._typeExposureMeasures.filter(t => t.typeExposureMeasureId == ix);\r\n if (x != null && x.length > 0) {\r\n this._currentTypeExposureMeasure = x[0];\r\n }\r\n }\r\n}\r\n","\r\n

{{_adding ? \"Adding an Exposure Survey Measure\" : \"Editing an Exposure Survey Measure\" }}

\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n

{{_validationMessage}}

\r\n
\r\n\r\n
\r\n
\r\n
\r\n

Select an External Material to see Available Exposure Surveys:

\r\n \r\n
\r\n\r\n
\r\n
\r\n Selected CAS No.:\r\n {{_selectedExposureAdditionalMaterial.cASNumber}}\r\n\r\n External Material Name:\r\n {{_selectedExposureAdditionalMaterial.materialName}}\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n 0\" class=\"inline\">\r\n Available Exposure Surveys: \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n For the Selected Exposure Survey: \r\n {{_selectedExposureSurvey.exposureSurveyMonthYear}}\r\n with Number: \r\n {{_selectedExposureSurvey.exposureSurveyNumber}}\r\n
\r\n The Response Status was: \r\n {{_currentExposureAdditionalMaterialSurvey.typeExposureSurveyResponse.responseType}}\r\n
\r\n (Back to Material List)\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n

{{_unsurveyedMessage}}

\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n

There is no Measure data for this external material for the selected survey.

\r\n 0\" class=\"inline\">\r\n Exposure Survey Measure Data\r\n \r\n Indicates multiple runs of the same measure within an Exposure Survey.\r\n \r\n 0\">\r\n \r\n \r\n Edit\r\n Remove\r\n Multiple Runs\r\n Measure\r\n Value\r\n Date Entered\r\n Notes\r\n Creme Version\r\n \r\n \r\n \r\n \r\n Edit\r\n Remove\r\n \r\n {{mx.data.typeExposureMeasure.measureDescription}}\r\n {{mx.data.measureQualitativeResult || mx.data.measureQuantitativeResult}}\r\n {{utilFns.formatDate(mx.data.created)}}\r\n {{mx.data.measureNotes}}\r\n {{mx.data.typeCremeVersion.cremeVersion}}\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, forwardRef, Inject, OnInit } from '@angular/core';\r\n\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\n\r\nimport { ErrorLogger, provideParent, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { EditManager, IEditHost, UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport {\r\n ExposureAdditionalMaterial,\r\n ExposureAdditionalMaterialSurvey,\r\n ExposureAdditionalMaterialSurveyMeasure,\r\n ExposureSurvey\r\n} from '../../entities/EntityModels';\r\nimport { MeasureEditData, RecordExposureSurveyMeasuresComponent } from './record-exposure-survey-measures.component';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'exposure-additional-material-survey-measures',\r\n templateUrl: './exposure-additional-material-survey-measures.html',\r\n providers: [provideParent(ExposureAdditionalMaterialSurveyMeasuresComponent, EditPropParent)]\r\n})\r\nexport class ExposureAdditionalMaterialSurveyMeasuresComponent implements IEditHost, OnInit {\r\n\r\n\r\n\r\n private _adding: boolean;\r\n\r\n // Default type ids\r\n private _typeCremeVersionId = 0;\r\n private _typeExposureMeasureId = 0;\r\n private _typeExposureMeasureValueId = 0;\r\n\r\n private _exposureAdditionalMaterials: ExposureAdditionalMaterial[] = [];\r\n private _selectedExposureAdditionalMaterial: ExposureAdditionalMaterial;\r\n private _selectedExposureAdditionalMaterialIndex: number;\r\n\r\n private _selectedExposureSurveyIndex: number;\r\n private _selectedExposureSurvey: ExposureSurvey;\r\n\r\n private _currentExposureAdditionalMaterialSurvey: ExposureAdditionalMaterialSurvey;\r\n private _exposureAdditionalMaterialSurveys: ExposureAdditionalMaterialSurvey[] = [];\r\n\r\n private _selectedExposureAdditionalMaterialSurveyMeasure: ExposureAdditionalMaterialSurveyMeasure;\r\n public _exposureAdditionalMaterialSurveyMeasuresEx: SelectableEntity[] = [];\r\n\r\n private _data: MeasureEditData;\r\n\r\n _edm: EditManager;\r\n _validationMessage: string;\r\n _unsurveyedMessage: string;\r\n _isLoading = false;\r\n\r\n constructor(@Inject(forwardRef(() => RecordExposureSurveyMeasuresComponent)) public _parent: RecordExposureSurveyMeasuresComponent,\r\n private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n public _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Exposure Additional Material Survey Measures');\r\n\r\n this._uow.exposureAdditionalMaterialRepository.all().then(m => {\r\n this._exposureAdditionalMaterials = m;\r\n\r\n // Filter to input parameter, if set.\r\n if (this._data.exposureAdditionalMaterialId > 0 && this._exposureAdditionalMaterials != null) {\r\n\r\n this._selectedExposureAdditionalMaterial = this.filterToAdditionalMaterialById(this._data.exposureAdditionalMaterialId);\r\n\r\n if (this._selectedExposureAdditionalMaterial) {\r\n this._selectedExposureAdditionalMaterialIndex = this._exposureAdditionalMaterials\r\n .findIndex(a => a.exposureAdditionalMaterialId == this._selectedExposureAdditionalMaterial.exposureAdditionalMaterialId);\r\n }\r\n\r\n this.fetchExposureAdditionalMaterialSurveys();\r\n }\r\n });\r\n\r\n this.getDefaultMeasureTypeIds();\r\n }\r\n\r\n fetchExposureAdditionalMaterialSurveys() {\r\n\r\n let filterId = 0;\r\n\r\n this._edm.entities = null;\r\n this._exposureAdditionalMaterialSurveys = [];\r\n this._unsurveyedMessage = null;\r\n\r\n const params = { exposureAdditionalMaterialId: this._selectedExposureAdditionalMaterial.exposureAdditionalMaterialId };\r\n\r\n this._isLoading = true;\r\n\r\n this._uow.fetch('ExposureSurveys/ExposureAdditionalMaterialSurveyByAdditionalMaterialId', params).then(m => {\r\n this._exposureAdditionalMaterialSurveys = m;\r\n if (this._exposureAdditionalMaterialSurveys != null && this._exposureAdditionalMaterialSurveys.length > 0) {\r\n\r\n if (this._data.additionalExposureSurveyId > 0) {\r\n const expsurveyid = this._exposureAdditionalMaterialSurveys.findIndex(e => e.exposureSurveyId == this._data.additionalExposureSurveyId);\r\n filterId = (expsurveyid < 0) ? 0 : expsurveyid;\r\n }\r\n this._selectedExposureSurveyIndex = filterId;\r\n this.filterExposureSurveyByIndex(this._selectedExposureSurveyIndex); // Set the selected exposure survey which will call the fetchMeasures method\r\n } else {\r\n this._currentExposureAdditionalMaterialSurvey = null;\r\n this._unsurveyedMessage = 'This Exposure Additional Material was not included in any Exposure Survey.';\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n fetchMeasures() {\r\n\r\n if (this._selectedExposureAdditionalMaterial == null || this._selectedExposureSurvey == null) {\r\n return;\r\n }\r\n\r\n const params = {\r\n exposureAdditionalMaterialId: this._selectedExposureAdditionalMaterial.exposureAdditionalMaterialId,\r\n exposureSurveyId: this._selectedExposureSurvey.exposureSurveyId\r\n };\r\n\r\n this._isLoading = true;\r\n this._uow.fetch('ExposureSurveys/FetchExposureAdditionalMaterialSurveyMeasures', params).then(m => {\r\n this._edm.entities = m;\r\n this._edm.updatePageState();\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._exposureAdditionalMaterialSurveyMeasuresEx = [];\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return;\r\n }\r\n\r\n _.clone(this._edm.entities).forEach(element => {\r\n const isMultiple = this.isDuplicateMeasureEntry(element.exposureAdditionalMaterialId, element.typeExposureMeasureId);\r\n this._exposureAdditionalMaterialSurveyMeasuresEx.push(new SelectableEntity(element, '#FFFFFF', '', isMultiple));\r\n });\r\n }\r\n\r\n get isLoading() {\r\n return this._isLoading;\r\n }\r\n\r\n set isLoading(value) {\r\n this._isLoading = value;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n canAdd() {\r\n return ((!this._edm.editing) && this._currentExposureAdditionalMaterialSurvey != null);\r\n }\r\n\r\n // edit manager overrides\r\n canApply() {\r\n if (this._edm.editing) {\r\n return (this._uow.hasChanges() && !this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n canSave() {\r\n if (this._edm.editing) {\r\n return false;\r\n }\r\n if (!this._edm.hasEdits()) {\r\n return false;\r\n }\r\n if (!this._edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) {\r\n return false;\r\n }\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n onAdd() {\r\n if (this._edm.entities == null) {\r\n this._edm.entities = [];\r\n }\r\n\r\n this._adding = true;\r\n const m = this._uow.exposureAdditionalMaterialSurveyMeasureFactory.create();\r\n\r\n m.exposureAdditionalMaterialId = this._selectedExposureAdditionalMaterial.exposureAdditionalMaterialId;\r\n m.exposureSurveyId = this._selectedExposureSurvey.exposureSurveyId;\r\n m.typeExposureMeasureId = this._typeExposureMeasureId; //The default value is set on ngInit\r\n m.typeExposureMeasureValueId = this._typeExposureMeasureValueId;\r\n //03/07/2019: Use Creme Version of the Exposure Survey as the default\r\n m.typeCremeVersionId = this._selectedExposureSurvey.typeCremeVersionId;\r\n\r\n this._edm.entities.push(m);\r\n this._edm.onSelect(m);\r\n }\r\n\r\n onApply() {\r\n\r\n this._validationMessage = '';\r\n\r\n\r\n if (this._edm.currentEntity.typeExposureMeasure == null) {\r\n this._validationMessage = 'Please select a Measure type other than None.';\r\n return;\r\n }\r\n\r\n if (this._edm.currentEntity.typeExposureMeasure.measureDescription.toLowerCase() == 'none') {\r\n this._validationMessage = 'Please select a Measure type other than None.';\r\n return;\r\n }\r\n\r\n if (this._edm.currentEntity.measureQualitativeResult == null && this._edm.currentEntity.measureQuantitativeResult == null) {\r\n this._validationMessage = 'Please enter a measure value.';\r\n return;\r\n }\r\n\r\n if (this._edm.currentEntity.typeCremeVersion.cremeVersion.toLowerCase() == 'none') {\r\n this._validationMessage = 'Please select a Creme Version other than None.';\r\n return;\r\n }\r\n\r\n // 01/26/2019: Measure data for the same measure type can be recorded for a material/survey more than once.\r\n // if (this.isDuplicateMeasureEntry(this._edm.currentEntity.exposureAdditionalMaterialId, this._edm.currentEntity.typeExposureMeasureId)) {\r\n // this._validationMessage = 'This measure type has already been assigned to this exposure additional material for the selected exposure survey.';\r\n // return;\r\n // }\r\n\r\n this._edm.onApplyCore();\r\n this._adding = false;\r\n\r\n this.formatSelectableEntities();\r\n\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edm.editing = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._adding = false;\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n\r\n this._exposureAdditionalMaterialSurveyMeasuresEx = [];\r\n\r\n this.fetchMeasures();\r\n }\r\n\r\n onEdit(mx: SelectableEntity) {\r\n if (mx == null) {\r\n return;\r\n }\r\n\r\n this._selectedExposureAdditionalMaterialSurveyMeasure = this.filterToExposureAdditionalMaterialSurveyMeasureById(mx.data.exposureAdditionalMaterialSurveyMeasureId);\r\n\r\n if (this._selectedExposureAdditionalMaterialSurveyMeasure == null) {\r\n return;\r\n }\r\n\r\n this._edm.onSelect(this._selectedExposureAdditionalMaterialSurveyMeasure);\r\n }\r\n\r\n onRemove(mx: SelectableEntity) {\r\n\r\n if (mx == null) {\r\n return;\r\n }\r\n this._selectedExposureAdditionalMaterialSurveyMeasure = this.filterToExposureAdditionalMaterialSurveyMeasureById(mx.data.exposureAdditionalMaterialSurveyMeasureId);\r\n\r\n if (this._selectedExposureAdditionalMaterialSurveyMeasure == null) {\r\n this._validationMessage = 'Error occurred, could not remove the selected measure from the list.';\r\n return;\r\n }\r\n\r\n if (this._selectedExposureAdditionalMaterialSurveyMeasure.entityAspect.entityState.isAdded()) {\r\n this._selectedExposureAdditionalMaterialSurveyMeasure.entityAspect.rejectChanges();\r\n } else {\r\n this._selectedExposureAdditionalMaterialSurveyMeasure.entityAspect.setDeleted();\r\n }\r\n\r\n _.remove(this._edm.entities, this._selectedExposureAdditionalMaterialSurveyMeasure);\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n onSave() {\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n\r\n this._adding = false;\r\n this._edm.editing = false;\r\n\r\n this.fetchMeasures();\r\n });\r\n }\r\n }\r\n\r\n onShowMaterialSurveys() {\r\n if (this._selectedExposureSurvey == null) {\r\n return;\r\n }\r\n\r\n this._router.navigate(['../exposure-survey-lists', { id: this._selectedExposureSurvey.exposureSurveyId }], { relativeTo: this._route });\r\n }\r\n\r\n isDuplicateMeasureEntry(exposureAdditionalMaterialId: number, typeExposureMeasureId: number): boolean {\r\n if (this._edm.entities == null) {\r\n return false;\r\n }\r\n\r\n const measure = this._edm.entities.filter(m => m.exposureAdditionalMaterialId == exposureAdditionalMaterialId && m.typeExposureMeasureId == typeExposureMeasureId);\r\n if (measure != null && measure.length > 1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n // Filters\r\n filterToAdditionalMaterialById(exposureAdditionalMaterialId: number): ExposureAdditionalMaterial {\r\n if (this._exposureAdditionalMaterials == null || this._exposureAdditionalMaterials.length < 1) {\r\n return null;\r\n }\r\n\r\n const additionalmaterial = this._exposureAdditionalMaterials.filter(a => a.exposureAdditionalMaterialId == exposureAdditionalMaterialId);\r\n if (additionalmaterial != null && additionalmaterial.length > 0) {\r\n return additionalmaterial[0];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n filterToExposureAdditionalMaterialSurveyMeasureById(exposureAdditionalMaterialSurveyMeasureId: number): ExposureAdditionalMaterialSurveyMeasure {\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return null;\r\n }\r\n\r\n const measure = this._edm.entities.filter(m => m.exposureAdditionalMaterialSurveyMeasureId == exposureAdditionalMaterialSurveyMeasureId);\r\n if (measure != null && measure.length > 0) {\r\n return measure[0];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n filterExposureAdditionalMaterialByIndex(ix: number) {\r\n this._selectedExposureAdditionalMaterialIndex = ix;\r\n this._selectedExposureAdditionalMaterial = this._exposureAdditionalMaterials[ix];\r\n this._data.exposureAdditionalMaterialId = this._selectedExposureAdditionalMaterial.exposureAdditionalMaterialId;\r\n this._data.additionalExposureSurveyId = null;\r\n\r\n this.fetchExposureAdditionalMaterialSurveys();\r\n }\r\n\r\n public filterExposureSurveyByIndex(ix: number) {\r\n\r\n this._selectedExposureSurveyIndex = ix;\r\n\r\n this._selectedExposureSurvey = this._exposureAdditionalMaterialSurveys[ix].exposureSurvey;\r\n this._data.additionalExposureSurveyId = this._selectedExposureSurvey.exposureSurveyId;\r\n this._currentExposureAdditionalMaterialSurvey = this._exposureAdditionalMaterialSurveys[ix];\r\n\r\n this.fetchMeasures();\r\n\r\n return true;\r\n }\r\n\r\n getDefaultMeasureTypeIds() {\r\n this._uow.typeExposureMeasureRepository.all().then(m => {\r\n if (m != null && m.length > 0) {\r\n const types = m.filter(t => t.measureName.toLowerCase() == 'none');\r\n if (types != null && types.length > 0) {\r\n this._typeExposureMeasureId = types[0].typeExposureMeasureId;\r\n this._typeExposureMeasureValueId = types[0].typeExposureMeasureValueId;\r\n }\r\n }\r\n });\r\n\r\n this._uow.typeCremeVersionRepository.all().then(c => {\r\n if (c != null && c.length > 0) {\r\n const types = c.filter(t => t.cremeVersion.toLowerCase() == 'none');\r\n if (types != null && types.length > 0) {\r\n this._typeCremeVersionId = types[0].typeCremeVersionId;\r\n }\r\n }\r\n });\r\n }\r\n}\r\n","
\r\n\r\n \r\n {{entity.material?.realCASNumber}}\r\n \r\n\r\n \r\n {{entity.material?.formattedRIFMId}}\r\n \r\n\r\n \r\n {{entity.material?.principalSynonym().synonymWordOrWebVersion()}}\r\n \r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n {{entity.typeExposureMeasure.measureDescription}}\r\n \r\n
\r\n\r\n
\r\n \r\n {{_currentTypeExposureMeasure.typeExposureMeasureValue?.measureValueType}}\r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n","import {Component, Input, OnInit} from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport {provideParent, UnitOfWork} from '../../services/common';\r\nimport {EditPropParent} from '../../controls/common';\r\nimport {MaterialExposureSurveyMeasure, TypeCremeVersion, TypeExposureMeasure, TypeExposureMeasureValue} from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'material-exposure-survey-measure-editor',\r\n templateUrl: './material-exposure-survey-measure-editor.html',\r\n providers: [provideParent(MaterialExposureSurveyMeasureEditorComponent, EditPropParent)]\r\n})\r\nexport class MaterialExposureSurveyMeasureEditorComponent implements OnInit, EditPropParent {\r\n @Input() entity: MaterialExposureSurveyMeasure;\r\n\r\n _currentTypeExposureMeasure: TypeExposureMeasure;\r\n _typeExposureMeasures: TypeExposureMeasure[];\r\n _typeExposureMeasureValues: TypeExposureMeasureValue[];\r\n\r\n _typeCremeVersions: TypeCremeVersion[];\r\n\r\n constructor(public uow: UnitOfWork) {\r\n }\r\n\r\n ngOnInit() {\r\n this.uow.typeExposureMeasureRepository.all().then(m => {\r\n this._typeExposureMeasures = m;\r\n\r\n if (m == null || m.length < 1) { return; }\r\n\r\n if (!this.entity.entityAspect.entityState.isAdded()) {\r\n this.setCurrentMeasureType(this.entity.typeExposureMeasure.typeExposureMeasureValueId);\r\n }\r\n });\r\n\r\n this.uow.typeExposureMeasureValueRepository.all().then(v => {\r\n this._typeExposureMeasureValues = v;\r\n });\r\n\r\n this.uow.typeCremeVersionRepository.all().then(c => {\r\n this._typeCremeVersions = _.sortBy(c, t => t.cremeVersion).reverse();\r\n });\r\n }\r\n\r\n checkIfNull(value: string) {\r\n if (value == '') { return null; } else { return value; }\r\n }\r\n\r\n getError(propName: string) {\r\n if (this.entity == null) {\r\n return;\r\n }\r\n\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n hasQualitativeValue(): boolean {\r\n if (this._currentTypeExposureMeasure == null || this._currentTypeExposureMeasure.typeExposureMeasureValue == null) { return false; }\r\n\r\n return (this._currentTypeExposureMeasure.typeExposureMeasureValue.measureValueType == 'Qualitative');\r\n }\r\n\r\n hasQuantitativeValue(): boolean {\r\n if (this._currentTypeExposureMeasure == null || this._currentTypeExposureMeasure.typeExposureMeasureValue == null) { return false; }\r\n\r\n return (this._currentTypeExposureMeasure.typeExposureMeasureValue.measureValueType == 'Quantitative' || this._currentTypeExposureMeasure.typeExposureMeasureValue.measureValueType == 'Percentage');\r\n }\r\n\r\n isAdded() {\r\n return this.entity.entityAspect.entityState.isAdded();\r\n }\r\n\r\n onSelectMeasure(ix: number) {\r\n this.setCurrentMeasureType(ix);\r\n\r\n this.entity.typeExposureMeasureId = this._currentTypeExposureMeasure.typeExposureMeasureId;\r\n this.entity.typeExposureMeasureValueId = this._currentTypeExposureMeasure.typeExposureMeasureValueId;\r\n }\r\n\r\n setCurrentMeasureType(ix: number) {\r\n const x = this._typeExposureMeasures.filter(t => t.typeExposureMeasureId == ix);\r\n if (x != null && x.length > 0) {\r\n this._currentTypeExposureMeasure = x[0];\r\n }\r\n }\r\n}\r\n","
\r\n

{{_adding ? \"Adding an Exposure Survey Measure\" : \"Editing an Exposure Survey Measure\" }}

\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n

{{_validationMessage}}

\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n
\r\n Selected CAS No.: \r\n {{_selectedMaterial.realCASNumber || '(No CAS#)'}}\r\n\r\n RIFM Id: \r\n {{_selectedMaterial.formattedRIFMId + ','}}\r\n\r\n Principal Synonym: \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n 0\" class=\"inline\">\r\n Available Exposure Surveys: \r\n \r\n \r\n
\r\n
\r\n
\r\n For the Selected Exposure Survey:\r\n {{_selectedExposureSurvey.exposureSurveyMonthYear}}\r\n with Number: \r\n {{_selectedExposureSurvey.exposureSurveyNumber}}\r\n
\r\n The Response Status was: \r\n {{_currentMaterialExposureSurvey.typeExposureSurveyResponse.responseType}}\r\n
\r\n (Back to Material List)\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n

{{_unsurveyedMessage}}

\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n

\r\n There is no Measure data for this material for the selected survey.\r\n

\r\n 0\" class=\"inline\">\r\n Exposure Survey Measure Data\r\n \r\n Indicates multiple runs of the same measure within an Exposure Survey.\r\n \r\n 0\">\r\n \r\n \r\n Edit\r\n Remove\r\n Multiple Runs\r\n Measure\r\n Value\r\n Date Entered\r\n Notes\r\n Creme Version\r\n \r\n \r\n \r\n \r\n Edit\r\n Remove\r\n \r\n {{mx.data.typeExposureMeasure.measureDescription}}\r\n {{mx.data.measureQualitativeResult || utilFns.formatNumber(mx.data.measureQuantitativeResult, 12, 4)}}\r\n {{utilFns.formatDate(mx.data.created)}}\r\n {{mx.data.measureNotes}}\r\n {{mx.data.typeCremeVersion.cremeVersion}}\r\n \r\n \r\n \r\n
\r\n 0 && !_edm.editing\">\r\n Isomers surveyed with this material: \r\n {{_materialExposureSurveyIsomers}}\r\n \r\n
\r\n\r\n\r\n\r\n
\r\n \r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, ViewChild, Inject, forwardRef, OnInit } from '@angular/core';\r\n\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport { UnitOfWork, StateMap, ErrorLogger, provideParent, UserManager } from '../../services/common';\r\nimport { EditManager, IEditHost, UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { Material, ExposureSurvey, MaterialExposureSurvey, MaterialExposureSurveyMeasure, MaterialExposureSurveyIsomer } from '../../entities/EntityModels';\r\n\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\nimport { RecordExposureSurveyMeasuresComponent, MeasureEditData } from './record-exposure-survey-measures.component';\r\n\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'material-exposure-survey-measures',\r\n templateUrl: './material-exposure-survey-measures.html',\r\n providers: [provideParent(MaterialExposureSurveyMeasuresComponent, EditPropParent)]\r\n})\r\nexport class MaterialExposureSurveyMeasuresComponent implements IEditHost, OnInit {\r\n\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n\r\n private _isLoading = false;\r\n\r\n private _adding: boolean;\r\n _unsurveyedMessage: string;\r\n _validationMessage: string;\r\n\r\n // Default type ids\r\n private _typeCremeVersionId = 0;\r\n private _typeExposureMeasureId = 0;\r\n private _typeExposureMeasureValueId = 0;\r\n\r\n private _selectedExposureSurveyIndex: number;\r\n private _selectedExposureSurvey: ExposureSurvey;\r\n\r\n private _currentMaterialExposureSurvey: MaterialExposureSurvey;\r\n private _materialExposureSurveys: MaterialExposureSurvey[] = [];\r\n\r\n private _selectedMaterialExposureSurveyMeasure: MaterialExposureSurveyMeasure;\r\n private _materialExposureSurveyMeasures: MaterialExposureSurveyMeasure[] = [];\r\n\r\n public _materialExposureSurveyIsomers: string;\r\n\r\n private _selectedMaterial: Material;\r\n _edm: EditManager;\r\n public _materialExposureSurveyMeasuresEx: SelectableEntity[] = [];\r\n\r\n private _data: MeasureEditData;\r\n\r\n constructor( @Inject(forwardRef(() => RecordExposureSurveyMeasuresComponent)) public _parent: RecordExposureSurveyMeasuresComponent,\r\n private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n public _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Exposure Survey Material Measures');\r\n\r\n this._edm.pageState.canShowMessage = false;\r\n\r\n if (this._data.materialId > 0) {\r\n this.fetchMaterial(this._data.materialId);\r\n }\r\n\r\n this.getDefaultMeasureTypeIds();\r\n }\r\n\r\n fetchMaterial(materialId: number) {\r\n this._edm.entities = null;\r\n this._materialExposureSurveys = [];\r\n\r\n this._isLoading = true;\r\n this._uow.materialRepository.withId(materialId).then(m => {\r\n if (m) {\r\n this._selectedMaterial = m;\r\n this.fetchMaterialExposureSurveys();\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n fetchMaterialExposureSurveys() {\r\n\r\n let filterId = 0;\r\n\r\n this._materialExposureSurveys = [];\r\n\r\n const params = { materialId: this._selectedMaterial.materialId };\r\n\r\n this._isLoading = true;\r\n\r\n this._uow.fetch('ExposureSurveys/MaterialExposureSurveyByMaterialId', params).then(m => {\r\n this._materialExposureSurveys = m;\r\n if (this._materialExposureSurveys != null && this._materialExposureSurveys.length > 0) {\r\n if (this._data.exposureSurveyId > 0) {\r\n const expsurveyid = this._materialExposureSurveys.findIndex(e => e.exposureSurveyId == this._data.exposureSurveyId);\r\n filterId = (expsurveyid < 0) ? 0 : expsurveyid;\r\n }\r\n this._selectedExposureSurveyIndex = filterId;\r\n this.filterExposureSurveyByIndex(this._selectedExposureSurveyIndex); // Set the selected exposure survey which will call the fetchMeasures method\r\n } else {\r\n this._currentMaterialExposureSurvey = null;\r\n this._unsurveyedMessage = 'This Material was not included in any Exposure Survey.';\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n fetchIsomers() {\r\n this._materialExposureSurveyIsomers = '';\r\n\r\n const params = {materialExposureSurveyId: this._currentMaterialExposureSurvey.materialExposureSurveyId};\r\n this._uow.fetch('ExposureSurveys/MaterialExposureSurveyIsomerByMaterialExposureSurveyId', params).then(i => {\r\n if (i != null && i.length > 0) {\r\n this._materialExposureSurveyIsomers = i.map((m: { material: Material; }) => {\r\n return this.formatIsomerIdentifiers(m.material);\r\n }).join('; ');\r\n }\r\n });\r\n }\r\n\r\n formatIsomerIdentifiers(material: Material) {\r\n const rifmId = (material.formattedRIFMId == '-') ? '' : ' (' + material.formattedRIFMId + ')';\r\n return material.realCASNumber + rifmId;\r\n }\r\n\r\n fetchMeasures() {\r\n\r\n if (this._selectedMaterial == null || this._selectedExposureSurvey == null) { return; }\r\n\r\n const params = { materialId: this._selectedMaterial.materialId, exposureSurveyId: this._selectedExposureSurvey.exposureSurveyId };\r\n\r\n this._isLoading = true;\r\n this._uow.fetch('ExposureSurveys/FetchExposureSurveyMaterialMeasures', params).then(m => {\r\n this._edm.entities = m;\r\n this._edm.updatePageState();\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._materialExposureSurveyMeasuresEx = [];\r\n if (this._edm.entities == null || this._edm.entities.length < 1) { return; }\r\n\r\n _.clone(this._edm.entities).forEach(element => {\r\n const isMultiple = this.isDuplicateMeasureEntry(element.materialId, element.typeExposureMeasureId);\r\n this._materialExposureSurveyMeasuresEx.push(new SelectableEntity(element, '#FFFFFF', '', isMultiple));\r\n });\r\n }\r\n\r\n get isLoading() {\r\n return this._isLoading;\r\n }\r\n\r\n set isLoading(value) {\r\n this._isLoading = value;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n canAdd() {\r\n return ((!this._edm.editing) && this._currentMaterialExposureSurvey != null);\r\n }\r\n\r\n // edit manager overrides\r\n canApply() {\r\n if (this._edm.editing) {\r\n return (this._uow.hasChanges() && !this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n canSave() {\r\n if (this._edm.editing) { return false; }\r\n if (!this._edm.hasEdits()) { return false; }\r\n if (!this._edm.validateBeforeSave()) { return false; }\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) { return false; }\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n onAdd() {\r\n if (this._edm.entities == null) {\r\n this._edm.entities = [];\r\n }\r\n\r\n this._adding = true;\r\n const m = this._uow.materialExposureSurveyMeasureFactory.create();\r\n\r\n m.materialId = this._selectedMaterial.materialId;\r\n m.exposureSurveyId = this._selectedExposureSurvey.exposureSurveyId;\r\n m.typeExposureMeasureId = this._typeExposureMeasureId;\r\n m.typeExposureMeasureValueId = this._typeExposureMeasureValueId;\r\n // 03/07/2019: Use Creme Version of the Exposure Survey as the default\r\n m.typeCremeVersionId = this._selectedExposureSurvey.typeCremeVersionId;\r\n m.created = new Date(); // the date is displayed in the table after apply so a valid date is needed here.\r\n\r\n this._edm.entities.push(m);\r\n this._edm.onSelect(m);\r\n }\r\n\r\n onApply() {\r\n\r\n this._validationMessage = '';\r\n\r\n if (this._edm.currentEntity.typeExposureMeasure == null) {\r\n this._validationMessage = 'Please select a Measure type other than None.';\r\n return;\r\n }\r\n\r\n if (this._edm.currentEntity.typeExposureMeasure.measureDescription.toLowerCase() == 'none') {\r\n this._validationMessage = 'Please select a Measure type other than None.';\r\n return;\r\n }\r\n\r\n if (this._edm.currentEntity.measureQualitativeResult == null && this._edm.currentEntity.measureQuantitativeResult == null) {\r\n this._validationMessage = 'Please enter a measure value.';\r\n return;\r\n }\r\n\r\n if (this._edm.currentEntity.typeCremeVersion.cremeVersion.toLowerCase() == 'none') {\r\n this._validationMessage = 'Please select a Creme Version other than None.';\r\n return;\r\n }\r\n\r\n // 01/26/2019: Measure data for the same measure type can be recorded for a material/survey more than once.\r\n // if (this.isDuplicateMeasureEntry(this._edm.currentEntity.materialId, this._edm.currentEntity.typeExposureMeasureId)) {\r\n // this._validationMessage = 'This measure type has already been assigned to this material for the selected exposure survey.';\r\n // return;\r\n // }\r\n\r\n this._edm.onApplyCore();\r\n this._adding = false;\r\n\r\n this.formatSelectableEntities();\r\n\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edm.editing = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._adding = false;\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n\r\n this._materialExposureSurveyMeasuresEx = [];\r\n\r\n this.fetchMeasures();\r\n }\r\n\r\n onEdit(mx: SelectableEntity) {\r\n\r\n if (mx == null) { return; }\r\n\r\n this._selectedMaterialExposureSurveyMeasure = this.filterToMaterialExposureSurveyMeasureById(mx.data.materialExposureSurveyMeasureId);\r\n\r\n if (this._selectedMaterialExposureSurveyMeasure == null) { return; }\r\n\r\n this._edm.onSelect(this._selectedMaterialExposureSurveyMeasure);\r\n }\r\n\r\n onRemove(mx: SelectableEntity) {\r\n\r\n if (mx == null) { return; }\r\n this._selectedMaterialExposureSurveyMeasure = this.filterToMaterialExposureSurveyMeasureById(mx.data.materialExposureSurveyMeasureId);\r\n\r\n if (this._selectedMaterialExposureSurveyMeasure == null) {\r\n this._validationMessage = 'Error occurred, could not remove the selected measure from the list.';\r\n return;\r\n }\r\n\r\n if (this._selectedMaterialExposureSurveyMeasure.entityAspect.entityState.isAdded()) {\r\n this._selectedMaterialExposureSurveyMeasure.entityAspect.rejectChanges();\r\n } else {\r\n this._selectedMaterialExposureSurveyMeasure.entityAspect.setDeleted();\r\n }\r\n\r\n _.remove(this._edm.entities, this._selectedMaterialExposureSurveyMeasure);\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n onSave() {\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n\r\n this._adding = false;\r\n this._edm.editing = false;\r\n\r\n this.fetchMeasures();\r\n });\r\n }\r\n }\r\n\r\n onShowMaterial(mat: Material) {\r\n if (mat == null) { return; }\r\n\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, mat.materialId, ROUTES.Material.childRoutes.MaterialExposure));\r\n }\r\n\r\n\r\n onShowMaterialSurveys() {\r\n if (this._selectedExposureSurvey == null) {\r\n return;\r\n }\r\n\r\n this._router.navigate(['../exposure-survey-lists', { id: this._selectedExposureSurvey.exposureSurveyId }], { relativeTo: this._route });\r\n }\r\n\r\n isDuplicateMeasureEntry(materialId: number, typeExposureMeasureId: number): boolean {\r\n if (this._edm.entities == null) { return false; }\r\n\r\n const measure = this._edm.entities.filter(m => m.materialId == materialId && m.typeExposureMeasureId == typeExposureMeasureId);\r\n if (measure != null && measure.length > 1) { return true; }\r\n\r\n return false;\r\n }\r\n\r\n // Filters\r\n public filterExposureSurveyByIndex(ix: number) {\r\n\r\n this._selectedExposureSurveyIndex = ix;\r\n\r\n this._selectedExposureSurvey = this._materialExposureSurveys[ix].exposureSurvey;\r\n this._data.exposureSurveyId = this._selectedExposureSurvey.exposureSurveyId;\r\n this._currentMaterialExposureSurvey = this._materialExposureSurveys[ix];\r\n\r\n this.fetchMeasures();\r\n this.fetchIsomers();\r\n return true;\r\n }\r\n\r\n filterToMaterialExposureSurveyMeasureById(materialExposureSurveyMeasureId: number): MaterialExposureSurveyMeasure {\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return null;\r\n }\r\n\r\n const measure = this._edm.entities.filter(m => m.materialExposureSurveyMeasureId == materialExposureSurveyMeasureId);\r\n if (measure != null && measure.length > 0) {\r\n return measure[0];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n selectMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this).then(mli => {\r\n if (mli == null) { return; }\r\n return this._uow.materialRepository.withId(mli.materialId);\r\n }).then(m => {\r\n if (m) {\r\n this._selectedMaterial = m;\r\n this._data.materialId = m.materialId;\r\n this._data.exposureSurveyId = null;\r\n\r\n this.fetchMaterialExposureSurveys();\r\n }\r\n });\r\n }\r\n\r\n getDefaultMeasureTypeIds() {\r\n this._uow.typeExposureMeasureRepository.all().then(m => {\r\n if (m != null && m.length > 0) {\r\n const types = m.filter(t => t.measureName.toLowerCase() == 'none');\r\n if (types != null && types.length > 0) {\r\n this._typeExposureMeasureId = types[0].typeExposureMeasureId;\r\n this._typeExposureMeasureValueId = types[0].typeExposureMeasureValueId;\r\n }\r\n }\r\n });\r\n\r\n this._uow.typeCremeVersionRepository.all().then(c => {\r\n if (c != null && c.length > 0) {\r\n const types = c.filter(t => t.cremeVersion.toLowerCase() == 'none');\r\n if (types != null && types.length > 0) {\r\n this._typeCremeVersionId = types[0].typeCremeVersionId;\r\n }\r\n }\r\n });\r\n }\r\n}\r\n","

List of Materials for the Exposure Survey:

\r\n\r\n
\r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport { UnitOfWork, StateMap, UserManager, ErrorLogger, EditorService } from '../../services/common';\r\nimport { ColumnSorter, TabContainer } from '../../controls/common';\r\nimport { EditPropParent } from '../../controls/edit-prop.component';\r\nimport { UtilFns, IEditHost, EditManager, LocationFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { ExposureSurvey } from '../../entities/EntityModels';\r\nimport { ExposureAdditionalMaterialSurveyMeasuresComponent } from './exposure-additional-material-survey-measures.component';\r\nimport { MaterialExposureSurveyMeasuresComponent } from './material-exposure-survey-measures.component';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport { EXPOSURE_ROUTES } from './exposure.routes';\r\n\r\nexport class MeasureEditData {\r\n inSubEditor: boolean;\r\n currentTab: number;\r\n materialId: number;\r\n exposureSurveyId: number;\r\n exposureAdditionalMaterialId: number;\r\n additionalExposureSurveyId: number\r\n}\r\n\r\n@Component({\r\n selector: 'record-exposure-survey-measures',\r\n templateUrl: './record-exposure-survey-measures.html',\r\n})\r\n\r\nexport class RecordExposureSurveyMeasuresComponent implements OnInit {\r\n @ViewChild(ExposureAdditionalMaterialSurveyMeasuresComponent) _exposureAdditionalMaterialSurveyMeasuresComponent: ExposureAdditionalMaterialSurveyMeasuresComponent;\r\n @ViewChild(MaterialExposureSurveyMeasuresComponent) _materialExposureSurveyMeasuresComponent: MaterialExposureSurveyMeasuresComponent;\r\n\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n _tab: number;\r\n\r\n public _data: MeasureEditData = new MeasureEditData();\r\n private _isLoading: boolean;\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n public _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._stateMap.currentRouteName = EXPOSURE_ROUTES.RecordExposureSurveyMeasuresComponent.name;\r\n\r\n const _sub = this._route.params.subscribe(params => {\r\n this._data.materialId = +params['materialId'];\r\n this._data.exposureAdditionalMaterialId = +params['exposureAdditionalMaterialId'];\r\n this._data.exposureSurveyId = +params['exposuresurveyid'];\r\n this._data.additionalExposureSurveyId = +params['exposuresurveyid'];\r\n });\r\n\r\n if (this._data.materialId > 0) {\r\n this.setTab(0);\r\n } else if (this._data.exposureAdditionalMaterialId > 0) {\r\n this.setTab(1);\r\n }\r\n }\r\n\r\n setTab(tabNumber: number) {\r\n setTimeout(() => {\r\n this._tabContainer.selectTab(tabNumber);\r\n }, 1)\r\n }\r\n\r\n canDeactivate() {\r\n return !this._data.inSubEditor && !this._uow.hasChanges();\r\n }\r\n\r\n get isLoading() {\r\n return this._isLoading;\r\n }\r\n\r\n set isLoading(value) {\r\n this._isLoading = value;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // Reports\r\n\r\n // Navigation\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n Most Recent Exposure Survey for a Material Report\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
MaterialIdCAS No.RIFM IDPrincipal NameMost Recent Survey DateMost Recent Survey Number
{{item.materialId}}{{item.realCASNumber}}{{item.rIFMId}}{{item.synonymWord}}{{utilFns.formatDate(item.exposureSurveyDate, 'MMM, YYYY')}}{{item.exposureSurveyNumber}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n\r\n\r\n","import { Component, Input, ViewChild } from '@angular/core';\r\nimport { ExposureSurveyMaterialMostRecent } from '../../entities/EntityModels';\r\nimport { UserManager } from '../../services/common';\r\n\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PrintToPdfDocComponent } from '../main/print-to-pdf-doc.component';\r\n\r\n\r\n@Component({\r\n selector: 'exposure-survey-last-report',\r\n templateUrl: './exposure-survey-last-report.html',\r\n})\r\nexport class ExposureSurveyLastReportComponent {\r\n\r\n @ViewChild(PrintToPdfDocComponent, { static: true }) _printToPdfDocComponent: PrintToPdfDocComponent;\r\n\r\n @Input() reportItems: ExposureSurveyMaterialMostRecent[];\r\n\r\n constructor(private _userManager: UserManager) {\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n printExposureSurveyLastReport() {\r\n const ele = document.querySelector('#report-data');\r\n UtilFns.printElement(ele);\r\n }\r\n\r\n exportReportFile() {\r\n const params: { key: string, value: string }[] = [];\r\n\r\n params.push({ key: 'reporttype', value: 'mostrecentsurvey' });\r\n\r\n const url = this._userManager.getReportUrl(params);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n}\r\n","

View Online

\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n

Available for Download

\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport { ExposureSurveyMaterialMostRecent, RIFMReport } from '../../entities/EntityModels';\r\nimport { EXPOSURE_ROUTES } from './exposure.routes';\r\n\r\n@Component({\r\n templateUrl: './exposure-survey-reports.html',\r\n})\r\nexport class ExposureSurveyReportsComponent implements OnInit {\r\n private _isLoading = false;\r\n public _exposureSurveyMostRecents: ExposureSurveyMaterialMostRecent[] = [];\r\n public _rifmReports: RIFMReport[] = [];\r\n\r\n constructor(public _stateMap: StateMap, public _uow: UnitOfWork, public _userManager: UserManager) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = EXPOSURE_ROUTES.ExposureSurveyReportsComponent.name;\r\n\r\n this.fetch();\r\n }\r\n\r\n // ***** RIFM Reports *****\r\n fetch() {\r\n const params = { reportTopic: 'ExposureSurveyReports' };\r\n return this._uow.fetch('Misc/RIFMReportsByReportTopic', params).then(r => {\r\n if (r) {\r\n this._rifmReports = _.sortBy(r, x => x.reportTitle);\r\n } else {\r\n this._rifmReports = r;\r\n }\r\n });\r\n }\r\n\r\n onShowRIFMReport(r: RIFMReport) {\r\n if (r.reportWebLink != null) {\r\n window.open(r.reportWebLink);\r\n } else if (r.reportFileName != null) {\r\n const url = this._userManager.getFileServiceFilePathUrl(r.reportFileName);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n return;\r\n }\r\n\r\n onShowMostRecentSurveyReport() {\r\n this._isLoading = true;\r\n\r\n return this._uow.fetch('ExposureSurveys/ExposureSurveyMaterialMostRecents', {}).then(r => {\r\n this._exposureSurveyMostRecents = r;\r\n if (this._exposureSurveyMostRecents != null && this._exposureSurveyMostRecents.length > 0) {\r\n this._isLoading = false;\r\n setTimeout(() => {\r\n const ele = $('#ExposureSurveyLastReport');\r\n (ele).modal('show');\r\n }, 0);\r\n return;\r\n }\r\n });\r\n }\r\n\r\n onExportMaterialThresholdReport() {\r\n const params: { key: string, value: string }[] = [];\r\n\r\n params.push({ key: 'reporttype', value: 'materialthreshold' });\r\n\r\n const url = this._userManager.getReportUrl(params);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { TypeCremeVersion } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'type-creme-version-editor',\r\n templateUrl: './type-creme-version-editor.html',\r\n providers: [provideParent(TypeCremeVersionEditorComponent, EditPropParent)]\r\n})\r\nexport class TypeCremeVersionEditorComponent implements OnInit, EditPropParent {\r\n @Input() entity: TypeCremeVersion;\r\n\r\n constructor(public uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n getError(propName: string) {\r\n if (this.entity == null) {\r\n return;\r\n }\r\n\r\n const err = this.entity.getErrorFor(propName);\r\n if (err) {\r\n return err;\r\n }\r\n return null;\r\n }\r\n}\r\n","
\r\n \r\n {{_adding ? \"Adding a Creme Version\" : \"Editing a Creme Version\" }}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n

{{_validationMessage}}

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
Edit
\r\n
Remove
\r\n
Creme Version
\r\n
Notes
\r\n
\r\n
\r\n
\r\n \r\n \r\n
{{c.data.cremeVersion}}
\r\n
{{c.data.description}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n","import { ExposureSurveysComponent } from './exposure-surveys.component';\r\nimport { ExposureSurveyListsComponent } from './exposure-survey-lists.component';\r\nimport { ExposureAdditionalMaterialsComponent } from './exposure-additional-materials.component';\r\nimport { RecordExposureSurveyMeasuresComponent } from './record-exposure-survey-measures.component';\r\nimport { ExposureSurveyReportsComponent } from './exposure-survey-reports.component';\r\nimport { TypeCremeVersionsComponent } from './type-creme-versions.component';\r\n\r\nexport const EXPOSURE_ROUTES = {\r\n ExposureSurveys: { name: 'ExposureSurveys', title: 'Manage Surveys', path: 'exposure-surveys', component: ExposureSurveysComponent, rolesExcluded: 'consultant,FEMA' },\r\n ExposureSurveyLists: { name: 'ExposureSurveyListsComponent', title: 'Manage Material Lists', path: 'exposure-survey-lists', component: ExposureSurveyListsComponent, rolesExcluded: 'consultant,FEMA' },\r\n // tslint:disable-next-line:max-line-length\r\n RecordExposureSurveyMeasuresComponent: { name: 'RecordExposureSurveyMeasures', title: 'Record Exposure Survey Measures', path: 'record-exposure-survey-measures', component: RecordExposureSurveyMeasuresComponent, rolesExcluded: 'consultant,FEMA' },\r\n // tslint:disable-next-line:max-line-length\r\n ExposureAdditionalMaterialsComponent: { name: 'ExposureAdditionalMaterials', title: 'Manage External Materials', path: 'exposure-additional-materials', component: ExposureAdditionalMaterialsComponent, rolesExcluded: 'consultant,FEMA' },\r\n TypeCremeVersionsComponent: { name: 'TypeCremeVersions', title: 'Creme Versions', path: 'type-creme-versions', component: TypeCremeVersionsComponent, rolesExcluded: 'consultant,FEMA' },\r\n ExposureSurveyReportsComponent: { name: 'ExposureSurveyReports', title: 'Reports', path: 'exposure-survey-reports', component: ExposureSurveyReportsComponent, rolesExcluded: 'consultant,FEMA' }\r\n};\r\n","import { Component, forwardRef, Inject, OnInit, ViewChild } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/edit-prop.component';\r\nimport { EditManager } from '../../utils/common';\r\nimport { TypeCremeVersion } from '../../entities/EntityModels';\r\n\r\n// import { TypeCremeVersionEditorComponent } from './type-creme-version-editor.component';\r\nimport { ConfirmFinishOverrideComponent } from '../staff/confirm-finish-override.component';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\n\r\nexport class CremeVersionEditData {\r\n inSubEditor: boolean;\r\n}\r\n\r\n@Component({\r\n selector: 'type-creme-versions',\r\n\r\n templateUrl: './type-creme-versions.html',\r\n providers: [provideParent(TypeCremeVersionsComponent, EditPropParent)]\r\n})\r\nexport class TypeCremeVersionsComponent implements OnInit, EditPropParent {\r\n @ViewChild(ConfirmFinishOverrideComponent, { static: true }) _confirmFinishOverrideComponent: ConfirmFinishOverrideComponent;\r\n\r\n public _typeCremeVersionsEx: SelectableEntity[] = [];\r\n\r\n _edm: EditManager;\r\n private _adding = false;\r\n\r\n private _isLoading = false;\r\n private _selectedTypeCremeVersion: TypeCremeVersion;\r\n\r\n _validationMessage: string;\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Type Creme Versions');\r\n\r\n this.loadData();\r\n }\r\n\r\n loadData() {\r\n this._isLoading = true;\r\n\r\n this._uow.typeCremeVersionRepository.all().then(c => {\r\n\r\n if (c != null) {\r\n this._edm.entities = c.filter(t => t.cremeVersion.toLowerCase() != 'none');\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n }\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._typeCremeVersionsEx = [];\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return;\r\n }\r\n\r\n _.clone(this._edm.entities).forEach(element => {\r\n this._typeCremeVersionsEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n\r\n this._typeCremeVersionsEx = _.orderBy(this._typeCremeVersionsEx, v => v.data.cremeVersion, 'desc');\r\n }\r\n\r\n checkIfNull(value: string) {\r\n if (value == '') {\r\n return null;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n getError(propName: string) {\r\n if (this._selectedTypeCremeVersion == null) {\r\n return;\r\n }\r\n\r\n const err = this._selectedTypeCremeVersion.getErrorFor(propName);\r\n if (err) {\r\n return err;\r\n }\r\n return null;\r\n }\r\n\r\n // EditManager overrides\r\n canApply() {\r\n if (this._edm.editing && this._uow.hasChanges()) {\r\n if (this._edm.currentEntity != null) {\r\n return (!this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n canSave() {\r\n if (!this._edm.hasEdits()) {\r\n return false;\r\n }\r\n if (!this._edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) {\r\n return false;\r\n }\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n onAdd() {\r\n this._adding = true;\r\n\r\n const cv = this._uow.typeCremeVersionFactory.create();\r\n this._edm.entities.push(cv);\r\n this._edm.onSelect(cv);\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n\r\n if (this._edm.editing) {\r\n if (this.isDuplicateTypeCremeVersionEntry(this._edm.currentEntity.cremeVersion)) {\r\n this._validationMessage = 'A Creme version with the same label already exists.';\r\n return;\r\n }\r\n\r\n this._edm.onApplyCore();\r\n this._adding = false;\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edm.editing = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._adding = false;\r\n\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n\r\n this.loadData();\r\n }\r\n\r\n onEdit(px: SelectableEntity) {\r\n\r\n if (px == null) {\r\n return;\r\n }\r\n\r\n this._selectedTypeCremeVersion = this.filterToTypeCremeVersionById(px.data.typeCremeVersionId);\r\n\r\n if (this._selectedTypeCremeVersion == null) {\r\n this._validationMessage = 'An error occurred trying to edit the selected Creme version.';\r\n return;\r\n }\r\n\r\n this._edm.onSelect(this._selectedTypeCremeVersion);\r\n }\r\n\r\n onRemove(cx: SelectableEntity) {\r\n\r\n if (cx == null) {\r\n return;\r\n }\r\n\r\n this._selectedTypeCremeVersion = this.filterToTypeCremeVersionById(cx.data.typeCremeVersionId);\r\n\r\n if (this._selectedTypeCremeVersion == null) {\r\n this._validationMessage = 'An error occurred, could not remove the selected Creme version.';\r\n return;\r\n }\r\n\r\n const messages: string[] = []; // Only needed to satisfy a parameter\r\n this._confirmFinishOverrideComponent.showModal('Confirm Deletion of the selected Creme Version',\r\n 'There may be Exposure Survey data assigned to this Creme version that will prevent its removal.', messages).then(ok => {\r\n if (ok) {\r\n if (this._selectedTypeCremeVersion.entityAspect.entityState.isAdded()) {\r\n this._selectedTypeCremeVersion.entityAspect.rejectChanges();\r\n } else {\r\n this._selectedTypeCremeVersion.entityAspect.setDeleted();\r\n }\r\n\r\n _.remove(this._edm.entities, this._selectedTypeCremeVersion);\r\n\r\n this.loadData();\r\n\r\n this.formatSelectableEntities();\r\n }\r\n });\r\n }\r\n\r\n onSave() {\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n\r\n this._adding = false;\r\n this._edm.editing = false;\r\n\r\n this.loadData();\r\n });\r\n }\r\n }\r\n\r\n filterToTypeCremeVersionById(typeCremeVersionId: number): TypeCremeVersion {\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return null;\r\n }\r\n\r\n const versions = this._edm.entities.filter(e => e.typeCremeVersionId == typeCremeVersionId);\r\n if (versions != null && versions.length > 0) {\r\n return versions[0];\r\n }\r\n }\r\n\r\n isDuplicateTypeCremeVersionEntry(version: string): boolean {\r\n if (this._edm.entities == null) {\r\n return false;\r\n }\r\n\r\n const cv = this._edm.entities.filter(e => e.cremeVersion == version);\r\n if (cv != null && cv.length > 1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n","
\r\n
{{getPageTitle()}}
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
","import {Component, OnInit} from '@angular/core';\r\nimport * as _ from 'lodash';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport { StateMap, IRouteDefinition } from '../../services/common';\r\nimport { EXPOSURE_ROUTES } from './exposure.routes';\r\n\r\n@Component({\r\n selector: 'exposure',\r\n templateUrl: './exposure.html',\r\n})\r\nexport class ExposureComponent implements OnInit {\r\n\r\n _routes = _.values(EXPOSURE_ROUTES);\r\n\r\n constructor(public _stateMap: StateMap, public _route: ActivatedRoute) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n\r\n }\r\n\r\n canShow(routeDef: IRouteDefinition) {\r\n\r\n if (this._stateMap.currentUser.isStaff) {\r\n // Exception to prevent consultant staff from seeing otherwise staff viewable content.\r\n if (routeDef.rolesExcluded) {\r\n const roles = routeDef.rolesExcluded.split(',').map(function (item) {\r\n return item.trim();\r\n });\r\n\r\n if (roles != null && roles.length > 0) {\r\n return (!this.userRoleFound(roles));\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n if (routeDef.staffOnly) { return false; }\r\n return true;\r\n }\r\n\r\n currentRoute() {\r\n return _.find(this._routes, r => r.name == this.routeName);\r\n }\r\n\r\n getPageTitle() {\r\n return (this.currentRoute() ? this.currentRoute().title : '') + ': ';\r\n }\r\n\r\n get routeName() {\r\n return this._stateMap.currentRouteName;\r\n }\r\n\r\n isActiveTab(r: IRouteDefinition) {\r\n const currentRouteName = this.routeName || this._routes[0].name;\r\n return r.name == currentRouteName;\r\n }\r\n\r\n userRoleFound(roles: string[]): boolean {\r\n for (let idx = 0; idx < roles.length; idx++) {\r\n if (this._stateMap.currentUser.isInRole(roles[idx])) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n","
\r\n \r\n Uploading PDF files...\r\n
\r\n
\r\n\r\n \r\n
\r\n \r\n \r\n {{fileCount}}\r\n
\r\n\r\n {{_validationMessage}}\r\n\r\n \r\n Drag-n-Drop Files\r\n\r\n\r\n \r\n
\r\n \r\n
\r\n\r\n\r\n\r\n
0\" class=\"item-dragndrop-valid-results\">\r\n
\r\n Valid Files: Ready to Upload\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
File NameRef IdAdd/ReplaceDescriptionRemove from ListResultsShow
{{f.fileName}}{{f.referenceId}}\r\n \r\n \r\n \r\n A record already exists, the file will be replaced.\r\n Remove{{f.results}}Go to Document
\r\n
\r\n
\r\n\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n\r\n
0\" class=\"item-dragndrop-invalid-results\">\r\n Invalid Files\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
File NameFile Error
{{i.fileName}}{{i.errorMsg}}
\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n","import { Location } from '@angular/common';\r\nimport { Component, ViewChild, OnInit, AfterViewInit } from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport {UnitOfWork, StateMap, UserManager, ErrorLogger, WorkflowEntityState, ReferenceState} from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { environment } from '../../../environments/environment';\r\nimport * as _ from 'lodash';\r\nimport { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';\r\n\r\nimport { Reference, RIFMDocument, RIFMDocumentFolder, RIFMDocumentArchive, TypeRIFMDocument } from '../../entities/EntityModels';\r\nimport { FileHandle } from '../../entities/projections/FileHandle';\r\n\r\nimport {Observable} from 'rxjs';\r\n\r\nimport { DOCUMENTMANAGEMENT_ROUTES } from './document-management.routes';\r\nimport { ROUTES } from '../routes';\r\n\r\nimport {ReferenceDocumentListItem} from '../../entities/projections/ReferenceDocumentListItem';\r\n\r\nexport class UploadFileData {\r\n fileName: string;\r\n fileIndex: number;\r\n referenceId: number;\r\n hasRIFMDocumentRecord: boolean;\r\n rIFMDocumentId: number;\r\n results: string;\r\n successAdd: boolean;\r\n successReplace: boolean;\r\n ignore: boolean;\r\n}\r\n\r\n@Component({\r\n selector: 'quick-document-upload',\r\n templateUrl: '../docmanagement/quick-document-upload.html',\r\n})\r\nexport class QuickDocumentUploadComponent implements OnInit, AfterViewInit {\r\n\r\n public _files: any = [];\r\n public _referenceDocumentListItems: ReferenceDocumentListItem[];\r\n public _workflowReference: Reference;\r\n\r\n // Default type ids\r\n public _typeRIFMDocumentId: string;\r\n\r\n public _isLoading = false;\r\n public _isProcessingFiles = false;\r\n\r\n public _fileInvalidList: { fileName: string, errorMsg: string }[] = [];\r\n public _fileValidList: UploadFileData[] = [];\r\n public _fileInputElement: any;\r\n public _readyForMore = false;\r\n public _validationMessage: string;\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n private _httpClient: HttpClient, private _referenceState: ReferenceState,\r\n private _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = DOCUMENTMANAGEMENT_ROUTES.QuickDocumentUpload.name;\r\n\r\n if (!this.isValidString(this._stateMap.documentManagementUrl)) {\r\n this._stateMap.documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDocument';\r\n }\r\n }\r\n\r\n ngAfterViewInit() {\r\n this._fileInputElement = $('#fileInputElement')[0] as HTMLInputElement;\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url\r\n // ************************************************************************\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n public isValidString(testString: string): boolean {\r\n return (testString && testString.length > 0);\r\n }\r\n\r\n // ************************************************************************\r\n // load data\r\n // ************************************************************************\r\n fetchRIFMDocuments(referenceIds: number[]): Promise {\r\n this._validationMessage = '';\r\n\r\n return this._uow.fetch('DocumentManagement/FetchRIFMDocumentsByReferenceId', {referenceIds: referenceIds}).then(f => {\r\n if (f != null && f.length > 0) {\r\n this._referenceDocumentListItems = f;\r\n }\r\n });\r\n }\r\n\r\n // ************************************************************************\r\n canDeactivate() {\r\n return !this._isProcessingFiles;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // ************************************************************************\r\n // file data\r\n // ************************************************************************\r\n public get fileCount() {\r\n if (this._files == null || this._files.length == 0) {\r\n return '';\r\n }\r\n\r\n return ('There are ' + this._files.length + ' file(s) ready to upload.');\r\n }\r\n\r\n public parseFileName(fileName: string): number {\r\n try {\r\n const filePart = fileName.substring(0, fileName.lastIndexOf('.'));\r\n const refId = parseInt(filePart, 10);\r\n return (!isNaN(refId)) ? refId : 0;\r\n } catch (error) {\r\n console.log(error);\r\n return 0;\r\n }\r\n }\r\n\r\n // ************************************************************************\r\n // file interactions\r\n // ************************************************************************\r\n allowDrop(event: any) {\r\n event.preventDefault();\r\n }\r\n\r\n onDragOver(evt: any) {\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n }\r\n\r\n onDragLeave(evt: any) {\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n }\r\n\r\n onDrop(evt: any) {\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n\r\n this._files = evt.dataTransfer.files;\r\n }\r\n\r\n onFileInput(files: FileList) {\r\n if (files == null || files.length == 0) {\r\n return;\r\n }\r\n this._files = files;\r\n }\r\n\r\n onAddDocument(ix: number) {\r\n this._isLoading = true;\r\n this.addReferenceDocument(ix);\r\n\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n this._isLoading = false;\r\n }\r\n\r\n onReplaceFile(ix: number) {\r\n this._isLoading = true;\r\n this.replaceReferenceDocumentFile(ix);\r\n\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n this._isLoading = false;\r\n }\r\n\r\n onRemoveFileFromList(ix: number) {\r\n this._fileValidList[ix].ignore = true;\r\n }\r\n\r\n async onUploadAll() {\r\n this._isLoading = true;\r\n this._isProcessingFiles = true;\r\n\r\n const newFiles = _.clone(this._fileValidList);\r\n\r\n // upload file data\r\n for (let idx = 0; idx < newFiles.length; idx++) {\r\n if (newFiles[idx].ignore == false) {\r\n if (newFiles[idx].hasRIFMDocumentRecord) {\r\n const result = await this.replaceReferenceDocumentFile(idx);\r\n } else {\r\n const result = await this.addReferenceDocument(idx);\r\n }\r\n }\r\n }\r\n\r\n if (this._uow.hasChanges()) {\r\n this._uow.commit();\r\n }\r\n\r\n this._readyForMore = true;\r\n this._files = [];\r\n\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n\r\n this._isLoading = false;\r\n this._isProcessingFiles = false;\r\n }\r\n\r\n clearData() {\r\n this._readyForMore = false;\r\n this._validationMessage = '';\r\n\r\n this._files = [];\r\n this._fileInvalidList = [];\r\n this._fileValidList = [];\r\n this._referenceDocumentListItems = [];\r\n\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n }\r\n\r\n // ************************************************************************\r\n // page interaction\r\n // ************************************************************************\r\n canCancel() {\r\n return (this._files != null && this._files.length > 0);\r\n }\r\n\r\n canDragFiles() {\r\n return (this._fileValidList == null || this._fileValidList.length == 0);\r\n }\r\n\r\n canPrepareFiles() {\r\n if (this._fileValidList != null && this._fileValidList.length > 0) {\r\n return false;\r\n }\r\n\r\n return (this._files != null && this._files.length > 0);\r\n }\r\n\r\n canUploadAll() {\r\n if (this._readyForMore) {\r\n return false;\r\n }\r\n\r\n return (this._fileValidList != null && this._fileValidList.length > 0);\r\n }\r\n\r\n onAddMore() {\r\n this.clearData();\r\n }\r\n\r\n onCancel() {\r\n this.clearData();\r\n }\r\n\r\n public onPrepareFiles() {\r\n this._fileInvalidList = [];\r\n this._fileValidList = [];\r\n\r\n // sort files by name\r\n this._files = _.sortBy(this._files, n => n.name);\r\n\r\n for (let idx = 0; idx < this._files.length; idx++) {\r\n const refId = this.parseFileName(this._files[idx].name);\r\n\r\n if (refId == 0) {\r\n this._fileInvalidList.push({fileName: this._files[idx].name, errorMsg: 'Invalid file name: cannot identify the Reference Id.'});\r\n } else {\r\n // tslint:disable-next-line:max-line-length\r\n this._fileValidList.push({\r\n fileName: this._files[idx].name,\r\n fileIndex: idx,\r\n referenceId: refId,\r\n hasRIFMDocumentRecord: false,\r\n rIFMDocumentId: 0,\r\n results: '',\r\n successAdd: false,\r\n successReplace: false,\r\n ignore: false\r\n });\r\n }\r\n }\r\n\r\n if (this._fileValidList.length == 0) {\r\n return;\r\n }\r\n\r\n const refIds = this._fileValidList.map(i => i.referenceId);\r\n\r\n // match rifm document to file reference ids\r\n this.fetchRIFMDocuments(refIds).then(r => {\r\n if (this._referenceDocumentListItems == null || this._referenceDocumentListItems.length == 0) {\r\n return;\r\n }\r\n\r\n for (let idx = 0; idx < this._fileValidList.length; idx++) {\r\n const rifmdoc = this._referenceDocumentListItems.filter(d => d.referenceId == this._fileValidList[idx].referenceId);\r\n if (rifmdoc != null && rifmdoc.length > 0) {\r\n this._fileValidList[idx].hasRIFMDocumentRecord = true;\r\n this._fileValidList[idx].rIFMDocumentId = rifmdoc[0].rIFMDocumentId;\r\n }\r\n }\r\n });\r\n }\r\n\r\n get fileValidList(): UploadFileData[] {\r\n if (this._fileValidList == null) {\r\n return [];\r\n }\r\n return this._fileValidList.filter(f => f.ignore == false);\r\n }\r\n\r\n public onNavToRefDoc(idx: number) {\r\n const fileData = this._fileValidList[idx];\r\n this._stateMap.documentManagementReferenceId = fileData.referenceId;\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.DocumentManagement, ROUTES.DocumentManagement.childRoutes.RIFMDocuments));\r\n }\r\n\r\n // ************************************************************************\r\n // web api calls\r\n // ************************************************************************\r\n getAddDocumentURL(fileData: UploadFileData): Observable {\r\n const url = this._stateMap.documentManagementUrl + '/AddRIFMDocument';\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n\r\n const formData: FormData = new FormData();\r\n formData.append('referenceId', fileData.referenceId + '');\r\n formData.append('fileName', fileData.referenceId + '.pdf');\r\n formData.append('file', this._files[fileData.fileIndex]);\r\n\r\n return this._httpClient.post(url, formData);\r\n }\r\n\r\n getReplaceDocumentURL(fileData: UploadFileData): Observable {\r\n const url = this._stateMap.documentManagementUrl + '/ReplaceRIFMDocument';\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n\r\n const formData: FormData = new FormData();\r\n formData.append('referenceId', fileData.referenceId + '');\r\n formData.append('rifmDocumentId', fileData.rIFMDocumentId + '');\r\n formData.append('fileName', fileData.referenceId + '.pdf');\r\n formData.append('file', this._files[fileData.fileIndex]);\r\n\r\n return this._httpClient.post(url, formData);\r\n }\r\n\r\n public addReferenceDocument(idx: number): Promise {\r\n\r\n const fileData = this._fileValidList[idx];\r\n\r\n const url = this._stateMap.documentManagementUrl + '/AddRIFMDocument';\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n\r\n const formData: FormData = new FormData();\r\n formData.append('referenceId', fileData.referenceId + '');\r\n formData.append('fileName', fileData.referenceId + '.pdf');\r\n formData.append('file', this._files[fileData.fileIndex]);\r\n\r\n return this._httpClient.post(url, formData)\r\n .toPromise()\r\n .then(response => {\r\n if (response) {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n this._fileValidList[idx].successAdd = false;\r\n this._fileValidList[idx].results = 'Error: ' + data.ExceptionMessage;\r\n return false;\r\n }\r\n\r\n this._fileValidList[idx].successAdd = true;\r\n this._fileValidList[idx].results = 'Added Successfully';\r\n\r\n return true;\r\n }\r\n return false;\r\n })\r\n .catch(() => {\r\n this._fileValidList[idx].successAdd = false;\r\n this._fileValidList[idx].results = 'Error Occurred';\r\n return false;\r\n });\r\n\r\n }\r\n\r\n public replaceReferenceDocumentFile(idx: number): Promise {\r\n const fileData = this._fileValidList[idx];\r\n\r\n const url = this._stateMap.documentManagementUrl + '/ReplaceRIFMDocument';\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n\r\n const formData: FormData = new FormData();\r\n formData.append('referenceId', fileData.referenceId + '');\r\n formData.append('rifmDocumentId', fileData.rIFMDocumentId + '');\r\n formData.append('fileName', fileData.referenceId + '.pdf');\r\n formData.append('file', this._files[fileData.fileIndex]);\r\n\r\n return this._httpClient.post(url, formData)\r\n .toPromise()\r\n .then(response => {\r\n if (response) {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n this._fileValidList[idx].successReplace = false;\r\n this._fileValidList[idx].results = 'Error: ' + data.ExceptionMessage;\r\n return false;\r\n }\r\n this._fileValidList[idx].successReplace = true;\r\n this._fileValidList[idx].results = 'Replaced Successfully';\r\n\r\n return true;\r\n }\r\n return false;\r\n })\r\n .catch(() => {\r\n this._fileValidList[idx].successReplace = false;\r\n this._fileValidList[idx].results = 'Error Occurred';\r\n return false;\r\n });\r\n }\r\n}\r\n","
\r\n
\r\n \r\n Show:\r\n \r\n\r\n \r\n Filter By:\r\n \r\n\r\n \r\n Search Terms:\r\n \r\n \r\n\r\n \r\n {{searchTypeMessage}}\r\n\r\n \r\n {{_searchErrorMessage}}\r\n\r\n
\r\n\r\n
\r\n Search Results\r\n
\r\n\r\n
\r\n
0\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Ref IdBrief ReferenceFile NameArchived DateArchived ByViewRestore
{{rd.data.referenceId}}{{rd.data.briefReference}}\r\n \r\n \r\n \r\n {{_stateMap.utilFns.formatDate(rd.data.created, \"YYYY-MM-DD HH:mm:ss\")}}{{rd.data.createdUser}}\r\n \r\n \r\n \r\n Restore
\r\n
\r\n\r\n
\r\n\r\n
\r\n
0\" class=\"background-white\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Ref IdBrief ReferenceFile NameArchived DateArchived ByViewRestore
{{rd.data.referenceId}}{{rd.data.briefReference}}{{rd.data.originalFileName}}{{_stateMap.utilFns.formatDate(rd.data.modified)}}{{rd.data.modifyUser}}\r\n \r\n \r\n \r\n Restore
\r\n
\r\n\r\n
\r\n\r\n
\r\n","import {Component, Input, Output, ViewChild, OnInit, EventEmitter} from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport * as _ from 'lodash';\r\nimport { UnitOfWork, StateMap, UserManager, ErrorLogger } from '../../services/common';\r\nimport { UtilFns, IEditHost, EditManager } from '../../utils/common';\r\nimport { RIFMDocument, RIFMDocumentFolder, RIFMDocumentArchive, TypeRIFMDocument } from '../../entities/EntityModels';\r\nimport { DocumentFoldersListItem } from '../../entities/projections/DocumentFoldersListItem';\r\nimport { ArchivedReferenceDocumentListItem } from '../../entities/projections/ArchivedReferenceDocumentListItem';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport { DOCUMENTMANAGEMENT_ROUTES } from './document-management.routes';\r\n\r\nexport enum SearchType { REFERENCEID, RECENTLYARCHIVED }\r\n\r\n@Component({\r\n selector: 'archived-document-selector',\r\n templateUrl: './archived-document-selector.html'\r\n})\r\nexport class ArchivedDocumentSelectorComponent implements OnInit {\r\n @Input() showSelectors: boolean;\r\n @Output() stateChange = new EventEmitter();\r\n\r\n private _isLoading: boolean;\r\n\r\n // Default type ids\r\n public _typeRIFMDocumentId: string;\r\n public _selectedRIFMDocumentArchive: ArchivedReferenceDocumentListItem;\r\n\r\n public colorUnselected = '#FCFCFC';\r\n public colorSelected = '#C6FAE8';\r\n\r\n public _searchType: SearchType = SearchType.REFERENCEID;\r\n\r\n public _searchTerm: string;\r\n public _searchErrorMessage: string;\r\n public _searchTypeMessage = 'Enter ReferenceIds separated by a comma.';\r\n\r\n public _rifmDocumentArchivesEx: SelectableEntity[] = [];\r\n public _recentRIFMDocumentArchivesEx: SelectableEntity[] = [];\r\n\r\n _isDataLoading: boolean;\r\n\r\n constructor(public _stateMap: StateMap, private _uow: UnitOfWork) {\r\n }\r\n\r\n ngOnInit() {\r\n // clear out chrome autofill of search term input\r\n this._searchTerm = '';\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // **************************************************************************************\r\n // load archived documents data\r\n // **************************************************************************************\r\n fetchRIFMDocumentArchivesByReferenceIds(referenceIds: number[]) {\r\n this._rifmDocumentArchivesEx = [];\r\n\r\n this._uow.fetch('DocumentManagement/FetchRIFMDocumentArchivesByReferenceId', { referenceIds: referenceIds }).then ( f => {\r\n if (f != null && f.length > 0) {\r\n f.forEach((element: ArchivedReferenceDocumentListItem) => {\r\n this._rifmDocumentArchivesEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n } else {\r\n this._searchErrorMessage = 'No Archived Reference Documents found';\r\n }\r\n });\r\n }\r\n\r\n fetchRecentlyArchivedRIFMDocuments() {\r\n this._recentRIFMDocumentArchivesEx = [];\r\n\r\n this._uow.fetch('DocumentManagement/FetchRecentlyArchivedRIFMDocuments', { takeCount: 25 }).then ( f => {\r\n if (f != null && f.length > 0) {\r\n f.forEach((element: ArchivedReferenceDocumentListItem) => {\r\n this._recentRIFMDocumentArchivesEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n } else {\r\n this._searchErrorMessage = 'No Reference Documents found';\r\n }\r\n });\r\n }\r\n\r\n // **************************************************************************************\r\n // search by referenceid(s)\r\n // **************************************************************************************\r\n search() {\r\n let hasErrors = false;\r\n\r\n this._searchErrorMessage = '';\r\n\r\n if (this.searchType == SearchType.REFERENCEID) { // search by ReferenceIds\r\n const referenceIds = this._searchTerm.split(',').map(function (item) {\r\n const num = Number(item.trim());\r\n if (isNaN(num)) {\r\n hasErrors = true;\r\n } else {\r\n return num;\r\n }\r\n });\r\n if (hasErrors) {\r\n this._searchErrorMessage = 'Hmmm, looks like some of the ReferenceIds are not numbers.';\r\n return;\r\n }\r\n return this.fetchRIFMDocumentArchivesByReferenceIds(referenceIds);\r\n }\r\n }\r\n\r\n // filter interactions\r\n canSearch() {\r\n return (this.searchType == SearchType.REFERENCEID && this._searchTerm && this._searchTerm.trim().length > 0);\r\n }\r\n\r\n showSearchElements() : boolean {\r\n return (this.searchType != SearchType.RECENTLYARCHIVED);\r\n }\r\n\r\n public filterButtonColor(filtertype: string) {\r\n switch (filtertype) {\r\n case 'reference': {\r\n return (this.searchType == SearchType.REFERENCEID) ? this.colorSelected : this.colorUnselected;\r\n break;\r\n }\r\n case 'recentlymodified': {\r\n return (this.searchType == SearchType.RECENTLYARCHIVED) ? this.colorSelected : this.colorUnselected;\r\n break;\r\n }\r\n default: {\r\n return this.colorUnselected;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // toggle button\r\n onSelectFilterType(type: string) {\r\n this._searchErrorMessage = '';\r\n\r\n if (type == 'reference') {\r\n this.searchType = SearchType.REFERENCEID;\r\n } else {\r\n this.searchType = SearchType.RECENTLYARCHIVED;\r\n // no filters are required so run the search immediately\r\n this.fetchRecentlyArchivedRIFMDocuments();\r\n }\r\n }\r\n\r\n public refreshWithRecentlyArchived() {\r\n this.onSelectFilterType('recentlyarchived');\r\n }\r\n\r\n public onView(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n this._selectedRIFMDocumentArchive = dx.data;\r\n this.stateChange.emit('view');\r\n\r\n if (this.searchType == SearchType.REFERENCEID) {\r\n const items = _.clone(this._rifmDocumentArchivesEx);\r\n this._rifmDocumentArchivesEx = this.resetBackgroundColor(items);\r\n } else {\r\n const items = _.clone(this._recentRIFMDocumentArchivesEx);\r\n this._recentRIFMDocumentArchivesEx = this.resetBackgroundColor(items);\r\n }\r\n\r\n dx.backgroundColor = this.colorSelected;\r\n\r\n }\r\n\r\n // link click events\r\n public onEdit(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n this._selectedRIFMDocumentArchive = dx.data;\r\n this.stateChange.emit('edit');\r\n }\r\n\r\n public onRestore(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n this._selectedRIFMDocumentArchive = dx.data;\r\n this.stateChange.emit('restore');\r\n }\r\n\r\n resetBackgroundColor(archives: SelectableEntity[]) {\r\n\r\n archives.forEach((element, index) => {\r\n element.backgroundColor = this.colorUnselected;\r\n });\r\n\r\n return archives;\r\n }\r\n\r\n // *****************************************************************************\r\n // bindable properties\r\n // *****************************************************************************\r\n public get filterSearchType(): typeof SearchType {\r\n return SearchType;\r\n }\r\n\r\n public get searchType(): SearchType {\r\n return this._searchType;\r\n }\r\n\r\n public set searchType(value) {\r\n this._searchType = value;\r\n }\r\n\r\n public get searchTypeMessage() {\r\n return this._searchTypeMessage;\r\n }\r\n\r\n public set searchTypeMessage(value) {\r\n this._searchTypeMessage = value;\r\n }\r\n\r\n public get selectedFileName(): string {\r\n return (this._selectedRIFMDocumentArchive != null) ? this._selectedRIFMDocumentArchive.fileName : null;\r\n }\r\n\r\n public get selectedOriginalFileName(): string {\r\n return (this._selectedRIFMDocumentArchive != null) ? this._selectedRIFMDocumentArchive.originalFileName : null;\r\n }\r\n\r\n public get selectedReferenceId(): number {\r\n return (this._selectedRIFMDocumentArchive != null) ? this._selectedRIFMDocumentArchive.referenceId : null;\r\n }\r\n\r\n public get selectedRIFMDocumentArchive(): ArchivedReferenceDocumentListItem {\r\n return this._selectedRIFMDocumentArchive;\r\n }\r\n\r\n public set selectedRIFMDocumentArchive(val: ArchivedReferenceDocumentListItem) {\r\n this._selectedRIFMDocumentArchive = val;\r\n }\r\n}\r\n","
\r\n \r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n \r\n Search and Restore Archived Reference Documents.\r\n \r\n \r\n

{{_validationMessage}}

\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n View Archived Reference Documents.\r\n \r\n \r\n
\r\n\r\n \r\n
\r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, ViewChild, OnInit, AfterViewInit, OnDestroy } from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport {UnitOfWork, StateMap, UserManager, ErrorLogger, ReferenceState, WorkflowEntityState} from '../../services/common';\r\nimport { UtilFns, IEditHost, EditManager } from '../../utils/common';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { environment } from '../../../environments/environment';\r\nimport * as _ from 'lodash';\r\n\r\nimport { Reference, RIFMDocument, RIFMDocumentFolder, RIFMDocumentArchive, TypeRIFMDocument } from '../../entities/EntityModels';\r\nimport {ArchivedDocumentSelectorComponent} from './archived-document-selector.component';\r\nimport {Observable} from 'rxjs';\r\nimport {PDFEditorComponent} from './pdf-editor.component';\r\n\r\nimport { DOCUMENTMANAGEMENT_ROUTES } from './document-management.routes';\r\n\r\n@Component({\r\n selector: 'rifm-archived-documents',\r\n templateUrl: './rifm-archived-documents.html',\r\n})\r\n\r\nexport class RIFMArchivedDocumentsComponent implements OnInit, AfterViewInit, OnDestroy {\r\n @ViewChild(ArchivedDocumentSelectorComponent) _archivedDocumentSelector: ArchivedDocumentSelectorComponent;\r\n @ViewChild(PDFEditorComponent, { static: true }) _pdfEditorComponent: PDFEditorComponent;\r\n\r\n public _adding = false;\r\n\r\n public _isLoading = false;\r\n public _isRestoring = false;\r\n public _selectedRIFMDocumentArchive: RIFMDocumentArchive;\r\n\r\n _rifmDocumentSelectorNextAction = 'Hide Filters';\r\n _showRIFMDocumentSelector = true;\r\n\r\n public _editorWidth = '800px';\r\n public _selectorWidth = '600px';\r\n public _selectorDisplay = 'inline';\r\n public _validationMessage: string;\r\n\r\n public _workflowReference: Reference;\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n private _httpClient: HttpClient, private _route: ActivatedRoute, public _location: Location,\r\n private _referenceState: ReferenceState) {\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = DOCUMENTMANAGEMENT_ROUTES.RIFMArchivedDocuments.name;\r\n\r\n if (!this.isValidString(this._stateMap.documentManagementArchiveUrl)) {\r\n this._stateMap.documentManagementArchiveUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDocumentArchive';\r\n }\r\n this._pdfEditorComponent.serviceUrl = this._stateMap.documentManagementArchiveUrl;\r\n }\r\n\r\n ngAfterViewInit() {\r\n\r\n }\r\n\r\n ngOnDestroy() {\r\n\r\n if (this._pdfEditorComponent != null) {\r\n this._pdfEditorComponent.destroyData();\r\n }\r\n\r\n // remove application cache\r\n this.clearPDFViewerCache();\r\n }\r\n\r\n public clearPDFViewerCache() {\r\n // remove application cache\r\n for (const key in sessionStorage) {\r\n if (key.indexOf('Sync_PdfViewer') !== -1) {\r\n sessionStorage.removeItem(key);\r\n }\r\n }\r\n }\r\n\r\n // ************************************************************************\r\n // load data\r\n // ************************************************************************\r\n // fetchThenEditReference(referenceId: number) {\r\n // return this._uow.fetch('References/GetForWorkflow', { referenceId: referenceId }).then(rd => {\r\n // const ref = (rd && rd.length) ? rd[0] : null;\r\n // if (ref) {\r\n // this._workflowReference = ref;\r\n // }\r\n // });\r\n // }\r\n\r\n archivedDocumentSelectorEventHandler(event: string) {\r\n switch (event) {\r\n case 'restore': {\r\n this._validationMessage = '';\r\n this.restoreRIFMDocumentFile(this._archivedDocumentSelector.selectedRIFMDocumentArchive.rIFMDocumentArchiveId, this._archivedDocumentSelector.selectedRIFMDocumentArchive.referenceId);\r\n break;\r\n }\r\n case 'view': {\r\n this._validationMessage = '';\r\n this.loadPDFFileDataAPI(this._archivedDocumentSelector.selectedFileName);\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // ************************************************************************\r\n canDeactivate() {\r\n return (!this._isRestoring);\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get rifmDocumentSelectorNextAction() {\r\n return this._rifmDocumentSelectorNextAction;\r\n }\r\n\r\n set rifmDocumentSelectorNextAction(value) {\r\n this._rifmDocumentSelectorNextAction = value;\r\n }\r\n\r\n get showRIFMDocumentSelector() {\r\n return this._showRIFMDocumentSelector;\r\n }\r\n\r\n set showRIFMDocumentSelector(value) {\r\n this._showRIFMDocumentSelector = value;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // ************************************************************************\r\n // interactions\r\n // ************************************************************************\r\n onSetSelectorVisibility() {\r\n if (this.rifmDocumentSelectorNextAction == 'Hide Filters') {\r\n this.rifmDocumentSelectorNextAction = 'Show Filters';\r\n this._selectorDisplay = 'none';\r\n this._editorWidth = '1200px';\r\n } else {\r\n this.rifmDocumentSelectorNextAction = 'Hide Filters';\r\n this._selectorDisplay = 'inline';\r\n this._editorWidth = '800px';\r\n }\r\n }\r\n\r\n // ************************************************************************\r\n // PDF Viewer\r\n // ************************************************************************\r\n public loadPDFFileDataAPI(fileName: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this._pdfEditorComponent.loadPDF(fileName);\r\n this._pdfEditorComponent.setViewMode();\r\n this._isLoading = false;\r\n }\r\n\r\n // ************************************************************************\r\n // Web Api Urls\r\n // ************************************************************************\r\n getRestoreFileURL(rifmDocumentArchiveId: number, referenceId: number): Observable {\r\n const url = this._stateMap.documentManagementArchiveUrl + '/Restore?rifmDocumentArchiveId=' + rifmDocumentArchiveId + '&referenceId=' + referenceId;\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n\r\n // const token = this._stateMap.currentUser.authenticationToken;\r\n // headers.append('Authorization', token);\r\n\r\n return this._httpClient.post(url, { });\r\n }\r\n\r\n // ************************************************************************\r\n // HttpClient calls\r\n // ************************************************************************\r\n public restoreRIFMDocumentFile(rifmDocumentArchiveId: number, referenceId: number) {\r\n this._isLoading = true;\r\n this._isRestoring = true;\r\n this._validationMessage = '';\r\n this.getRestoreFileURL(rifmDocumentArchiveId, referenceId)\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n if (data.Success == false) {\r\n this._validationMessage = 'Error occurred, unable to restore the file.' + data.ExceptionMessage;\r\n return;\r\n }\r\n\r\n // refresh the list of archived files in the selector since one record has been removed when the file was restored.\r\n this._archivedDocumentSelector.refreshWithRecentlyArchived();\r\n this._isRestoring = false;\r\n\r\n this._validationMessage = 'RIFM Document restored successfully.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n this._isRestoring = false;\r\n },\r\n () => {\r\n console.error('Request completed');\r\n this._isLoading = false;\r\n this._isRestoring = false;\r\n });\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url\r\n // ************************************************************************\r\n public getDocumentManagementArchiveUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n public isValidString(testString: string): boolean {\r\n return (testString && testString.length > 0);\r\n }\r\n}\r\n","
\r\n
\r\n \r\n \r\n Search Reference Documents\r\n \r\n Or\r\n \r\n \r\n\r\n \r\n Filter By:\r\n \r\n \r\n\r\n \r\n Search Terms:\r\n \r\n \r\n\r\n \r\n {{searchTypeMessage}}\r\n\r\n \r\n {{_searchErrorMessage}}\r\n\r\n
\r\n\r\n
\r\n Search Results\r\n
\r\n\r\n
\r\n
0\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Ref IdFile NameBrief ReferenceFolder NameViewDownloadEditCopy/Add/Delete PagesDelete FileReplace File
{{rd.data.referenceId}}{{rd.data.fileName}}{{rd.data.briefReference}}{{rd.data.folderName}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Edit PDF\r\n Copy/Add/Delete Pages\r\n \r\n \r\n \r\n \r\n \r\n 0\" class=\"centered-image\" src=\"assets/images/ReplacePDF.png\" width=\"24\"/>\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n
0\">\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n {{folder.folderName}}\r\n
\r\n
\r\n File Count: \r\n {{folder.referenceDocumentsEx.length}}\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
{{d.data.referenceId}}{{d.data.fileName}}{{d.data.briefReference}}{{d.data.folderName}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Edit PDFCopy/Add/Delete Pages\r\n \r\n \r\n \r\n \r\n \r\n 0\" class=\"centered-image\" src=\"assets/images/ReplacePDF.png\" width=\"24\"/>\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
0\" class=\"background-white\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Ref IdFile NameLast Change DateChanged ByViewDownloadEditCopy/Add/Delete PagesDelete FileReplace File
{{rd.data.referenceId}}{{rd.data.fileName}}{{_stateMap.utilFns.formatDate(rd.data.modified)}}{{rd.data.modifyUser}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Edit PDFCopy/Add/Delete Pages\r\n \r\n \r\n \r\n \r\n \r\n 0\" class=\"centered-image\" src=\"assets/images/ReplacePDF.png\" width=\"24\"/>\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n","import {Component, Input, Output, ViewChild, OnInit, AfterViewInit, EventEmitter} from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport * as _ from 'lodash';\r\nimport { UnitOfWork, StateMap, UserManager, ErrorLogger } from '../../services/common';\r\nimport { UtilFns, IEditHost, EditManager } from '../../utils/common';\r\nimport { RIFMDocument, RIFMDocumentFolder, RIFMDocumentArchive, TypeRIFMDocument } from '../../entities/EntityModels';\r\nimport { DocumentFoldersListItem } from '../../entities/projections/DocumentFoldersListItem';\r\nimport { ReferenceDocumentListItem } from '../../entities/projections/ReferenceDocumentListItem';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport { DOCUMENTMANAGEMENT_ROUTES } from './document-management.routes';\r\n\r\nimport { ROUTES } from '../routes';\r\n\r\nexport enum SearchType { REFERENCEID, FOLDER, RECENTLYMODIFIED }\r\n\r\n@Component({\r\n selector: 'document-selector',\r\n templateUrl: './document-selector.html'\r\n})\r\n\r\nexport class DocumentSelectorComponent implements OnInit, AfterViewInit {\r\n @Input() showSelectors: boolean;\r\n @Input() searchTerm: string;\r\n @Output() stateChange = new EventEmitter();\r\n\r\n public _isLoading: boolean;\r\n\r\n public _selectedFileName: string;\r\n public _selectedReferenceId: number;\r\n public _selectedRIFMDocumentId: number;\r\n\r\n public colorUnselected = '#C1CDC1';\r\n public colorSelected = '#C1FFC1';\r\n public specialColorSelected = '#A4D3EE';\r\n\r\n public _searchType: SearchType = SearchType.REFERENCEID;\r\n\r\n public _searchTerm: string;\r\n public _searchErrorMessage: string;\r\n public _searchTypeMessage = 'Enter ReferenceIds separated by a comma.';\r\n\r\n public _rifmDocumentFolders: RIFMDocumentFolder[] = [];\r\n public _rifmDocumentsEx: SelectableEntity[] = [];\r\n public _recentRIFMDocumentsEx: SelectableEntity[] = [];\r\n\r\n public _selectedRIFMDocumentFolderId = -1;\r\n public _selectedDocumentFolder: RIFMDocumentFolder;\r\n\r\n public _isDisabled = false;\r\n\r\n // grouped data\r\n public _foldersAndFiles: { folderId: number, folderName: string, referenceDocumentsEx: SelectableEntity[], collapsed?: boolean }[] = [];\r\n\r\n _isDataLoading: boolean;\r\n\r\n constructor(public _stateMap: StateMap, private _uow: UnitOfWork, public _router: Router) {\r\n }\r\n\r\n ngOnInit() {\r\n if (this.searchTerm != null && this.searchTerm != '') {\r\n this.searchAndLoadReferenceDocument(this.searchTerm);\r\n }\r\n // clear out initialization param after it has been used\r\n this.searchTerm = '';\r\n this._stateMap.documentManagementReferenceId = null;\r\n }\r\n\r\n ngAfterViewInit() {\r\n\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // **************************************************************************************\r\n // load data\r\n // **************************************************************************************\r\n fetchAllFolders() {\r\n\r\n this._rifmDocumentFolders = [];\r\n this._selectedRIFMDocumentFolderId = -1;\r\n this._selectedDocumentFolder = null;\r\n\r\n this._uow.fetch('DocumentManagement/RIFMDocumentFolders', { archiveFolder: false }).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._rifmDocumentFolders = _.sortBy(r, n => n.folderName);\r\n }\r\n this._isLoading = true;\r\n });\r\n }\r\n\r\n fetchFoldersByFolderId(folderIds: number[]) {\r\n\r\n this._foldersAndFiles = [];\r\n\r\n this._uow.fetch('DocumentManagement/FetchRIFMDocumentFoldersDictionaryByFolderIds', { folderIds: folderIds }).then(r => {\r\n\r\n if (r != null && r.length > 0) {\r\n const docandfiles: DocumentFoldersListItem[] = r as DocumentFoldersListItem[];\r\n\r\n docandfiles.forEach((d: DocumentFoldersListItem) => {\r\n const foldername = d.documents[0].folderName; // all items for each dictionary entry should have the same folder assignment\r\n const files: SelectableEntity[] = [];\r\n d.documents.forEach((element: ReferenceDocumentListItem) => {\r\n files.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n this._foldersAndFiles.push({ folderId: d.folderId, folderName: foldername, referenceDocumentsEx: files, collapsed: true });\r\n });\r\n this._foldersAndFiles = _.sortBy(this._foldersAndFiles, n => n.folderName);\r\n }\r\n this._isLoading = true;\r\n });\r\n }\r\n\r\n fetchFoldersByReferenceId(referenceIds: number[]) {\r\n\r\n this._foldersAndFiles = [];\r\n\r\n this._uow.fetch('DocumentManagement/FetchRIFMDocumentFoldersDictionaryByReferenceIds', { referenceIds: referenceIds }).then(r => {\r\n\r\n if (r != null && r.length > 0) {\r\n const docandfiles: DocumentFoldersListItem[] = r as DocumentFoldersListItem[];\r\n\r\n docandfiles.forEach((d: DocumentFoldersListItem) => {\r\n const foldername = d.documents[0].folderName; // all items for each dictionary entry should have the same folder assignment\r\n const files: SelectableEntity[] = [];\r\n d.documents.forEach((element: ReferenceDocumentListItem) => {\r\n files.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n this._foldersAndFiles.push({ folderId: d.folderId, folderName: foldername, referenceDocumentsEx: files, collapsed: true });\r\n });\r\n this._foldersAndFiles = _.sortBy(this._foldersAndFiles, n => n.folderName);\r\n } else {\r\n this._searchErrorMessage = 'No Reference Documents found';\r\n }\r\n this._isLoading = true;\r\n });\r\n }\r\n\r\n fetchAndFormatFiles(ix: number) {\r\n this._foldersAndFiles[ix].referenceDocumentsEx = [];\r\n\r\n const folderIds: number[] = [];\r\n folderIds.push(this._foldersAndFiles[ix].folderId); // fetch function accepts multiple folderIds but here we only have one\r\n\r\n this._uow.fetch('DocumentManagement/FetchRIFMDocumentsByFolderId', { folderIds: folderIds }).then ( f => {\r\n if (f != null && f.length > 0) {\r\n f.forEach((element: ReferenceDocumentListItem) => {\r\n this._foldersAndFiles[ix].referenceDocumentsEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n }\r\n });\r\n }\r\n\r\n fetchRIFMDocuments(referenceIds: number[]): Promise {\r\n this._rifmDocumentsEx = [];\r\n\r\n return this._uow.fetch('DocumentManagement/FetchRIFMDocumentsByReferenceId', { referenceIds: referenceIds }).then ( f => {\r\n if (f != null && f.length > 0) {\r\n f.forEach((element: ReferenceDocumentListItem) => {\r\n this._rifmDocumentsEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n } else {\r\n this._searchErrorMessage = 'No Reference Documents found';\r\n }\r\n });\r\n }\r\n\r\n fetchRecentlyModifiedRIFMDocuments() {\r\n this._recentRIFMDocumentsEx = [];\r\n\r\n this._uow.fetch('DocumentManagement/FetchRecentlyModifiedRIFMDocuments', { takeCount: 25 }).then ( f => {\r\n if (f != null && f.length > 0) {\r\n f.forEach((element: ReferenceDocumentListItem) => {\r\n this._recentRIFMDocumentsEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n } else {\r\n this._searchErrorMessage = 'No Reference Documents found';\r\n }\r\n });\r\n }\r\n\r\n // **************************************************************************************\r\n // reset selection formatting\r\n // **************************************************************************************\r\n resetBackgroundColor(rifmDocuments: SelectableEntity[]) {\r\n rifmDocuments.forEach((element, index) => {\r\n element.backgroundColor = this.colorUnselected;\r\n });\r\n }\r\n\r\n private foldersAndFilesCollapse(ix: number) {\r\n this._foldersAndFiles[ix].collapsed = !this._foldersAndFiles[ix].collapsed;\r\n if (!this._foldersAndFiles[ix].collapsed) {\r\n if (this._foldersAndFiles[ix].referenceDocumentsEx.length == 0) { // check to see if you need to load the file list for this folder\r\n this.fetchAndFormatFiles(ix);\r\n }\r\n }\r\n }\r\n\r\n public expandAll(expand: boolean) {\r\n setTimeout(() => {\r\n this._foldersAndFiles.forEach(g => g.collapsed = !expand);\r\n }, 0);\r\n }\r\n\r\n hasData(): boolean {\r\n return (this._foldersAndFiles != null && this._foldersAndFiles.length > 0);\r\n }\r\n\r\n // **************************************************************************************\r\n // search by folder\r\n // **************************************************************************************\r\n\r\n filterRIFMDocumentFolderByIndex(ix: number) {\r\n this._selectedDocumentFolder = this._rifmDocumentFolders[ix];\r\n this._selectedRIFMDocumentFolderId = this._selectedDocumentFolder.rIFMDocumentFolderId;\r\n\r\n const folderIds: number[] = [];\r\n folderIds.push(this._selectedRIFMDocumentFolderId);\r\n\r\n this.fetchFoldersByFolderId(folderIds);\r\n }\r\n\r\n // **************************************************************************************\r\n // search by referenceid\r\n // **************************************************************************************\r\n search() {\r\n let hasErrors = false;\r\n\r\n this._searchErrorMessage = '';\r\n\r\n if (this.searchType == SearchType.FOLDER) {\r\n const referenceIds = this._searchTerm.split(',').map(function (item) {\r\n const num = Number(item.trim());\r\n if (isNaN(num)) {\r\n hasErrors = true;\r\n } else {\r\n return num;\r\n }\r\n });\r\n if (hasErrors) {\r\n this._searchErrorMessage = 'Hmmm, looks like some of the ReferenceIds are not numbers.';\r\n return;\r\n }\r\n return this.fetchFoldersByReferenceId(referenceIds);\r\n\r\n } else if (this.searchType == SearchType.REFERENCEID) { // search by ReferenceIds\r\n const referenceIds = this._searchTerm.split(',').map(function (item) {\r\n const num = Number(item.trim());\r\n if (isNaN(num)) {\r\n hasErrors = true;\r\n } else {\r\n return num;\r\n }\r\n });\r\n if (hasErrors) {\r\n this._searchErrorMessage = 'Hmmm, looks like some of the ReferenceIds are not numbers.';\r\n return;\r\n }\r\n return this.fetchRIFMDocuments(referenceIds);\r\n }\r\n }\r\n\r\n // filter interactions\r\n canSearch() {\r\n return (this.searchType != SearchType.RECENTLYMODIFIED && this._searchTerm && this._searchTerm.trim().length > 0);\r\n }\r\n\r\n showSearchElements(): boolean {\r\n return (this.searchType != SearchType.RECENTLYMODIFIED);\r\n }\r\n\r\n public filterButtonColor(filtertype: string) {\r\n switch (filtertype) {\r\n case 'reference': {\r\n return (this.searchType == SearchType.REFERENCEID) ? this.colorSelected : this.colorUnselected;\r\n break;\r\n }\r\n case 'folder': {\r\n return (this.searchType == SearchType.FOLDER) ? this.colorSelected : this.colorUnselected;\r\n break;\r\n }\r\n case 'recentlymodified': {\r\n return (this.searchType == SearchType.RECENTLYMODIFIED) ? this.colorSelected : this.specialColorSelected;\r\n break;\r\n }\r\n default: {\r\n return this.colorUnselected;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // toggle button\r\n onSelectFilterType(type: string) {\r\n\r\n this._searchErrorMessage = '';\r\n\r\n if (type == 'reference') {\r\n this.searchType = SearchType.REFERENCEID;\r\n } else if (type == 'folder') {\r\n this.searchType = SearchType.FOLDER;\r\n\r\n if (this._rifmDocumentFolders == null || this._rifmDocumentFolders.length == 0) {\r\n this.fetchAllFolders();\r\n }\r\n } else {\r\n this.searchType = SearchType.RECENTLYMODIFIED;\r\n // no filters are required so run the search immediately\r\n this.fetchRecentlyModifiedRIFMDocuments();\r\n }\r\n }\r\n\r\n public refreshWithRecentlyModified() {\r\n this.onSelectFilterType('recentlymodified');\r\n }\r\n\r\n public onView(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n this._selectedReferenceId = dx.data.referenceId;\r\n this._selectedRIFMDocumentId = dx.data.rIFMDocumentId;\r\n this._selectedFileName = dx.data.fileName;\r\n this.stateChange.emit('view');\r\n }\r\n\r\n // link click events\r\n public onDeleteFile(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n this._selectedReferenceId = dx.data.referenceId;\r\n this._selectedRIFMDocumentId = dx.data.rIFMDocumentId;\r\n this._selectedFileName = dx.data.fileName;\r\n this.stateChange.emit('deletefile');\r\n }\r\n\r\n public onEdit(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n this._selectedReferenceId = dx.data.referenceId;\r\n this._selectedRIFMDocumentId = dx.data.rIFMDocumentId;\r\n this._selectedFileName = dx.data.fileName;\r\n this.stateChange.emit('edit');\r\n }\r\n\r\n public onEditPDFPages(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n this._selectedReferenceId = dx.data.referenceId;\r\n this._selectedRIFMDocumentId = dx.data.rIFMDocumentId;\r\n this._selectedFileName = dx.data.fileName;\r\n this.stateChange.emit('editPDFPages');\r\n }\r\n\r\n public onExport(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n this._selectedReferenceId = dx.data.referenceId;\r\n this._selectedRIFMDocumentId = dx.data.rIFMDocumentId;\r\n this._selectedFileName = dx.data.fileName;\r\n this.stateChange.emit('export');\r\n }\r\n\r\n public onRemove(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n this._selectedReferenceId = dx.data.referenceId;\r\n this._selectedRIFMDocumentId = dx.data.rIFMDocumentId;\r\n this._selectedFileName = dx.data.fileName;\r\n this.stateChange.emit('remove');\r\n }\r\n\r\n public onReplace(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n this._selectedReferenceId = dx.data.referenceId;\r\n this._selectedRIFMDocumentId = dx.data.rIFMDocumentId;\r\n this._selectedFileName = dx.data.fileName;\r\n this.stateChange.emit('replace');\r\n }\r\n\r\n onNavToRef(dx: SelectableEntity) {\r\n if (!dx) {return; }\r\n\r\n if (dx.data.referenceId == null) {\r\n return;\r\n }\r\n\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, dx.data.referenceId));\r\n }\r\n\r\n // *****************************************************************************\r\n // bindable properties\r\n // *****************************************************************************\r\n public get filterSearchType(): typeof SearchType {\r\n return SearchType;\r\n }\r\n\r\n public get isDisabled() {\r\n return this._isDisabled;\r\n }\r\n\r\n public set isDisabled(value) {\r\n this._isDisabled = value;\r\n }\r\n\r\n public get searchType(): SearchType {\r\n return this._searchType;\r\n }\r\n\r\n public set searchType(value) {\r\n this._searchType = value;\r\n }\r\n\r\n public get selectedFileName(): string {\r\n return this._selectedFileName;\r\n }\r\n\r\n public set selectedFileName(val: string) {\r\n this._selectedFileName = val;\r\n }\r\n\r\n public get selectedReferenceId(): number {\r\n return this._selectedReferenceId;\r\n }\r\n\r\n public set selectedReferenceId(val: number) {\r\n this._selectedReferenceId = val;\r\n }\r\n\r\n public get searchTypeMessage() {\r\n return this._searchTypeMessage;\r\n }\r\n\r\n public set searchTypeMessage(value) {\r\n this._searchTypeMessage = value;\r\n }\r\n\r\n public get selectedRIFMDocumentId(): number {\r\n return this._selectedRIFMDocumentId;\r\n }\r\n\r\n public set selectedRIFMDocumentId(val: number) {\r\n this._selectedRIFMDocumentId = val;\r\n }\r\n\r\n // **************************************************************************************\r\n // pre-load reference\r\n // **************************************************************************************\r\n searchAndLoadReferenceDocument(searchTerm: string) {\r\n if (this.canConvertToNumber(searchTerm)) {\r\n this.onSelectFilterType('reference');\r\n this._searchTerm = searchTerm;\r\n\r\n const referenceId = parseInt(searchTerm, 10);\r\n\r\n const params: number[] = new Array();\r\n params.push(referenceId);\r\n\r\n this.fetchRIFMDocuments(params).then(r => {\r\n const refDocEx = this.filterToReferenceDocumentByReferenceId(referenceId);\r\n\r\n if (refDocEx != null && this.isValidString(refDocEx.data.fileName)) {\r\n this.onView(refDocEx);\r\n }\r\n });\r\n }\r\n }\r\n\r\n canConvertToNumber(teststring: string) {\r\n if (!this.isValidString(teststring)) {\r\n return false;\r\n }\r\n\r\n const testnum = parseInt(teststring, 10);\r\n return !isNaN(testnum) && testnum > -1;\r\n }\r\n\r\n filterToReferenceDocumentByReferenceId(referenceId: number): SelectableEntity {\r\n if (this._rifmDocumentsEx == null || this._rifmDocumentsEx.length < 1) {\r\n return null;\r\n }\r\n\r\n const docs = this._rifmDocumentsEx.filter(r => r.data.referenceId == referenceId);\r\n if (docs != null && docs.length > 0) {\r\n return docs[0];\r\n }\r\n }\r\n\r\n isValidString(teststring: string): boolean {\r\n if (!teststring) {\r\n return false;\r\n }\r\n return (teststring.trim().length > 0);\r\n }\r\n}\r\n","
\r\n \r\n\r\n
\r\n {{_validationMessage}}\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n {{_pdfProcessingMessage}}\r\n
\r\n\r\n\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n \r\n
\r\n \r\n Editing a Reference PDF Document File\r\n \r\n \r\n {{_pdfEditorMessage}}\r\n \r\n \r\n
\r\n\r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import {Location} from '@angular/common';\r\nimport {Component, OnInit, OnDestroy, ViewChild, AfterViewInit } from '@angular/core';\r\nimport {ActivatedRoute, Router} from '@angular/router';\r\nimport { environment } from '../../../environments/environment';\r\n\r\nimport {IRouteDefinition, ErrorLogger, StateMap, UnitOfWork, UserManager} from '../../services/common';\r\nimport {IEditHost, UtilFns} from '../../utils/common';\r\nimport {HttpClient, HttpHeaders, HTTP_INTERCEPTORS} from '@angular/common/http';\r\n\r\nimport {Reference, RIFMDocument} from '../../entities/EntityModels';\r\nimport {DocumentSelectorComponent} from '../docmanagement/document-selector.component';\r\nimport {PDFEditorComponent} from '../docmanagement/pdf-editor.component';\r\nimport { ConfirmFinishOverrideComponent } from '../staff/confirm-finish-override.component';\r\nimport {Observable} from 'rxjs';\r\nimport {DOCUMENTMANAGEMENT_ROUTES} from '../docmanagement/document-management.routes';\r\n\r\nexport class ReferenceDocumentEditData {\r\n inPDFSubEditor: boolean;\r\n adding: boolean;\r\n editingPDF: boolean;\r\n editingPDFPages: boolean;\r\n showPDFToolbar: boolean;\r\n replacing: boolean;\r\n entity: RIFMDocument;\r\n rIFMDocumentId: number;\r\n referenceId: number;\r\n}\r\n\r\n@Component({\r\n selector: 'rifm-documents',\r\n templateUrl: '../docmanagement/rifm-documents.html',\r\n})\r\n\r\nexport class RIFMDocumentsComponent implements OnInit, AfterViewInit, OnDestroy {\r\n @ViewChild(DocumentSelectorComponent) _documentSelector: DocumentSelectorComponent;\r\n @ViewChild(PDFEditorComponent, { static: true }) _pdfEditorComponent: PDFEditorComponent;\r\n @ViewChild(ConfirmFinishOverrideComponent, { static: true }) _confirmFinishOverrideComponent: ConfirmFinishOverrideComponent;\r\n\r\n public _data: ReferenceDocumentEditData = new ReferenceDocumentEditData();\r\n\r\n public _isLoading = false;\r\n public _isSavingPDFFile = false;\r\n public _documentFileName: string;\r\n public _pdfProcessingMessage = '';\r\n public _selectedRIFMDocument: RIFMDocument;\r\n\r\n _rifmDocumentSelectorNextAction = 'Hide Filters';\r\n _showRIFMDocumentSelector = true;\r\n\r\n public _editorWidth = '1200px';\r\n public _selectorWidth = '1200px';\r\n public _selectorDisplay = 'inline';\r\n\r\n public _validationMessage: string;\r\n\r\n public _pdfEditorLastRequest = '';\r\n public _pdfEditorMessage = '';\r\n\r\n public _showSelectionMessage = false;\r\n\r\n public _workflowReference: Reference;\r\n\r\n public _paramSearchTerm = '';\r\n\r\n // tslint:disable-next-line:max-line-length\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n private _httpClient: HttpClient, private _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._stateMap.currentRouteName = DOCUMENTMANAGEMENT_ROUTES.RIFMDocuments.name;\r\n\r\n this._data.inPDFSubEditor = false;\r\n\r\n this._stateMap.documentManagementArchiveUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDocumentArchive';\r\n this._stateMap.documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDocument';\r\n\r\n // _paramSearchTerm is an input parameter to the document-selector-component to pre-populate the selection and display of the reference document\r\n this._paramSearchTerm = (this._stateMap.documentManagementReferenceId != null) ? this._stateMap.documentManagementReferenceId + '' : '';\r\n }\r\n\r\n ngAfterViewInit() {\r\n }\r\n\r\n ngOnDestroy() {\r\n if (this._pdfEditorComponent != null) {\r\n this._pdfEditorComponent.destroyData();\r\n }\r\n\r\n // remove application cache\r\n this.clearPDFViewerCache();\r\n }\r\n\r\n public clearPDFViewerCache() {\r\n // remove application cache\r\n for (const key in sessionStorage) {\r\n if (key.indexOf('Sync_PdfViewer') !== -1) {\r\n sessionStorage.removeItem(key);\r\n }\r\n }\r\n }\r\n\r\n // ************************************************************************\r\n // load data\r\n // ************************************************************************\r\n fetchRIFMDocumentThenEditPDF(rifmDocumentId: number) {\r\n this._selectedRIFMDocument = this._data.entity = null;\r\n\r\n this._uow.fetch('DocumentManagement/RIFMDocumentById', {rifmDocumentId: rifmDocumentId}).then(rd => {\r\n this._selectedRIFMDocument = (rd && rd.length) ? rd[0] : null;\r\n if (this._selectedRIFMDocument) {\r\n\r\n this._data.rIFMDocumentId = this._selectedRIFMDocument.rIFMDocumentId;\r\n this._data.entity = this._selectedRIFMDocument;\r\n\r\n const data = this._data;\r\n data.adding = false;\r\n data.editingPDF = true;\r\n data.replacing = false;\r\n data.inPDFSubEditor = true;\r\n\r\n this.showRIFMDocumentSelector = false;\r\n\r\n if (this._selectedRIFMDocument.fileName) {\r\n this._pdfEditorComponent.loadPDF(this._selectedRIFMDocument.fileName);\r\n this.documentFileName = this._selectedRIFMDocument.fileName;\r\n this._pdfEditorComponent.setEditMode();\r\n }\r\n }\r\n });\r\n }\r\n\r\n fetchRIFMDocumentThenEditForEditPDFPages(rifmDocumentId: number) {\r\n this._selectedRIFMDocument = this._data.entity = null;\r\n\r\n this._uow.fetch('DocumentManagement/RIFMDocumentById', {rifmDocumentId: rifmDocumentId}).then(rd => {\r\n this._selectedRIFMDocument = (rd && rd.length) ? rd[0] : null;\r\n if (this._selectedRIFMDocument) {\r\n\r\n this._data.rIFMDocumentId = this._selectedRIFMDocument.rIFMDocumentId;\r\n this._data.entity = this._selectedRIFMDocument;\r\n\r\n const data = this._data;\r\n data.adding = false;\r\n data.editingPDF = false;\r\n data.editingPDFPages = true;\r\n data.replacing = false;\r\n data.inPDFSubEditor = true;\r\n\r\n this.showRIFMDocumentSelector = false;\r\n }\r\n });\r\n }\r\n\r\n // ************************************************************************\r\n // event handlers\r\n // ************************************************************************\r\n documentSelectorEventHandler(event: string) {\r\n // if the component is in edit mode, don't respond to selection events and notifiy the user\r\n\r\n if (this._data.inPDFSubEditor) {\r\n this.showSelectionMessage = true;\r\n }\r\n\r\n switch (event) {\r\n case 'edit': {\r\n this._validationMessage = '';\r\n\r\n // The _paramSearchTerm is an input parameter to the document-selector component.\r\n // When the user exits the Edit mode, the selector will reload the document referenced in the _paramSearchTerm\r\n this._paramSearchTerm = this._documentSelector.selectedReferenceId + '';\r\n\r\n this.fetchRIFMDocumentThenEditPDF(this._documentSelector.selectedRIFMDocumentId);\r\n break;\r\n }\r\n case 'editPDFPages': {\r\n this._validationMessage = '';\r\n this.fetchRIFMDocumentThenEditForEditPDFPages(this._documentSelector.selectedRIFMDocumentId);\r\n break;\r\n }\r\n case 'export': {\r\n this._validationMessage = '';\r\n this.exportPDFFile(this._documentSelector.selectedRIFMDocumentId, this._documentSelector.selectedReferenceId);\r\n break;\r\n }\r\n case 'view': {\r\n this._pdfEditorLastRequest = 'Loading PDF file';\r\n\r\n this._validationMessage = '';\r\n this.loadPDFFileData(this._documentSelector.selectedFileName);\r\n this.documentFileName = this._documentSelector.selectedFileName;\r\n break;\r\n }\r\n case 'replace': {\r\n this._validationMessage = '';\r\n\r\n this.onReplaceRIFMDocumentFile();\r\n\r\n break;\r\n }\r\n case 'remove': {\r\n this._validationMessage = '';\r\n\r\n // don't display a file that is going to be removed\r\n if (this._pdfEditorComponent.downloadFileName == this._documentSelector.selectedFileName) {\r\n this._pdfEditorComponent.unloadPDF();\r\n }\r\n\r\n this.removeReferenceDocument(this._documentSelector.selectedRIFMDocumentId, this._documentSelector.selectedReferenceId);\r\n break;\r\n }\r\n case 'deletefile': {\r\n this._validationMessage = '';\r\n this.deleteFile(this._documentSelector.selectedRIFMDocumentId, this._documentSelector.selectedReferenceId);\r\n break;\r\n }\r\n default: {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n pdfEditorEventHandler(event: string) {\r\n switch (event) {\r\n case 'documentchanged': {\r\n break;\r\n }\r\n case 'documentloaded': {\r\n break;\r\n }\r\n case 'downloadend': {\r\n this._pdfEditorMessage = this._pdfEditorLastRequest + ' Result: ' + 'Success.';\r\n this._isSavingPDFFile = false;\r\n break;\r\n }\r\n case 'loadfailederror': {\r\n this._pdfEditorMessage = this._pdfEditorLastRequest + ' Result: ' + 'Unsuccessful, please contact support.';\r\n break;\r\n }\r\n case 'success': {\r\n // this._pdfEditorMessage = this._pdfEditorLastRequest + ' Result: ' + 'Success.';\r\n break;\r\n }\r\n case 'error': {\r\n this._pdfEditorMessage = this._pdfEditorLastRequest + ' Result: ' + 'Unsuccessful, please contact support.';\r\n this._isSavingPDFFile = false;\r\n break;\r\n }\r\n default: {\r\n this._pdfEditorMessage = '';\r\n break;\r\n }\r\n }\r\n\r\n this._isLoading = false;\r\n this._pdfProcessingMessage = '';\r\n }\r\n\r\n // ************************************************************************\r\n // document management methods not managed by the pdf editor\r\n // ************************************************************************\r\n public removeReferenceDocument(rifmDocumentId: number, referenceId: number): boolean {\r\n\r\n const messages: string[] = [];\r\n this._confirmFinishOverrideComponent.showModal('Confirm Removal of a Reference Document',\r\n 'This action will archive the assigned file and remove the meta data record. Do you want to proceed?', messages).then(ok => {\r\n if (ok) {\r\n return this.removeRIFMDocumentApiCall(rifmDocumentId, referenceId);\r\n }\r\n });\r\n\r\n return false;\r\n }\r\n\r\n public deleteFile(rifmDocumentId: number, referenceId: number): boolean {\r\n\r\n this.deleteAndArchiveRIFMDocumentFile(rifmDocumentId, referenceId);\r\n return true;\r\n\r\n // const messages: string[] = [];\r\n // this._confirmFinishOverrideComponent.showModal('Confirm Deletion of the File',\r\n // 'This action will archive the assigned file and remove the file name from the meta data record. Do you want to proceed?', messages).then(ok => {\r\n // if (ok) {\r\n // return this.deleteAndArchiveRIFMDocumentFile(rifmDocumentId, referenceId);\r\n // }\r\n // });\r\n //\r\n // return false;\r\n }\r\n\r\n // ************************************************************************\r\n canDeactivate() {\r\n return true;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get documentFileName() {\r\n return this._documentFileName;\r\n }\r\n\r\n set documentFileName(value) {\r\n this._documentFileName = value;\r\n }\r\n\r\n get pdfEditorDisplayElement(): string {\r\n return (!this._data.adding && !this._data.replacing && !this._data.editingPDFPages) ? 'inline' : 'none';\r\n }\r\n\r\n // this property was added to hide, not destroy, the pdf viewer due to lags in load time\r\n get pdfEditorDisplayElementHeight(): string {\r\n return (!this._data.adding && !this._data.replacing && !this._data.editingPDFPages) ? 'auto' : '10px';\r\n }\r\n\r\n get pdfHasChanges(): boolean {\r\n return (this._pdfEditorComponent != null) ? this._pdfEditorComponent.hasChanges : false;\r\n }\r\n\r\n // label to show or hide the document selector component\r\n get rifmDocumentSelectorNextAction() {\r\n return this._rifmDocumentSelectorNextAction;\r\n }\r\n\r\n set rifmDocumentSelectorNextAction(value) {\r\n this._rifmDocumentSelectorNextAction = value;\r\n }\r\n\r\n get showRIFMDocumentSelector() {\r\n return this._showRIFMDocumentSelector;\r\n }\r\n\r\n set showRIFMDocumentSelector(value) {\r\n this._showRIFMDocumentSelector = value;\r\n }\r\n\r\n get showSelectionMessage() {\r\n return this._showSelectionMessage;\r\n }\r\n\r\n set showSelectionMessage(value) {\r\n this._showSelectionMessage = value;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // ************************************************************************\r\n // interactions\r\n // ************************************************************************\r\n onSetSelectorVisibility() {\r\n if (this.rifmDocumentSelectorNextAction == 'Hide Filters') {\r\n this.rifmDocumentSelectorNextAction = 'Show Filters';\r\n this._selectorDisplay = 'none';\r\n } else {\r\n this.rifmDocumentSelectorNextAction = 'Hide Filters';\r\n this._selectorDisplay = 'inline';\r\n }\r\n }\r\n\r\n // ************************************************************************\r\n // PDF Editing\r\n // ************************************************************************\r\n canCancel() {\r\n return (this._pdfEditorComponent != null && this._pdfEditorComponent.hasChanges);\r\n }\r\n\r\n canSave() {\r\n return (this._pdfEditorComponent != null && this._pdfEditorComponent.hasChanges);\r\n }\r\n\r\n canShowBack() {\r\n return (!this._isSavingPDFFile && this._pdfEditorComponent != null && !this._pdfEditorComponent.hasChanges);\r\n }\r\n\r\n onAdd() {\r\n this._data.adding = true;\r\n this.showRIFMDocumentSelector = false;\r\n }\r\n\r\n addCompleted(referenceId: number) {\r\n this._data.adding = false;\r\n this.showRIFMDocumentSelector = true;\r\n\r\n if (referenceId != -1) {\r\n this._paramSearchTerm = referenceId + '';\r\n }\r\n }\r\n\r\n editPagesCompleted(msg: string) {\r\n this._data.editingPDFPages = false;\r\n this._data.inPDFSubEditor = false;\r\n\r\n this.showRIFMDocumentSelector = true;\r\n this._validationMessage = msg;\r\n\r\n // clear the cache so the updated pdf file will be displayed instead of the cached one\r\n setTimeout(() => {\r\n this.clearPDFViewerCache();\r\n }, 500);\r\n\r\n if (msg == 'viewPDF') {\r\n this._paramSearchTerm = this._data.entity.referenceId + '';\r\n } else {\r\n this._paramSearchTerm = '';\r\n }\r\n }\r\n\r\n replaceCompleted(msg: string) {\r\n this._data.replacing = false;\r\n this.showRIFMDocumentSelector = true;\r\n\r\n this._validationMessage = msg;\r\n }\r\n\r\n onBack() {\r\n this.resetDisplay();\r\n }\r\n\r\n resetDisplay() {\r\n this._pdfEditorMessage = '';\r\n this._validationMessage = '';\r\n\r\n this._data.adding = false;\r\n this._data.editingPDF = false;\r\n this._data.replacing = false;\r\n this._data.inPDFSubEditor = false;\r\n\r\n this._pdfEditorComponent.setViewMode();\r\n\r\n this.showSelectionMessage = false;\r\n this.showRIFMDocumentSelector = true;\r\n }\r\n\r\n onCancel() {\r\n this.resetDisplay();\r\n }\r\n\r\n onSave() {\r\n this._isSavingPDFFile = true;\r\n this._pdfEditorComponent.savePDF();\r\n this._pdfEditorLastRequest = 'Save PDF File Changes';\r\n }\r\n\r\n onReplaceRIFMDocumentFile() {\r\n this._data.replacing = true; // displays the replace component\r\n\r\n this._data.rIFMDocumentId = this._documentSelector.selectedRIFMDocumentId;\r\n this._data.referenceId = this._documentSelector.selectedReferenceId;\r\n\r\n this.showRIFMDocumentSelector = false;\r\n }\r\n\r\n // ************************************************************************\r\n // PDF Component Interaction\r\n // ************************************************************************\r\n public loadPDFFileData(fileName: string) {\r\n this._isLoading = true;\r\n this._pdfProcessingMessage = 'Loading the PDF File...';\r\n this._validationMessage = '';\r\n\r\n this._pdfEditorComponent.canShowPDF = true;\r\n this._pdfEditorComponent.loadPDF(fileName);\r\n this._pdfEditorComponent.setViewMode();\r\n }\r\n\r\n // ************************************************************************\r\n // Web Api Urls\r\n // ************************************************************************\r\n getArchiveFileURL(rifmDocumentId: number, referenceId: number): Observable {\r\n const url = this._stateMap.documentManagementArchiveUrl + '/ArchiveFile?rifmDocumentId=' + rifmDocumentId + '&referenceId=' + referenceId;\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n return this._httpClient.post(url, { });\r\n }\r\n\r\n getExportFileURL(rifmDocumentId: number): Observable {\r\n const url = this._stateMap.documentManagementUrl + '/GetReferenceDocumentPDF?rifmDocumentId=' + rifmDocumentId;\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n getRemoveDocumentURL(rifmDocumentId: number, referenceId: number): Observable {\r\n const url = this._stateMap.documentManagementArchiveUrl + '/Remove?rifmDocumentId=' + rifmDocumentId + '&referenceId=' + referenceId;\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n return this._httpClient.post(url, { });\r\n }\r\n\r\n // ************************************************************************\r\n // http requests to rifm document file service\r\n // ************************************************************************\r\n public deleteAndArchiveRIFMDocumentFile(rifmDocumentId: number, referenceId: number) {\r\n this._isLoading = true;\r\n this._pdfProcessingMessage = 'Archiving and Deleting the PDF file...';\r\n this._validationMessage = '';\r\n this.getArchiveFileURL(rifmDocumentId, referenceId)\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n this._validationMessage = 'Error occurred, unable to remove the file: ' + data.ExceptionMessage;\r\n return;\r\n }\r\n\r\n // refresh the list of archived files in the selector since one record has been removed when the file was restored.\r\n this._documentSelector.refreshWithRecentlyModified();\r\n\r\n this._pdfProcessingMessage = '';\r\n this._validationMessage = 'Document file deleted and archived successfully.';\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n this._pdfProcessingMessage = '';\r\n },\r\n () => {\r\n console.error('Request completed');\r\n this._isLoading = false;\r\n this._pdfProcessingMessage = '';\r\n });\r\n }\r\n\r\n public exportPDFFile(rifmDocumentId: number, referenceId: number) {\r\n this._isLoading = true;\r\n this._pdfProcessingMessage = 'Downloading the PDF file...';\r\n this._validationMessage = '';\r\n this.getExportFileURL(rifmDocumentId)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = referenceId + '.pdf';\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._pdfProcessingMessage = '';\r\n this._validationMessage = 'File download successful.';\r\n },\r\n (error: any) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n this._pdfProcessingMessage = '';\r\n },\r\n () => {\r\n this._isLoading = false;\r\n this._pdfProcessingMessage = '';\r\n });\r\n }\r\n\r\n public removeRIFMDocumentApiCall(rifmDocumentId: number, referenceId: number) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getRemoveDocumentURL(rifmDocumentId, referenceId)\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n this._validationMessage = 'Error occurred, unable to remove the file: ' + data.ExceptionMessage;\r\n return;\r\n }\r\n\r\n // refresh the list of archived files in the selector since one record has been removed when the file was restored.\r\n this._documentSelector.refreshWithRecentlyModified();\r\n\r\n this._validationMessage = 'Reference document meta data and file archived and removed successfully.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url\r\n // ************************************************************************\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n public isValidString(testString: string): boolean {\r\n return (testString && testString.length > 0);\r\n }\r\n}\r\n\r\n","
\r\n

Document Management Reports

\r\n
\r\n\r\n
\r\n
\r\n Select Report: \r\n
\r\n
\r\n \r\n
\r\n
\r\n

{{selectedReportDescription}}

\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
Ref Id
\r\n
Brief Reference
\r\n
Title
\r\n
Reference Created Date
\r\n
Reference Created User
\r\n
Captive Paper
\r\n
File Name
\r\n
Most Recent Workflow Activity
\r\n
Most Recent Workflow Date
\r\n
Date Reference Document Created
\r\n
\r\n
\r\n
\r\n
{{rd.referenceId}}
\r\n
{{rd.briefReference}}
\r\n
{{rd.title}}
\r\n
{{rd.created}}
\r\n
{{rd.createdUser}}
\r\n
{{rd.captive}}
\r\n
{{rd.fileName}}
\r\n
{{rd.lastWorkflowActivityId}}
\r\n
{{rd.formattedWorkflowActivityDate}}
\r\n
{{rd.formattedReferenceDocumentCreateDate}}
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n","import {QuickDocumentUploadComponent} from './quick-document-upload.component';\r\nimport {RIFMArchivedDocumentsComponent } from './rifm-archived-documents.component';\r\nimport {RIFMDocumentsComponent} from './rifm-documents.component';\r\nimport {DocumentManagementReportsComponent} from './document-management-reports.component';\r\n\r\nexport const DOCUMENTMANAGEMENT_ROUTES = {\r\n RIFMDocuments: { name: 'RIFMDocuments', title: 'Reference Documents', path: 'rifm-documents', component: RIFMDocumentsComponent, rolesExcluded: 'consultant,FEMA' },\r\n QuickDocumentUpload: { name: 'QuickDocumentUpload', title: 'Quick Upload', path: 'quick-document-upload', component: QuickDocumentUploadComponent, rolesExcluded: 'consultant,FEMA' },\r\n RIFMArchivedDocuments: { name: 'RIFMArchivedDocuments', title: 'Archived Documents', path: 'rifm-archived-documents', component: RIFMArchivedDocumentsComponent, rolesExcluded: 'consultant,FEMA' },\r\n // tslint:disable-next-line:max-line-length\r\n DocumentManagementReports: { name: 'DocumentManagementReports', title: 'Reports', path: 'document-management-reports', component: DocumentManagementReportsComponent, rolesExcluded: 'consultant,FEMA' },\r\n};\r\n","import { Location } from '@angular/common';\r\nimport { Component, ViewChild, OnInit, } from '@angular/core';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport { UnitOfWork, StateMap, UserManager, ErrorLogger } from '../../services/common';\r\nimport { UtilFns, IEditHost, EditManager } from '../../utils/common';\r\nimport {HttpClient, HttpHeaders, HTTP_INTERCEPTORS} from '@angular/common/http';\r\nimport {Observable} from 'rxjs';\r\nimport { environment } from '../../../environments/environment';\r\nimport * as _ from 'lodash';\r\n\r\nimport { MissingReferenceDocument, RIFMDocument, RIFMDocumentFolder, RIFMDocumentArchive, TypeRIFMDocument } from '../../entities/EntityModels';\r\nimport { DOCUMENTMANAGEMENT_ROUTES } from './document-management.routes';\r\n\r\nexport class ReferenceDocumentReport {\r\n id: number;\r\n name: string;\r\n description: string;\r\n}\r\n\r\n@Component({\r\n selector: 'document-management-reports',\r\n templateUrl: '../docmanagement/document-management-reports.html',\r\n})\r\n\r\nexport class DocumentManagementReportsComponent implements OnInit {\r\n public _missingReferenceDocuments: MissingReferenceDocument[] = [];\r\n public _referenceDocumentReports: ReferenceDocumentReport[] = [];\r\n public _selectedReportIndex = 0;\r\n public _isLoading = false;\r\n\r\n public _documentManagementReportUrl: string;\r\n\r\n public _validationMessage: string;\r\n\r\n\r\n constructor(private _httpClient: HttpClient, private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._stateMap.currentRouteName = DOCUMENTMANAGEMENT_ROUTES.DocumentManagementReports.name;\r\n\r\n this._referenceDocumentReports.push({id: 0, name: 'None', description: ''});\r\n this._referenceDocumentReports.push({id: 1, name: 'Missing Reference Documents', description: 'References that do not have a file assigned yet.'});\r\n\r\n this._documentManagementReportUrl = this._stateMap.documentManagementBaseUrl + '/Report';\r\n }\r\n\r\n // **************************************************************************************\r\n // load data\r\n // **************************************************************************************\r\n fetchMissingDocuments() {\r\n\r\n this._isLoading = true;\r\n\r\n this._missingReferenceDocuments = [];\r\n\r\n this._uow.fetch('DocumentManagement/MissingReferenceDocuments', { }).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._missingReferenceDocuments = r;\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n clearData() {\r\n this._missingReferenceDocuments = [];\r\n }\r\n\r\n // ************************************************************************\r\n //\r\n // ************************************************************************\r\n canDeactivate() {\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // ************************************************************************\r\n // interactions\r\n // ************************************************************************\r\n onSelectReport(idx: string) {\r\n switch (idx) {\r\n case '0': {\r\n this.clearData();\r\n break;\r\n }\r\n case '1': {\r\n this.fetchMissingDocuments();\r\n break;\r\n }\r\n default: {\r\n this.clearData();\r\n this._selectedReportIndex = 0;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n get selectedReportDescription(): string {\r\n return this._referenceDocumentReports[this._selectedReportIndex].description;\r\n }\r\n\r\n rowColor(idx: number) {\r\n return ((idx % 2) > 0) ? '#F0F8FF' : '#FFFFFF';\r\n }\r\n\r\n // ************************************************************************\r\n // web api calls\r\n // ************************************************************************\r\n getMissingDocumentReportURL(): Observable {\r\n const url = this._documentManagementReportUrl + '/GetMissingDocumentReportFile';\r\n const headers = new HttpHeaders().set('Content-Type', 'text/plain; charset=utf-8');\r\n return this._httpClient.get(url, { headers, responseType: 'text' as 'json'});\r\n }\r\n\r\n public exportMissingDocumentCSVFile() {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getMissingDocumentReportURL()\r\n .subscribe(\r\n (response: any) => {\r\n const data = response;\r\n\r\n const a = document.createElement('a');\r\n a.href = 'data:attachment/csv;charset=utf-8,' + encodeURI(data);\r\n a.target = '_blank';\r\n a.download = 'MissingDocumentReport.csv';\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = 'File download successful.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n // ************************************************************************\r\n // document management data\r\n // ************************************************************************\r\n public getDocumentManagementReportUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n}\r\n","
\r\n
{{getPageTitle()}}
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n","import { HOME_ROUTES } from './home/home.routes';\r\nimport { HomeComponent } from './home/home.component';\r\n\r\nimport { MATERIAL_ROUTES } from './material/material.routes';\r\nimport { MaterialComponent } from './material/material.component';\r\n\r\nimport { REFERENCE_ROUTES } from './reference/reference.routes';\r\nimport { ReferenceComponent } from './reference/reference.component';\r\n\r\nimport { STAFF_ROUTES } from './staff/staff.routes';\r\nimport { StaffEditingComponent } from './staff/staff-editing.component';\r\n\r\nimport { EXPOSURE_ROUTES } from './exposure/exposure.routes';\r\nimport { ExposureComponent } from './exposure/exposure.component';\r\n\r\nimport { DOCUMENTMANAGEMENT_ROUTES } from './docmanagement/document-management.routes';\r\nimport { DocumentManagementComponent } from './docmanagement/document-management.component';\r\n\r\nexport const ROUTES = {\r\n Home: { name: 'Home', path: 'home', component: HomeComponent, childRoutes: HOME_ROUTES },\r\n Material: { name: 'Material', path: 'material/:id', component: MaterialComponent, childRoutes: MATERIAL_ROUTES },\r\n Reference: { name: 'Reference', path: 'reference/:id', component: ReferenceComponent, childRoutes: REFERENCE_ROUTES },\r\n Staff: { name: 'Staff', path: 'staff', component: StaffEditingComponent, childRoutes: STAFF_ROUTES },\r\n Exposure: { name: 'Exposure', path: 'exposure', component: ExposureComponent, childRoutes: EXPOSURE_ROUTES },\r\n DocumentManagement: {name: 'Document Management', path: 'docmanagement', component: DocumentManagementComponent, childRoutes: DOCUMENTMANAGEMENT_ROUTES }\r\n};\r\n","import {Component, OnInit} from '@angular/core';\r\nimport * as _ from 'lodash';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport {StateMap, IRouteDefinition, UnitOfWork} from '../../services/common';\r\nimport { DOCUMENTMANAGEMENT_ROUTES } from './document-management.routes';\r\nimport {UtilFns} from '../../utils/util-fns';\r\n\r\n@Component({\r\n selector: 'document-management',\r\n templateUrl: './document-management.html',\r\n})\r\nexport class DocumentManagementComponent implements OnInit {\r\n\r\n _routes = _.values(DOCUMENTMANAGEMENT_ROUTES);\r\n\r\n public _referenceId = 0;\r\n\r\n constructor(public _stateMap: StateMap, public _route: ActivatedRoute, private _uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.documentManagementArchiveUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDocumentArchive';\r\n this._stateMap.documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDocument';\r\n\r\n this._route.paramMap\r\n .subscribe(params => {\r\n this._referenceId = +params.get('id');\r\n }\r\n );\r\n }\r\n\r\n canShow(routeDef: IRouteDefinition) {\r\n\r\n if (this._stateMap.currentUser.isStaff) {\r\n // Exception to prevent consultant staff from seeing otherwise staff viewable content.\r\n if (routeDef.rolesExcluded) {\r\n const roles = routeDef.rolesExcluded.split(',').map(function (item) {\r\n return item.trim();\r\n });\r\n\r\n if (roles != null && roles.length > 0) {\r\n return (!this.userRoleFound(roles));\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n if (routeDef.staffOnly) { return false; }\r\n return true;\r\n }\r\n\r\n currentRoute() {\r\n return _.find(this._routes, r => r.name == this.routeName);\r\n }\r\n\r\n getPageTitle() {\r\n return (this.currentRoute() ? this.currentRoute().title : '') + ': ';\r\n }\r\n\r\n get routeName() {\r\n return this._stateMap.currentRouteName;\r\n }\r\n\r\n isActiveTab(r: IRouteDefinition) {\r\n const currentRouteName = this.routeName || this._routes[0].name;\r\n return r.name == currentRouteName;\r\n }\r\n\r\n userRoleFound(roles: string[]): boolean {\r\n for (let idx = 0; idx < roles.length; idx++) {\r\n if (this._stateMap.currentUser.isInRole(roles[idx])) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n // ************************************************************************\r\n // document management web api url\r\n // ************************************************************************\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n public isValidString(testString: string): boolean {\r\n return (testString && testString.length > 0);\r\n }\r\n}\r\n","import { RouterModule, Routes } from '@angular/router';\r\n\r\nimport { AuthGuard, AuthGuardAllowAuthorized, CanDeactivateGuard, IRouteDefinition } from './services/common';\r\nimport { MaterialResolver } from './components/material/material.resolver';\r\nimport { ReferenceResolver } from './components/reference/reference.resolver';\r\nimport { ROUTES } from './components/routes';\r\nimport * as _ from 'lodash';\r\n\r\n// calculate navPath for each RouteDef path.\r\nfunction processPaths(routeDefObj: {}) {\r\n _.forOwn(routeDefObj, (value: IRouteDefinition) => {\r\n value.navPath = value.path.split('/')[0];\r\n const childRoutes = value['childRoutes'];\r\n if (childRoutes) {\r\n processPaths(childRoutes);\r\n }\r\n });\r\n}\r\n\r\nprocessPaths(ROUTES);\r\n\r\nconst homeConfig: Routes = [\r\n {\r\n path: ROUTES.Home.path,\r\n component: ROUTES.Home.component,\r\n canActivate: [AuthGuardAllowAuthorized],\r\n canDeactivate: [CanDeactivateGuard],\r\n children: [\r\n { path: '', redirectTo: 'home-page', pathMatch: 'full' },\r\n { path: ROUTES.Home.childRoutes.AfterLogin.path, component: ROUTES.Home.childRoutes.AfterLogin.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Home.childRoutes.HomePage.path, component: ROUTES.Home.childRoutes.HomePage.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Home.childRoutes.Introduction.path, component: ROUTES.Home.childRoutes.Introduction.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.SearchResults.path, component: ROUTES.Home.childRoutes.SearchResults.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes._SearchResults.path, component: ROUTES.Home.childRoutes._SearchResults.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.SearchAuthors.path, component: ROUTES.Home.childRoutes.SearchAuthors.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.SearchSynonyms.path, component: ROUTES.Home.childRoutes.SearchSynonyms.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.SearchStructure.path, component: ROUTES.Home.childRoutes.SearchStructure.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes._SearchStructure.path, component: ROUTES.Home.childRoutes.SearchStructure.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.EnvironmentalData.path, component: ROUTES.Home.childRoutes.EnvironmentalData.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.MaterialGroups.path, component: ROUTES.Home.childRoutes.MaterialGroups.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.SafetyAssessments.path, component: ROUTES.Home.childRoutes.SafetyAssessments.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.IFRAAttachments.path, component: ROUTES.Home.childRoutes.IFRAAttachments.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.ToolsAndModels.path, component: ROUTES.Home.childRoutes.ToolsAndModels.component, canDeactivate: [CanDeactivateGuard] },\r\n // tslint:disable-next-line:max-line-length\r\n { path: ROUTES.Home.childRoutes.ReportDatabaseChanges.path, component: ROUTES.Home.childRoutes.ReportDatabaseChanges.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.SystemRequirements.path, component: ROUTES.Home.childRoutes.SystemRequirements.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.IFRASurveyUse.path, component: ROUTES.Home.childRoutes.IFRASurveyUse.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n // tslint:disable-next-line:max-line-length\r\n { path: ROUTES.Home.childRoutes.DatabaseSubscription.path, component: ROUTES.Home.childRoutes.DatabaseSubscription.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n { path: ROUTES.Home.childRoutes.MaterialClusters.path, component: ROUTES.Home.childRoutes.MaterialClusters.component, canDeactivate: [CanDeactivateGuard], canActivate: [AuthGuard] },\r\n ]\r\n }\r\n];\r\n\r\nconst materialConfig: Routes = [\r\n {\r\n path: ROUTES.Material.path,\r\n component: ROUTES.Material.component,\r\n resolve: { material: MaterialResolver },\r\n canActivate: [AuthGuard],\r\n canDeactivate: [CanDeactivateGuard],\r\n children: [\r\n { path: '', redirectTo: 'synonyms', pathMatch: 'full' },\r\n { path: ROUTES.Material.childRoutes.Synonyms.path, component: ROUTES.Material.childRoutes.Synonyms.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.StructureIdentity.path, component: ROUTES.Material.childRoutes.StructureIdentity.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.Relations.path, component: ROUTES.Material.childRoutes.Relations.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.AnalyticalResults.path, component: ROUTES.Material.childRoutes.AnalyticalResults.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.ToxicData.path, component: ROUTES.Material.childRoutes.ToxicData.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.Flavor.path, component: ROUTES.Material.childRoutes.Flavor.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.Synopsis.path, component: ROUTES.Material.childRoutes.Synopsis.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.Status.path, component: ROUTES.Material.childRoutes.Status.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.FragranceUse.path, component: ROUTES.Material.childRoutes.FragranceUse.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.Naturals.path, component: ROUTES.Material.childRoutes.Naturals.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.Predictions.path, component: ROUTES.Material.childRoutes.Predictions.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.Publications.path, component: ROUTES.Material.childRoutes.Publications.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.Reach.path, component: ROUTES.Material.childRoutes.Reach.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.SafetyAssessment.path, component: ROUTES.Material.childRoutes.SafetyAssessment.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.RIFMStatus.path, component: ROUTES.Material.childRoutes.RIFMStatus.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.MaterialConsumptions.path, component: ROUTES.Material.childRoutes.MaterialConsumptions.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Material.childRoutes.MaterialExposure.path, component: ROUTES.Material.childRoutes.MaterialExposure.component, canDeactivate: [CanDeactivateGuard] }\r\n ]\r\n }\r\n];\r\n\r\nconst referenceConfig: Routes = [\r\n {\r\n path: ROUTES.Reference.path,\r\n component: ROUTES.Reference.component,\r\n resolve: { reference: ReferenceResolver },\r\n canActivate: [AuthGuard],\r\n canDeactivate: [CanDeactivateGuard],\r\n children: [\r\n { path: '', redirectTo: 'reference-details', pathMatch: 'full' },\r\n { path: ROUTES.Reference.childRoutes.ReferenceDetails.path, component: ROUTES.Reference.childRoutes.ReferenceDetails.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Reference.childRoutes.ReferenceData.path, component: ROUTES.Reference.childRoutes.ReferenceData.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Reference.childRoutes.ReferenceRelations.path, component: ROUTES.Reference.childRoutes.ReferenceRelations.component, canDeactivate: [CanDeactivateGuard] }\r\n ]\r\n }\r\n];\r\n\r\nconst staffConfig: Routes = [\r\n {\r\n path: ROUTES.Staff.path,\r\n component: ROUTES.Staff.component,\r\n canActivate: [AuthGuard],\r\n canDeactivate: [CanDeactivateGuard],\r\n children: [\r\n { path: '', redirectTo: 'material', pathMatch: 'full' },\r\n { path: ROUTES.Staff.childRoutes.Material.path, component: ROUTES.Staff.childRoutes.Material.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.MaterialById.path, component: ROUTES.Staff.childRoutes.MaterialById.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.Reference.path, component: ROUTES.Staff.childRoutes.Reference.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.ReferenceAudit.path, component: ROUTES.Staff.childRoutes.ReferenceAudit.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.Protocol.path, component: ROUTES.Staff.childRoutes.Protocol.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.ReferenceEditor.path, component: ROUTES.Staff.childRoutes.ReferenceEditor.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.ReferenceAuditById.path, component: ROUTES.Staff.childRoutes.ReferenceAuditById.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.ProtocolById.path, component: ROUTES.Staff.childRoutes.ProtocolById.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.Journals.path, component: ROUTES.Staff.childRoutes.Journals.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.Project.path, component: ROUTES.Staff.childRoutes.Project.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.FSAG.path, component: ROUTES.Staff.childRoutes.FSAG.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.TypeReferenceRelation.path, component: ROUTES.Staff.childRoutes.TypeReferenceRelation.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.WhatsNew.path, component: ROUTES.Staff.childRoutes.WhatsNew.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.RefWorkflowStats.path, component: ROUTES.Staff.childRoutes.RefWorkflowStats.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.MaterialReportedUses.path, component: ROUTES.Staff.childRoutes.MaterialReportedUses.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.SurveyReportedUse.path, component: ROUTES.Staff.childRoutes.SurveyReportedUse.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Staff.childRoutes.AssessmentCategories.path, component: ROUTES.Staff.childRoutes.AssessmentCategories.component, canDeactivate: [CanDeactivateGuard] },\r\n {\r\n path: ROUTES.Staff.childRoutes.TypePredictionEditorBaseComponent.path,\r\n component: ROUTES.Staff.childRoutes.TypePredictionEditorBaseComponent.component,\r\n canDeactivate: [CanDeactivateGuard]\r\n }\r\n // ...createChildConfig(ROUTES.Staff.childRoutes)\r\n ]\r\n }\r\n];\r\n\r\nconst exposureConfig: Routes = [\r\n {\r\n path: ROUTES.Exposure.path,\r\n component: ROUTES.Exposure.component,\r\n canActivate: [AuthGuard],\r\n canDeactivate: [CanDeactivateGuard],\r\n children: [\r\n { path: '', redirectTo: 'exposure-surveys', pathMatch: 'full' },\r\n { path: ROUTES.Exposure.childRoutes.ExposureSurveys.path, component: ROUTES.Exposure.childRoutes.ExposureSurveys.component, canDeactivate: [CanDeactivateGuard] },\r\n { path: ROUTES.Exposure.childRoutes.ExposureSurveyLists.path, component: ROUTES.Exposure.childRoutes.ExposureSurveyLists.component, canDeactivate: [CanDeactivateGuard] },\r\n {\r\n path: ROUTES.Exposure.childRoutes.RecordExposureSurveyMeasuresComponent.path,\r\n component: ROUTES.Exposure.childRoutes.RecordExposureSurveyMeasuresComponent.component,\r\n canDeactivate: [CanDeactivateGuard]\r\n },\r\n {\r\n path: ROUTES.Exposure.childRoutes.ExposureAdditionalMaterialsComponent.path,\r\n component: ROUTES.Exposure.childRoutes.ExposureAdditionalMaterialsComponent.component,\r\n canDeactivate: [CanDeactivateGuard]\r\n },\r\n {\r\n path: ROUTES.Exposure.childRoutes.TypeCremeVersionsComponent.path,\r\n component: ROUTES.Exposure.childRoutes.TypeCremeVersionsComponent.component,\r\n canDeactivate: [CanDeactivateGuard]\r\n },\r\n {\r\n path: ROUTES.Exposure.childRoutes.ExposureSurveyReportsComponent.path,\r\n component: ROUTES.Exposure.childRoutes.ExposureSurveyReportsComponent.component,\r\n canDeactivate: [CanDeactivateGuard]\r\n }\r\n // ...createChildConfig(ROUTES.Exposure.childRoutes)\r\n ]\r\n }\r\n];\r\n\r\nconst documentManagementConfig: Routes = [\r\n {\r\n path: ROUTES.DocumentManagement.path,\r\n component: ROUTES.DocumentManagement.component,\r\n canActivate: [AuthGuard],\r\n canDeactivate: [CanDeactivateGuard],\r\n children: [\r\n { path: '', redirectTo: 'rifm-documents', pathMatch: 'full' },\r\n { path: ROUTES.DocumentManagement.childRoutes.RIFMDocuments.path, component: ROUTES.DocumentManagement.childRoutes.RIFMDocuments.component, canDeactivate: [CanDeactivateGuard] },\r\n // tslint:disable-next-line:max-line-length\r\n { path: ROUTES.DocumentManagement.childRoutes.QuickDocumentUpload.path, component: ROUTES.DocumentManagement.childRoutes.QuickDocumentUpload.component, canDeactivate: [CanDeactivateGuard] },\r\n // tslint:disable-next-line:max-line-length\r\n { path: ROUTES.DocumentManagement.childRoutes.RIFMArchivedDocuments.path, component: ROUTES.DocumentManagement.childRoutes.RIFMArchivedDocuments.component, canDeactivate: [CanDeactivateGuard] },\r\n // tslint:disable-next-line:max-line-length\r\n { path: ROUTES.DocumentManagement.childRoutes.DocumentManagementReports.path, component: ROUTES.DocumentManagement.childRoutes.DocumentManagementReports.component, canDeactivate: [CanDeactivateGuard] }\r\n ]\r\n }\r\n];\r\n\r\nexport const routes: Routes = [\r\n {\r\n path: '',\r\n redirectTo: 'home',\r\n pathMatch: 'full'\r\n },\r\n ...homeConfig,\r\n ...materialConfig,\r\n ...referenceConfig,\r\n ...staffConfig,\r\n ...exposureConfig,\r\n ...documentManagementConfig,\r\n {\r\n path: '**',\r\n redirectTo: 'home'\r\n },\r\n];\r\n\r\n// export const appRouterProviders = [\r\n// provideRouter(routesConfig), AuthGuard, CanDeactivateGuard\r\n// ];\r\n\r\nexport const appRouterProviders = [\r\n AuthGuard, AuthGuardAllowAuthorized, CanDeactivateGuard\r\n];\r\n\r\nexport const routing = RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' });\r\n","import {Configuration} from './configuration';\r\nimport {ErrorLogger} from './error-logger';\r\n\r\nimport {EntityManagerProvider} from './entity-manager-provider';\r\nimport {UnitOfWork, StateMap} from './common';\r\nimport {SearchService} from './search';\r\nimport {UserManager} from './user-manager';\r\nimport {MolImageService} from './mol-image.service';\r\nimport {EditorService} from './editor.service';\r\nimport {ReferenceState} from './reference-state';\r\nimport {ReferenceFinishedService} from './reference-finished-service';\r\nimport {WorkflowService} from './workflow-service';\r\nimport {WorkflowEmailService} from './workflow-email-service';\r\nimport { BusyService } from './busy.service';\r\nimport { ReferenceLoader } from '../components/staff/services/reference-loader';\r\nimport { MaterialLoader } from '../components/staff/services/material-loader';\r\n\r\nexport var SERVICE_PROVIDERS = [Configuration, ErrorLogger,\r\n EntityManagerProvider, UnitOfWork, SearchService, StateMap, UserManager,\r\n MolImageService, EditorService, ReferenceState, ReferenceFinishedService, WorkflowService, WorkflowEmailService,\r\n BusyService, ReferenceLoader, MaterialLoader ];","import { ErrorHandler, Injector } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap } from './state-map';\r\nimport * as Raven from 'raven-js';\r\n\r\ndeclare var ga: Function;\r\n\r\nclass CustomExceptionHandler {\r\n constructor(private stateMap: StateMap, private injector: Injector) {\r\n }\r\n\r\n call(exception: any, stackTrace: any = null, reason: string = null) {\r\n Raven.captureException(exception.originalError || exception);\r\n console.log(exception);\r\n console.log(stackTrace);\r\n this.stateMap.errors.push({ exception: exception, stackTrace: stackTrace });\r\n\r\n if (!(this.stateMap.exceptionDialog && this.stateMap.exceptionDialog.showModal)) {\r\n alert(exception); // use plain ol' javascript alert;\r\n return;\r\n }\r\n this.stateMap.exceptionDialog.showModal().then((result) => {\r\n const location = this.injector.get(Location);\r\n ga('send', 'exception', {\r\n 'exDescription': exception && exception.toString(),\r\n 'page': location.path()\r\n });\r\n\r\n // var parts = UtilFns.parseUrl(location.path());\r\n if (!result) {\r\n location.replaceState('/home');\r\n }\r\n document.location.reload();\r\n\r\n });\r\n }\r\n\r\n handleError(exception: any, stackTrace: any = null, reason: string = null) {\r\n this.call(exception, stackTrace, reason);\r\n }\r\n}\r\n\r\nexport function CustomExceptionHandlerFactory(stateMap: StateMap, injector: Injector) {\r\n return new CustomExceptionHandler(stateMap, injector);\r\n}\r\n\r\nexport const customExceptionHandlerProvider = {\r\n provide: ErrorHandler,\r\n useFactory: CustomExceptionHandlerFactory,\r\n deps: [StateMap, Injector]\r\n};\r\n","
\r\n
\r\n
\r\n
\r\n \r\n

{{_title}}

\r\n
\r\n
\r\n

{{_message}}

\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
","import { Component, OnInit } from '@angular/core';\r\n\r\ndeclare const $: any;\r\n\r\n@Component({\r\n selector: 'yes-no-dialog',\r\n templateUrl: './yes-no.html'\r\n})\r\nexport class YesNoComponent implements OnInit {\r\n _title: string;\r\n _message: string;\r\n _buttonNames: string[];\r\n _result: boolean;\r\n\r\n ngOnInit() {\r\n }\r\n\r\n select(isYes: boolean) {\r\n this._result = isYes;\r\n this.getModalEle().modal('hide');\r\n }\r\n\r\n showModal(title: string, message: string, buttonNames?: string []): Promise {\r\n this._title = title;\r\n this._message = message;\r\n this._buttonNames = buttonNames || ['Yes', 'No' ];\r\n const ele = this.getModalEle();\r\n const p = new Promise( (resolve, reject) => {\r\n ele.modal({ backdrop: 'static', keyboard: false }).on('hidden.bs.modal', () => {\r\n resolve(this._result);\r\n });\r\n });\r\n return p;\r\n }\r\n\r\n getModalEle(): any {\r\n return $('#yes-no-modal');\r\n }\r\n}\r\n\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { StateMap } from '../../services/common';\r\nimport * as _ from 'lodash';\r\n\r\n\r\n@Component({\r\n selector: 'exception-dialog',\r\n templateUrl: './exception-dialog.html'\r\n})\r\nexport class ExceptionDialogComponent implements OnInit {\r\n _ele: any;\r\n _result: boolean;\r\n _errorHeader: string;\r\n _errorMessages: string;\r\n _addlErrorText: string;\r\n _title: string;\r\n\r\n constructor(private _stateMap: StateMap) {\r\n\r\n }\r\n\r\n\r\n ngOnInit() {\r\n }\r\n\r\n showModal(): Promise {\r\n this._ele = this.getModalEle();\r\n this._errorHeader = 'Error from RIFM web app';\r\n this.updateErrorVars();\r\n // HACK because binding isn't working at this level - i.e. when launched from the global exception handler.\r\n // so using jquery to push the error message text instead.\r\n $('#errorMessages').text(() => this._errorMessages);\r\n $('#addlErrorText').text(() => this._addlErrorText);\r\n const p = new Promise((resolve) => {\r\n this._ele.modal({backdrop: 'static', keyboard: false}).on('hidden.bs.modal', () => {\r\n resolve(this._result);\r\n });\r\n });\r\n return p;\r\n }\r\n\r\n getModalEle(): any {\r\n return $('#exception-dialog');\r\n }\r\n\r\n updateErrorVars() {\r\n if (this._stateMap.errors.length == 0) {\r\n return '';\r\n }\r\n const lastError = this._stateMap.errors[this._stateMap.errors.length - 1];\r\n const exception = lastError.exception;\r\n this._errorMessages = _.get(exception, 'rejection.message') || exception.message || '';\r\n this._addlErrorText = exception.toString();\r\n }\r\n\r\n onRespond(result: boolean) {\r\n this._result = result;\r\n this._ele.modal('hide');\r\n }\r\n\r\n onSendEmail() {\r\n // Neither of these approaches works with all browsers - email clients.\r\n // Best approach is to use a server based email messaging system.\r\n\r\n // Attempt 1:\r\n // window.open('mailto:jayt@ideablade.com?subject=' +\r\n // this._errorHeader +\r\n // '&body=' +\r\n // this._errorMessages);\r\n\r\n // Attempt 2:\r\n // var link = \"mailto:jayt@ideablade.com\"\r\n // // + \"?cc=myCCaddress@example.com\"\r\n // + \"&subject=\" + encodeURIComponent(this._errorHeader)\r\n // + \"&body=\" + encodeURIComponent(this._errorMessages);\r\n\r\n // window.location.href = link;\r\n\r\n }\r\n}\r\n\r\n","
\r\n
\r\n
\r\n
\r\n \r\n

An error has occurred

\r\n

Please send an email to help@rifm.org with the error message shown below. \r\n If possible, please include the steps you took just prior to the occurrence of this error. \r\n This will allow our developers to reproduce the error, and get to the cause faster.\r\n

\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n

{{ _errorMessages }}

\r\n
\r\n

\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
","\r\n","import {Component, OnInit} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\n\r\nimport { ErrorLogger, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { EntityManagerProvider } from '../../services/entity-manager-provider';\r\nimport { ROUTES } from '../routes';\r\nimport { TypeSearch } from '../../entities/TypeSearch';\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'rifm-toolbar',\r\n templateUrl: './toolbar.html'\r\n})\r\n// tslint:disable-next-line:component-class-suffix\r\nexport class ToolBar implements OnInit {\r\n _searchTerm: string;\r\n _filters: TypeSearch[] = [];\r\n _filter: string = null;\r\n _defaultFilter: string = null;\r\n _noFilterData = true;\r\n _errorLogger: ErrorLogger;\r\n _nullSearchParts = UtilFns.asRouterParts(ROUTES.Home, ROUTES.Home.childRoutes.SearchResults);\r\n _typeSearches: TypeSearch[] = [];\r\n\r\n constructor(public _emProvider: EntityManagerProvider, public _userManager: UserManager,\r\n public _uow: UnitOfWork, public _stateMap: StateMap,\r\n public _router: Router, public _route: ActivatedRoute, public _location: Location\r\n ) {\r\n this._errorLogger = _emProvider.errorLogger;\r\n }\r\n\r\n ngOnInit() {\r\n return this._emProvider\r\n .prepare()\r\n .then(() => this._uow.typeSearchRepository.all())\r\n .then(data => {\r\n this._typeSearches = data;\r\n // at this point the user may not have logged in yet and the staff setting may not be known. The data are filtered in the get function.\r\n this.searchFilters = data;\r\n const defaults = this.searchFilters.filter(f => f.defaultOption);\r\n this._filter = this._defaultFilter = (defaults.length > 0) ? defaults[0].radioOptionId : this.searchFilters[0].radioOptionId;\r\n this._noFilterData = false;\r\n return data;\r\n });\r\n }\r\n\r\n refreshSearchOptions() {\r\n if (this.isStaff()) {\r\n this._filters = this._typeSearches; //\r\n }\r\n }\r\n\r\n logout() {\r\n return this._userManager.logout().then(() => {\r\n this._location.replaceState('/home?logout');\r\n document.location.reload();\r\n });\r\n }\r\n\r\n printBody() {\r\n const ele = document.querySelector('#main-body');\r\n UtilFns.printElement(ele);\r\n }\r\n\r\n isOnHomePage() {\r\n return _.endsWith(this._location.path(), 'home-page');\r\n }\r\n\r\n canToggleStaff() {\r\n return this._stateMap.currentUser.isReallyStaff;\r\n }\r\n\r\n isStaffOnlyPage() {\r\n return this._location.path().indexOf('staff/') >= 0;\r\n }\r\n\r\n toggleStaff() {\r\n this._stateMap.currentUser.toggleRoles();\r\n\r\n const parts = UtilFns.parseUrl(this._location.path());\r\n parts.paramHash['isStaff'] = this.isStaff().toString();\r\n this._stateMap.set('Search Results', null); // to insure that old results aren't reused.\r\n if (parts.base.indexOf('SearchResults') >= 0) {\r\n this._router.navigate(this._nullSearchParts);\r\n this.search();\r\n return;\r\n }\r\n\r\n this._location.go(UtilFns.formatUrl(parts));\r\n this._location.back();\r\n\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n isAuthorizedDownloadUser() {\r\n return this._stateMap.currentUser.isAuthorizedDownloadUser;\r\n }\r\n\r\n goHome() {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Home));\r\n }\r\n\r\n goStaffEditing() {\r\n const parts = UtilFns.parseUrl(this._location.path());\r\n\r\n if (this._stateMap.currentUser.isInRole('fema') == true) { // FEMA staff can only edit Reference Protocol data\r\n const routeParts = [ `/${ROUTES.Staff.path}`, 'reference', 'info' ];\r\n this._router.navigate(routeParts);\r\n } else if (parts.base.indexOf('/material/') >= 0) {\r\n if (this._stateMap.currentMaterial != null) {\r\n const routeParts = [`/${ROUTES.Staff.path}`, 'material', this._stateMap.currentMaterial.materialId, 'info'];\r\n this._router.navigate(routeParts);\r\n } else {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Staff, ROUTES.Staff.childRoutes.Material));\r\n }\r\n } else if (parts.base.indexOf('/reference/') >= 0) {\r\n if (this._stateMap.currentReference != null) {\r\n const routeParts = [`/${ROUTES.Staff.path}`, 'reference', this._stateMap.currentReference.referenceId, 'info'];\r\n this._router.navigate(routeParts);\r\n } else {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Staff, ROUTES.Staff.childRoutes.Reference));\r\n }\r\n } else {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Staff));\r\n }\r\n }\r\n\r\n goDocManagement() {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.DocumentManagement, ROUTES.DocumentManagement.childRoutes.RIFMDocuments));\r\n }\r\n\r\n goExposureAdmin() {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Exposure, ROUTES.Exposure.childRoutes.ExposureSurveys));\r\n }\r\n\r\n goMaterial() {\r\n if (this._stateMap.currentMaterial) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, this._stateMap.currentMaterial.materialId));\r\n }\r\n }\r\n\r\n goReference() {\r\n if (this._stateMap.currentReference) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, this._stateMap.currentReference.referenceId));\r\n }\r\n }\r\n\r\n goSearchResults() {\r\n this._router.navigate(this._nullSearchParts);\r\n }\r\n\r\n canSearch() {\r\n return (this.isValidString(this._searchTerm));\r\n }\r\n\r\n search() {\r\n if (this._filter && this._searchTerm) {\r\n const parts = UtilFns.asRouterParts(ROUTES.Home, ROUTES.Home.childRoutes.SearchResults,\r\n this._filter.trim(),\r\n UtilFns.encodeRouterPart(this._searchTerm.trim()));\r\n this._router.navigate(parts);\r\n }\r\n }\r\n\r\n searchIfEnter(event: any) {\r\n if (event.keyCode == 13) {\r\n this.search();\r\n }\r\n }\r\n\r\n clear() {\r\n this._searchTerm = '';\r\n this._filter = this._defaultFilter;\r\n }\r\n\r\n hasErrors() {\r\n return this._stateMap.errors.length > 0;\r\n }\r\n\r\n canShowDocManagement() {\r\n\r\n if (this._stateMap.currentUser.isStaff) {\r\n if (this._stateMap.currentUser.isInRole('consultant') || this._stateMap.currentUser.isInRole('FEMA')) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n canShowExposureAdmin() {\r\n\r\n if (this._stateMap.currentUser.isStaff) {\r\n if (this._stateMap.currentUser.isInRole('consultant') || this._stateMap.currentUser.isInRole('FEMA')) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n get searchFilters() {\r\n if (this._filters == null || this._filters.length == 0) { return this._filters; }\r\n\r\n if (this._stateMap.currentUser.isNullUser || !this._stateMap.currentUser.isStaff) {\r\n return this._filters.filter(s => s.staffOnlyOption == false);\r\n } else {\r\n return this._filters;\r\n }\r\n }\r\n\r\n set searchFilters(value: TypeSearch[]) {\r\n this._filters = value;\r\n }\r\n\r\n get userReady(): boolean {\r\n return (this._stateMap.currentUser && !this._stateMap.currentUser.isNullUser);\r\n }\r\n // showErrors() {\r\n // this._stateMap.exceptionDialog.showModal();\r\n // }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n}\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { NavigationEnd, Router } from '@angular/router';\r\n\r\nimport { YesNoComponent } from './yes-no.component';\r\nimport { ExceptionDialogComponent } from './exception-dialog.component';\r\n\r\nimport { StateMap, UserManager } from '../../services/common';\r\nimport { EntityManagerProvider } from '../../services/entity-manager-provider';\r\nimport {ToolBar} from './toolbar.component';\r\n\r\ndeclare var ga: Function;\r\n\r\n@Component({\r\n selector: 'my-app',\r\n templateUrl: './app.html',\r\n})\r\nexport class AppComponent implements OnInit, AfterViewInit {\r\n @ViewChild(YesNoComponent, { static: true }) yesNoComponent: YesNoComponent;\r\n @ViewChild(ExceptionDialogComponent, { static: true }) exceptionDialog: ExceptionDialogComponent;\r\n @ViewChild(ToolBar, { static: true }) toolBar: ToolBar;\r\n private _currentRoute: string;\r\n\r\n constructor(public _stateMap: StateMap, private _emProvider: EntityManagerProvider, private _userManager: UserManager,\r\n private _router: Router, private _location: Location) {\r\n _router.events.subscribe((event: any) => {\r\n // Send GA tracking on NavigationEnd event.\r\n if (event instanceof NavigationEnd) {\r\n // When the route is '/', location.path actually returns ''.\r\n const newRoute = this._location.path() || '/';\r\n // If the route has changed, send the new route to analytics.\r\n if (this._currentRoute != newRoute) {\r\n // we want this page set for any events that come after - not just the pageview.\r\n ga('set', 'page', newRoute);\r\n ga('send', 'pageview');\r\n // ga('send', 'pageview', newRoute + '/alt');\r\n this._currentRoute = newRoute;\r\n }\r\n }\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n this._emProvider.prepare().catch(console.log.bind(console));\r\n }\r\n\r\n ngAfterViewInit() {\r\n this._stateMap.yesNoComponent = this.yesNoComponent;\r\n this._stateMap.exceptionDialog = this.exceptionDialog;\r\n\r\n // Scrollbar modal dialog fix\r\n // If you have a modal on your page that exceeds the browser height,\r\n // then you can't scroll in it when closing an second modal.\r\n // from: http://stackoverflow.com/questions/19305821/multiple-modals-overlay\r\n $(document).on('hidden.bs.modal', '.modal', function () {\r\n if ($('.modal:visible').length) {\r\n $(document.body).addClass('modal-open');\r\n }\r\n });\r\n }\r\n\r\n successfulLogin() {\r\n if (this.toolBar != null) {\r\n this.toolBar.refreshSearchOptions();\r\n }\r\n }\r\n}\r\n","
\r\n \r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n \r\n\r\n \r\n \r\n
\r\n","import {Component, forwardRef, Inject, OnInit} from '@angular/core';\r\nimport { provideParent, StateMap, UserManager } from '../../services/common';\r\nimport {AppComponent} from './app.component';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport {environment} from '../../../environments/environment';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\n\r\ndeclare var ga: Function; // Google analytics\r\n\r\n@Component({\r\n selector: 'login',\r\n templateUrl: './login.html'\r\n})\r\nexport class LoginComponent implements OnInit {\r\n _email: string;\r\n _oauthRedirectURL: string;\r\n\r\n constructor(public _userManager: UserManager, private _stateMap: StateMap, public _http: HttpClient,\r\n @Inject(forwardRef(() => AppComponent)) public _parent: AppComponent, @Inject(DOCUMENT) private document: Document) {\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n\r\n // TODO: Ugly - replace with real Ng2 component when we get time.\r\n public async tryLogin(): Promise {\r\n if (!this.isValidString(this._oauthRedirectURL)) {\r\n await this.getOAuthRedirectURL().then(url => {\r\n if (this.isValidString(url)) {\r\n this._oauthRedirectURL = url;\r\n }\r\n });\r\n }\r\n\r\n // OAUTH login URL\r\n window.location.href = this._oauthRedirectURL;\r\n\r\n // this.document.location.href = this._oauthRedirectURL;\r\n return Promise.resolve(false);\r\n }\r\n\r\n public getOAuthRedirectURL(): Promise {\r\n return this._http.get(`${environment.appUrl}/breeze/oAuthRedirectURL`, {})\r\n .toPromise()\r\n .then((url: any) => {\r\n return url;\r\n });\r\n }\r\n\r\n get userMessage(): string {\r\n const loc = window.location.href;\r\n\r\n return (loc.toLowerCase().indexOf('logout') > -1) ? 'You are logged out of the RIFM Database.' : 'Unable to authenticate your credentials.';\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n}\r\n\r\n","
\r\n
\r\n
\r\n\r\n
\r\n

RIFM Database

\r\n
\r\n\r\n
\r\n\r\n
\r\n {{userMessage}}\r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n","
\r\n\r\n
\r\n Select an External Material: \r\n \r\n
\r\n\r\n
\r\n \r\n {{entity.exposureAdditionalMaterial?.cASNumber}}\r\n \r\n\r\n \r\n {{entity.exposureAdditionalMaterial?.materialName}}\r\n \r\n\r\n \r\n {{entity.exposureAdditionalMaterial?.memberCompany}}\r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n","import { Location } from '@angular/common';\r\nimport { Component, Input, OnInit, ViewChild, Inject, forwardRef, QueryList } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { UnitOfWork, StateMap, EditorService, provideParent, UserManager } from '../../services/common';\r\nimport { EditManager, IEditHost, LocationFns, UtilFns } from '../../utils/common';\r\nimport { PageState, EditPropParent } from '../../controls/common';\r\nimport { ExposureAdditionalMaterial, ExposureSurvey, ExposureAdditionalMaterialSurvey, TypeExposureSurveyResponse } from '../../entities/EntityModels';\r\nimport { ROUTES } from '../routes';\r\nimport { EXPOSURE_ROUTES } from './exposure.routes'\r\n\r\nexport class ExposureAdditionalMaterialData {\r\n edmAdditionalMaterial: EditManager;\r\n}\r\n\r\n@Component({\r\n selector: 'exposure-additional-material-survey-editor',\r\n templateUrl: './exposure-additional-material-survey-editor.html',\r\n providers: [provideParent(ExposureAdditionalMaterialSurveyEditorComponent, EditPropParent)]\r\n})\r\n\r\nexport class ExposureAdditionalMaterialSurveyEditorComponent implements OnInit, EditPropParent, IEditHost {\r\n _isLoading: boolean = false;\r\n\r\n _pageState = new PageState(\"Exposure Additional Material Survey Editor\");\r\n _typeExposureSurveyResponses: TypeExposureSurveyResponse[];\r\n\r\n _selectedExposureAdditionalMaterialIndex: number;\r\n _selectedExposureAdditionalMaterial: ExposureAdditionalMaterial;\r\n _exposureAdditionalMaterials: ExposureAdditionalMaterial[] = [];\r\n\r\n public _data: ExposureAdditionalMaterialData = new ExposureAdditionalMaterialData();\r\n \r\n @Input() entity: ExposureAdditionalMaterialSurvey;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n }\r\n\r\n onAdd() {\r\n }\r\n\r\n ngOnInit() {\r\n this._isLoading = true;\r\n\r\n this._data.edmAdditionalMaterial = new EditManager(this, this._uow, this._stateMap, \"Exposure Survey Additional Materials\");\r\n\r\n this._uow.typeExposureSurveyResponseRepository.all().then(r => {\r\n this._typeExposureSurveyResponses = r;\r\n this._uow.exposureAdditionalMaterialRepository.all().then(m => {\r\n this._exposureAdditionalMaterials = m;\r\n this._data.edmAdditionalMaterial.entities = m;\r\n this._isLoading = false;\r\n });\r\n });\r\n }\r\n\r\n getError(propName: string) {\r\n if (this.entity == null) {\r\n return;\r\n }\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n isAdded() {\r\n return this.entity.entityAspect.entityState.isAdded();\r\n }\r\n\r\n filterExposureAdditionalMaterialByIndex(ix: number) {\r\n this._selectedExposureAdditionalMaterialIndex = ix;\r\n\r\n this._selectedExposureAdditionalMaterial = this._data.edmAdditionalMaterial.entities[ix];\r\n\r\n if (this.isAdded) {\r\n this.entity.exposureAdditionalMaterial = this._selectedExposureAdditionalMaterial;\r\n }\r\n }\r\n}\r\n","
\r\n
\r\n

{{_adding ? \"Adding an External Material to the Exposure Survey List\" : \"Editing an External Material from the Exposure Survey List\" }}

\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n

Add an External Material to the Survey List

\r\n\r\n
\r\n

{{_validationMessage}}

\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n
No External Materials have been added yet.
\r\n
\r\n
\r\n

External Materials Added to the Material List

\r\n\r\n
\r\n
\r\n
Edit
\r\n
Remove
\r\n
CAS No.
\r\n
MaterialId
\r\n
Name
\r\n
Notes
\r\n
Response Type
\r\n
Banned Material
\r\n
Add Measures
\r\n
\r\n
\r\n
\r\n \r\n \r\n
{{eam.data.exposureAdditionalMaterial?.cASNumber}}
\r\n
{{eam.data.exposureAdditionalMaterial?.exposureAdditionalMaterialId}}
\r\n
{{eam.data.exposureAdditionalMaterial?.materialName}}
\r\n
{{eam.data.notes}}
\r\n
{{eam.data.typeExposureSurveyResponse?.responseType}}
\r\n
{{eam.data.bannedMaterialCaption}}
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, Input, Inject, forwardRef, OnInit } from '@angular/core';\r\n\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport { UnitOfWork, StateMap, UserManager, ErrorLogger } from '../../services/common';\r\nimport { UtilFns, IEditHost, EditManager } from '../../utils/common';\r\nimport { ExposureSurvey } from '../../entities/EntityModels';\r\nimport { ExposureAdditionalMaterialSurvey, ExposureAdditionalMaterialSurveyMeasure } from '../../entities/EntityModels';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport { ExposureSurveyListsComponent } from './exposure-survey-lists.component';\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'exposure-additional-material-surveys',\r\n templateUrl: './exposure-additional-material-surveys.html',\r\n})\r\n\r\nexport class ExposureAdditionalMaterialSurveysComponent implements IEditHost, OnInit {\r\n @Input() exposureSurvey: ExposureSurvey;\r\n\r\n public _isLoading = false;\r\n\r\n public _edm: EditManager;\r\n public _edmMeasures: EditManager;\r\n public _adding: boolean;\r\n\r\n public _selectedExposureAdditionalMaterialSurvey: ExposureAdditionalMaterialSurvey;\r\n public _exposureAdditionalMaterialSurveys: ExposureAdditionalMaterialSurvey[] = [];\r\n public _exposureAdditionalMaterialSurveysEx: SelectableEntity[] = [];\r\n\r\n public _validationMessage: string;\r\n\r\n constructor(@Inject(forwardRef(() => ExposureSurveyListsComponent)) public _parent: ExposureSurveyListsComponent,\r\n private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n public _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Exposure Survey External Materials');\r\n this._edmMeasures = new EditManager(this, this._uow, this._stateMap, 'Exposure Survey External Material Measures');\r\n\r\n this.fetch();\r\n }\r\n\r\n fetch() {\r\n this._isLoading = true;\r\n\r\n const params = { exposureSurveyId: this.exposureSurvey.exposureSurveyId };\r\n this._uow.fetch('ExposureSurveys/ExposureAdditionalMaterialSurveyByExposureSurveyId', params)\r\n .then(e => {\r\n this._exposureAdditionalMaterialSurveys = e;\r\n this._edm.entities = this._exposureAdditionalMaterialSurveys;\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._exposureAdditionalMaterialSurveysEx = [];\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return;\r\n }\r\n\r\n _.clone(this._edm.entities).forEach(element => {\r\n this._exposureAdditionalMaterialSurveysEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n }\r\n\r\n filterToExposureAdditionalMaterialSurveyById(exposureAdditionalMaterialSurveyId: number): ExposureAdditionalMaterialSurvey {\r\n if (this._exposureAdditionalMaterialSurveys == null || this._exposureAdditionalMaterialSurveys.length < 1) {\r\n return null;\r\n }\r\n\r\n const additionalMaterial = this._exposureAdditionalMaterialSurveys.filter(a => a.exposureAdditionalMaterialSurveyId == exposureAdditionalMaterialSurveyId);\r\n if (additionalMaterial != null && additionalMaterial.length > 0) {\r\n return additionalMaterial[0];\r\n }\r\n }\r\n\r\n hasData() {\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return false;\r\n }\r\n\r\n if (this._exposureAdditionalMaterialSurveysEx == null || this._exposureAdditionalMaterialSurveysEx.length < 1) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n canAddToMaterialList() {\r\n if (this._edm.editing) {\r\n return false;\r\n }\r\n\r\n // Make sure the Exposure Survey status allows materials to be added to the list\r\n if (this.exposureSurvey == null) {\r\n return false;\r\n }\r\n\r\n return (this.exposureSurvey.typeExposureSurveyStatusId == 'Open for Materials');\r\n }\r\n\r\n // edit manager overrides\r\n canApply() {\r\n\r\n if (this._edm.editing) {\r\n return (this._uow.hasChanges() && !this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return this._edm.hasEdits();\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n canSave() {\r\n if (this._edm.editing) {\r\n return false;\r\n }\r\n if (!this._edm.hasEdits()) {\r\n return false;\r\n }\r\n if (!this._edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) {\r\n return false;\r\n }\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n onAdd() {\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n\r\n this._adding = true;\r\n const e = this._uow.exposureAdditionalMaterialSurveyFactory.create();\r\n\r\n e.exposureSurveyId = this.exposureSurvey.exposureSurveyId;\r\n e.typeExposureSurveyResponseId = 2;\r\n\r\n this._edm.entities.push(e);\r\n this._edm.onSelect(e);\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n if (this._edm.editing) {\r\n\r\n if (this._edm.currentEntity.exposureAdditionalMaterial == null) {\r\n this._validationMessage = 'Please select a material or enter data for a new one.';\r\n return;\r\n }\r\n\r\n if (this.isDuplicateAdditionalMaterialEntry(this._edm.currentEntity.exposureAdditionalMaterialId, this._edm.currentEntity.exposureAdditionalMaterial.cASNumber)) {\r\n\r\n this._validationMessage = 'This external material has already been added to the selected exposure survey.';\r\n return;\r\n }\r\n\r\n this._edm.onApplyCore();\r\n this._adding = false;\r\n\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edm.editing = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._adding = false;\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n\r\n this.fetch();\r\n }\r\n\r\n onEdit(amx: SelectableEntity) {\r\n\r\n if (amx == null) {\r\n return;\r\n }\r\n\r\n this._selectedExposureAdditionalMaterialSurvey = this.filterToExposureAdditionalMaterialSurveyById(amx.data.exposureAdditionalMaterialSurveyId);\r\n\r\n if (this._selectedExposureAdditionalMaterialSurvey == null) {\r\n return;\r\n }\r\n\r\n this._edm.onSelect(this._selectedExposureAdditionalMaterialSurvey);\r\n }\r\n\r\n onRemove(amx: SelectableEntity) {\r\n if (amx == null) {\r\n return;\r\n }\r\n\r\n this._selectedExposureAdditionalMaterialSurvey = this.filterToExposureAdditionalMaterialSurveyById(amx.data.exposureAdditionalMaterialSurveyId);\r\n\r\n if (this._selectedExposureAdditionalMaterialSurvey == null) {\r\n this._validationMessage = 'Error occurred, could not remove the selected external material from the list.';\r\n return;\r\n }\r\n\r\n if (this._selectedExposureAdditionalMaterialSurvey.entityAspect.entityState.isAdded()) {\r\n this._selectedExposureAdditionalMaterialSurvey.entityAspect.rejectChanges();\r\n } else {\r\n this._selectedExposureAdditionalMaterialSurvey.entityAspect.setDeleted();\r\n this.removeExposureAdditionalMaterialSurvey();\r\n }\r\n\r\n _.remove(this._edm.entities, this._selectedExposureAdditionalMaterialSurvey);\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n removeExposureAdditionalMaterialSurvey() {\r\n // Delete the measures associated with removed exposure additional material survey record.\r\n const params = {\r\n exposureAdditionalMaterialId: this._selectedExposureAdditionalMaterialSurvey.exposureAdditionalMaterialId,\r\n exposureSurveyId: this._selectedExposureAdditionalMaterialSurvey.exposureSurveyId\r\n };\r\n\r\n this._uow.fetchTyped('ExposureSurveys/FetchExposureAdditionalMaterialSurveyMeasures', ExposureAdditionalMaterialSurveyMeasure, params).then(m => {\r\n this._edmMeasures.entities = m;\r\n\r\n if (this._edmMeasures.entities != null && this._edmMeasures.entities.length > 0) {\r\n this._edmMeasures.entities.forEach(r => r.entityAspect.setDeleted());\r\n }\r\n });\r\n }\r\n\r\n removeAdditionalMaterialMeasures() {\r\n // Delete the measures associated with removed additional material survey record.\r\n const params = {\r\n additionalMaterialId: this._selectedExposureAdditionalMaterialSurvey.exposureAdditionalMaterialId,\r\n exposureSurveyId: this._selectedExposureAdditionalMaterialSurvey.exposureSurveyId\r\n };\r\n\r\n this._uow.fetchTyped('ExposureSurveys/FetchExposureAdditionalMaterialSurveyMeasures', ExposureAdditionalMaterialSurveyMeasure, params).then(m => {\r\n this._edmMeasures.entities = m;\r\n\r\n if (this._edmMeasures.entities != null && this._edmMeasures.entities.length > 0) {\r\n this._edmMeasures.entities.forEach(r => r.entityAspect.setDeleted());\r\n }\r\n });\r\n }\r\n\r\n onSave() {\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n\r\n this._adding = false;\r\n this._edm.editing = false;\r\n\r\n this._edmMeasures.editing = false;\r\n\r\n this.fetch();\r\n });\r\n }\r\n }\r\n\r\n onShowAdditionalMaterialMeasures(amx: SelectableEntity) {\r\n if (amx == null) {\r\n return;\r\n }\r\n\r\n this._selectedExposureAdditionalMaterialSurvey = this.filterToExposureAdditionalMaterialSurveyById(amx.data.exposureAdditionalMaterialSurveyId);\r\n\r\n if (this._selectedExposureAdditionalMaterialSurvey == null) {\r\n return;\r\n }\r\n\r\n this._router.navigate(['../record-exposure-survey-measures', {\r\n exposureAdditionalMaterialId: this._selectedExposureAdditionalMaterialSurvey.exposureAdditionalMaterialId,\r\n exposuresurveyid: this.exposureSurvey.exposureSurveyId\r\n }], { relativeTo: this._parent._route });\r\n }\r\n\r\n isDuplicateAdditionalMaterialEntry(exposureAdditionalMaterialId: number, casNumber: string): boolean {\r\n if (this._edm.entities == null) {\r\n return false;\r\n }\r\n\r\n const mat = this._edm.entities.filter(m => m.exposureAdditionalMaterialId == exposureAdditionalMaterialId);\r\n if (mat != null && mat.length > 1) {\r\n return true;\r\n }\r\n\r\n const casMat = this._edm.entities.filter(m => m.exposureAdditionalMaterial.cASNumber == casNumber);\r\n if (casMat != null && casMat.length > 1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n","
\r\n\r\n \r\n {{entity.material?.realCASNumber}}\r\n \r\n\r\n \r\n {{entity.material?.formattedRIFMId}}\r\n \r\n\r\n \r\n {{entity.material?.principalSynonym().synonymWordOrWebVersion()}}\r\n \r\n\r\n
\r\n {{_dateErrorMsg}}\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n {{entity.typeExposureMeasure.measureDescription}}\r\n \r\n
\r\n\r\n
\r\n \r\n {{_currentTypeExposureMeasure.typeExposureMeasureValue?.measureValueType}}\r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n","import {Component, Input, OnInit} from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport {provideParent, UnitOfWork} from '../../services/common';\r\nimport {EditPropParent} from '../../controls/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport {MaterialExposureCustomSurveyMeasure, TypeCremeVersion, TypeExposureMeasure, TypeExposureMeasureValue} from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'material-exposure-custom-survey-measure-editor',\r\n templateUrl: './material-exposure-custom-survey-measure-editor.html',\r\n providers: [provideParent(MaterialExposureCustomSurveyMeasureEditorComponent, EditPropParent)]\r\n})\r\nexport class MaterialExposureCustomSurveyMeasureEditorComponent implements OnInit, EditPropParent {\r\n @Input() entity: MaterialExposureCustomSurveyMeasure;\r\n\r\n public _currentTypeExposureMeasure: TypeExposureMeasure;\r\n public _typeExposureMeasures: TypeExposureMeasure[];\r\n public _typeExposureMeasureValues: TypeExposureMeasureValue[];\r\n public _typeCremeVersions: TypeCremeVersion[];\r\n\r\n public _customSurveyDate: string;\r\n public _dateErrorMsg: string;\r\n\r\n constructor(public uow: UnitOfWork) {\r\n }\r\n\r\n ngOnInit() {\r\n this.uow.typeExposureMeasureRepository.all().then(m => {\r\n this._typeExposureMeasures = m;\r\n\r\n if (m == null || m.length < 1) { return; }\r\n\r\n if (!this.entity.entityAspect.entityState.isAdded()) {\r\n this.setCurrentMeasureType(this.entity.typeExposureMeasure.typeExposureMeasureValueId);\r\n this.customSurveyDate = this.utilFns.formatDate(this.entity.customSurveyDate);\r\n }\r\n });\r\n\r\n this.uow.typeExposureMeasureValueRepository.all().then(v => {\r\n this._typeExposureMeasureValues = v;\r\n });\r\n\r\n this.uow.typeCremeVersionRepository.all().then(c => {\r\n this._typeCremeVersions = _.sortBy(c, t => t.cremeVersion).reverse();\r\n });\r\n }\r\n\r\n checkIfNull(value: string) {\r\n if (value == '') { return null; } else { return value; }\r\n }\r\n\r\n getError(propName: string) {\r\n if (this.entity == null) {\r\n return;\r\n }\r\n\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n hasQualitativeValue(): boolean {\r\n if (this._currentTypeExposureMeasure == null || this._currentTypeExposureMeasure.typeExposureMeasureValue == null) { return false; }\r\n\r\n return (this._currentTypeExposureMeasure.typeExposureMeasureValue.measureValueType == 'Qualitative');\r\n }\r\n\r\n hasQuantitativeValue(): boolean {\r\n if (this._currentTypeExposureMeasure == null || this._currentTypeExposureMeasure.typeExposureMeasureValue == null) { return false; }\r\n\r\n return (this._currentTypeExposureMeasure.typeExposureMeasureValue.measureValueType == 'Quantitative' || this._currentTypeExposureMeasure.typeExposureMeasureValue.measureValueType == 'Percentage');\r\n }\r\n\r\n isAdded() {\r\n return this.entity.entityAspect.entityState.isAdded();\r\n }\r\n\r\n onCheckCustomSurveyDate() {\r\n if (this.customSurveyDate == null) {\r\n this.entity.customSurveyDate = null;\r\n this._dateErrorMsg = 'Please enter a valid Custom Survey Date';\r\n return;\r\n }\r\n\r\n const date = new Date(this.customSurveyDate);\r\n if (isNaN(date.getTime())) {\r\n this.entity.customSurveyDate = null;\r\n this._dateErrorMsg = 'Please enter a valid Custom Survey Date';\r\n return;\r\n }\r\n\r\n this.entity.customSurveyDate = date;\r\n this._dateErrorMsg = '';\r\n }\r\n\r\n onSelectMeasure(ix: number) {\r\n this.setCurrentMeasureType(ix);\r\n\r\n this.entity.typeExposureMeasureId = this._currentTypeExposureMeasure.typeExposureMeasureId;\r\n this.entity.typeExposureMeasureValueId = this._currentTypeExposureMeasure.typeExposureMeasureValueId;\r\n }\r\n\r\n setCurrentMeasureType(ix: number) {\r\n const x = this._typeExposureMeasures.filter(t => t.typeExposureMeasureId == ix);\r\n if (x != null && x.length > 0) {\r\n this._currentTypeExposureMeasure = x[0];\r\n }\r\n }\r\n\r\n public get customSurveyDate(): string {\r\n return this._customSurveyDate;\r\n }\r\n\r\n public set customSurveyDate(value) {\r\n this._customSurveyDate = value;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n}\r\n","
\r\n

{{_adding ? \"Adding an Exposure Custom Survey Measure\" : \"Editing an Exposure Custom Survey Measure\" }}

\r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n

{{_validationMessage}}

\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n
\r\n Selected CAS No.: \r\n {{_selectedMaterial.realCASNumber || '(No CAS#)'}}\r\n\r\n RIFM Id: \r\n {{_selectedMaterial.formattedRIFMId + ','}}\r\n\r\n Principal Synonym: \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n

\r\n There is no Custom Survey Measure data for this material.\r\n

\r\n 0\" class=\"inline\">\r\n Exposure Custom Survey Measure Data\r\n \r\n 0\">\r\n \r\n \r\n Edit\r\n Remove\r\n Custom Survey Date\r\n Measure\r\n Value\r\n Date Entered\r\n Notes\r\n Creme Version\r\n \r\n \r\n \r\n \r\n Edit\r\n Remove\r\n {{utilFns.formatDate(mx.data.customSurveyDate)}}\r\n {{mx.data.typeExposureMeasure.measureDescription}}\r\n {{mx.data.measureQualitativeResult || utilFns.formatNumber(mx.data.measureQuantitativeResult, 12, 4)}}\r\n {{utilFns.formatDate(mx.data.created)}}\r\n {{mx.data.measureNotes}}\r\n {{mx.data.typeCremeVersion.cremeVersion}}\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n\r\n\r\n
\r\n \r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, ViewChild, Inject, forwardRef, OnInit } from '@angular/core';\r\n\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport { UnitOfWork, StateMap, ErrorLogger, provideParent, UserManager } from '../../services/common';\r\nimport { EditManager, IEditHost, UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { Material, MaterialExposureCustomSurveyMeasure } from '../../entities/EntityModels';\r\n\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\nimport { RecordExposureSurveyMeasuresComponent, MeasureEditData } from './record-exposure-survey-measures.component';\r\n\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport * as _ from 'lodash';\r\n\r\n\r\n@Component({\r\n selector: 'material-exposure-custom-survey-measures',\r\n templateUrl: './material-exposure-custom-survey-measures.html',\r\n providers: [provideParent(MaterialExposureCustomSurveyMeasuresComponent, EditPropParent)]\r\n})\r\nexport class MaterialExposureCustomSurveyMeasuresComponent implements IEditHost, OnInit {\r\n\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n\r\n public _isLoading = false;\r\n\r\n public _adding: boolean;\r\n public _unsurveyedMessage: string;\r\n public _validationMessage: string;\r\n\r\n // Default type ids\r\n public _typeCremeVersionId = 0;\r\n public _typeExposureMeasureId = 0;\r\n public _typeExposureMeasureValueId = 0;\r\n\r\n public _selectedMaterialExposureCustomSurveyMeasure: MaterialExposureCustomSurveyMeasure;\r\n public _materialExposureCustomSurveyMeasures: MaterialExposureCustomSurveyMeasure[] = [];\r\n\r\n public _selectedMaterial: Material;\r\n _edm: EditManager;\r\n public _materialExposureCustomSurveyMeasuresEx: SelectableEntity[] = [];\r\n\r\n private _data: MeasureEditData;\r\n\r\n constructor( @Inject(forwardRef(() => RecordExposureSurveyMeasuresComponent)) public _parent: RecordExposureSurveyMeasuresComponent,\r\n private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n public _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Custom Survey Material Measures');\r\n\r\n this._edm.pageState.canShowMessage = false;\r\n\r\n if (this._data.materialId > 0) {\r\n this.fetchMaterialAndCustomSurveys(this._data.materialId);\r\n }\r\n\r\n this.getDefaultMeasureTypeIds();\r\n }\r\n\r\n fetchMaterialAndCustomSurveys(materialId: number) {\r\n this._edm.entities = null;\r\n\r\n this._isLoading = true;\r\n this._uow.materialRepository.withId(materialId).then(m => {\r\n if (m) {\r\n this._selectedMaterial = m;\r\n this.fetchMeasures();\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n fetchMeasures() {\r\n\r\n if (this._selectedMaterial == null) { return; }\r\n\r\n const params = { materialId: this._selectedMaterial.materialId };\r\n\r\n this._isLoading = true;\r\n this._uow.fetch('ExposureSurveys/MaterialExposureCustomSurveyMeasuresByMaterialId', params).then(m => {\r\n this._edm.entities = m;\r\n this._edm.updatePageState();\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._materialExposureCustomSurveyMeasuresEx = [];\r\n if (this._edm.entities == null || this._edm.entities.length < 1) { return; }\r\n\r\n _.clone(this._edm.entities).forEach(element => {\r\n this._materialExposureCustomSurveyMeasuresEx.push(new SelectableEntity(element, '#FFFFFF', '', false));\r\n });\r\n }\r\n\r\n // Only show the message if there is a material selected and queried.\r\n hasNoCustomMeassureData(): boolean {\r\n if (this._selectedMaterial == null) {\r\n return false;\r\n }\r\n\r\n if (this._isLoading) {\r\n return false;\r\n }\r\n\r\n return (this._materialExposureCustomSurveyMeasuresEx == null || this._materialExposureCustomSurveyMeasuresEx.length < 1);\r\n }\r\n\r\n get isLoading() {\r\n return this._isLoading;\r\n }\r\n\r\n set isLoading(value) {\r\n this._isLoading = value;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n canAdd() {\r\n return (this._selectedMaterial != null && !this._edm.editing);\r\n }\r\n\r\n // edit manager overrides\r\n canApply() {\r\n if (this._edm.editing) {\r\n return (this._uow.hasChanges() && !this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n canSave() {\r\n if (this._edm.editing) { return false; }\r\n if (!this._edm.hasEdits()) { return false; }\r\n if (!this._edm.validateBeforeSave()) { return false; }\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) { return false; }\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n onAdd() {\r\n if (this._edm.entities == null) {\r\n this._edm.entities = [];\r\n }\r\n\r\n this._adding = true;\r\n const m = this._uow.materialExposureCustomSurveyMeasureFactory.create();\r\n\r\n m.customSurveyDate = null;\r\n m.materialId = this._selectedMaterial.materialId;\r\n m.typeExposureMeasureId = this._typeExposureMeasureId;\r\n m.typeExposureMeasureValueId = this._typeExposureMeasureValueId;\r\n m.typeCremeVersionId \t\t\t= this._typeCremeVersionId;\r\n m.created = new Date(); // the date is displayed in the table after apply so a valid date is needed here.\r\n\r\n this._edm.entities.push(m);\r\n this._edm.onSelect(m);\r\n }\r\n\r\n onApply() {\r\n\r\n this._validationMessage = '';\r\n\r\n if (this._edm.currentEntity.customSurveyDate == null) {\r\n this._validationMessage = 'Please enter a valid Custom Survey Date.';\r\n return;\r\n\r\n const date = new Date(this._edm.currentEntity.customSurveyDate);\r\n\r\n if (isNaN(date.getTime())) {\r\n this._validationMessage = 'Please enter a valid Custom Survey Date.';\r\n return;\r\n }\r\n }\r\n\r\n if (this._edm.currentEntity.typeExposureMeasure == null) {\r\n this._validationMessage = 'Please select a Measure type other than None.';\r\n return;\r\n }\r\n\r\n if (this._edm.currentEntity.typeExposureMeasure.measureDescription.toLowerCase() == 'none') {\r\n this._validationMessage = 'Please select a Measure type other than None.';\r\n return;\r\n }\r\n\r\n if (this._edm.currentEntity.measureQualitativeResult == null && this._edm.currentEntity.measureQuantitativeResult == null) {\r\n this._validationMessage = 'Please enter a measure value.';\r\n return;\r\n }\r\n\r\n if (this._edm.currentEntity.typeCremeVersion.cremeVersion.toLowerCase() == 'none') {\r\n this._validationMessage = 'Please select a Creme Version other than None.';\r\n return;\r\n }\r\n\r\n this._edm.onApplyCore();\r\n this._adding = false;\r\n\r\n this.formatSelectableEntities();\r\n\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edm.editing = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._adding = false;\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n\r\n this._materialExposureCustomSurveyMeasuresEx = [];\r\n\r\n this.fetchMeasures();\r\n }\r\n\r\n onEdit(mx: SelectableEntity) {\r\n\r\n if (mx == null) { return; }\r\n\r\n this._selectedMaterialExposureCustomSurveyMeasure = this.filterToMaterialExposureCustomSurveyMeasureById(mx.data.materialExposureCustomSurveyMeasureId);\r\n\r\n if (this._selectedMaterialExposureCustomSurveyMeasure == null) { return; }\r\n\r\n this._edm.onSelect(this._selectedMaterialExposureCustomSurveyMeasure);\r\n }\r\n\r\n onRemove(mx: SelectableEntity) {\r\n\r\n if (mx == null) { return; }\r\n this._selectedMaterialExposureCustomSurveyMeasure = this.filterToMaterialExposureCustomSurveyMeasureById(mx.data.materialExposureCustomSurveyMeasureId);\r\n\r\n if (this._selectedMaterialExposureCustomSurveyMeasure == null) {\r\n this._validationMessage = 'Error occurred, could not remove the selected measure from the list.';\r\n return;\r\n }\r\n\r\n if (this._selectedMaterialExposureCustomSurveyMeasure.entityAspect.entityState.isAdded()) {\r\n this._selectedMaterialExposureCustomSurveyMeasure.entityAspect.rejectChanges();\r\n } else {\r\n this._selectedMaterialExposureCustomSurveyMeasure.entityAspect.setDeleted();\r\n }\r\n\r\n _.remove(this._edm.entities, this._selectedMaterialExposureCustomSurveyMeasure);\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n onSave() {\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n\r\n this._adding = false;\r\n this._edm.editing = false;\r\n\r\n this.fetchMeasures();\r\n });\r\n }\r\n }\r\n\r\n onShowMaterial(mat: Material) {\r\n if (mat == null) { return; }\r\n\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, mat.materialId, ROUTES.Material.childRoutes.MaterialExposure));\r\n }\r\n\r\n // Filters\r\n filterToMaterialExposureCustomSurveyMeasureById(materialExposureCustomSurveyMeasureId: number): MaterialExposureCustomSurveyMeasure {\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return null;\r\n }\r\n\r\n const measure = this._edm.entities.filter(m => m.materialExposureCustomSurveyMeasureId == materialExposureCustomSurveyMeasureId);\r\n if (measure != null && measure.length > 0) {\r\n return measure[0];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n selectMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this).then(mli => {\r\n if (mli == null) { return; }\r\n return this._uow.materialRepository.withId(mli.materialId);\r\n }).then(m => {\r\n if (m) {\r\n this._selectedMaterial = m;\r\n this._data.materialId = m.materialId;\r\n\r\n this.fetchMeasures();\r\n }\r\n });\r\n }\r\n\r\n getDefaultMeasureTypeIds() {\r\n this._uow.typeExposureMeasureRepository.all().then(m => {\r\n if (m != null && m.length > 0) {\r\n const types = m.filter(t => t.measureName.toLowerCase() == 'none');\r\n if (types != null && types.length > 0) {\r\n this._typeExposureMeasureId = types[0].typeExposureMeasureId;\r\n this._typeExposureMeasureValueId = types[0].typeExposureMeasureValueId;\r\n }\r\n }\r\n });\r\n\r\n this._uow.typeCremeVersionRepository.all().then(c => {\r\n if (c != null && c.length > 0) {\r\n const types = c.filter(t => t.cremeVersion.toLowerCase() == 'none');\r\n if (types != null && types.length > 0) {\r\n this._typeCremeVersionId = types[0].typeCremeVersionId;\r\n }\r\n }\r\n });\r\n }\r\n}\r\n","
\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n Select a Material Surveyed as an Isomer: \r\n\r\n \r\n
\r\n\r\n
\r\n
\r\n Selected Isomer CAS No.:\r\n {{_selectedIsomerMaterial.realCASNumber}}\r\n\r\n RIFM ID:\r\n {{_selectedIsomerMaterial.formattedRIFMId}}\r\n\r\n Principal Synonym:\r\n {{_selectedIsomerMaterial.principalSynonym().synonymWordOrWebVersion()}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
0\" class=\"inline\">\r\n Available Exposure Surveys for Isomer: \r\n \r\n
\r\n
\r\n\r\n
\r\n
0\" class=\"inline\">\r\n Primary Survey Material: \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n

There is no Measure data for this material/isomer for the selected survey.

\r\n 0\" class=\"inline\">\r\n Exposure Survey Measure Data\r\n \r\n Indicates multiple runs of the same measure within an Exposure Survey.\r\n \r\n 0\">\r\n \r\n \r\n Multiple Runs\r\n Measure\r\n Value\r\n Date Entered\r\n Notes\r\n Creme Version\r\n \r\n \r\n \r\n \r\n \r\n {{mx.data.typeExposureMeasure.measureDescription}}\r\n {{mx.data.measureQualitativeResult || mx.data.measureQuantitativeResult}}\r\n {{utilFns.formatDate(mx.data.created)}}\r\n {{mx.data.measureNotes}}\r\n {{mx.data.typeCremeVersion.cremeVersion}}\r\n \r\n \r\n \r\n
\r\n
\r\n","import { Location } from '@angular/common';\r\nimport { Component, ViewChild, Inject, OnInit } from '@angular/core';\r\n\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\n\r\nimport { UnitOfWork, StateMap, ErrorLogger, provideParent, UserManager } from '../../services/common';\r\nimport { EditManager, IEditHost, UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { Material, ExposureSurvey, MaterialExposureSurvey, MaterialExposureSurveyMeasure, MaterialExposureSurveyIsomer } from '../../entities/EntityModels';\r\n\r\nimport { RecordExposureSurveyMeasuresComponent, MeasureEditData } from './record-exposure-survey-measures.component';\r\n\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\nimport { SelectionItem } from '../../entities/projections/SelectionItem';\r\n\r\nimport { ROUTES } from '../routes';\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'material-exposure-survey-isomer-measures',\r\n templateUrl: './material-exposure-survey-isomer-measures.html',\r\n})\r\nexport class MaterialExposureSurveyIsomerMeasuresComponent implements OnInit {\r\n\r\n public _isLoading = false;\r\n public _validationMessage: string;\r\n\r\n public _selectedExposureSurveyIndex = -1;\r\n public _selectedExposureSurvey: SelectionItem;\r\n public _uniqueExposureSurveys: SelectionItem[] = [];\r\n\r\n public _materialExposureSurveyIsomers: MaterialExposureSurveyIsomer[] = [];\r\n\r\n public _selectedIsomerMaterial: Material;\r\n public _selectedIsomerMaterialIndex = -1;\r\n public _uniqueIsomerMaterials: SelectionItem[] = [];\r\n\r\n public _selectedMaterialExposureSurveyIndex = -1;\r\n public _selectedMaterialExposureSurvey: MaterialExposureSurvey;\r\n public _materialExposureSurveys: MaterialExposureSurvey[] = [];\r\n\r\n public _materialExposureSurveyMeasures: MaterialExposureSurveyMeasure[] = [];\r\n public _materialExposureSurveyMeasuresEx: SelectableEntity[] = [];\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router,\r\n public _route: ActivatedRoute, public _location: Location, public _errorLogger: ErrorLogger) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this.fetchIsomers();\r\n }\r\n\r\n private clearFilteredData() {\r\n this._selectedIsomerMaterial = null;\r\n this._selectedIsomerMaterialIndex = -1;\r\n\r\n this._selectedExposureSurveyIndex = -1;\r\n this._selectedExposureSurvey = null;\r\n this._uniqueExposureSurveys = [];\r\n\r\n this._selectedMaterialExposureSurvey = null;\r\n this._materialExposureSurveys = [];\r\n\r\n this._materialExposureSurveyMeasures = [];\r\n\r\n }\r\n fetchIsomers() {\r\n this.clearFilteredData();\r\n\r\n this._materialExposureSurveyIsomers = [];\r\n this._uniqueIsomerMaterials = [];\r\n\r\n this._isLoading = true;\r\n\r\n this._uow.fetch('ExposureSurveys/MaterialExposureSurveyIsomers', {}).then(isomers => {\r\n if (isomers != null && isomers.length > 0) {\r\n this._materialExposureSurveyIsomers = isomers;\r\n\r\n this._materialExposureSurveyIsomers.map(i => {\r\n if (this._uniqueIsomerMaterials.findIndex(u => u.id == i.materialId) < 0) {\r\n const casandrifmid = MaterialExposureSurveyIsomerMeasuresComponent.formatIsomerIdentifiers(i.material);\r\n const syn = i.material.principalSynonym().synonymWordOrWebVersion();\r\n this._uniqueIsomerMaterials.push({ id: i.materialId, textId: casandrifmid, description: syn, selected: false });\r\n }\r\n });\r\n }\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n static formatIsomerIdentifiers(material: Material) {\r\n const rifmId = (material.formattedRIFMId == '-') ? '' : ' (RIFM Id: ' + material.formattedRIFMId + ')';\r\n return material.realCASNumber + rifmId;\r\n }\r\n\r\n fetchMeasures() {\r\n\r\n if (this._selectedMaterialExposureSurvey == null) { return; }\r\n\r\n this._isLoading = true;\r\n\r\n const params = { materialId: this._selectedMaterialExposureSurvey.materialId, exposureSurveyId: this._selectedMaterialExposureSurvey.exposureSurveyId };\r\n this._uow.fetch('ExposureSurveys/FetchExposureSurveyMaterialMeasures', params).then(m => {\r\n this._materialExposureSurveyMeasures = m;\r\n this.formatSelectableEntities();\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._materialExposureSurveyMeasuresEx = [];\r\n if (this._materialExposureSurveyMeasures == null || this._materialExposureSurveyMeasures.length < 1) { return; }\r\n\r\n _.clone(this._materialExposureSurveyMeasures).forEach(element => {\r\n const isMultiple = this.isDuplicateMeasureEntry(element.materialId, element.typeExposureMeasureId);\r\n this._materialExposureSurveyMeasuresEx.push(new SelectableEntity(element, '#FFFFFF', '', isMultiple));\r\n });\r\n }\r\n\r\n isDuplicateMeasureEntry(materialId: number, typeExposureMeasureId: number): boolean {\r\n if (this._materialExposureSurveyMeasures == null) { return false; }\r\n\r\n const measure = this._materialExposureSurveyMeasures.filter(m => m.materialId == materialId && m.typeExposureMeasureId == typeExposureMeasureId);\r\n return measure != null && measure.length > 1;\r\n }\r\n\r\n get isLoading() {\r\n return this._isLoading;\r\n }\r\n\r\n set isLoading(value) {\r\n this._isLoading = value;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n canDeactivate() {\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n canShowBack() {\r\n return !this._uow.hasChanges();\r\n }\r\n\r\n // Filters\r\n filterIsomerMaterialByIndex(ix: number) {\r\n\r\n this.clearFilteredData();\r\n\r\n const surveyIsomers = this._materialExposureSurveyIsomers.filter(i => i.materialId == this._uniqueIsomerMaterials[ix].id);\r\n\r\n if (surveyIsomers == null || surveyIsomers.length < 1) { return; }\r\n\r\n this._selectedIsomerMaterial = surveyIsomers[0].material;\r\n\r\n const surveys = surveyIsomers.map(i => i.materialExposureSurvey.exposureSurvey);\r\n surveys.forEach(s => {\r\n if (this._uniqueExposureSurveys.findIndex(u => u.id == s.exposureSurveyId) < 0) {\r\n this._uniqueExposureSurveys.push({id: s.exposureSurveyId, textId: s.exposureSurveyMonthYearNumber, description: '', selected: false});\r\n }\r\n });\r\n this.filterExposureSurveyByIndex(0);\r\n }\r\n\r\n public filterExposureSurveyByIndex(ix: number) {\r\n if (this._materialExposureSurveyIsomers == null) { return; }\r\n\r\n this._selectedExposureSurveyIndex = ix;\r\n this._selectedExposureSurvey = this._uniqueExposureSurveys[ix];\r\n\r\n // A few isomers were surveyed for more than one material within a given survey.\r\n // This is why there is a selection list of survey primary materials.\r\n // tslint:disable-next-line:max-line-length\r\n const matsurveys = this._materialExposureSurveyIsomers.filter(m => m.materialId == this._selectedIsomerMaterial.materialId && m.materialExposureSurvey.exposureSurveyId == this._selectedExposureSurvey.id);\r\n\r\n this._materialExposureSurveys = [];\r\n this._materialExposureSurveyMeasures = [];\r\n _.clone(matsurveys).forEach(m => {\r\n this._materialExposureSurveys.push(m.materialExposureSurvey);\r\n }\r\n );\r\n this.filterMaterialExposureSurveyByIndex(0);\r\n return true;\r\n }\r\n\r\n filterMaterialExposureSurveyByIndex(ix: number) {\r\n this._selectedMaterialExposureSurveyIndex = ix;\r\n this._selectedMaterialExposureSurvey = this._materialExposureSurveys[ix];\r\n this.fetchMeasures();\r\n }\r\n\r\n onShowMaterial(mat: Material) {\r\n if (mat == null) { return; }\r\n\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, mat.materialId, ROUTES.Material.childRoutes.MaterialExposure));\r\n }\r\n}\r\n","
\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n\r\n
","import { Component, Input, OnInit } from '@angular/core';\r\nimport { ValidationError } from 'breeze-client';\r\nimport * as _ from 'lodash';\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { RegulatoryStatus, TypeRegulatoryStatus } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'regulatory-status',\r\n templateUrl: './regulatory-status.html',\r\n providers: [provideParent(RegulatoryStatusComponent, EditPropParent)]\r\n})\r\nexport class RegulatoryStatusComponent implements OnInit, EditPropParent {\r\n @Input() entity: RegulatoryStatus;\r\n @Input() statusType: string;\r\n _typeRegulatoryStatuses: TypeRegulatoryStatus[];\r\n _valError: ValidationError;\r\n\r\n constructor(public uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n const agencies = RegulatoryStatus.getEvaluatingAgenciesFor(this.statusType);\r\n this.uow.typeRegulatoryStatusRepository.all()\r\n .then(r => {\r\n this._typeRegulatoryStatuses = r.filter(trs => {\r\n return _.includes(agencies, trs.evaluatingAgencyId);\r\n });\r\n });\r\n }\r\n\r\n getError(propName: string) {\r\n const err = this.entity.getErrorFor(propName);\r\n if (err) {\r\n return err;\r\n }\r\n if (propName == 'webReference' || propName == 'linkDisplay') {\r\n return this.validate();\r\n }\r\n return null;\r\n }\r\n\r\n validate() {\r\n const wr = (this.entity.webReference || '').trim();\r\n const ld = (this.entity.linkDisplay || '').trim();\r\n let errText: string;\r\n if (wr.length > 0 && ld.length == 0) {\r\n errText = 'A \"Link display\" must be set if a \"Web Reference\" is specified';\r\n } else if (wr.length == 0 && ld.length > 0) {\r\n errText = 'A \"Web Reference\" must be set if a \"Link display\" is specified';\r\n }\r\n\r\n if (this._valError) {\r\n this.entity.entityAspect.removeValidationError(this._valError);\r\n }\r\n if (errText) {\r\n this._valError = new ValidationError(null, null, errText, 'web-link');\r\n this.entity.entityAspect.addValidationError(this._valError);\r\n }\r\n return errText;\r\n }\r\n\r\n}\r\n","
\r\n\r\n\r\n\r\n\r\n

{{_validationMessage}}

\r\n\r\n
0)\" [attr.data-hidden]=\"_edm.editing\" style=\"width: 40%\">\r\n\t

Registered Flavors

\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\t{{ cell.data.evaluatingAgency() }}\r\n\t\t
\r\n\r\n\t\t\r\n\t
\r\n
\r\n\r\n
0)\" [attr.data-hidden]=\"_edm.editing\">\r\n\t

Regulatory Status

\r\n\r\n\t>\r\n\t\t\r\n\t\t\r\n\t\t\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\t{{ cell.data.evaluatingAgency() }}\r\n\t\t
\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\t{{ cell.data.agencyTitle() }}\r\n\t\t
\r\n\r\n\t\t\r\n\t\t\r\n\t\t
\r\n\t\t\t{{ cell.data.prefixedDetermination() }}\r\n\t\t
\r\n\r\n\t\t\r\n\t\t\r\n\r\n\r\n\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
\r\n\r\n
\r\n\t\r\n
\r\n","import { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport { EditorService, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { EditManager, LocationFns, UtilFns } from '../../utils/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { RegulatoryStatusComponent } from './regulatory-status.component';\r\nimport { FoodStatus, RegulatoryStatus } from '../../entities/EntityModels';\r\n\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\n\r\n@Component({\r\n selector: 'flavor-statuses',\r\n templateUrl: './flavor-statuses.html',\r\n})\r\nexport class FlavorStatusesComponent implements OnInit {\r\n @ViewChild(RegulatoryStatusComponent) editingComponent: RegulatoryStatusComponent;\r\n\r\n @Input() materialId: number;\r\n\r\n\r\n _registeredFlavors: FoodStatus[] = []; // unique subset of FoodStatues\r\n _foodStatuses: FoodStatus[]; // all food statuses\r\n _flavorStatuses: (FoodStatus | RegulatoryStatus)[] = []; // combo used for display.\r\n _edm: EditManager;\r\n _documentManagementUrl: string;\r\n _isLoading = false;\r\n _validationMessage: string;\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap,\r\n public _editorService: EditorService, public _location: Location, private _httpClient: HttpClient) {\r\n }\r\n\r\n ngOnInit() {\r\n LocationFns.setTab(this._location, 0);\r\n\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Flavor.name;\r\n this._edm = this._editorService.createEditManager(this, 'Flavor Status');\r\n const material = this._stateMap.currentMaterial;\r\n const p = {materialId: this.materialId};\r\n this._edm.pageState.isLoading = true;\r\n\r\n this._uow.foodStatusRepository.whereWithParams(p).then(r => {\r\n this._registeredFlavors = r.filter(fs => fs.regulatoryTypeForCompare().toLowerCase() == 'identifier' && (fs.foodAgencyId == 'Flavis' || fs.foodAgencyId == 'JECFA'));\r\n // JECFA can be applied for non-identifing regulatory status\r\n this._foodStatuses = r.filter(fs => fs.regulatoryTypeForCompare().toLowerCase() != 'identifier' && fs.foodAgencyId != 'Flavis');\r\n this._flavorStatuses = this._flavorStatuses.concat(this._foodStatuses);\r\n this._flavorStatuses = _.sortBy(this._flavorStatuses, fs => fs.evaluatingAgency());\r\n this._edm.pageState.isLoaded = r;\r\n });\r\n\r\n const p2 = {materialId: this.materialId, statusType: 'flavor'};\r\n this._uow.regulatoryStatusRepository.whereWithParams(p2).then(r => {\r\n this._edm.entities = r;\r\n this._flavorStatuses = this._flavorStatuses.concat(r);\r\n this._flavorStatuses = _.sortBy(this._flavorStatuses, fs => fs.evaluatingAgency());\r\n });\r\n\r\n // needed for file downloads\r\n this._documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/RIFMDownloadableFile';\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n onSelect(e: FoodStatus | RegulatoryStatus) {\r\n if (this.isRegulatoryStatus(e)) {\r\n this._edm.onSelect(e);\r\n }\r\n }\r\n\r\n selectWebRef(e: FoodStatus | RegulatoryStatus) {\r\n\r\n const filePath = e.webReferenceExt();\r\n\r\n if (!this.isValidString(filePath)) {\r\n return false;\r\n }\r\n\r\n if (filePath.indexOf('http') == 0) {\r\n const url = filePath;\r\n if (url) {\r\n window.open(url, '_blank');\r\n return false;\r\n }\r\n }\r\n\r\n const [fileName, subFolder] = this.parseFilePath(filePath);\r\n\r\n this.downloadFoodStatusFile(fileName, subFolder);\r\n }\r\n\r\n isRegulatoryStatus(fs: RegulatoryStatus | FoodStatus) {\r\n return UtilFns.getClassName(fs) == 'RegulatoryStatus';\r\n }\r\n\r\n // EditManager overrides\r\n\r\n onAdd() {\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n const rs = this._uow.regulatoryStatusFactory.create();\r\n rs.materialId = this.materialId;\r\n this._flavorStatuses.push(rs);\r\n this._edm.entities.push(rs);\r\n this.onSelect(rs);\r\n }\r\n\r\n onDelete() {\r\n const e = this._edm.currentEntity;\r\n this._edm.onDeleteCore();\r\n _.remove(this._flavorStatuses, e);\r\n this._edm.pageState.isLoaded = this._flavorStatuses;\r\n }\r\n\r\n onApply() {\r\n this._edm.onApplyCore();\r\n this._edm.pageState.isLoaded = this._flavorStatuses;\r\n }\r\n\r\n onCancel() {\r\n this._edm.onCancelCore();\r\n _.remove(this._flavorStatuses, fs => fs.entityAspect.entityState.isDetached());\r\n this._edm.pageState.isLoaded = this._flavorStatuses;\r\n }\r\n\r\n\r\n onSelectRegulatoryStatus(evt: any) {\r\n this.onSelect(evt.selectedRowsData[0]);\r\n return false;\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n // ***********************************************\r\n // *document downloads\r\n // ***********************************************\r\n public parseFilePath(filepath: string) {\r\n if (!this.isValidString(filepath)) { return ['', '']; }\r\n\r\n // replace forward slashes with backslashes\r\n const newpath = filepath.split('/').join('\\\\');\r\n\r\n const tempSubFolder = newpath.substring(0, newpath.lastIndexOf('\\\\'));\r\n const fileName = newpath.substring(newpath.lastIndexOf('\\\\') + 1);\r\n\r\n // Remove any backslashes at the beginning of the subfolder(s)\r\n const subFolder = tempSubFolder.replace(/^\\\\+/, '');\r\n\r\n console.log('parsed filepath: ' + subFolder + ', ' + fileName);\r\n return [fileName, subFolder];\r\n }\r\n\r\n public getDocumentManagementUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n getDownloadFileURL(fileName: string, subFolder: string): Observable {\r\n let url: string;\r\n url = this._documentManagementUrl + '/GetFileBySubFolderAndName?fileName=' + fileName + '&subFolder=' + subFolder ;\r\n\r\n return this._httpClient.get(url, { responseType: 'blob' as 'json'});\r\n }\r\n\r\n public downloadFoodStatusFile(fileName: string, subFolder: string) {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getDownloadFileURL(fileName, subFolder)\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], { type: 'application/pdf' });\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = fileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = 'File download successful.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n}\r\n","
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { MaterialUses, TypeFoodCategory } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'flavor-uses-item',\r\n templateUrl: './flavor-uses-item.html',\r\n providers: [provideParent(FlavorUsesItemComponent, EditPropParent)]\r\n})\r\nexport class FlavorUsesItemComponent implements OnInit, EditPropParent {\r\n @Input() entity: MaterialUses;\r\n _typeFoodCategories: TypeFoodCategory[];\r\n\r\n constructor(public uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this.uow.typeFoodCategoryRepository.all().then(r => {\r\n this._typeFoodCategories = r;\r\n\r\n });\r\n }\r\n\r\n hasChanges() {\r\n return (!this.entity.entityAspect.entityState.isUnchanged());\r\n }\r\n\r\n getError(propName: string) {\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n apply() {\r\n }\r\n}\r\n","
\r\n\r\n\r\n
\r\n\t

PADI (Possible Average Daily Intake): {{ _stateMap.utilFns.formatNumber(_PADI) }} mg/person/day

\r\n\r\n\t
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t
\r\n
\r\n\r\n
\r\n\t\r\n
\r\n","import { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, IEditHost, LocationFns, UtilFns } from '../../utils/common';\r\nimport { ColumnSorter, PageState, SortColumn } from '../../controls/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { FlavorUsesItemComponent } from './flavor-uses-item.component';\r\nimport { MaterialUses } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'flavor-uses',\r\n templateUrl: './flavor-uses.html',\r\n})\r\nexport class FlavorUsesComponent implements IEditHost, OnInit {\r\n @Input() materialId: number;\r\n @ViewChild(FlavorUsesItemComponent) _editingComponent: FlavorUsesItemComponent;\r\n\r\n _PADI: number;\r\n _edm: EditManager;\r\n _pageState = new PageState('Flavor Uses');\r\n _colSorter: ColumnSorter;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n LocationFns.setTab(this._location, 1);\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Flavor.name;\r\n const material = this._stateMap.currentMaterial;\r\n\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Material Uses');\r\n\r\n this._colSorter = new ColumnSorter(this, {\r\n 'Average Usual (ppm)': (mu: MaterialUses) => this.format(mu.averageUsual),\r\n 'Average Maximum (ppm)': (mu: MaterialUses) => this.format(mu.averageMaximum),\r\n 'Mean Daily Consumption (gms)': (mu: MaterialUses) => mu.typeFoodCategory ? this.format(mu.typeFoodCategory.meanDailyConsumption) : '',\r\n 'Food Description': (mu: MaterialUses) => mu.typeFoodCategory && mu.typeFoodCategory.foodDescription\r\n },\r\n new SortColumn('Food Description', true),\r\n (sortColumn) => this._pageState.sortColumn = sortColumn);\r\n\r\n // setTimeout needed because of Angular RC5 bug where Location is not set correctly until\r\n // after timeout resolves.\r\n setTimeout(() => {\r\n const isReturning = LocationFns.updatePageState(this._location, this._stateMap, this._pageState, (state: PageState) => {\r\n this._colSorter.sortColumn = state.sortColumn;\r\n });\r\n this.search(isReturning);\r\n }, 0);\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n search(isReturning: boolean) {\r\n this._edm.pageState.isLoading = true;\r\n const p = {materialId: this.materialId};\r\n this._uow.materialUsesRepository.whereWithParams(p).then(r => {\r\n // this._edm.entities = _.sortBy(r, r => r.typeFoodCategory.foodDescription);\r\n this._edm.entities = r;\r\n this._edm.pageState.isLoaded = r;\r\n this.calcPADI();\r\n this._colSorter.sort(this._edm.entities);\r\n });\r\n }\r\n\r\n onSelectionChanged(evt: any) {\r\n this._edm.onSelect(evt.selectedRowsData[0]);\r\n }\r\n\r\n format(val: number) {\r\n if (!val) {\r\n return '';\r\n }\r\n return UtilFns.formatNumber(val, 10);\r\n }\r\n\r\n sortWith(colSorter: ColumnSorter) {\r\n colSorter.sort(this._edm.entities);\r\n }\r\n\r\n calcPADI() {\r\n if (this._edm.hasEntities()) {\r\n this._PADI = this._edm.entities.map(e => (e.averageUsual * e.typeFoodCategory.meanDailyConsumption) / 1000).reduce((a, b) => a + b);\r\n }\r\n }\r\n\r\n // EditManager overrides\r\n\r\n onAdd() {\r\n // don't allow add unless current synonym is valid.\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n\r\n const rs = this._uow.materialUsesFactory.create();\r\n rs.materialId = this.materialId;\r\n rs.typeFoodCategoryId = null; // otherwise will default to 0 - which will not cause validation error.\r\n this._edm.entities.push(rs);\r\n this._edm.onSelect(rs);\r\n }\r\n\r\n onDelete() {\r\n this._edm.onDeleteCore();\r\n this.calcPADI();\r\n }\r\n\r\n onApply() {\r\n if (!this._edm.onApplyCore()) {\r\n return false;\r\n }\r\n this.calcPADI();\r\n return true;\r\n }\r\n\r\n onCancel() {\r\n this._edm.onCancelCore();\r\n this.calcPADI();\r\n }\r\n\r\n\r\n}\r\n","
\r\n
\r\n \r\n
\r\n\r\n 0)\">\r\n \r\n \r\n \r\n Kilograms consumed \r\n Area \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{group.name}}\r\n \r\n \r\n \r\n {{ent.kilogramsConsumed}}\r\n {{ent.survey?.typeGeographicalArea?.geographicalArea}}\r\n \r\n \r\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { LocationFns, UtilFns } from '../../utils/common';\r\nimport { ColumnSorter, PageState } from '../../controls/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { MaterialConsumption } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'flavor-volumes',\r\n templateUrl: './flavor-volumes.html',\r\n})\r\nexport class FlavorVolumesComponent implements OnInit {\r\n @Input() materialId: number;\r\n\r\n _entities: MaterialConsumption[];\r\n _groups: { name: string, entities: MaterialConsumption[], collapsed?: boolean }[] = [];\r\n _pageState = new PageState('Flavor volumes');\r\n _colSorter: ColumnSorter;\r\n _editing = false;\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap,\r\n public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n LocationFns.setTab(this._location, 2);\r\n\r\n this._colSorter = new ColumnSorter(this, {\r\n 'Kilograms consumed': (e: MaterialConsumption) => UtilFns.formatNumber(e.kilogramsConsumed, 8),\r\n 'Area': (e: MaterialConsumption) => this.getGeoArea(e)\r\n }, 'Kilograms consumed', (sortColumn) => this._pageState.sortColumn = sortColumn);\r\n\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Flavor.name;\r\n\r\n const p = {materialId: this.materialId, materialType: 'flavor'};\r\n this._pageState.isLoading = true;\r\n this._uow.materialConsumptionRepository.whereWithParams(p).then(r => {\r\n this._entities = _.sortBy(r, e => e.surveyYear);\r\n const groups = _.groupBy(this._entities, (e) => e.surveyYear);\r\n this._groups = _.map(groups, (v, k) => {\r\n return {name: k, entities: v, isCollapsed: false};\r\n });\r\n\r\n this._pageState.isLoaded = r;\r\n });\r\n }\r\n\r\n collapseGroup(ix: number) {\r\n this._groups[ix].collapsed = !this._groups[ix].collapsed;\r\n }\r\n\r\n getGeoArea(mc: MaterialConsumption) {\r\n const survey = mc.survey;\r\n if (!survey) {\r\n return '';\r\n }\r\n const t1 = survey.typeGeographicalArea;\r\n if (!t1) {\r\n return '';\r\n }\r\n return t1.geographicalArea;\r\n }\r\n\r\n sortWith(colSorter: ColumnSorter) {\r\n this._groups.forEach(g => {\r\n colSorter.sort(g.entities);\r\n });\r\n }\r\n\r\n\r\n}\r\n","
\r\n
\r\n \r\n
\r\n\r\n 0)\">\r\n

Kgs/Year

\r\n \r\n \r\n Year\r\n China\r\n Japan\r\n Asia Pacific\r\n Europe\r\n North America\r\n South America\r\n Other\r\n Total\r\n\r\n \r\n \r\n \r\n \r\n {{ent.year}}\r\n \r\n \r\n {{ _stateMap.utilFns.formatNumber(ent['China'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(ent['Japan'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(ent['Asia-Pacific'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(ent['Europe'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(ent['North America'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(ent['South America'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(ent['Other'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(ent.total, 9, 3) }}\r\n \r\n \r\n Totals\r\n {{ _stateMap.utilFns.formatNumber(_totals['China'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(_totals['Japan'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(_totals['Asia-Pacific'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(_totals['Europe'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(_totals['North America'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(_totals['South America'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(_totals['Other'], 9, 3) }}\r\n {{ _stateMap.utilFns.formatNumber(_totals.total, 9 , 3) }}\r\n \r\n \r\n\r\n
Trace amounts (< 1 mg) are recorded as 0.001 kgs.
\r\n
\r\n
","import { Component, Input, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { LocationFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { MaterialConsumption } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'fragrance',\r\n templateUrl: './fragrance.html',\r\n})\r\nexport class FragranceComponent implements OnInit {\r\n @Input() materialId: number;\r\n\r\n // _entities: MaterialConsumption[];\r\n _pageState = new PageState('Fragrance Use');\r\n _crossTab: {}[];\r\n _totals: {} = {};\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap,\r\n public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n LocationFns.setTab(this._location, 0);\r\n\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.FragranceUse.name;\r\n\r\n const p = {materialId: this.materialId, materialType: 'fragrance'};\r\n this._pageState.isLoading = true;\r\n this._uow.materialConsumptionRepository.whereWithParams(p).then(r => {\r\n this._crossTab = this.crossTabulate(r);\r\n this._pageState.isLoaded = this._crossTab;\r\n });\r\n }\r\n\r\n onSelect(crossTabRow: {}) {\r\n }\r\n\r\n crossTabulate(mcs: MaterialConsumption[]) {\r\n mcs = _.sortBy(mcs, ['surveyYear']);\r\n // because of 'bad' data in the db.\r\n const areaMap: { [area: string]: string; } = {\r\n 'China': 'China',\r\n 'Japan': 'Japan',\r\n 'Asia-Pacific': 'Asia-Pacific',\r\n 'Europe': 'Europe',\r\n 'EEC': 'Europe',\r\n 'North America': 'North America',\r\n 'USA': 'North America',\r\n 'South America': 'South America',\r\n 'SOUTHAMERICA': 'South America'\r\n };\r\n const r: {} [] = [];\r\n let currentRow = {};\r\n let currentYear = '';\r\n mcs.forEach(mc => {\r\n const year = mc.surveyYear;\r\n if (year != currentYear) {\r\n currentYear = year;\r\n currentRow = {year: year};\r\n r.push(currentRow);\r\n }\r\n const area = areaMap[mc.geographicalArea] || 'Other';\r\n currentRow[area] = (currentRow[area] || 0) + mc.kilogramsConsumed;\r\n currentRow['total'] = (currentRow['total'] || 0) + mc.kilogramsConsumed;\r\n this._totals[area] = (this._totals[area] || 0) + mc.kilogramsConsumed;\r\n this._totals['total'] = (this._totals['total'] || 0) + mc.kilogramsConsumed;\r\n });\r\n return r;\r\n }\r\n}\r\n","\r\n\r\n
\r\n
\r\n \r\n
    \r\n
  • \r\n {{_studiesText}}   \r\n Group By\r\n \r\n
  • \r\n
  • \r\n Filter By\r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n
  • \r\n \r\n
  • \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
M=Member Company Report, R=RIFM Sponsored Report
\r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n
StudyRouteSpeciesReference No.M R Sub-Reference FFIDSBrief Reference Date Sponsor Contains MixtureCAS No.
\r\n \r\n \r\n \r\n \r\n \r\n \r\n {{getGroupDescription(group)}}\r\n
\r\n {{expMat?.studyLong()}}\r\n \r\n
       {{stDescr}}\r\n
\r\n
{{expMat?.referenceId()}}{{expMat?.M()}}{{expMat?.R()}}{{expMat?.subReference}}{{expMat?.fFDS()}}{{ expMat?.briefRef(isStaff()) }}{{expMat?.modifiedOn()}}{{expMat?.sponsoringCompany()}}{{expMat?.typeStudyMixtureId}}{{expMat?.material?.realCASNumber || '(No CAS#)'}}
\r\n \r\n
\r\n","import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\nimport * as pluralize from 'pluralize';\r\nimport * as _ from 'lodash';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { IBrowser, LocationFns, UtilFns } from '../../utils/common';\r\nimport { ColumnSorter, PageState } from '../../controls/common';\r\n\r\nimport { ExperimentalMaterial, TypeStudyMixture } from '../../entities/EntityModels';\r\nimport { ROUTES } from '../routes';\r\n\r\nclass PageStateExt extends PageState {\r\n groupBy: string;\r\n filter: string;\r\n}\r\n\r\ninterface ExpMatGroup {\r\n name: string;\r\n experimentalMaterials: ExperimentalMaterial[];\r\n collapsed?: boolean;\r\n count?: number;\r\n}\r\n\r\n// TODO: need to support 'sub'-sorting by columns 'FullReferenced\r\n@Component({\r\n selector: 'human-health',\r\n templateUrl: './human-health.html',\r\n})\r\nexport class HumanHealthComponent implements OnInit {\r\n\r\n @Input() materialIds: number[];\r\n @Input() toxType: string; // either 'H' or 'E'\r\n @Input() tabPath: string;\r\n @Input() shouldFetchMaterials: boolean;\r\n\r\n _allExpMats: ExperimentalMaterial[];\r\n _allGroups: ExpMatGroup[] = [];\r\n _expMatGroups: ExpMatGroup[] = [];\r\n _typeStudyMixtures: TypeStudyMixture[];\r\n _studiesText = '';\r\n _groupByMap: {};\r\n _groupByKeys: string[];\r\n _filters: string[];\r\n _colSorter: ColumnSorter;\r\n _pageState: PageStateExt;\r\n\r\n _browser: IBrowser;\r\n _maxExpMats: number;\r\n\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location, public _router: Router,\r\n public _cd: ChangeDetectorRef) {\r\n this._browser = UtilFns.detectBrowser();\r\n if (this._browser.isEdge || this._browser.isChrome) {\r\n this._maxExpMats = 1500;\r\n } else if (this._browser.isFirefox) {\r\n this._maxExpMats = 1000;\r\n } else { // usually IE but we want to allow others as well.\r\n this._maxExpMats = 1000;\r\n }\r\n }\r\n\r\n ngOnInit() {\r\n // TODO: Hack... should pass page\r\n if (this.tabPath.indexOf('.') > 0) {\r\n this._pageState = new PageStateExt(this.isHumanHealth() ? 'Related Human Health' : 'Related Environment');\r\n } else {\r\n this._pageState = new PageStateExt(this.isHumanHealth() ? 'Human Health' : 'Environment');\r\n }\r\n\r\n this._uow.typeStudyMixtureRepository.all().then(r => {\r\n this._typeStudyMixtures = r;\r\n });\r\n\r\n\r\n this._colSorter = new ColumnSorter(this, {\r\n 'M': (em: ExperimentalMaterial) => em.M(),\r\n 'R': (em: ExperimentalMaterial) => em.R(),\r\n 'Sub-Reference': (em: ExperimentalMaterial) => em.subReference,\r\n 'Brief Reference': (em: ExperimentalMaterial) => em.briefReference(),\r\n 'Date': (em: ExperimentalMaterial) => em.modifiedAsISO(),\r\n 'Sponsor': (em: ExperimentalMaterial) => em.sponsoringCompany()\r\n }, '', (sortColumn) => this._pageState.sortColumn = sortColumn);\r\n\r\n this._groupByMap = {\r\n 'Study': 'studyLong',\r\n 'Route': 'routeLong',\r\n 'Species': 'speciesLong',\r\n // 'Reference': 'briefReference', // removed per #190\r\n 'Reference No.': 'referenceId',\r\n };\r\n this._groupByKeys = Object.keys(this._groupByMap);\r\n\r\n this._pageState.groupBy = 'Study';\r\n this._pageState.filter = 'None';\r\n\r\n // setTimeout needed because of Angular RC5 bug where Location is not set correctly until\r\n // after timeout resolves.\r\n setTimeout(() => {\r\n const returned = LocationFns.updatePageState(this._location, this._stateMap, this._pageState, (state: PageState) => {\r\n this._colSorter.sortColumn = state.sortColumn;\r\n this.fetchAndGroupBy().then(() => {\r\n this.filter();\r\n this.sortWith(this._colSorter);\r\n });\r\n });\r\n\r\n LocationFns.setTab(this._location, this.tabPath);\r\n\r\n if (!returned) {\r\n this.fetchAndGroupBy();\r\n }\r\n }, 0);\r\n }\r\n\r\n calculateM(data: any) {\r\n return data.M();\r\n }\r\n\r\n calculateR(data: any) {\r\n return data.R();\r\n }\r\n\r\n expandAll(expand: boolean) {\r\n this._pageState.isLoading = true;\r\n setTimeout(() => {\r\n this._allGroups.forEach(g => g.collapsed = !expand);\r\n this._pageState.isLoading = false;\r\n }, 0);\r\n }\r\n\r\n\r\n isHumanHealth() {\r\n return this.toxType != 'E';\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n navToRef(expMat: ExperimentalMaterial) {\r\n const parts = UtilFns.asRouterParts(ROUTES.Reference, expMat.referenceId());\r\n return this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, expMat.referenceId()));\r\n }\r\n\r\n navToRefData(expMat: ExperimentalMaterial) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, expMat.referenceId(),\r\n ROUTES.Reference.childRoutes.ReferenceData),\r\n { queryParams: { cas: expMat.material.realCASNumber, bioid: expMat.biologicalDataId } });\r\n // To use matrix params instead of queryParams ... ugh ... not yet documented in Angular2\r\n // this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, expMat.referenceId(),\r\n // ROUTES.Reference.childRoutes.ReferenceData, { cas: expMat.material.realCASNumber, bioid: expMat.biologicalDataId }),\r\n\r\n }\r\n\r\n\r\n sortWith(colSorter: ColumnSorter) {\r\n this._expMatGroups.forEach(emg => {\r\n colSorter.sort(emg.experimentalMaterials);\r\n });\r\n }\r\n\r\n isVeryLarge() {\r\n return this._allExpMats && this._allExpMats.length > this._maxExpMats;\r\n }\r\n\r\n expCollapse(ix: number) {\r\n this._expMatGroups[ix].collapsed = !this._expMatGroups[ix].collapsed;\r\n }\r\n\r\n getGroupDescription(group: ExpMatGroup) {\r\n const count = group.count || group.experimentalMaterials.length;\r\n return ` - ${count} ${pluralize('study', count)}`;\r\n }\r\n\r\n filterChange(event: any) {\r\n // on a filterChange we do NOT need to get a new list of filters.\r\n const ix = event.currentTarget.selectedIndex;\r\n this._pageState.filter = this._filters[ix];\r\n this.filter();\r\n }\r\n\r\n filter() {\r\n if (this._pageState.filter == 'None') {\r\n this._expMatGroups = this._allGroups;\r\n } else {\r\n this._expMatGroups = this._allGroups.filter(g => g.name == this._pageState.filter);\r\n this._expMatGroups.forEach(g => g.collapsed = false);\r\n }\r\n }\r\n\r\n set groupBy(value) {\r\n this._pageState.groupBy = value;\r\n this._pageState.filter = 'None';\r\n this._colSorter.reset();\r\n this.doGroupBy();\r\n }\r\n\r\n get groupBy() {\r\n return this._pageState.groupBy;\r\n }\r\n\r\n fetchAndGroupBy() {\r\n this._pageState.isLoading = true;\r\n return this.fetch().then(r => {\r\n this.doGroupBy();\r\n this._pageState.isLoaded = r;\r\n return r;\r\n });\r\n }\r\n\r\n doGroupBy() {\r\n const propFnName = this._groupByMap[this._pageState.groupBy];\r\n const groups = _.groupBy(this._allExpMats, (expMat) => expMat[propFnName]());\r\n\r\n const expMatGroups = _.map(groups, (v, k) => {\r\n return { name: k, experimentalMaterials: v, isCollapsed: false };\r\n });\r\n if (this._pageState.groupBy == 'Reference No.') {\r\n this._allGroups = _.sortBy(expMatGroups, (g) => parseInt(g.name));\r\n } else {\r\n this._allGroups = _.sortBy(expMatGroups, (g) => g.name);\r\n }\r\n\r\n if (this.isVeryLarge()) {\r\n this._allGroups.forEach(g => g.collapsed = true);\r\n }\r\n this._filters = this._allGroups.map(g => g.name);\r\n this._filters.unshift('None');\r\n this._expMatGroups = this._allGroups;\r\n\r\n }\r\n\r\n fetch(): Promise {\r\n const p = { materialIds: this.materialIds, biologicalDataType: this.isHumanHealth() ? 0 : 1 };\r\n this._pageState.isLoading = true;\r\n if (this.shouldFetchMaterials) {\r\n // this can be done in parallel with query down below and is not required to finish before 2nd query\r\n // results will be lazily bound when they complete.\r\n this._uow.fetch('Materials/MaterialsByIds', { materialIds: this.materialIds });\r\n }\r\n return this._uow.experimentalMaterialRepository.whereWithParams(p).then(r => {\r\n this._allExpMats = r;\r\n const sText = pluralize('study', this._allExpMats.length);\r\n const mText = pluralize('material', this.materialIds.length);\r\n this._studiesText = `${this._allExpMats.length} ${sText} on ${this.materialIds.length} ${mText}`;\r\n return r;\r\n });\r\n }\r\n\r\n selectCAS(expMat: ExperimentalMaterial) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, expMat.materialId));\r\n }\r\n\r\n}\r\n","
\r\n \r\n
\r\n\r\n
\r\n
\r\n List of Constituents for\r\n \r\n

\r\n

{{ \"Constituent Total Amount: \" + utilFns.formatNumber(_componentAmountTotal, 6, 4) }}

\r\n
\r\n\r\n
0)\">\r\n \r\n \r\n \r\n \r\n\r\n \r\n
\r\n \r\n {{ cell.data.materialComponent.material?.realCASNumber }}\r\n \r\n \r\n {{cell.data.materialComponent.cASNumber}}\r\n \r\n
\r\n\r\n \r\n
\r\n {{ cell.data.materialComponent.material?.formattedRIFMId }}\r\n -\r\n
\r\n\r\n \r\n \r\n\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.componentAmount, 6, 4) }}\r\n
\r\n
\r\n
\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\nimport { ROUTES } from '../routes';\r\nimport { Material, MaterialComposition } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'material-composition',\r\n templateUrl: './material-composition.html',\r\n})\r\nexport class MaterialCompositionComponent implements OnInit {\r\n\r\n @Input() materialId: number;\r\n @Input() principalName: string;\r\n\r\n _pageState = new PageState('Constituent');\r\n\r\n _materialCompositions: MaterialComposition[];\r\n _componentAmountTotal: number;\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._componentAmountTotal = 0;\r\n\r\n this._pageState.isLoading = true;\r\n\r\n const pMatId = {materialId: this.materialId};\r\n\r\n this._uow.fetch('Materials/MaterialCompositions', pMatId).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._materialCompositions = r;\r\n this._componentAmountTotal = this._materialCompositions.map(a => a.componentAmount).reduce((a, b) => a + b);\r\n this._pageState.isLoaded = true;\r\n } else {\r\n this._pageState.isLoaded = false;\r\n }\r\n });\r\n }\r\n\r\n goToSynonyms(m: Material) {\r\n if (m != null) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, m.materialId));\r\n }\r\n }\r\n\r\n public get utilFns() {\r\n return UtilFns;\r\n }\r\n}\r\n","
\r\n \r\n
\r\n\r\n
\r\n\r\n
\r\n Materials that contain\r\n \r\n as a constituent:\r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n {{ utilFns.formatNumber(cell.data.componentAmount, 6, 4) }}\r\n
\r\n
\r\n
\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\n\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\nimport { ROUTES } from '../routes';\r\nimport { Material, MaterialComposition } from '../../entities/EntityModels';\r\n\r\n\r\n@Component({\r\n selector: 'material-partof-compounds',\r\n templateUrl: './material-partof-compounds.html',\r\n})\r\nexport class MaterialPartOfCompoundsComponent implements OnInit {\r\n\r\n @Input() materialId: number;\r\n @Input() principalName: string;\r\n\r\n _pageState = new PageState('Natural Materials');\r\n\r\n _materialCompositions: MaterialComposition[];\r\n\r\n constructor(private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _router: Router, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n const pMatId = {componentMaterialId: this.materialId};\r\n\r\n this._pageState.isLoading = true;\r\n\r\n this._uow.fetch('Materials/MaterialCompositionsByComponentMaterial', pMatId)\r\n .then(r => {\r\n if (r != null && r.length > 0) {\r\n this._materialCompositions = r;\r\n this._pageState.isLoaded = true;\r\n } else {\r\n this._pageState.isLoaded = false;\r\n }\r\n });\r\n }\r\n\r\n goToSynonyms(m: Material) {\r\n if (m != null) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, m.materialId));\r\n }\r\n }\r\n\r\n public get utilFns() {\r\n return UtilFns;\r\n }\r\n}\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { provideParent } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { NaturalOccurrenceDescriptor } from '../../entities/NaturalOccurrenceDescriptor';\r\n\r\n@Component({\r\n selector: 'natural-occurrence',\r\n templateUrl: './natural-occurrence.html',\r\n providers: [provideParent(NaturalOccurrenceComponent, EditPropParent)]\r\n})\r\nexport class NaturalOccurrenceComponent implements OnInit, EditPropParent {\r\n @Input() entity: NaturalOccurrenceDescriptor;\r\n\r\n constructor() {\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n getError(propName: string) {\r\n return this.entity.getErrorFor(propName);\r\n }\r\n}\r\n","
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
","
\r\n\r\n\r\n\r\n \r\n \r\n Product\r\n Category\r\n Product CAS\r\n Less Than\r\n Trace\r\n Qualitative\r\n Range Min\r\n Range Max\r\n Unit\r\n Comment\r\n \r\n \r\n \r\n \r\n {{e.product}}\r\n \r\n \r\n \r\n {{e.productCAS}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{e.rangeMin}}\r\n {{e.rangeMax}}\r\n {{e.unit}}\r\n {{e.comment}}\r\n \r\n \r\n \r\n\r\n\r\n
\r\n \r\n
","import { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, IEditHost, LocationFns } from '../../utils/common';\r\nimport { NaturalOccurrenceComponent } from './natural-occurrence.component';\r\nimport { NaturalOccurrenceDescriptor } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'natural-occurrences',\r\n templateUrl: './natural-occurrences.html',\r\n})\r\nexport class NaturalOccurrencesComponent implements IEditHost, OnInit {\r\n @Input() materialId: number;\r\n @ViewChild(NaturalOccurrenceComponent) _editingComponent: NaturalOccurrenceComponent;\r\n\r\n _edm: EditManager;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n LocationFns.setTab(this._location, 1);\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Natural Occurrence Descriptors');\r\n\r\n this._edm.pageState.isLoading = true;\r\n const p = {materialId: this.materialId};\r\n this._uow.naturalOccurrenceDescriptorRepository\r\n .whereWithParams(p)\r\n .then(r => {\r\n this._edm.entities = r;\r\n this._edm.pageState.isLoaded = r;\r\n });\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n\r\n onAdd() {\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n\r\n // TODO: add a unique validation for materialId, product pair.\r\n const config = {\r\n materialId: this.materialId,\r\n product: '-'\r\n };\r\n const entity = this._uow.naturalOccurrenceDescriptorFactory.create(config);\r\n entity.product = '';\r\n this._edm.entities.push(entity);\r\n this._edm.onSelect(entity);\r\n }\r\n\r\n\r\n}\r\n","\r\n\r\n
\r\n No BIOWIN Data Available\r\n
\r\n\r\n\r\n
0\" class=\"outermost table-responsive\" style=\"margin-top: 4px;\">\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Parameter Value
\r\n \r\n \r\n \r\n \r\n {{group.name}}
{{epiSuite.typeEpiSuiteParameter.ePISuiteParameter}}{{epiSuite.ePIValue}}
\r\n
\r\n
\r\n\r\n
\r\n No ECOSAR Toxic Effect Data Available\r\n
\r\n\r\n
0\" style=\"padding-left: 0px !Important; margin-top: 4px;\">\r\n \r\n\r\n
\r\n \r\n *\r\n\t (asterisk) indicates Chemical may not be soluble enough to measure the predicted effect. If the effect level exceeds the water solubility by 10X, typically no effects at saturation (NES) are reported.\r\n \r\n \r\n \r\n \r\n Fish, 96-hr, LC50, Class\r\n Fish, 96-hr, LC50, mg/L (ppm)\r\n Daphnid, 48-hr, LC50, Class\r\n Daphnid, 48-hr, LC50, mg/L (ppm)\r\n Green Algae, 96-hr, EC50, Class\r\n Green Algae, 96-hr, EC50, mg/L (ppm)\r\n \r\n \r\n \r\n \r\n {{sar.fish_96hr_LC50_Class}}\r\n {{sar.fish_96hr_LC50_mg_L_ppm}}\r\n {{sar.daphnid_48hr_LC50_Class}}\r\n {{sar.daphnid_48hr_LC50_mg_L_ppm}}\r\n {{sar.greenAlgae_96hr_EC50_Class}}\r\n {{sar.greenAlgae_96hr_EC50_mg_L_ppm}}\r\n \r\n \r\n \r\n
\r\n
\r\n","import { Component, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { LocationFns } from '../../utils/common';\r\nimport { ColumnSorter, PageState } from '../../controls/common';\r\n\r\nimport { EPISuite, Material, ECOSARToxicEffect } from '../../entities/EntityModels';\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\n\r\n@Component({\r\n selector: 'prediction-environmental',\r\n templateUrl: './prediction-environmental.html',\r\n})\r\nexport class PredictionEnvironmentalComponent implements OnInit {\r\n material: Material;\r\n\r\n _epiSuites: EPISuite[];\r\n _epiGroups: { name: string, epiSuites: EPISuite[], collapsed?: boolean } [] = [];\r\n _ecoSARToxicEffects: ECOSARToxicEffect[];\r\n _colSorter: ColumnSorter;\r\n _pageState = new PageState('Environmental Predictions');\r\n\r\n _biowinCollapsed = false;\r\n _ecoSARCollapsed = false;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Predictions.name;\r\n LocationFns.setTab(this._location, 1);\r\n\r\n this._colSorter = new ColumnSorter(this, {\r\n 'Parameter': (e: EPISuite) => e.typeEpiSuiteParameter.ePISuiteParameter,\r\n 'Value': (e: EPISuite) => e.ePIValue\r\n }, 'Parameter', (sortColumn) => this._pageState.sortColumn = sortColumn);\r\n\r\n // setTimeout needed because of Angular RC5 bug where Location is not set correctly until\r\n // after timeout resolves.\r\n setTimeout(() => {\r\n const returned = LocationFns.updatePageState(this._location, this._stateMap, this._pageState, (state: PageState) => {\r\n this._colSorter.sortColumn = state.sortColumn;\r\n });\r\n\r\n this.fetchAndGroup();\r\n }, 0);\r\n }\r\n\r\n fetchAndGroup() {\r\n this._pageState.isLoading = true;\r\n\r\n // fetch epiSuite data\r\n const params = {materialId: this.material.materialId};\r\n this._uow.epiSuiteRepository.whereWithParams(params).then(r => {\r\n this._epiSuites = _.sortBy(r, e => e.typeEpiSuiteParameter.ePISuiteSortOrder);\r\n\r\n const groups = _.groupBy(this._epiSuites, (epiSuite) => epiSuite.typeEpiSuiteParameter.typeEpiSuiteCategory.categoryName);\r\n this._epiGroups = _.map(groups, (v, k) => {\r\n return {name: k, epiSuites: v, isCollapsed: false};\r\n });\r\n // this._epiGroups = _.sortBy(this._epiGroups, g => g.name);\r\n this._pageState.isLoaded = r;\r\n this.sortWith(this._colSorter);\r\n });\r\n\r\n // fetch ecoSARToxicEffect data\r\n this._uow.ecoSARToxicEffectRepository.whereWithParams(params).then(e => {\r\n if (e) {\r\n this._ecoSARToxicEffects = _.sortBy(e, o => o.fish_96hr_LC50_Class);\r\n } else {\r\n this._ecoSARToxicEffects = null;\r\n }\r\n });\r\n }\r\n\r\n collapseGroup(ix: number) {\r\n this._epiGroups[ix].collapsed = !this._epiGroups[ix].collapsed;\r\n }\r\n\r\n sortWith(colSorter: ColumnSorter) {\r\n this._epiGroups.forEach(g => {\r\n colSorter.sort(g.epiSuites);\r\n });\r\n }\r\n\r\n setBIOWINCollapse() {\r\n this._biowinCollapsed = !this._biowinCollapsed;\r\n }\r\n\r\n setECOSARCollapse() {\r\n this._ecoSARCollapsed = !this._ecoSARCollapsed;\r\n }\r\n\r\n}\r\n","
\r\n

Structure Alerts Components

\r\n
None found
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
\r\n Carcinogenic Effects:\r\n
{{ _score.carcinogenicEffects}}
\r\n
\r\n
\r\n Concentration Level Score:\r\n
{{ _score.concentrationLevelScore}}
\r\n
\r\n
\r\n
\r\n
\r\n Systemic Effects:\r\n
{{ _score.systemicEffects}}
\r\n
\r\n
\r\n Volume Score:\r\n
{{ _score.volumeScore}}
\r\n
\r\n
\r\n
\r\n
\r\n Topical Effects:\r\n
{{ _score.topicalEffects}}
\r\n
\r\n
\r\n Evaluation Priority:\r\n
{{ _score.evaluationPriority}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
0)\" class=\"row\">\r\n \r\n \r\n \r\n Rule\r\n Partial Structure\r\n \r\n \r\n \r\n \r\n {{e.rule}}\r\n \r\n {{e.typeAlertRule.description}} \r\n \r\n \r\n \r\n \r\n \r\n \r\n Material Structure\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n
Reference
\r\n
\r\n Ford R.A., Domeyer B., Easterday O., Maier K. and Middleton J. (2000)\r\n Criteria for development of a database for safety evaluation of fragrance ingredients. Regulatory Toxicology and Pharmacology, 31, 166-181\r\n
\r\n\r\n
\r\n
","import { Component, Input, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { HttpClient } from '@angular/common/http';\r\n\r\nimport { MolImageService, SearchService, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { LocationFns, UtilFns } from '../../utils/common';\r\nimport { ColumnSorter, PageState } from '../../controls/common';\r\nimport { Material, MaterialAlertRule } from '../../entities/EntityModels';\r\nimport { StructureAlertListItem } from '../../entities/projections/StructureAlertListItem';\r\nimport { environment } from '../../../environments/environment';\r\n\r\n@Component({\r\n selector: 'prediction-hh-alert',\r\n templateUrl: './prediction-hh-alert.html',\r\n})\r\nexport class PredictionHHAlertComponent implements OnInit {\r\n @Input() materialId: number;\r\n material: Material;\r\n _score: StructureAlertListItem;\r\n _scoreNotFound: boolean;\r\n _materialAlertRules: MaterialAlertRule[];\r\n _pageState = new PageState('Prediction Alert');\r\n _colSorter: ColumnSorter;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _searchService: SearchService,\r\n public _molImageService: MolImageService, public _location: Location, public _userManager: UserManager,\r\n public _http: HttpClient) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n LocationFns.setTab(this._location, '0.0');\r\n const params = {materialId: this.materialId};\r\n\r\n this._uow.fetch('fetchStructureAlertListItem', params).then(r => {\r\n this._scoreNotFound = (r.length == 0);\r\n if (this._scoreNotFound) {\r\n return;\r\n }\r\n this._score = r[0];\r\n });\r\n\r\n this._uow.materialAlertRuleRepository.whereWithParams(params).then(r => {\r\n this._materialAlertRules = r;\r\n });\r\n\r\n this._colSorter = new ColumnSorter(this, {\r\n 'Rule': (mar: MaterialAlertRule) => UtilFns.formatNumber(mar.rule, 3)\r\n }, 'Rule', (sortColumn) => this._pageState.sortColumn = sortColumn);\r\n }\r\n\r\n getSmileUrl(material: Material) {\r\n return this._molImageService.getImageUrlForSmile(material.smiles);\r\n }\r\n\r\n hasStockImage(mar: MaterialAlertRule) {\r\n // Synced up value in TypeAlertRules table so the GIF value is null when the image is missing.\r\n return (mar.typeAlertRule.gIF != null);\r\n }\r\n\r\n getStockImage(mar: MaterialAlertRule) {\r\n return environment.assetsUrl + 'assets/images/' + mar.rule + '.png';\r\n }\r\n\r\n sortWith(colSorter: ColumnSorter) {\r\n colSorter.sort(this._materialAlertRules);\r\n }\r\n\r\n linkTo(fileName: string) {\r\n const url = this._userManager.getFileServiceFilePathUrl('PublicReferences//' + fileName);\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n}\r\n","
\r\n
No Cramer classifications found
\r\n
\r\n Cramer Classification: \r\n {{ _cramerClassification}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
{{p.typePrediction.predictionName}}
\r\n
{{p.predictionClass}}
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n Comment: \r\n {{ _cramerComment}}\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n\r\n \r\n

Predictions

\r\n \r\n \r\n Prediction type\r\n Prediction class\r\n Comment\r\n Enabled\r\n \r\n \r\n \r\n \r\n {{e.typePrediction?.predictionName}}\r\n {{e.predictionClass}}\r\n {{e.comment}}\r\n {{e.enabled}}\r\n \r\n \r\n
\r\n\r\n\r\n
","import { Component, OnInit, Input, Inject } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { LocationFns } from '../../utils/common';\r\nimport { UnitOfWork, StateMap } from '../../services/common';\r\n\r\nimport { Material, Prediction, TypePrediction, TypePredictionClass } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'prediction-hh-cramer',\r\n templateUrl: './prediction-hh-cramer.html',\r\n})\r\nexport class PredictionHHCramerComponent implements OnInit {\r\n @Input() materialId: number;\r\n material: Material;\r\n\r\n _predictions: Prediction[];\r\n _cramerClassification: string;\r\n _cramerComment: string;\r\n _isEditEnabled = false;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap,\r\n public _location: Location) {\r\n\r\n }\r\n\r\n isStaff() {\r\n return ((this._stateMap.currentUser.isStaff) && (this._stateMap.currentUser.isInRole('fema') == false));\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n LocationFns.setTab(this._location, '0.1');\r\n const params = { materialId: this.materialId };\r\n this._uow.predictionRepository.whereWithParams(params).then(r => {\r\n this._predictions = r.filter(p => {\r\n if (this.isStaff()) { return true; }\r\n if (!p.enabled) { return false; }\r\n const predictionName = p.typePrediction.predictionName;\r\n return (!predictionName.startsWith('Tox')) && (!predictionName.startsWith('QSAR'));\r\n });\r\n const primaryJudgements = this._predictions.filter(p => p.typePrediction.primaryJudgment && p.enabled);\r\n if (primaryJudgements.length > 0) {\r\n const primaryJudgement = primaryJudgements[0];\r\n if (primaryJudgement.predictionClass) { // nullable field\r\n this._cramerClassification = `Class ${primaryJudgement.predictionClass}, ${primaryJudgement.typePredictionClass.predictionClassDescription}`;\r\n }\r\n this._cramerComment = primaryJudgement.comment;\r\n }\r\n });\r\n }\r\n}\r\n","import { Component, OnInit, Input, Inject } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { LocationFns } from '../../utils/common';\r\nimport { UnitOfWork, StateMap } from '../../services/common';\r\n\r\nimport { Material } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'prediction-hh-ttc',\r\n templateUrl: './prediction-hh-ttc.html'\r\n})\r\nexport class PredictionHHTTCComponent implements OnInit {\r\n @Input() materialId: number;\r\n material: Material;\r\n\r\n \r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap,\r\n public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n LocationFns.setTab(this._location, '0.2');\r\n }\r\n\r\n\r\n\r\n}\r\n","
\r\n
Placeholder for TTC - Not yet implemented
\r\n
","
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n","import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap } from '../../services/common';\r\nimport { LocationFns } from '../../utils/common';\r\nimport { TabContainer } from '../../controls/common';\r\n\r\nimport { Material } from '../../entities/EntityModels';\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\n\r\n@Component({\r\n selector: 'prediction-human-health',\r\n templateUrl: './prediction-human-health.html',\r\n})\r\nexport class PredictionHumanHealthComponent implements OnInit, AfterViewInit {\r\n material: Material;\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n _tab: number;\r\n\r\n constructor(public _stateMap: StateMap, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n this.material = this._stateMap.currentMaterial;\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Predictions.name;\r\n this._tab = LocationFns.getTab(this._location, 1) || 0;\r\n\r\n }\r\n\r\n ngAfterViewInit() {\r\n setTimeout(() => {\r\n this._tabContainer.selectTab(this._tab);\r\n }, 1);\r\n\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n}\r\n","
\r\n\r\n\r\n\r\n

Regulatory Status

\r\n \r\n \r\n Agency\r\n Agency Title\r\n Reference\r\n Determination\r\n Web or File Link\r\n Web Reference\r\n \r\n \r\n \r\n \r\n {{e.evaluatingAgency()}}\r\n {{e.agencyTitle()}}\r\n {{e.evaluatorId}}\r\n {{e.prefixedDetermination()}}\r\n {{e.linkDisplay}}\r\n {{e.webReferenceExt()}}\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n
","import { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { EditManager, IEditHost, LocationFns } from '../../utils/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { RegulatoryStatusComponent } from './regulatory-status.component';\r\nimport { RegulatoryStatus } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'regulatory-statuses',\r\n templateUrl: './regulatory-statuses.html',\r\n})\r\nexport class RegulatoryStatusesComponent implements IEditHost, OnInit {\r\n @Input() materialId: number;\r\n @Input() statusType: string;\r\n\r\n @ViewChild(RegulatoryStatusComponent) _editingComponent: RegulatoryStatusComponent;\r\n\r\n _edm: EditManager;\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Status.name;\r\n let tab: number;\r\n if (this.statusType == 'general') {\r\n tab = 0;\r\n } else if (this.statusType == 'ifra') {\r\n tab = 1;\r\n } else if (this.statusType == 'occupational') {\r\n tab = 2;\r\n } else {\r\n tab = 0;\r\n }\r\n LocationFns.setTab(this._location, tab);\r\n const displayName = (this.statusType == 'ifra') ? 'IFRA' : this.statusType;\r\n this._edm = new EditManager(this, this._uow, this._stateMap, displayName);\r\n\r\n this._edm.pageState.isLoading = true;\r\n const p = {materialId: this.materialId, statusType: this.statusType};\r\n this._uow.regulatoryStatusRepository.whereWithParams(p).then(r => {\r\n this._edm.entities = r;\r\n this._edm.pageState.isLoaded = r;\r\n });\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n formatWebReference(regulatoryStatus: RegulatoryStatus) {\r\n if (regulatoryStatus.webReferenceExt() == null || (regulatoryStatus.webReferenceExt().indexOf('http') == 0)) {\r\n return regulatoryStatus.webReferenceExt();\r\n } else {\r\n return this._userManager.getFileServiceFilePathUrl(regulatoryStatus.webReferenceExt());\r\n }\r\n }\r\n\r\n\r\n selectWebRef(e: RegulatoryStatus) {\r\n const url = this.formatWebReference(e);\r\n if (url) {\r\n window.open(url);\r\n }\r\n }\r\n\r\n onAdd() {\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n const rs = this._uow.regulatoryStatusFactory.create();\r\n rs.materialId = this.materialId;\r\n this._edm.entities.push(rs);\r\n this._edm.onSelect(rs);\r\n }\r\n\r\n\r\n}\r\n","
\r\n\r\n \r\n \r\n \r\n\r\n
","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { FSAG, MaterialFSAG } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'relations-group',\r\n templateUrl: './relations-group.html',\r\n providers: [provideParent(RelationsGroupComponent, EditPropParent)]\r\n})\r\nexport class RelationsGroupComponent implements OnInit {\r\n @Input() entity: MaterialFSAG;\r\n _FSAGs: FSAG[];\r\n\r\n constructor(public _uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.fSAGRepository.all().then(r => {\r\n // insert a blank line at the top of the select box.\r\n // r.unshift(null);\r\n this._FSAGs = r;\r\n });\r\n }\r\n\r\n getError(propName: string) {\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n\r\n}\r\n","\r\n\r\n
0\">\r\n
\r\n

Non-tox References

\r\n
\r\n
\r\n \r\n
{{group.key}}
\r\n \r\n \r\n Brief Reference\r\n Description\r\n Reference Id\r\n \r\n \r\n \r\n \r\n {{ e.reference?.briefRef(isStaff()) }}\r\n {{e.description()}}\r\n \r\n {{e.referenceId}}\r\n \r\n \r\n \r\n
\r\n
\r\n
","import { Component, Input, OnInit } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { StateMap, UnitOfWork } from '../../services/common';\r\nimport { LocationFns, UtilFns } from '../../utils/common';\r\nimport { PageState } from '../../controls/common';\r\n\r\nimport { SpecialLink } from '../../entities/SpecialLink';\r\n\r\nimport { ROUTES } from '../routes';\r\n\r\n@Component({\r\n selector: 'tox-data-other',\r\n templateUrl: './tox-data-other.html',\r\n})\r\nexport class ToxDataOtherReferencesComponent implements OnInit {\r\n @Input() materialIds: number[];\r\n @Input() tabPath: string;\r\n _specialLinks: SpecialLink[];\r\n _groupedLinks: { key: string, specialLinks: SpecialLink[] } [];\r\n\r\n _pageState = new PageState('Non-tox references');\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location,\r\n public _router: Router) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n LocationFns.setTab(this._location, this.tabPath);\r\n\r\n const p = {materialIds: this.materialIds};\r\n this._pageState.isLoading = true;\r\n this._uow.specialLinkMaterialRepository.whereWithParams(p).then(r => {\r\n this._specialLinks = r;\r\n const groups = _.groupBy(r, x => x.explanation());\r\n const groupedLinks = _.keys(groups).map(k => {\r\n return {key: k, specialLinks: groups[k]};\r\n });\r\n this._groupedLinks = _.sortBy(groupedLinks, g => g.key);\r\n this._pageState.isLoaded = r;\r\n }).catch(() => {\r\n this._pageState.isLoadedWithNoData = true;\r\n });\r\n\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n onReferenceSelect(specialLink: SpecialLink) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, specialLink.referenceId));\r\n }\r\n\r\n\r\n}\r\n","
\r\n

Related By Fragrance Structure Activity Group: {{_fsagNote}} - {{_materialIds.length}} material(s)

\r\n
\r\n\r\n\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n You cannot leave the Relations tab until you either 'Save' or 'Cancel'\r\n \r\n {{_edm.status.message}}\r\n
\r\n\r\n
\r\n
\r\n
{{ errorMessage }}
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n \r\n \r\n \r\n CAS #\r\n RIFM ID\r\n Principal Name\r\n Structure\r\n \r\n \r\n \r\n \r\n \r\n {{e.material.realCASNumber || '(No CAS#)'}}\r\n \r\n {{e.material.formattedRIFMId}}\r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\nimport { MolImageService, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditManager, IEditHost, LocationFns, UtilFns } from '../../utils/common';\r\nimport { ColumnSorter, TabContainer } from '../../controls/common';\r\n\r\nimport { Material, MaterialFSAG } from '../../entities/EntityModels';\r\nimport { ROUTES } from '../routes';\r\n\r\n@Component({\r\n selector: 'relations-groups',\r\n templateUrl: './relations-groups.html',\r\n})\r\nexport class RelationsGroupsComponent implements IEditHost, OnInit {\r\n\r\n @ViewChild(TabContainer, { static: true }) _tabContainer: TabContainer;\r\n _material: Material;\r\n _materialIds: number[];\r\n _edm: EditManager;\r\n _fsagNote: string;\r\n _tab: number;\r\n _colSorter: ColumnSorter;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _molImageService: MolImageService,\r\n public _router: Router, public _route: ActivatedRoute, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._material = this._stateMap.currentMaterial;\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Related Groups');\r\n this._edm.femaRestricted = true; // FEMA can't edit this data\r\n // var returned = LocationFns.updatePageState(this._location, this._stateMap, this._pageState, (state: PageState) => {\r\n // this._colSorter1.sortColumn = ( state).sortColumn1;\r\n // this._colSorter2.sortColumn = ( state).sortColumn2;\r\n // });\r\n\r\n // The ',1' below is because this is a nested tab\r\n this._tab = LocationFns.getTab(this._location, 1) || 0;\r\n\r\n this.search();\r\n\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n onTabChange(paneNumber: number) {\r\n if (paneNumber == 0) {\r\n LocationFns.setTab(this._location, '1.0');\r\n }\r\n }\r\n\r\n onCasSelect(materialFSAG: MaterialFSAG) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, materialFSAG.material.materialId));\r\n }\r\n\r\n search() {\r\n const materialId = this._material.materialId;\r\n this._edm.pageState.isLoading = true;\r\n return this._uow.materialFSAGRepository.whereWithParams({ materialId: materialId, sagId: null }).then(r => {\r\n if (r.length == 0) {\r\n return Promise.resolve(r);\r\n } else {\r\n const baseMaterialFSAG = r[0];\r\n this._fsagNote = baseMaterialFSAG.fSAG.note;\r\n return this._uow.materialFSAGRepository.whereWithParams({ materialId: null, sagId: baseMaterialFSAG.sAGID });\r\n }\r\n }).then(r => {\r\n this._edm.entities = _.sortBy(r, x => x.material.principalSynonym().synonymWordOrWebVersion());\r\n this._materialIds = this._edm.entities.map(fsag => fsag.materialId);\r\n this._tabContainer.selectTab(this._tab);\r\n this._edm.pageState.isLoaded = r;\r\n });\r\n }\r\n\r\n canSave() {\r\n if (!this._edm.hasEdits()) { return false; }\r\n if (!this._edm.validateBeforeSave()) { return false; }\r\n return true;\r\n }\r\n\r\n getMaterialImageUrl(m: MaterialFSAG) {\r\n return this._molImageService.getImageUrlForMaterial(m.material.materialId);\r\n }\r\n\r\n sortWith(colSorter: ColumnSorter) {\r\n\r\n }\r\n\r\n // EditManager overrides\r\n\r\n canAdd() {\r\n return this._edm.entities && (this._edm.entities.length == 0);\r\n }\r\n\r\n onAdd() {\r\n if (!this._edm.validateCurrent()) { return; }\r\n const config = {\r\n materialId: this._material.materialId,\r\n sAGID: 0\r\n };\r\n\r\n const e = this._uow.materialFSAGFactory.create(config);\r\n e.sAGID = null;\r\n this._edm.entities.push(e);\r\n this._edm.onSelect(e);\r\n }\r\n\r\n onDelete() {\r\n const ents = this._edm.entities.filter(e => e.materialId == this._material.materialId);\r\n if (ents.length == 0) { return; }\r\n this._edm.entities = [];\r\n ents[0].entityAspect.setDeleted();\r\n this._edm.commitSave().then(() => {\r\n this.search();\r\n }).catch(e => {\r\n this.search();\r\n });\r\n }\r\n\r\n onSave() {\r\n return this._edm.onSaveCore().then(() => {\r\n this._edm.editing = false;\r\n this.search();\r\n }).catch((e) => {\r\n // leave in _editing mode to see error.\r\n this._edm.errorMessages.push(e.toString());\r\n });\r\n }\r\n\r\n\r\n\r\n\r\n}\r\n","
\r\n\r\n \r\n \r\n \r\n\r\n
\r\n \r\n
\r\n\r\n \r\n \r\n \r\n\r\n\r\n
\r\n \r\n
\r\n \r\n \r\n \r\n CAS No.\r\n RIFM ID\r\n Principal Synonym\r\n \r\n \r\n \r\n \r\n {{_relatedMaterial.realCASNumber}}\r\n {{_relatedMaterial.formattedRifmId}}\r\n \r\n \r\n \r\n \r\n
\r\n {{ _relatedMaterial == null ? 'A related material is required' : '' }}\r\n {{ _editErrorMessage }}\r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n {{getRelationTypeText()}} \r\n \r\n
\r\n
\r\n\r\n
\r\n\r\n\r\n","import { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { Material, MaterialRelation, TypeMaterialRelation } from '../../entities/EntityModels';\r\nimport { MaterialListItem } from '../../entities/projections/MaterialListItem';\r\nimport { MaterialSelectorComponent } from './material-selector.component';\r\n\r\n@Component({\r\n selector: 'relations-material',\r\n templateUrl: './relations-material.html',\r\n providers: [provideParent(RelationsMaterialComponent, EditPropParent)]\r\n})\r\nexport class RelationsMaterialComponent implements OnInit {\r\n @Input() entity: MaterialRelation;\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n @Input() reciprocalRelation: boolean;\r\n // next two vars are used to hold temporarily invalid values.\r\n _material: Material;\r\n private _typeMaterialRelationId: number;\r\n private _reciprocalTypeMaterialRelationId: number;\r\n _relatedMaterial: MaterialListItem;\r\n _isEditing: boolean;\r\n _isNew: boolean;\r\n _types: TypeMaterialRelation[];\r\n _reciprocalTypes: TypeMaterialRelation[];\r\n _editErrorMessage: string;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._material = this._stateMap.currentMaterial;\r\n if (!this.reciprocalRelation) {\r\n this.reciprocalRelation = false;\r\n }\r\n this._isNew = this.entity.entityAspect.entityState.isAdded();\r\n\r\n if (!this.reciprocalRelation) {\r\n this.typeMaterialRelationId = this.entity.typeMaterialRelationId;\r\n } else {\r\n this.reciprocalTypeMaterialRelationId = this.entity.typeMaterialRelationId;\r\n }\r\n\r\n this._uow.typeMaterialRelationRepository.all().then(r => {\r\n this._types = _.sortBy(r, x => x.relationType);\r\n this._reciprocalTypes = this._types;\r\n });\r\n if (this.entity) {\r\n\r\n if (!this.reciprocalRelation) {\r\n this._uow.fetch('Materials/MaterialListItems', {materialIds: this.entity.relatedMaterialId}).then(r => {\r\n this._relatedMaterial = r[0];\r\n this._isEditing = true;\r\n });\r\n } else {\r\n this._uow.fetch('Materials/MaterialListItems', {materialIds: this.entity.materialId}).then(r => {\r\n this._relatedMaterial = r[0];\r\n this._isEditing = true;\r\n });\r\n }\r\n }\r\n }\r\n\r\n get typeMaterialRelationId(): number {\r\n return this._typeMaterialRelationId;\r\n }\r\n\r\n set typeMaterialRelationId(val: number) {\r\n this._typeMaterialRelationId = val;\r\n if (val > 0) {\r\n this.reciprocalTypeMaterialRelationId = -1;\r\n }\r\n }\r\n\r\n\r\n get reciprocalTypeMaterialRelationId(): number {\r\n return this._reciprocalTypeMaterialRelationId;\r\n }\r\n\r\n set reciprocalTypeMaterialRelationId(val: number) {\r\n this._reciprocalTypeMaterialRelationId = val;\r\n if (val > 0) {\r\n this.typeMaterialRelationId = -1;\r\n }\r\n }\r\n\r\n hasChanges() {\r\n return (!this.entity.entityAspect.entityState.isUnchanged());\r\n }\r\n\r\n isAdded() {\r\n return this.entity.entityAspect.entityState.isAdded();\r\n }\r\n\r\n isDeleted() {\r\n return this.entity.entityAspect.entityState.isDeleted();\r\n }\r\n\r\n rejectChanges() {\r\n this.entity.entityAspect.rejectChanges();\r\n this.entity.entityAspect.setDeleted();\r\n if (this.entity.materialId == this._material.materialId) {\r\n this.typeMaterialRelationId = this.entity.typeMaterialRelationId;\r\n } else {\r\n this.reciprocalTypeMaterialRelationId = this.entity.typeMaterialRelationId;\r\n }\r\n }\r\n\r\n onSetRelationId(val: number) {\r\n try {\r\n this.typeMaterialRelationId = val;\r\n if (val <= 0) {\r\n return;\r\n }\r\n this.reciprocalRelation = false;\r\n this.entity.materialId = 0;\r\n this.entity.relatedMaterialId = 0;\r\n this.entity.typeMaterialRelationId = val;\r\n this.entity.materialId = this._material.materialId;\r\n this.entity.relatedMaterialId = this._relatedMaterial ? this._relatedMaterial.materialId : null;\r\n // next two lines are needed in case a collision occured earlier - in that case we need to set back\r\n // the relatedmaterialId after setting the relationId\r\n // if (this._relatedMaterial && this._relatedMaterial.materialId != this.entity.relatedMaterialId) {\r\n // this.entity.relatedMaterialId = this._relatedMaterial.materialId;\r\n // }\r\n this._editErrorMessage = null;\r\n } catch (e) {\r\n this._editErrorMessage = 'This material and relation type combination has already been added.';\r\n }\r\n }\r\n\r\n onSetReciprocalRelationId(val: number) {\r\n try {\r\n this.reciprocalTypeMaterialRelationId = val;\r\n if (val <= 0) {\r\n return;\r\n }\r\n this.reciprocalRelation = true;\r\n // for reciprocal relations reverse materialId with relatedMaterialId\r\n this.entity.materialId = 0;\r\n this.entity.relatedMaterialId = 0;\r\n this.entity.typeMaterialRelationId = val;\r\n this.entity.relatedMaterialId = this._material.materialId;\r\n this.entity.materialId = this._relatedMaterial ? this._relatedMaterial.materialId : null;\r\n // next two lines are needed in case a collision occured earlier - in that case we need to set back\r\n // the relatedmaterialId after setting the relationId\r\n // if (this._relatedMaterial && this._material.materialId != this.entity.relatedMaterialId) {\r\n // this.entity.relatedMaterialId = this._material.materialId;\r\n // }\r\n\r\n this._editErrorMessage = null;\r\n } catch (e) {\r\n this._editErrorMessage = 'This material and relation type combination has already been added.';\r\n }\r\n }\r\n\r\n onSelectingMaterial() {\r\n // BUG: synonym display not changing when material is changed but the rest of the relatedMaterial does change. ... sometimes...\r\n UtilFns.showModal(this._materialSelectorComponent, this, null).then(mli => {\r\n if (mli == null) {\r\n return;\r\n }\r\n // this._relatedMaterial = null;\r\n this._relatedMaterial = mli;\r\n // Prevent exception thrown when a user inadvertently tries to set a relationship on the same material.\r\n if (this._material.materialId == mli.materialId) {\r\n this._editErrorMessage = 'You cannot set a relationship on a material to itself; please select a different material.';\r\n return;\r\n }\r\n try {\r\n if (!this.reciprocalRelation) {\r\n this.entity.materialId = this._material.materialId;\r\n this.entity.relatedMaterialId = mli.materialId;\r\n if (this.entity.typeMaterialRelationId != this._typeMaterialRelationId) {\r\n this.entity.typeMaterialRelationId = this._typeMaterialRelationId;\r\n }\r\n } else {\r\n this.entity.materialId = mli.materialId;\r\n this.entity.relatedMaterialId = this._material.materialId;\r\n if (this.entity.typeMaterialRelationId != this._reciprocalTypeMaterialRelationId) {\r\n this.entity.typeMaterialRelationId = this._reciprocalTypeMaterialRelationId;\r\n }\r\n }\r\n this._editErrorMessage = null;\r\n } catch (e) {\r\n this._editErrorMessage = 'This material and relation type combination has already been added.';\r\n }\r\n\r\n });\r\n }\r\n\r\n isValid(deleting: boolean) {\r\n const ok = this.entity.entityAspect.validateEntity();\r\n return ok && this._editErrorMessage == null && this.validateTypeRelationSelection(deleting) == null;\r\n }\r\n\r\n getError(propName: string) {\r\n return this._editErrorMessage || this.validateTypeRelationSelection(false) || this.entity.getErrorFor(propName);\r\n }\r\n\r\n validateTypeRelationSelection(deleting: boolean) {\r\n if (this.typeMaterialRelationId < 0 && this.reciprocalTypeMaterialRelationId < 0) {\r\n return 'Either \\'Relation type\\' or \\'Reciprocal relation type\\' must be selected';\r\n }\r\n if (!deleting && this.entity.materialId == this.entity.relatedMaterialId) {\r\n return 'Cannot create relation between material and self.';\r\n }\r\n return null;\r\n }\r\n\r\n getRelationTypeText() {\r\n if (this.typeMaterialRelationId > 0) {\r\n return _.find(this._types, x => x.typeMaterialRelationId == this.typeMaterialRelationId).relationType;\r\n }\r\n\r\n if (this.reciprocalTypeMaterialRelationId > 0) {\r\n const mat = _.find(this._types, x => x.typeMaterialRelationId == this.reciprocalTypeMaterialRelationId);\r\n return mat.reciprocalRelationType != null ? mat.reciprocalRelationType : mat.relationType;\r\n }\r\n\r\n return ' - ';\r\n }\r\n\r\n}\r\n","
\r\n \r\n \r\n \r\n \r\n \r\n You cannot leave the Relations tab until you either 'Save' or 'Cancel'\r\n \r\n {{_status.message}}\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n 0\" [attr.data-hidden]=\"_editing\">\r\n

Related Materials

\r\n \r\n \r\n Relation Type \r\n CAS No. \r\n RIFM ID \r\n FEMA No. \r\n EINECS \r\n Principal Name \r\n \r\n \r\n \r\n \r\n {{e.relationType}}\r\n {{e.realCASNumber || '(No CAS#)' }}\r\n {{e.formattedRifmId}}\r\n {{e.fEMANumber}}\r\n {{e.eINECSNumber}}\r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\n\r\nimport { SearchService, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { LocationFns, UtilFns } from '../../utils/common';\r\nimport { ColumnSorter, PageState, SortColumn, SortMap } from '../../controls/common';\r\n\r\nimport { RelationsMaterialComponent } from './relations-material.component';\r\nimport { Material, MaterialRelation, TypeMaterialRelation } from '../../entities/EntityModels';\r\nimport { MaterialRelationListItem } from '../../entities/projections/MaterialRelationListItem';\r\nimport { ROUTES } from '../routes';\r\n\r\nclass PageStateExt extends PageState {\r\n sortColumn1: SortColumn;\r\n}\r\n\r\n@Component({\r\n selector: 'relations-materials',\r\n templateUrl: './relations-materials.html',\r\n})\r\nexport class RelationsMaterialsComponent implements OnInit {\r\n @ViewChild(RelationsMaterialComponent) _editComponent: RelationsMaterialComponent;\r\n\r\n // Can't use editManager here because MaterialRelationListItem is not an Entity.\r\n _material: Material;\r\n _items: MaterialRelationListItem[];\r\n _currentItem: MaterialRelationListItem;\r\n _addedMaterialRelation: MaterialRelation;\r\n _materialRelations: MaterialRelation[]; // only resolved if staff.\r\n _reciprocalMaterialRelations: MaterialRelation[];\r\n _containsType: TypeMaterialRelation;\r\n _editing = false;\r\n _deleting = false;\r\n _status: {};\r\n _colSorter1: ColumnSorter;\r\n _isReciprocalRelation: boolean;\r\n\r\n _pageState = new PageStateExt('Related materials');\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap,\r\n public _searchService: SearchService, public _router: Router, public _route: ActivatedRoute, public _location: Location) {\r\n }\r\n\r\n ngOnInit() {\r\n this._material = this._stateMap.currentMaterial;\r\n\r\n LocationFns.setTab(this._location, 0);\r\n\r\n this._uow.typeMaterialRelationRepository.all().then(r => {\r\n this._containsType = r.find(tmr => tmr.relationType == 'contains');\r\n });\r\n this.getMaterialRelations()\r\n .then(r => {\r\n // note: canAdd is waiting for this.\r\n });\r\n\r\n const sortConfig: SortMap = {\r\n 'Relation Type': (e: MaterialRelationListItem) => e.relationType,\r\n 'CAS No.': (e: MaterialRelationListItem) => e.realCASNumber,\r\n 'RIFM ID': (e: MaterialRelationListItem) => e.formattedRifmId,\r\n 'FEMA No.': (e: MaterialRelationListItem) => (e.fEMANumber || '').toString(),\r\n 'EINECS': (e: MaterialRelationListItem) => e.eINECSNumber,\r\n 'Principal Name': (e: MaterialRelationListItem) => e.synonymWordOrWebVersion,\r\n };\r\n this._colSorter1 = new ColumnSorter(this, sortConfig, 'Principal Name',\r\n (sortColumn) => this._pageState.sortColumn1 = sortColumn);\r\n\r\n // setTimeout needed because of Angular RC5 bug where Location is not set correctly until\r\n // after timeout resolves.\r\n setTimeout(() => {\r\n const returned = LocationFns.updatePageState(this._location, this._stateMap, this._pageState, (state: PageState) => {\r\n this._colSorter1.sortColumn = (state).sortColumn1;\r\n });\r\n\r\n this.search();\r\n }, 0);\r\n\r\n }\r\n\r\n search() {\r\n const materialId = this._material.materialId;\r\n this._pageState.isLoading = true;\r\n const p = {materialId: materialId};\r\n this._uow.fetch('Materials/MaterialRelationsWithReciprocals', p).then(r => {\r\n if (r == null || r.length == 0) {\r\n this._pageState.isLoaded = [];\r\n return;\r\n }\r\n this._items = r;\r\n this.sortWith(this._colSorter1);\r\n if (this._items.length) {\r\n this._pageState.isLoaded = true;\r\n } else {\r\n this._pageState.isLoadedWithNoData = true;\r\n }\r\n });\r\n\r\n }\r\n\r\n public getMaterialRelations(): Promise {\r\n if (this._materialRelations) {\r\n return Promise.resolve(this._materialRelations);\r\n }\r\n const materialId = this._material.materialId;\r\n\r\n this._uow.materialReciprocalRelationRepository.whereWithParams({relatedMaterialId: materialId}).then(r => {\r\n this._reciprocalMaterialRelations = r;\r\n return r;\r\n });\r\n return this._uow.materialRelationRepository.whereWithParams({materialId: materialId}).then(r => {\r\n this._materialRelations = r;\r\n return r;\r\n });\r\n }\r\n\r\n isStaff() {\r\n return ((this._stateMap.currentUser.isStaff) && (this._stateMap.currentUser.isInRole('fema') == false));\r\n }\r\n\r\n goToSynonyms(mrli: MaterialRelationListItem) {\r\n if (this._material.materialId == mrli.materialId) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, mrli.relatedMaterialId));\r\n } else {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, mrli.materialId));\r\n }\r\n }\r\n\r\n canDeactivate() {\r\n return !this.hasEdits();\r\n }\r\n\r\n\r\n sortWith(colSorter: ColumnSorter) {\r\n if (colSorter == this._colSorter1) {\r\n colSorter.sort(this._items);\r\n }\r\n }\r\n\r\n\r\n onSelect(e: MaterialRelationListItem) {\r\n if (!this.isStaff()) {\r\n return;\r\n }\r\n if (!this.isValid()) {\r\n return;\r\n }\r\n this._isReciprocalRelation = false;\r\n let filteredItems = this._materialRelations.filter(mr => (mr.materialId == e.materialId)\r\n && (mr.relatedMaterialId == e.relatedMaterialId)\r\n && (mr.typeMaterialRelation && (mr.typeMaterialRelation.reciprocalRelationType == e.relationType || mr.typeMaterialRelation.relationType == e.relationType)));\r\n\r\n if (filteredItems.length == 0) {\r\n filteredItems = this._reciprocalMaterialRelations.filter(mr => (mr.materialId == e.materialId)\r\n && (mr.relatedMaterialId == e.relatedMaterialId)\r\n && (mr.typeMaterialRelation && (mr.typeMaterialRelation.reciprocalRelationType == e.relationType || mr.typeMaterialRelation.relationType == e.relationType)));\r\n this._isReciprocalRelation = true;\r\n }\r\n if (filteredItems.length == 0) {\r\n return;\r\n }\r\n this._addedMaterialRelation = filteredItems[0];\r\n this._editing = true;\r\n }\r\n\r\n hasEditableRelation(e: MaterialRelationListItem) {\r\n if (!this._materialRelations || !this._reciprocalMaterialRelations) {\r\n return false;\r\n }\r\n let filteredItems = this._materialRelations.filter(mr => (mr.materialId == e.materialId)\r\n && (mr.relatedMaterialId == e.relatedMaterialId)\r\n && (mr.typeMaterialRelation && (mr.typeMaterialRelation.reciprocalRelationType == e.relationType || mr.typeMaterialRelation.relationType == e.relationType)));\r\n\r\n if (filteredItems.length == 0) {\r\n filteredItems = this._reciprocalMaterialRelations.filter(mr => (mr.materialId == e.materialId)\r\n && (mr.relatedMaterialId == e.relatedMaterialId)\r\n && (mr.typeMaterialRelation && (mr.typeMaterialRelation.reciprocalRelationType == e.relationType || mr.typeMaterialRelation.relationType == e.relationType)));\r\n }\r\n return filteredItems.length > 0;\r\n }\r\n\r\n canAdd() {\r\n // need to wait until materialRelations have been fetched\r\n return this._materialRelations != null;\r\n }\r\n\r\n canSave() {\r\n return this.hasEdits() && this.isValid(this._deleting);\r\n // if (!this._edm.hasEdits()) return false;\r\n // // this._edm.canSaveCore does not include next line.\r\n // if (!this._edm.validateBeforeSave()) return false;\r\n // return true;\r\n }\r\n\r\n hasEdits() {\r\n return this._uow.hasChanges();\r\n }\r\n\r\n\r\n isValid(deleting: boolean = false) {\r\n if (this._editing) {\r\n return this._editComponent && this._editComponent.isValid(deleting);\r\n } else {\r\n return true;\r\n }\r\n\r\n }\r\n\r\n canDelete() {\r\n return this._addedMaterialRelation != null && !this._addedMaterialRelation.entityAspect.entityState.isAdded();\r\n }\r\n\r\n onAdd() {\r\n if (!this.isValid()) {\r\n return;\r\n }\r\n this._isReciprocalRelation = false;\r\n const config = {\r\n materialId: this._material.materialId,\r\n typeMaterialRelationId: this._containsType ? this._containsType.typeMaterialRelationId : 0,\r\n relatedMaterialId: 0 // needed for create to succeed.\r\n };\r\n const entity = this._uow.materialRelationFactory.create(config);\r\n entity.relatedMaterialId = null;\r\n this._addedMaterialRelation = entity;\r\n this._editing = true;\r\n\r\n }\r\n\r\n onDelete() {\r\n this._deleting = true;\r\n this._editComponent.rejectChanges();\r\n }\r\n\r\n canCancel() {\r\n if (this._editing) {\r\n return true;\r\n } else {\r\n return this.hasEdits();\r\n }\r\n }\r\n\r\n onCancel() {\r\n if (this._editing) {\r\n const e = this._addedMaterialRelation;\r\n e.entityAspect.rejectChanges();\r\n this._editing = false;\r\n this._deleting = false;\r\n } else {\r\n this._uow.rollback();\r\n this.search();\r\n }\r\n }\r\n\r\n onSave() {\r\n if (!this.isValid(this._deleting)) {\r\n return;\r\n }\r\n this._editing = false;\r\n this._deleting = false;\r\n\r\n const amr = this._addedMaterialRelation;\r\n if (amr.entityAspect.entityState.isModified()) {\r\n // typeMaterialRelationId has changed, and it's part of the key, so we need to delete & add\r\n const config = {\r\n materialId: amr.materialId,\r\n relatedMaterialId: amr.relatedMaterialId,\r\n typeMaterialRelationId: amr.typeMaterialRelationId,\r\n };\r\n // delete entity in the old state\r\n amr.entityAspect.rejectChanges();\r\n if (amr.materialId != config.materialId ||\r\n amr.relatedMaterialId != config.relatedMaterialId ||\r\n amr.typeMaterialRelationId != config.typeMaterialRelationId) {\r\n amr.entityAspect.setDeleted();\r\n // create entity for the new state\r\n const entity = this._uow.materialRelationFactory.create(config);\r\n }\r\n }\r\n\r\n this._uow.commit().then(() => {\r\n this._materialRelations = null;\r\n this.getMaterialRelations();\r\n this.search();\r\n this.setStatus({message: 'Saved', classes: 'label-success', isTemp: true});\r\n }).catch(e => {\r\n alert('save failed: ' + e);\r\n });\r\n }\r\n\r\n setStatus(status: { message: string, classes: string, isTemp: boolean }) {\r\n status.classes = 'label ' + status.classes;\r\n this._status = status;\r\n if (status.isTemp) {\r\n setTimeout(() => {\r\n this._status = null;\r\n }, 2000);\r\n }\r\n }\r\n\r\n\r\n}\r\n","
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n
\r\n {{_lastReviewDateAlertWarning}}\r\n
\r\n
\r\n {{_typeNTPStatusIdAlertWarning}}\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n Last Review Date:\r\n {{utilFns.formatDate(entity.lastReviewDate)}}\r\n \r\n Remove Review Date\r\n
\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { EditManager, UtilFns } from '../../utils/common';\r\nimport { provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { NationalToxicologyProgram, TypeNTPStatus, TypeRoute, TypeSpecies, TypeStudy } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'status-ntp',\r\n templateUrl: './status-ntp.html',\r\n providers: [provideParent(StatusNtpComponent, EditPropParent)]\r\n})\r\nexport class StatusNtpComponent implements OnInit, EditPropParent {\r\n\r\n @Input() edm: EditManager;\r\n @Input() entity: NationalToxicologyProgram;\r\n\r\n _typeStudies: TypeStudy[] = [];\r\n _typeSpecies: TypeSpecies[] = [];\r\n _typeRoutes: TypeRoute[] = [];\r\n _typeNTPStatuses: TypeNTPStatus[] = [];\r\n _lastReviewDateAlertWarning: string;\r\n _typeNTPStatusIdAlertWarning: string;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.typeStudyRepository.all().then(r => this._typeStudies = _.sortBy(r, x => x.studyLong));\r\n this._uow.typeSpeciesRepository.all().then(r => this._typeSpecies = _.sortBy(r, x => x.speciesLong));\r\n this._uow.typeRouteRepository.all().then(r => this._typeRoutes = _.sortBy(r, x => x.routeLong));\r\n this._uow.typeNTPStatusRepository.all().then(r => this._typeNTPStatuses = _.sortBy(r, x => x.description));\r\n }\r\n\r\n getError(propName: string) {\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n checkNull(value: string) {\r\n if (value) {\r\n return value;\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n markAsReviewed() {\r\n this.entity.lastReviewDate = new Date();\r\n this._lastReviewDateAlertWarning = null;\r\n }\r\n\r\n removeReviewDate() {\r\n this.entity.lastReviewDate = null;\r\n this._lastReviewDateAlertWarning = 'The Last Review Date is a required field. Please use the \"Mark as Reviewed\" button to update this field.';\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n onSetNTPStatusTypeId(val: string) {\r\n this.entity.typeNTPStatusId = val;\r\n if (val) {\r\n this._typeNTPStatusIdAlertWarning = null;\r\n }\r\n }\r\n\r\n // Editing Overrides\r\n canApply() {\r\n if (this.edm.editing) {\r\n return (this._uow.hasChanges() && !this.edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canShowBack(): boolean {\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n onApply() {\r\n this._lastReviewDateAlertWarning = null;\r\n this._typeNTPStatusIdAlertWarning = null;\r\n\r\n if (!this.entity.lastReviewDate) {\r\n this._lastReviewDateAlertWarning = 'The Last Review Date is a required field. Please use the \"Mark as Reviewed\" button to update this field.';\r\n return false;\r\n }\r\n\r\n if (!this.entity.typeNTPStatusId) {\r\n this._typeNTPStatusIdAlertWarning = 'The Description is a required field. Please select one from the list.';\r\n return false;\r\n }\r\n\r\n this.edm.onApplyCore();\r\n }\r\n}\r\n","
\r\n\r\n\r\n

National Toxicological Data

\r\n \r\n \r\n Last Updated\r\n Description\r\n Study\r\n Route\r\n Species\r\n Protocol\r\n Reference\r\n Comments\r\n \r\n \r\n \r\n \r\n {{ _stateMap.utilFns.formatDate(e.lastReviewDate) }}\r\n \r\n {{e.typeNTPStatus?.description }}\r\n {{e.typeStudy?.studyLong}}\r\n {{e.typeRoute?.routeLong}}\r\n {{e.typeSpecies?.speciesLong}}\r\n {{e.protocol}}\r\n {{e.reference}}\r\n {{e.comments}}\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n
","import { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport { StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { EditManager, IEditHost, LocationFns } from '../../utils/common';\r\n\r\nimport { MATERIAL_ROUTES } from './material.routes';\r\nimport { StatusNtpComponent } from './status-ntp.component';\r\n\r\nimport { NationalToxicologyProgram } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'status-ntps',\r\n templateUrl: './status-ntps.html',\r\n})\r\nexport class StatusNtpsComponent implements IEditHost, OnInit {\r\n @Input() materialId: number;\r\n @Input() statusType: string;\r\n\r\n @ViewChild(StatusNtpComponent) editingComponent: StatusNtpComponent;\r\n\r\n _edm: EditManager;\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n LocationFns.setTab(this._location, '3');\r\n this._stateMap.currentRouteName = MATERIAL_ROUTES.Status.name;\r\n\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'National Toxicology Program');\r\n\r\n this._edm.pageState.isLoading = true;\r\n const p = {materialId: this.materialId};\r\n this._uow.nationalToxicologyProgramRepository.whereWithParams(p).then(r => {\r\n this._edm.entities = r;\r\n this._edm.pageState.isLoaded = r;\r\n });\r\n }\r\n\r\n canDeactivate() {\r\n return !this._edm.hasEdits();\r\n }\r\n\r\n onAdd() {\r\n if (!this._edm.validateCurrent()) {\r\n return;\r\n }\r\n\r\n const e = this._uow.nationalToxicologyProgramFactory.create();\r\n e.materialId = this.materialId;\r\n e.modified = new Date();\r\n e.lastReviewDate = new Date();\r\n\r\n this._edm.entities.push(e);\r\n this._edm.onSelect(e);\r\n }\r\n\r\n get sortedNTPEntities(): NationalToxicologyProgram[] {\r\n if (this._edm.entities != null) {\r\n return _.sortBy(this._edm.entities, n => n.lastReviewDate).reverse();\r\n } else {\r\n return null;\r\n }\r\n }\r\n}\r\n","
\r\n\r\n\r\n\r\n
\r\n \"[Structure\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n {{material.getErrorFor('formula')}}\r\n
\r\n
\r\n \r\n
{{material.molecularWeightWithUnit}}
\r\n \r\n \r\n {{material.getErrorFor('molecularWeight')}}\r\n
\r\n
\r\n Smiles Notation:\r\n
\r\n {{material.smiles}}\r\n \r\n
\r\n \r\n {{material.getErrorFor('smiles')}}\r\n
\r\n
\r\n \r\n This link will open the Structure Search page where the SMILES string will be converted to a structure for searching.\r\n
\r\n
\r\n Generic Class:\r\n
{{material.typeTscaClass?.genericClass}}
\r\n \r\n
\r\n
\r\n Description:\r\n
{{material.materialDescription}}
\r\n \r\n {{material.getErrorFor('materialDescription')}}\r\n
\r\n
\r\n Functional Use:\r\n
{{material.functionalUseExt()}}
\r\n \r\n {{material.getErrorFor('molecularWeight')}}\r\n
\r\n
\r\n Material Notes:\r\n
{{material.materialNotes}}
\r\n \r\n
\r\n
\r\n Natural Occurrence:\r\n
\r\n \r\n
\r\n\r\n
\r\n Cluster Path:\r\n {{_clusterPath.clusterPathName}}\r\n
\r\n\r\n
\r\n Safety Assessment Information\r\n
\r\n\r\n
\r\n Second Round NCS:\r\n \r\n \r\n
\r\n\r\n
\r\n Second Round NCS Comment:\r\n
{{material.secondRoundNCSComment || '-'}}
\r\n \r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n Added to RIFM Database:\r\n \r\n
{{ _stateMap.utilFns.formatDate(material.created, 'YYYY')}}
\r\n
\r\n
\r\n Alternate CAS No.:\r\n
{{material.alternateCASNumber || '-'}}
\r\n \r\n
\r\n
\r\n Added to the Transparency List:\r\n
{{addedToTransparencyListDate() || '-'}}
\r\n
\r\n
\r\n No. Sample Avail:\r\n
{{material.noSampleAvail || '-'}}
\r\n
\r\n
\r\n No. Conc Surv Available:\r\n
{{material.noConcSurvAvail || '-'}}
\r\n
\r\n
\r\n Internal Material Notes:\r\n
{{material.internalMaterialNotes || '-'}}
\r\n \r\n {{material.getErrorFor('internalMaterialNotes')}}\r\n
\r\n
\r\n
\r\n","import { Component, OnInit, ChangeDetectorRef } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router, ActivatedRoute } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { EditorService, MolImageService, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { EditManager, LocationFns, UtilFns } from '../../utils/common';\r\n\r\nimport {Material, TypeMaterialUnit, TypeTSCAClass} from '../../entities/EntityModels';\r\nimport { ClusterPath, MaterialCluster } from '../../entities/EntityModels';\r\n\r\nimport { ROUTES } from '../routes';\r\n\r\n@Component({\r\n selector: 'structure',\r\n templateUrl: './structure.html',\r\n})\r\nexport class StructureComponent implements OnInit {\r\n material: Material;\r\n _typeMaterialUnits: TypeMaterialUnit[];\r\n _typeTSCAClasses: TypeTSCAClass[];\r\n _edm: EditManager;\r\n _clusterPath: ClusterPath;\r\n\r\n constructor(public _uow: UnitOfWork, public _userManager: UserManager, public _stateMap: StateMap,\r\n public _editorService: EditorService, public _molImageService: MolImageService,\r\n public _location: Location, public _router: Router, private changeDetectorRef: ChangeDetectorRef) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n LocationFns.setTab(this._location, 0);\r\n this.material = this._stateMap.currentMaterial;\r\n this._edm = this._editorService.createEditManager(this, 'Material');\r\n this._edm.onlyEntity = this.material;\r\n\r\n this._uow.typeMaterialUnitRepository.all().then(u => {\r\n this._typeMaterialUnits = u;\r\n });\r\n\r\n this._uow.typeTSCAClassRepository.all().then(r => {\r\n this._typeTSCAClasses = r;\r\n\r\n });\r\n this._molImageService.getBase32SmileUrl(this.material.materialId).then((url) => {\r\n this.material.base32SmileUrl = url;\r\n });\r\n\r\n this.fetchMaterialClusterPath();\r\n }\r\n\r\n fetchMaterialClusterPath() {\r\n const params = { materialId: this.material.materialId };\r\n this._uow.fetch('MaterialClusters/MaterialClusterByMaterialId', params).then(m => {\r\n if (m != null && m.length > 0) {\r\n this._clusterPath = m[0].clusterPath;\r\n }\r\n });\r\n }\r\n\r\n onSave() {\r\n // Save null instead of empty string\r\n if (this.material.secondRoundNCSComment != null) {\r\n if (this.isEmptyString(this.material.secondRoundNCSComment)) {\r\n this.material.secondRoundNCSComment = null;\r\n }\r\n }\r\n if (this.material.molecularWeight != null && this.material.typeMaterialUnitId != null) {\r\n if (!this.isValidString(this.material.typeMaterialUnitId) || this.material.typeMaterialUnitId.toLowerCase() == 'none') {\r\n this.material.typeMaterialUnitId = null;\r\n }\r\n }\r\n\r\n this._edm.onSaveCore()\r\n .then(() => {\r\n this._molImageService.getBase32SmileUrl(this.material.materialId).then((url) => {\r\n this.material.base32SmileUrl = url;\r\n });\r\n });\r\n }\r\n\r\n addedToTransparencyListDate() {\r\n const lists = this.material.materialTransparencyLists;\r\n if ((!lists) || lists.length == 0) {\r\n return null;\r\n }\r\n const mtl = _.sortBy(lists, l => l.addedToList)[lists.length - 1];\r\n return UtilFns.formatDate(mtl.addedToList, 'YYYY');\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n getSmileUrl(material: Material) {\r\n if (material.smiles == null) {\r\n return null;\r\n }\r\n const url = this._molImageService.getImageUrlForSmile(material.smiles);\r\n return url;\r\n }\r\n\r\n navToStructureSearch(id: number, smiles: string) {\r\n const parts = UtilFns.asRouterParts(ROUTES.Home, ROUTES.Home.childRoutes._SearchStructure, id, smiles);\r\n this._router.navigate(parts);\r\n }\r\n\r\n navToClusters(clusterPathId: number) {\r\n const parts = UtilFns.asRouterParts(ROUTES.Home, ROUTES.Home.childRoutes.MaterialClusters, this.material.materialId);\r\n this._router.navigate(parts);\r\n }\r\n\r\n hasSMILES() {\r\n if (this.material == null) { return false; }\r\n\r\n return (this.isValidString(this.material.smiles));\r\n }\r\n\r\n onCopySMILESToClipboard() {\r\n const smiles = this.material.smiles;\r\n\r\n const selBox = document.createElement('textarea');\r\n selBox.style.position = 'fixed';\r\n selBox.style.left = '0';\r\n selBox.style.top = '0';\r\n selBox.style.opacity = '0';\r\n selBox.value = smiles;\r\n document.body.appendChild(selBox);\r\n selBox.focus();\r\n selBox.select();\r\n document.execCommand('copy');\r\n document.body.removeChild(selBox);\r\n }\r\n\r\n onMolecularWeightChange() {\r\n if (this.material.molecularWeight == null) {\r\n this.material.typeMaterialUnitId = null;\r\n }\r\n }\r\n\r\n isEmptyString(teststring: string) {\r\n if (teststring == null) { return false; }\r\n\r\n return (teststring.trim().length == 0);\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n checkSecondRoundNCS(value: boolean) {\r\n this.material.secondRoundNCS = value;\r\n }\r\n}\r\n","
\r\n

{{userMessage}}

\r\n\r\n
\r\n
\r\n

No reserves for the selected journal.

\r\n
\r\n\r\n
\r\n
\r\n
\r\n
\r\n
Year
\r\n
Volume
\r\n
Issue
\r\n
Notes
\r\n
\r\n
\r\n
\r\n
{{h.journalYear}}
\r\n
{{h.volume}}
\r\n
{{h.issue}}
\r\n
{{h.notes}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n","import { Component, ViewChild, Inject, Input, forwardRef, OnInit } from '@angular/core';\r\n\r\nimport { UnitOfWork, provideParent } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\n\r\nimport { Journal } from '../../entities/EntityModels';\r\nimport { JournalReserveItem } from '../../entities/projections/JournalReserveItem';\r\n\r\nimport {JournalSelectorComponent, JournalSearchData } from './journal-selector.component';\r\n\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'journal-reserves',\r\n templateUrl: './journal-reserves.html',\r\n})export class JournalReservesComponent implements OnInit {\r\n _userMessage: string;\r\n\r\n _data: JournalSearchData;\r\n _reserves: JournalReserveItem[];\r\n\r\n constructor(@Inject(forwardRef(() => JournalSelectorComponent)) public _parent: JournalSelectorComponent, public _uow: UnitOfWork) {\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n this._data.onResetMap['base'] = this.onReset.bind(this);\r\n\r\n if (this._data != null && this._data.entity != null) {\r\n this.prepareReservesData();\r\n }\r\n }\r\n\r\n // load data\r\n prepareReservesData() {\r\n this.onReset();\r\n\r\n if (this._data.entity.journalReserveItems != null && this._data.entity.journalReserveItems.length > 0) {\r\n\r\n this._reserves = _.orderBy(this._data.entity.journalReserveItems, ['journalYear', 'volume'], ['desc', 'desc']);\r\n }\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n get userMessage() {\r\n return this._userMessage;\r\n }\r\n\r\n hasReservesData() {\r\n return (this._reserves != null && this._reserves.length > 0);\r\n }\r\n\r\n onReset() {\r\n this._userMessage = null;\r\n this._reserves = null;\r\n }\r\n}\r\n\r\n","
\r\n
\r\n {{_data.adding ? \"Adding a Reserve\" : \"Editing a Reserve\" }}\r\n  \r\n for Journal\r\n  \r\n {{_data.entity.journalName}}\r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n

{{_validationMessage}}

\r\n\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
\r\n\r\n
\r\n","import { Location } from '@angular/common';\r\nimport {Component, EventEmitter, forwardRef, Inject, Input, Output, OnInit, ViewChild} from '@angular/core';\r\n\r\nimport { UnitOfWork, StateMap, provideParent } from '../../services/common';\r\nimport { PageState, EditPropParent } from '../../controls/common';\r\nimport { Journal, JournalReserve } from '../../entities/EntityModels';\r\nimport * as _ from 'lodash';\r\n\r\nimport { JournalsComponent, JournalEditData, JournalEditState } from './journals.component';\r\nimport {EditManager} from '../../utils/edit-manager';\r\n\r\n@Component({\r\n selector: 'journal-reserve-editor',\r\n templateUrl: './journal-reserve-editor.html',\r\n providers: [provideParent(JournalReserveEditorComponent, EditPropParent)]\r\n})\r\n\r\nexport class JournalReserveEditorComponent implements OnInit {\r\n @Output() stateChange = new EventEmitter();\r\n\r\n _data: JournalEditData;\r\n _edmReserve: EditManager;\r\n\r\n _hasBeenDeleted = false;\r\n _pageState = new PageState('Journal Reserve Editor');\r\n _validationMessage: string;\r\n\r\n constructor( @Inject(forwardRef(() => JournalsComponent)) public _parent: JournalsComponent,\r\n private _uow: UnitOfWork, private _stateMap: StateMap, public _location: Location) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._edmReserve = new EditManager(this, this._uow, this._stateMap, 'JournalReserve');\r\n\r\n if (this._data == null) {\r\n return;\r\n }\r\n\r\n if (this._data.adding) {\r\n const h = this.createJournalReserve();\r\n this._edmReserve.onlyEntity = h;\r\n } else {\r\n if (this._data.journalReserveId == null) {\r\n return;\r\n }\r\n this.fetchThenEditJournalReserve();\r\n }\r\n\r\n this._edmReserve.editing = true;\r\n\r\n }\r\n\r\n get journalReserve() {\r\n return this._edmReserve.currentEntity;\r\n }\r\n\r\n createJournalReserve() {\r\n const journalReserve = this._uow.journalReserveFactory.create();\r\n journalReserve.journalId = this._data.entity.journalId;\r\n\r\n // provide a default year\r\n const today = new Date();\r\n journalReserve.journalYear = today.getFullYear();\r\n\r\n return journalReserve;\r\n }\r\n\r\n fetchThenEditJournalReserve() {\r\n this._pageState.isLoading = true;\r\n\r\n return this._uow.fetchTyped('Misc/JournalReserveById', JournalReserve, { journalReserveId: this._data.journalReserveId }).then(r => {\r\n const h = r && (r.length > 0) && r[0];\r\n if (h) {\r\n this._edmReserve.onlyEntity = h;\r\n }\r\n this._pageState.isLoading = false;\r\n }).catch(() => {\r\n this._pageState.isLoading = false;\r\n });\r\n }\r\n\r\n getError(propName: string) {\r\n\r\n return;\r\n\r\n if (this._edmReserve == null || this._edmReserve.currentEntity == null) {\r\n return;\r\n }\r\n\r\n const r = this._edmReserve.currentEntity.getErrorFor(propName);\r\n return r;\r\n }\r\n\r\n // *******************************************************\r\n // edit interactions\r\n // *******************************************************\r\n canApply() {\r\n\r\n if (this._data == null) {\r\n return false;\r\n }\r\n\r\n if (this._data.deleting) {\r\n return false;\r\n }\r\n\r\n if (this._edmReserve.editing && this._uow.hasChanges()) {\r\n if (this._edmReserve.currentEntity != null) {\r\n return (!this._edmReserve.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n\r\n if (this.isValidJournalReserve() == false) {\r\n return false;\r\n }\r\n\r\n // journals\r\n if (this._edmReserve.editing) {\r\n this._edmReserve.onApplyCore();\r\n }\r\n\r\n this._data.adding = false;\r\n\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (this._data.deleting) {\r\n return false;\r\n }\r\n\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n onBack() {\r\n this._data.adding = false;\r\n this._edmReserve.editing = false;\r\n this._data.inSubEditor = false;\r\n\r\n this.stateChange.emit('Back');\r\n\r\n }\r\n\r\n canCancel() {\r\n if (this._data.deleting) {\r\n return true;\r\n }\r\n\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._uow.rollback();\r\n\r\n this._edmReserve.clearErrors();\r\n this._edmReserve.editing = false;\r\n this._edmReserve.pageState.loadStatusMsg = null;\r\n\r\n const data = this._data;\r\n data.inSubEditor = false;\r\n\r\n this.stateChange.emit('Cancel');\r\n }\r\n\r\n canDelete() {\r\n if (this._hasBeenDeleted) {\r\n return false;\r\n }\r\n\r\n if (this._data == null || this._edmReserve == null) {\r\n return false;\r\n }\r\n\r\n return (this._data.deleting && this._edmReserve.currentEntity != null && this._hasBeenDeleted == false);\r\n }\r\n\r\n onDelete() {\r\n const reserve = this._edmReserve.currentEntity;\r\n\r\n if (reserve.entityAspect.entityState.isAdded()) {\r\n reserve.entityAspect.rejectChanges();\r\n } else {\r\n reserve.entityAspect.setDeleted();\r\n }\r\n\r\n // this is a confirmed delete so apply changes\r\n this.onApply();\r\n this._hasBeenDeleted = true;\r\n }\r\n\r\n canSave(): boolean {\r\n\r\n if (this._edmReserve.editing) { return false; }\r\n if (!this._edmReserve.hasEdits()) { return false; }\r\n if (!this._edmReserve.validateBeforeSave()) { return false; }\r\n\r\n return true;\r\n }\r\n\r\n onSave() {\r\n if (this._edmReserve.hasEdits()) {\r\n this._edmReserve.onSaveCore().then(() => {\r\n this._edmReserve.editing = false;\r\n });\r\n }\r\n\r\n this.stateChange.emit('Save');\r\n }\r\n\r\n isValidJournalReserve() {\r\n if (this.journalReserve.journalYear == null || this.journalReserve.journalYear == 0) {\r\n this._validationMessage = 'Please enter a valid Year.';\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\n","
\r\n

{{userMessage}}

\r\n\r\n
\r\n
\r\n

No related names for the selected journal.

\r\n
\r\n\r\n
\r\n\r\n
0\" style=\"margin-top: 10px;\">\r\n

Journal Name History

\r\n \r\n \r\n \r\n Journal Id\r\n Journal Name\r\n Journal Name Start Date\r\n Journal Name End Date\r\n Relationship\r\n \r\n \r\n \r\n \r\n {{n.journalId}}\r\n {{n.journalName}}\r\n {{n.displayStartDate}}\r\n {{n.displayEndDate}}\r\n {{n.relationship}}\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n","import { Component, ViewChild, Inject, Input, forwardRef, OnInit } from '@angular/core';\r\n\r\nimport { UnitOfWork, provideParent } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\n\r\nimport { Journal } from '../../entities/EntityModels';\r\nimport { RelatedJournalNameItem } from '../../entities/projections/RelatedJournalNameItem';\r\n\r\nimport {JournalSelectorComponent, JournalSearchData } from './journal-selector.component';\r\n\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'journal-names',\r\n templateUrl: './journal-names.html',\r\n providers: [provideParent(JournalNamesComponent)]\r\n})export class JournalNamesComponent implements OnInit {\r\n\r\n _userMessage: string;\r\n\r\n _relatedJournals: RelatedJournalNameItem[];\r\n\r\n _data: JournalSearchData;\r\n\r\n private colorSelected = 'B0E0E6'; // '#C6E7CE'; // '#e0eeee';\r\n private colorUnselected = '#FFFFFF';\r\n\r\n constructor(@Inject(forwardRef(() => JournalSelectorComponent)) public _parent: JournalSelectorComponent, public _uow: UnitOfWork) {\r\n this._data = _parent._data;\r\n this._data.onResetMap['base'] = this.onReset.bind(this);\r\n }\r\n\r\n ngOnInit() {\r\n if (this._data != null && this._data.entity != null) {\r\n this.fetchJournalsRelatedByName();\r\n }\r\n }\r\n\r\n fetchJournalsRelatedByName() {\r\n this.onReset();\r\n\r\n const params = {\r\n journalId: this._data.entity.journalId,\r\n rootJournalId: this._data.entity.rootJournalId,\r\n journalName: UtilFns.encodeHackForAnd(this._data.entity.journalName)\r\n };\r\n\r\n return this._uow.fetch('Misc/FetchJournalsRelatedByName', params).then(r => {\r\n if (r != null && r.length > 0) {\r\n this._relatedJournals = r;\r\n }\r\n });\r\n }\r\n\r\n hasNamesData() {\r\n return (this._relatedJournals != null && this._relatedJournals.length > 0);\r\n }\r\n\r\n get userMessage() {\r\n return this._userMessage;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n onReset() {\r\n this._userMessage\t = null;\r\n this._relatedJournals = null;\r\n }\r\n}\r\n\r\n","
\r\n

Reassign Journal References from

\r\n

{{pageTitle}}

\r\n

{{\"( \" + getReferenceCountText() + \")\"}}

\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n

{{_validationMessage}}

\r\n\r\n
\r\n\r\n
\r\n
\r\n

References Selected for Reassignment

\r\n 0\">\r\n
\r\n \r\n \r\n ReferenceId\r\n Brief Reference\r\n \r\n \r\n \r\n \r\n {{r.referenceId}}\r\n {{r.briefReference}}\r\n \r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n

{{reassignJournalName}}

\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n\r\n\r\n","import {Component, EventEmitter, forwardRef, Inject, Input, Output, OnInit, ViewChild} from '@angular/core';\r\nimport { Location } from '@angular/common';\r\n\r\nimport { Router } from '@angular/router';\r\nimport { Entity } from 'breeze-client';\r\nimport { EditorService, ErrorLogger, provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent, PageState } from '../../controls/common';\r\n\r\nimport {Journal, Reference} from '../../entities/EntityModels';\r\n\r\nimport { JournalEditData, JournalsComponent} from './journals.component';\r\nimport { JournalSelectorComponent } from './journal-selector.component';\r\nimport {UtilFns} from '../../utils/util-fns';\r\nimport {EditManager} from '../../utils/edit-manager';\r\n\r\nimport * as pluralize from 'pluralize';\r\n\r\n// class PageStateExt extends PageState {\r\n// journalId: number;\r\n// }\r\n\r\n@Component({\r\n selector: 'journal-reassign',\r\n templateUrl: './journal-reassign.html',\r\n providers: [provideParent(JournalReassignComponent, EditPropParent)]\r\n})\r\nexport class JournalReassignComponent implements OnInit, EditPropParent {\r\n @ViewChild(JournalSelectorComponent, { static: true }) _journalSelectorComponent: JournalSelectorComponent;\r\n\r\n @Output() stateChange = new EventEmitter();\r\n\r\n _data: JournalEditData;\r\n _edm: EditManager;\r\n _selectedReferences: Reference[] = [];\r\n\r\n _reassignJournal: Journal;\r\n _hasBeenReassigned = false;\r\n\r\n // _pageState = new PageStateExt('Journal editor');\r\n _validationMessage: string;\r\n\r\n constructor(@Inject(forwardRef(() => JournalsComponent)) public _parent: JournalsComponent,\r\n public _uow: UnitOfWork, public _stateMap: StateMap, public _editorService: EditorService,\r\n public _location: Location, public _errorLogger: ErrorLogger, public _router: Router) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n this._edm\t= new EditManager(this, this._uow, this._stateMap, 'Reassign Journal');\r\n\r\n if (this._data == null) {\r\n return;\r\n }\r\n\r\n this._edm.onlyEntity = this._data.entity;\r\n this._edm.editing = true;\r\n\r\n const data = this._data;\r\n this._selectedReferences = this._edm.currentEntity.references.filter(function(ref) {\r\n return data.selectedReferenceIds.indexOf(ref.referenceId) !== -1;\r\n });\r\n\r\n if (this._selectedReferences == null || this._selectedReferences.length < 1) {\r\n this._validationMessage = 'Error, no References selected for reassignment.';\r\n return;\r\n }\r\n }\r\n\r\n get reassignJournalName(): string {\r\n if (this._reassignJournal == null ) { return ''; }\r\n\r\n return (this._reassignJournal.journalName);\r\n }\r\n\r\n onSearchForReassignJournal() {\r\n this._validationMessage = '';\r\n\r\n this._journalSelectorComponent.setShowJournalData(true);\r\n UtilFns.showModal(this._journalSelectorComponent, this, null).then((j: Journal) => {\r\n if (!j) {\r\n return;\r\n }\r\n this._reassignJournal = j;\r\n if (this._data.entity.journalId == this._reassignJournal.journalId) {\r\n this._validationMessage = 'Cannot reassign to the same journal.';\r\n }\r\n });\r\n }\r\n\r\n getReferenceCountText() {\r\n if (this._selectedReferences != null) {\r\n const l = this._selectedReferences.length;\r\n return `${l} ${pluralize('reference', l)} will be reassigned.`;\r\n }\r\n }\r\n\r\n // *******************************************************\r\n // edit interactions\r\n // *******************************************************\r\n canApply() {\r\n\r\n if (this._data == null || this._reassignJournal == null) {\r\n return false;\r\n }\r\n\r\n if (this._selectedReferences == null || this._selectedReferences.length < 1) {\r\n return false;\r\n }\r\n\r\n if (this._data.entity.journalId == this._reassignJournal.journalId) {\r\n return false;\r\n }\r\n\r\n return (this._edm.editing);\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n\r\n if (this._edm.editing) {\r\n this.reassignJournalReferences();\r\n this._edm.onApplyCore();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (this._hasBeenReassigned) {\r\n return false;\r\n }\r\n\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n onBack() {\r\n this._edm.editing = false;\r\n this._data.inSubEditor = false;\r\n\r\n this.stateChange.emit('Back');\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._uow.rollback();\r\n\r\n this._edm.clearErrors();\r\n this._edm.editing = false;\r\n this._edm.pageState.loadStatusMsg = null;\r\n\r\n const data = this._data;\r\n data.inSubEditor = false;\r\n\r\n this.stateChange.emit('Cancel');\r\n }\r\n\r\n canReassign() {\r\n return (this._edm.currentEntity != null && this._reassignJournal != null);\r\n }\r\n\r\n reassignJournalReferences() {\r\n\r\n this._selectedReferences.forEach(r => {\r\n r.journalId = this._reassignJournal.journalId;\r\n });\r\n }\r\n\r\n canSave(): boolean {\r\n if (this._edm.editing) { return false; }\r\n if (!this._edm.hasEdits()) { return false; }\r\n if (!this._edm.validateBeforeSave()) { return false; }\r\n\r\n return true;\r\n }\r\n\r\n onSave() {\r\n // journal\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n this._edm.editing = false;\r\n\r\n const data = this._data;\r\n data.inSubEditor = false;\r\n this.stateChange.emit('Save');\r\n });\r\n }\r\n }\r\n\r\n sameStringWithoutSpaces(compare1: string, compare2: string) {\r\n return (compare1.replace(/\\s+/g, '').toLowerCase()\t== compare2.replace(/\\s+/g, '').toLowerCase());\r\n }\r\n\r\n getError(propName: string) {\r\n if (this._edm == null || this._edm.currentEntity == null) {\r\n return;\r\n }\r\n\r\n const r = this._edm.currentEntity.getErrorFor(propName);\r\n return r;\r\n }\r\n\r\n get pageTitle() {\r\n if (this._data == null || this._data.entity == null) {\r\n return '';\r\n }\r\n\r\n return this._data.entity.journalName;\r\n }\r\n}\r\n","
\r\n
\r\n {{_data.adding ? \"Adding a Subscription\" : \"Editing a Subscription\" }}\r\n  \r\n for Journal\r\n  \r\n {{_data.entity.journalName}}\r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n

{{_validationMessage}}

\r\n\r\n
\r\n\r\n
\r\n\r\n

Publisher Data

\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n

Subscription Data

\r\n\r\n
\r\n \r\n \r\n YYYY\r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n YYYY\r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n

Payment Data

\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n

Additional Data

\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
\r\n\r\n
\r\n","import { Location } from '@angular/common';\r\nimport {Component, EventEmitter, forwardRef, Inject, Input, Output, OnInit, ViewChild} from '@angular/core';\r\n\r\nimport { UnitOfWork, StateMap, provideParent } from '../../services/common';\r\nimport { PageState, EditPropParent } from '../../controls/common';\r\nimport {Journal, JournalSubscription, TypeJournalSubscription} from '../../entities/EntityModels';\r\nimport * as _ from 'lodash';\r\n\r\nimport { JournalsComponent, JournalEditData, JournalEditState } from './journals.component';\r\nimport {EditManager} from '../../utils/edit-manager';\r\n\r\n@Component({\r\n selector: 'journal-subscription-editor',\r\n templateUrl: './journal-subscription-editor.html',\r\n providers: [provideParent(JournalSubscriptionEditorComponent, EditPropParent)]\r\n})\r\n\r\nexport class JournalSubscriptionEditorComponent implements OnInit {\r\n @Output() stateChange = new EventEmitter();\r\n\r\n _data: JournalEditData;\r\n\r\n _edmSubscription: EditManager;\r\n _typeJournalSubscriptions: TypeJournalSubscription[];\r\n _journalSubscription: JournalSubscription;\r\n\r\n _pageState = new PageState('Journal Subscription Editor');\r\n _validationMessage: string;\r\n\r\n _hasBeenDeleted = false;\r\n\r\n _subscriptionStartYear: string;\r\n _subscriptionEndYear: string;\r\n _selectedSubscriptionStartMonthIndex = 0;\r\n _selectedSubscriptionEndMonthIndex = 0;\r\n\r\n _dateErrMsg = 'The Subscription Start Date is equal to or later than the Subscription End Date.';\r\n\r\n public _monthNames = [{ month: 'None' }, { month: 'January' }, { month: 'February' }, { month: 'March' },\r\n { month: 'April' }, { month: 'May' }, { month: 'June' },\r\n { month: 'July' }, { month: 'August' }, { month: 'September' },\r\n { month: 'October' }, { month: 'November' }, { month: 'December' }];\r\n\r\n constructor( @Inject(forwardRef(() => JournalsComponent)) public _parent: JournalsComponent,\r\n private _uow: UnitOfWork, private _stateMap: StateMap, public _location: Location) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n this._edmSubscription = new EditManager(this, this._uow, this._stateMap, 'JournalSubscription');\r\n\r\n if (this._data == null) {\r\n return;\r\n }\r\n\r\n this._uow.typeJournalSubscriptionRepository.all().then(types => {\r\n if (types != null) {\r\n this._typeJournalSubscriptions = _.sortBy(types, t => t.sortOrder);\r\n }\r\n });\r\n\r\n if (this._data.adding) {\r\n const s = this.createJournalSubscription();\r\n this._journalSubscription = s;\r\n this._journalSubscription.typeJournalSubscriptionId = 'NONE';\r\n this._edmSubscription.onlyEntity = this._journalSubscription;\r\n this._edmSubscription.editing = true;\r\n\r\n } else {\r\n if (this._data.journalSubscriptionId == null) {\r\n return;\r\n }\r\n this.fetchThenEditJournalSubscription();\r\n }\r\n }\r\n\r\n getError(propName: string) {\r\n\r\n return;\r\n\r\n if (this._edmSubscription.editing == false) {\r\n return;\r\n }\r\n\r\n if (this._journalSubscription == null) {\r\n return;\r\n }\r\n\r\n const r = this._journalSubscription.getErrorFor(propName);\r\n return r;\r\n }\r\n\r\n get journalSubscription() {\r\n return this._edmSubscription.currentEntity;\r\n }\r\n\r\n createJournalSubscription() {\r\n const journalSubscription = this._uow.journalSubscriptionFactory.create();\r\n journalSubscription.journalId = this._data.entity.journalId;\r\n\r\n return journalSubscription;\r\n }\r\n\r\n fetchThenEditJournalSubscription() {\r\n return this._uow.fetchTyped('Misc/JournalSubscriptionById', JournalSubscription, { journalSubscriptionId: this._data.journalSubscriptionId }).then(r => {\r\n const s = r && (r.length > 0) && r[0];\r\n if (s) {\r\n this._journalSubscription = s;\r\n this._edmSubscription.onlyEntity = this._journalSubscription;\r\n this._edmSubscription.editing = true;\r\n\r\n // tslint:disable-next-line:max-line-length\r\n this._subscriptionStartYear = (this._edmSubscription.currentEntity.subscriptionStartYear != null) ? this._edmSubscription.currentEntity.subscriptionStartYear.toString() : null;\r\n // tslint:disable-next-line:max-line-length\r\n this._subscriptionEndYear = (this._edmSubscription.currentEntity.subscriptionEndYear != null) ? this._edmSubscription.currentEntity.subscriptionEndYear.toString() : null;\r\n this._selectedSubscriptionStartMonthIndex = (this._edmSubscription.currentEntity.subscriptionStartMonth != null) ? this._edmSubscription.currentEntity.subscriptionStartMonth : 0;\r\n this._selectedSubscriptionEndMonthIndex \t= (this._edmSubscription.currentEntity.subscriptionEndMonth != null) ? this._edmSubscription.currentEntity.subscriptionEndMonth : 0;\r\n }\r\n this._pageState.isLoading = false;\r\n }).catch(() => {\r\n this._pageState.isLoading = false;\r\n });\r\n }\r\n\r\n // *******************************************************\r\n // edit interactions\r\n // *******************************************************\r\n canApply() {\r\n\r\n if (this._edmSubscription.currentEntity == null) {\r\n return false;\r\n }\r\n\r\n if (this._data == null) {\r\n return false;\r\n }\r\n\r\n if (this._data.deleting) {\r\n return false;\r\n }\r\n\r\n if (!this.hasValidJournalSubscriptionDates()) { return false; }\r\n\r\n if (this._edmSubscription.editing && this._uow.hasChanges()) {\r\n if (this._edmSubscription.currentEntity != null) {\r\n return (!this._edmSubscription.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n\r\n if (!this.isValidSubscription()) { return false; }\r\n\r\n // journals\r\n if (this._edmSubscription.editing) {\r\n this._edmSubscription.onApplyCore();\r\n this._data.adding = false;\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n canShowBack() {\r\n if (this._data.deleting) {\r\n return false;\r\n }\r\n\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n onBack() {\r\n this._data.adding = false;\r\n this._edmSubscription.editing = false;\r\n this._data.inSubEditor = false;\r\n\r\n this.stateChange.emit('Back');\r\n }\r\n\r\n canCancel() {\r\n if (this._data.deleting) {\r\n return true;\r\n }\r\n\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._uow.rollback();\r\n\r\n this._edmSubscription.clearErrors();\r\n this._edmSubscription.editing = false;\r\n this._edmSubscription.pageState.loadStatusMsg = null;\r\n\r\n const data = this._data;\r\n data.inSubEditor = false;\r\n\r\n this.stateChange.emit('Cancel');\r\n }\r\n\r\n canDelete() {\r\n if (this._hasBeenDeleted) {\r\n return false;\r\n }\r\n\r\n if (this._data == null || this._edmSubscription == null) {\r\n return false;\r\n }\r\n\r\n return (this._data.deleting && this._edmSubscription.currentEntity != null);\r\n }\r\n\r\n onDelete() {\r\n const subscription = this._edmSubscription.currentEntity;\r\n\r\n if (subscription.entityAspect.entityState.isAdded()) {\r\n subscription.entityAspect.rejectChanges();\r\n } else {\r\n subscription.entityAspect.setDeleted();\r\n }\r\n\r\n // this is a confirmed delete so apply changes\r\n this.onApply();\r\n\r\n this._hasBeenDeleted = true;\r\n }\r\n\r\n canSave(): boolean {\r\n\r\n if (this._edmSubscription.editing) { return false; }\r\n if (!this._edmSubscription.hasEdits()) { return false; }\r\n if (!this._edmSubscription.validateBeforeSave()) { return false; }\r\n\r\n return true;\r\n }\r\n\r\n onSave() {\r\n if (this._edmSubscription.hasEdits()) {\r\n this._edmSubscription.onSaveCore().then(() => {\r\n this._edmSubscription.editing = false;\r\n });\r\n }\r\n this.stateChange.emit('Save');\r\n }\r\n\r\n isValidSubscription(): boolean {\r\n if (!this.isValidString(this.journalSubscription.publisher)) {\r\n this._validationMessage = 'Please enter a Publisher';\r\n return false;\r\n }\r\n\r\n if (this.journalSubscription.typeJournalSubscriptionId.toLowerCase() == 'none') {\r\n this._validationMessage = 'Please select a Subscription Type';\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n isValidString(teststring: string) {\r\n if (!teststring) { return false; }\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n // dates\r\n onChangeJournalSubscriptionStartYear(yearString: string) {\r\n this._validationMessage = '';\r\n\r\n if (this.isStringNullOrEmpty(yearString)) {\r\n this._edmSubscription.currentEntity.subscriptionStartYear = null;\r\n this._edmSubscription.currentEntity.subscriptionStartMonth = null; // a year value is required for a month value\r\n this._subscriptionStartYear = null;\r\n return;\r\n }\r\n\r\n if (this.isValidYear(yearString)) {\r\n this._edmSubscription.currentEntity.subscriptionStartYear = parseInt(yearString, 10);\r\n this._subscriptionStartYear = parseInt(yearString, 10).toString();\r\n } else {\r\n this._validationMessage = 'An incorrect Year has been entered in the Subscription Start Year field.';\r\n }\r\n }\r\n\r\n onChangeJournalSubscriptionEndYear(yearString: string) {\r\n this._validationMessage = '';\r\n\r\n if (this.isStringNullOrEmpty(yearString)) {\r\n this._edmSubscription.currentEntity.subscriptionEndYear = null;\r\n this._edmSubscription.currentEntity.subscriptionEndMonth = null; // a year value is required for a month value\r\n this._subscriptionEndYear = null;\r\n return;\r\n }\r\n\r\n if (this.isValidYear(yearString)) {\r\n this._edmSubscription.currentEntity.subscriptionEndYear = parseInt(yearString, 10);\r\n this._subscriptionEndYear = parseInt(yearString, 10).toString();\r\n } else {\r\n this._validationMessage = 'An incorrect Year has been entered in the Subscription End Year field.';\r\n }\r\n }\r\n\r\n onSelectSubscriptionStartMonth(monthidx: number) {\r\n this._selectedSubscriptionStartMonthIndex = monthidx;\r\n this._edmSubscription.currentEntity.subscriptionStartMonth = (monthidx > 0) ? monthidx : null;\r\n\r\n if (this._validationMessage == this._dateErrMsg) {\r\n this._validationMessage = '';\r\n }\r\n this.hasValidJournalSubscriptionDates();\r\n }\r\n\r\n onSelectSubscriptionEndMonth(monthidx: number) {\r\n this._selectedSubscriptionEndMonthIndex = monthidx;\r\n this._edmSubscription.currentEntity.subscriptionEndMonth = (monthidx > 0) ? monthidx : null;\r\n\r\n if (this._validationMessage == this._dateErrMsg) {\r\n this._validationMessage = '';\r\n }\r\n this.hasValidJournalSubscriptionDates();\r\n }\r\n\r\n isStringNullOrEmpty(s: string): boolean {\r\n return (s == null || s.trim() === '');\r\n }\r\n\r\n isValidYear(yearString: string) {\r\n const year = parseInt(yearString, 10);\r\n return !isNaN(year) && year > 1900 && year < 2100;\r\n }\r\n\r\n checkDate(dateString: string): boolean {\r\n const d = Date.parse(dateString);\r\n\r\n return (!isNaN(d));\r\n }\r\n\r\n formatDate(month: number, year: number): Date {\r\n const s = '';\r\n const d = s.concat('' + month, '/', '01', '/', '' + year);\r\n return new Date(d);\r\n }\r\n\r\n hasValidJournalSubscriptionDates() {\r\n if (this._edmSubscription.currentEntity.subscriptionStartYear == null || this._edmSubscription.currentEntity.subscriptionEndYear == null) {\r\n return true;\r\n }\r\n\r\n const startMonth = (this._edmSubscription.currentEntity.subscriptionStartMonth != null) ? this._edmSubscription.currentEntity.subscriptionStartMonth : 1;\r\n const endMonth = (this._edmSubscription.currentEntity.subscriptionEndMonth != null) ? this._edmSubscription.currentEntity.subscriptionEndMonth : 1;\r\n\r\n const startDate = new Date(this._edmSubscription.currentEntity.subscriptionStartYear,startMonth,1);\r\n const endDate = new Date(this._edmSubscription.currentEntity.subscriptionEndYear,endMonth,1);\r\n\r\n if (startDate >= endDate) {\r\n this._validationMessage = this._dateErrMsg;\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n}\r\n","
\r\n

{{userMessage}}

\r\n\r\n
\r\n\r\n

No subscriptions for the selected journal.

\r\n\r\n
\r\n
\r\n
\r\n
Subscription Type
\r\n
Start Date
\r\n
End Date
\r\n
Issues per Year
\r\n
Publisher
\r\n
Notes
\r\n
\r\n
\r\n
\r\n
{{s.subscriptionDescription}}
\r\n
{{s.subscriptionStartYearAndMonth}}
\r\n
{{s.subscriptionEndYearAndMonth}}
\r\n
{{s.issuesPerYear}}
\r\n
{{s.publisher}}
\r\n
{{s.notes}}
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n\r\n
\r\n","import { Component, ViewChild, Inject, Input, forwardRef, OnInit } from '@angular/core';\r\n\r\nimport { UnitOfWork, provideParent } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { Journal } from '../../entities/EntityModels';\r\nimport { JournalSubscriptionItem } from '../../entities/projections/JournalSubscriptionItem';\r\n\r\nimport {JournalSelectorComponent, JournalSearchData } from './journal-selector.component';\r\n\r\nimport * as _ from 'lodash';\r\n\r\n@Component({\r\n selector: 'journal-subscriptions',\r\n templateUrl: './journal-subscriptions.html',\r\n})export class JournalSubscriptionsComponent implements OnInit {\r\n _userMessage: string;\r\n\r\n // For groupings\r\n _subscriptions: JournalSubscriptionItem[];\r\n\r\n _data: JournalSearchData;\r\n\r\n constructor(@Inject(forwardRef(() => JournalSelectorComponent)) public _parent: JournalSelectorComponent, public _uow: UnitOfWork) {\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n this._data.onResetMap['base'] = this.onReset.bind(this);\r\n\r\n if (this._data != null && this._data.entity != null) {\r\n this.prepareSubscriptionsData();\r\n }\r\n }\r\n\r\n // load data\r\n prepareSubscriptionsData() {\r\n this.onReset();\r\n\r\n if (this._data.entity.journalSubscriptionItems != null && this._data.entity.journalSubscriptionItems.length > 0) {\r\n this._subscriptions = (this._data.entity.journalSubscriptionItems.sort(JournalSubscriptionItem.compareJournalSubscriptionItems));\r\n }\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n get userMessage() {\r\n return this._userMessage;\r\n }\r\n\r\n hasSubscriptionsData() {\r\n return (this._subscriptions != null && this._subscriptions.length > 0);\r\n }\r\n\r\n onReset() {\r\n this._userMessage = null;\r\n this._subscriptions = null;\r\n }\r\n\r\n}\r\n\r\n","
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
Now select a row from below or click 'Cancel'
\r\n
\r\n
\r\n

{{validationMessage}}

\r\n
\r\n \r\n \r\n \r\n Guideline\r\n Explanation\r\n \r\n \r\n \r\n \r\n {{a.guideline}}\r\n {{a.explanation}}\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
","import { Component, ElementRef, OnInit } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { ModalDialog, PageState } from '../../controls/common';\r\n\r\nimport { TypeComplianceGuideline } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'compliance-selector',\r\n templateUrl: './compliance-selector.html',\r\n})\r\nexport class ComplianceSelectorComponent extends ModalDialog implements OnInit {\r\n _searchTerm: string;\r\n _allEntities: TypeComplianceGuideline[] = [];\r\n _entities: TypeComplianceGuideline[] = [];\r\n _pageState = new PageState('Complaince Guidelines');\r\n\r\n constructor(elementRef: ElementRef, public _uow: UnitOfWork) {\r\n super(elementRef);\r\n }\r\n\r\n ngOnInit() {\r\n this._pageState.isLoading = true;\r\n this._uow.typeComplianceGuidelineRepository.all().then(r => {\r\n this._pageState.isLoaded = r;\r\n this._allEntities = _.sortBy(r, x => x.guideline);\r\n this.search();\r\n });\r\n }\r\n\r\n hasSearchTerm() {\r\n return this._searchTerm && this._searchTerm.length > 0;\r\n }\r\n\r\n search() {\r\n this.validationMessage = null;\r\n\r\n if (this.hasSearchTerm()) {\r\n const searchTerm = this._searchTerm.toLowerCase();\r\n this._entities = this._allEntities.filter(f => (f.guideline || '').toLowerCase().indexOf(searchTerm) > -1\r\n || (f.explanation || '').toLowerCase().indexOf(searchTerm) > -1);\r\n } else {\r\n this._entities = this._allEntities;\r\n }\r\n\r\n }\r\n\r\n onSelect(type: TypeComplianceGuideline) {\r\n UtilFns.returnModal(this, type);\r\n }\r\n\r\n\r\n}\r\n\r\n","
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n \r\n {{briefRef}}\r\n (delete)\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n\r\n\r\n\r\n","import { Component, Input, OnInit, ViewChild } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { UtilFns } from '../../utils/common';\r\n\r\nimport {\r\n BiologicalData,\r\n TypeComplianceGuideline,\r\n TypeRoute,\r\n TypeSpecies,\r\n TypeStudy,\r\n TypeStudyDesignation,\r\n TypeTimeUnit,\r\n TypeUsefulness\r\n} from '../../entities/EntityModels';\r\nimport { ReferenceListItem } from '../../entities/projections/ReferenceListItem';\r\nimport { ReferenceSelectorComponent } from '../reference/reference-selector.component';\r\nimport { ComplianceSelectorComponent } from './compliance-selector.component';\r\n\r\n@Component({\r\n selector: 'protocol-editor-biodata',\r\n templateUrl: './protocol-editor-biodata.html',\r\n providers: [provideParent(ProtocolEditorBiodataComponent, EditPropParent)]\r\n})\r\nexport class ProtocolEditorBiodataComponent implements OnInit, EditPropParent {\r\n @ViewChild(ReferenceSelectorComponent, { static: true }) _referenceSelectorComponent: ReferenceSelectorComponent;\r\n @ViewChild(ComplianceSelectorComponent, { static: true }) _complianceSelectorComponent: ComplianceSelectorComponent;\r\n\r\n @Input() entity: BiologicalData;\r\n\r\n _typeStudies: TypeStudy[];\r\n _typeSpecies: TypeSpecies[];\r\n _typeRoutes: TypeRoute[];\r\n _typeTimeUnits: TypeTimeUnit[];\r\n _typeUsefulnesses: TypeUsefulness[];\r\n _typeStudyDesignations: TypeStudyDesignation[] = [];\r\n\r\n\r\n constructor(public _uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n // HACK: setTimeout is only needed in IE11 and Edge\r\n // reason seems to be that synchronous promises do not take a tick in IE and Edge\r\n // so this fix is needed to avoid 'Expression has changed after it was checked message.\r\n setTimeout(() => {\r\n this._uow.typeStudyDesignationRepository.all()\r\n .then(r => {\r\n this._typeStudyDesignations = r;\r\n this._uow.typeStudyRepository.all().then(x => this._typeStudies = _.sortBy(x, y => y.studyLong));\r\n this._uow.typeSpeciesRepository.all().then(x => this._typeSpecies = _.sortBy(x, y => y.speciesLong));\r\n });\r\n this._uow.typeRouteRepository.all().then(r => this._typeRoutes = _.sortBy(r, x => x.routeLong));\r\n this._uow.typeTimeUnitRepository.all().then(r => this._typeTimeUnits = _.sortBy(r, x => x.typeTimeUnitId));\r\n this._uow.typeUsefulnessRepository.all().then(r => this._typeUsefulnesses = _.sortBy(r, x => x.description));\r\n\r\n }, 0);\r\n\r\n }\r\n\r\n getError(propName: string) {\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n updateStudy(typeStudyId: string) {\r\n this.updateHHorEnv(typeStudyId, this.entity.typeSpeciesId);\r\n return typeStudyId;\r\n }\r\n\r\n updateSpecies(typeSpeciesId: string) {\r\n this.updateHHorEnv(this.entity.typeStudyId, typeSpeciesId);\r\n return typeSpeciesId;\r\n }\r\n\r\n updateHHorEnv(typeStudyId: string, typeSpeciesId: string) {\r\n const tsd = _.find(this._typeStudyDesignations, x =>\r\n (x.typeStudyId == typeStudyId || x.typeStudyId == null) && (x.typeSpeciesId == typeSpeciesId || x.typeSpeciesId == null));\r\n\r\n const designation = tsd ? tsd.designation : '';\r\n this.entity.humanHealthData = (designation == 'HH');\r\n this.entity.environmentalData = (designation == 'Env');\r\n }\r\n\r\n onAddBriefRef() {\r\n UtilFns.showModal(this._referenceSelectorComponent, this, this.validateReference)\r\n .then(rli => {\r\n if (rli == null) {\r\n return;\r\n }\r\n const briefRefs = this.entity.getMethodologyBriefRefs();\r\n briefRefs.push(rli.briefReference);\r\n this.refreshBriefRefs(briefRefs);\r\n });\r\n\r\n }\r\n\r\n onDeleteBriefRef(briefRef: string) {\r\n const briefRefs = this.entity.getMethodologyBriefRefs();\r\n _.remove(briefRefs, (br) => br == briefRef);\r\n this.refreshBriefRefs(briefRefs);\r\n\r\n }\r\n\r\n validateReference(rli: ReferenceListItem): string {\r\n return null;\r\n // TODO: might want to check for dups here - but not critical\r\n // if (alreadyExists) {\r\n // return \"Reference: \" + rli.referenceId + \" has already been referenced.\"\r\n // }\r\n }\r\n\r\n refreshBriefRefs(briefRefs: string[]) {\r\n this.entity.methodologyReference = briefRefs.join(';');\r\n }\r\n\r\n onSelectCompliance() {\r\n UtilFns.showModal(this._complianceSelectorComponent, this).then((r: TypeComplianceGuideline) => {\r\n if (r) {\r\n this.entity.compliance = r.guideline + ': ' + r.explanation;\r\n }\r\n });\r\n }\r\n}\r\n","
\r\n\r\n\r\n
\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n\r\n
\r\n\r\n
\r\n
\r\n \r\n {{_status}}\r\n
\r\n
\r\n\r\n
\r\n
\r\n 0\">\r\n \r\n \r\n Study\r\n Sub Study\r\n \r\n \r\n \r\n \r\n {{st.typeStudySubType.typeStudyId}}\r\n {{st.typeStudySubType.studySubTypeId}} - {{st.typeStudySubType.subTypeDescription}}\r\n Delete\r\n \r\n \r\n\r\n \r\n
\r\n
\r\n\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { BioDataStudySubType, BiologicalData, TypeStudy, TypeStudySubType } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'protocol-editor-substudies',\r\n templateUrl: './protocol-editor-substudies.html',\r\n providers: [provideParent(ProtocolEditorSubStudiesComponent, EditPropParent)]\r\n})\r\nexport class ProtocolEditorSubStudiesComponent implements OnInit, EditPropParent {\r\n @Input() entity: BiologicalData;\r\n _typeStudies: TypeStudy[];\r\n _typeStudySubTypes: TypeStudySubType[];\r\n _filteredSubTypes: TypeStudySubType[];\r\n _status: string;\r\n\r\n _typeStudyId = '';\r\n set typeStudyId(val: string) {\r\n if (this._typeStudyId != val) {\r\n this.typeStudySubTypeId = null;\r\n }\r\n this._typeStudyId = val;\r\n this._filteredSubTypes = this.getStudySubTypes(val);\r\n }\r\n\r\n get typeStudyId() {\r\n return this._typeStudyId;\r\n }\r\n\r\n typeStudySubTypeId = '';\r\n\r\n constructor(public _uow: UnitOfWork) {\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.bioDataStudySubTypeRepository\r\n .whereWithParams({ biologicalDataId: this.entity.biologicalDataId });\r\n\r\n this._uow.typeStudySubTypeRepository.all()\r\n .then(r => {\r\n this._typeStudySubTypes = _.sortBy(r, x => x.subTypeDescription);\r\n this._uow.typeStudyRepository.all()\r\n .then(data => {\r\n this._typeStudies = _.sortBy(data, x => x.studyLong)\r\n .filter(x => this.getStudySubTypes(x.typeStudyId).length > 0);\r\n });\r\n });\r\n }\r\n\r\n canAdd() {\r\n return !!this.typeStudySubTypeId;\r\n }\r\n\r\n addSubStudy() {\r\n try {\r\n if (!this.canAdd()) {\r\n return;\r\n }\r\n\r\n const config = {\r\n biologicalDataId: this.entity.biologicalDataId,\r\n typeStudyId: this.typeStudyId,\r\n studySubTypeId: this.typeStudySubTypeId\r\n };\r\n this._uow.bioDataStudySubTypeFactory.create(config);\r\n } catch (e) {\r\n this.setStatus('This sub study was already added or deleted.');\r\n }\r\n }\r\n\r\n getError(propName: string) {\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n onDeleteSubStudy(subStudy: BioDataStudySubType) {\r\n subStudy.entityAspect.setDeleted();\r\n }\r\n\r\n getStudySubTypes(studyId: string) {\r\n if (this._typeStudySubTypes) {\r\n return this._typeStudySubTypes.filter(x => x.typeStudyId == studyId);\r\n }\r\n }\r\n\r\n setStatus(message: string) {\r\n this._status = message;\r\n setTimeout(() => {\r\n this._status = null;\r\n }, 3000);\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n \r\n \r\n \r\n CAS No.\r\n Principal Name \r\n Procedure\r\n Observed Result\r\n Sample\r\n Test Method\r\n Updated\r\n \r\n \r\n \r\n \r\n {{ar.material.realCASNumber}}\r\n \r\n \r\n \r\n \r\n {{ar.analyticalSample}}\r\n {{ar.testMethod}}\r\n {{utilFns.formatDate(ar.modified) }}\r\n \r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n

Linked Physical Properties Checked

\r\n
\r\n
\r\n
\r\n","import { Component, forwardRef, Inject, OnInit } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, ReferenceState, StateMap, UnitOfWork, UserManager } from '../../services/common';\r\nimport { AnalyticalResult, Material, Reference } from '../../entities/EntityModels';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { ReferenceEditorComponent } from './reference-editor.component';\r\nimport { ROUTES } from '../routes';\r\n\r\n\r\n@Component({\r\n selector: 'reference-analytical-results',\r\n templateUrl: './reference-analytical-results.html',\r\n providers: [provideParent(ReferenceAnalyticalResultsComponent, EditPropParent)]\r\n})\r\nexport class ReferenceAnalyticalResultsComponent implements OnInit, EditPropParent {\r\n\r\n\r\n private _linkedAnalyticalResults: AnalyticalResult[];\r\n _data: {\r\n entity: Reference,\r\n inSubEditor: boolean,\r\n onCancelMap: {},\r\n };\r\n\r\n constructor(@Inject(forwardRef(() => ReferenceEditorComponent)) public _parent: ReferenceEditorComponent,\r\n private _uow: UnitOfWork, private _stateMap: StateMap, private _userManager: UserManager, private _referenceState: ReferenceState, public _router: Router) {\r\n }\r\n\r\n ngOnInit() {\r\n this._data = this._parent.data;\r\n this._data.onCancelMap['special'] = this.onCancel.bind(this);\r\n\r\n if (this.reference.analyticalResults != null && this.reference.analyticalResults.length > 0) {\r\n // material.... was fetched in Reference.GetForEdit on the reference-editor.component.\r\n this._linkedAnalyticalResults = _.sortBy(this.reference.analyticalResults, a => _.get(a, 'material.principalSynonym().synonymWordOrWebVersion()', ''));\r\n }\r\n }\r\n\r\n public get reference() {\r\n return this._data.entity;\r\n }\r\n\r\n\r\n get linkedAnalyticalResults() {\r\n return this._linkedAnalyticalResults;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n isStaff() {\r\n return this._stateMap.currentUser.isStaff;\r\n }\r\n\r\n downloadReport(fileName: string) {\r\n const url = this._userManager.getUVUrl(fileName.trim());\r\n window.open(url, '_self');\r\n return false;\r\n }\r\n\r\n getError(propName: string) {\r\n return this._parent.data.entity.getErrorFor(propName);\r\n }\r\n\r\n goToMaterialAnalyticalResults(mat: Material) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Material, mat.materialId, ROUTES.Material.childRoutes.AnalyticalResults));\r\n }\r\n\r\n onCancel() {\r\n }\r\n\r\n // Workflow related\r\n public hasCheckedSpecialLinks() {\r\n return (this._referenceState.hasCheckedAnalyticalResults(this._parent.data.entity));\r\n }\r\n\r\n public hasUncheckedSpecialLinks() {\r\n return (this._referenceState.hasUncheckedAnalyticalResults(this._parent.data.entity));\r\n }\r\n\r\n public onLinkedAnalyticalResultsChecked() {\r\n this._referenceState.recordAnalyticalResultsChecked(this._parent.data.entity);\r\n }\r\n}\r\n","

Adding new Author

\r\n

Editing existing Author

\r\n\r\n \r\n \r\n\r\n\r\n
\r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n
\r\n
\r\n
{{'These Author Names are similar to ' + entity.authorName}}
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Author NameAuthor InitialsDifference ScorePercent Difference
{{dist.comparedString}}{{dist.additionalData}}{{dist.distance}}{{utilFns.formatNumber(dist.percentDifference, 3, 2)}}
\r\n
\r\n\r\n

{{_noAuthorMatchesMessage}}

\r\n
\r\n
\r\n","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { Author } from '../../entities/EntityModels';\r\nimport {StringDistance} from '../../entities/projections/StringDistance';\r\nimport {UtilFns} from '../../utils/util-fns';\r\n\r\n@Component({\r\n selector: 'author-editor',\r\n templateUrl: './author-editor.html',\r\n providers: [provideParent(AuthorEditorComponent, EditPropParent)]\r\n})\r\nexport class AuthorEditorComponent implements OnInit, EditPropParent {\r\n @Input() entity: Author;\r\n @Output() apply = new EventEmitter();\r\n\r\n public _authorNameStringDistances: StringDistance[];\r\n public _noAuthorMatchesMessage: string;\r\n\r\n public _isLoading = true;\r\n\r\n constructor(public _uow: UnitOfWork) {}\r\n\r\n ngOnInit() {\r\n\r\n }\r\n\r\n getError(propName: string) {\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n canApplyAuthor() {\r\n return !this.entity.entityAspect.hasValidationErrors;\r\n }\r\n\r\n onApplyAuthor(author: Author) {\r\n if (!author) {\r\n this.entity.entityAspect.rejectChanges();\r\n }\r\n this.apply.emit(author);\r\n }\r\n\r\n isAdded() {\r\n return this.entity && this.entity.entityAspect.entityState.isAdded();\r\n }\r\n\r\n canCheckForSimilarAuthors(): boolean {\r\n return (this.entity != null && this.isValidString(this.entity.authorName));\r\n }\r\n\r\n canShowNoAuthorMatchesMessage(): boolean {\r\n return (this._authorNameStringDistances != null && this._authorNameStringDistances.length == 0 && this.isValidString(this._noAuthorMatchesMessage));\r\n }\r\n\r\n onCheckForSimilarAuthors() {\r\n\r\n this._noAuthorMatchesMessage = '';\r\n\r\n if (!this.isValidString(this.entity.authorName)) {\r\n return;\r\n }\r\n\r\n this._isLoading = true;\r\n\r\n if (this.isAdded()) {\r\n // tslint:disable-next-line:max-line-length\r\n this._uow.fetch('References/FetchAuthorNameStringDistance', { authorName: this.entity.authorName, distThreshold: 4, pctThreshold: 50.00 }).then(r => {\r\n this._authorNameStringDistances = r;\r\n this._isLoading = false;\r\n\r\n if (this._authorNameStringDistances == null || this._authorNameStringDistances.length == 0) {\r\n this._noAuthorMatchesMessage = 'No similar Author names found for ' + this.entity.authorName;\r\n }\r\n });\r\n } else { // in edit mode, exclude the name of the reporting organization being edited\r\n // tslint:disable-next-line:max-line-length\r\n this._uow.fetch('References/FetchAuthorNameStringDistancesExcludeById', { authorName: this.entity.authorName, distThreshold: 4, pctThreshold: 50.00, authorId: this.entity.authorId }).then(r => {\r\n this._authorNameStringDistances = r;\r\n this._isLoading = false;\r\n\r\n if (this._authorNameStringDistances == null || this._authorNameStringDistances.length == 0) {\r\n this._noAuthorMatchesMessage = 'No similar Author names found for ' + this.entity.authorName;\r\n }\r\n });\r\n }\r\n }\r\n\r\n hasCalculatedDistances(): boolean {\r\n return (this._authorNameStringDistances != null && this._authorNameStringDistances.length > 0);\r\n }\r\n\r\n isValidString(teststring: string) {\r\n\r\n if (!teststring) { return false; }\r\n\r\n return (teststring.trim().length > 0);\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n Author\r\n Initials\r\n Author Id\r\n Edit\r\n Unassign\r\n \r\n \r\n \r\n \r\n {{e.author?.authorName}}\r\n {{e.author?.initials}}\r\n {{e.author?.authorId}}\r\n Edit\r\n Unassign Author\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n","import { Component, forwardRef, Inject, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { LocationFns, UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\nimport { Author, Reference, ReferenceAuthor } from '../../entities/EntityModels';\r\nimport { ReferenceEditorComponent } from './reference-editor.component';\r\nimport { AuthorSelectorComponent } from '../reference/author-selector.component';\r\nimport { AuthorEditorComponent } from './author-editor.component';\r\n\r\n@Component({\r\n selector: 'reference-editor-author',\r\n templateUrl: './reference-editor-author.html',\r\n providers: [provideParent(ReferenceEditorAuthorComponent, EditPropParent)]\r\n})\r\nexport class ReferenceEditorAuthorComponent implements OnInit, EditPropParent {\r\n @ViewChild(AuthorSelectorComponent, { static: true }) _authorSelectorComponent: AuthorSelectorComponent;\r\n @ViewChild(AuthorEditorComponent) _authorEditorComponent: AuthorEditorComponent;\r\n\r\n _data: {\r\n entity: Reference,\r\n adding: boolean,\r\n inSubEditor: boolean,\r\n\r\n editAuthor?: Author;\r\n\r\n };\r\n _etAlEnabled: boolean;\r\n _newEtAlAuthor: Author;\r\n _etAlRefAuthor: ReferenceAuthor;\r\n\r\n constructor(@Inject(forwardRef(() => ReferenceEditorComponent)) public _parent: ReferenceEditorComponent,\r\n public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location) {\r\n\r\n LocationFns.setTab(this._location, 1);\r\n }\r\n\r\n ngOnInit() {\r\n this._data = this._parent.data;\r\n this._etAlRefAuthor = this.getEtAlRefAuthor();\r\n this._etAlEnabled = !!this._etAlRefAuthor;\r\n if (!this._etAlEnabled) {\r\n this._uow.fetchTyped('Misc/AuthorsByName', Author, { name: 'et al.' }).then(r => {\r\n if (r.length > 0) {\r\n this._newEtAlAuthor = r[0];\r\n this._etAlEnabled = true;\r\n }\r\n\r\n });\r\n }\r\n }\r\n\r\n getEtAlRefAuthor() {\r\n return this._entity.referenceAuthors.find(ra => ra.author && ra.author.authorName === 'et al.');\r\n }\r\n\r\n get _entity() {\r\n return this._data.entity;\r\n }\r\n\r\n referenceAuthors() {\r\n if (this._entity) {\r\n return _.sortBy(this._entity.referenceAuthors, a => a.counter);\r\n } else {\r\n return [];\r\n }\r\n }\r\n\r\n getError(propName: string) {\r\n return this._data.entity.getErrorFor(propName);\r\n }\r\n\r\n onEtAlChange(event: any) {\r\n const etAlRefAuthor = this.getEtAlRefAuthor();\r\n if (etAlRefAuthor) {\r\n this.onDetachAuthor(etAlRefAuthor);\r\n } else {\r\n // this._etAlRefAuthor may already be deleted to we need to throw away the deletion\r\n // instead of creating a new ReferenceAuthor.\r\n if (this._etAlRefAuthor && !this._etAlRefAuthor.entityAspect.entityState.isDetached()) {\r\n this._etAlRefAuthor.entityAspect.rejectChanges();\r\n const maxCounter = _.max(this._entity.referenceAuthors.map(ra => ra.counter)) || 0;\r\n this._etAlRefAuthor.counter = maxCounter;\r\n } else {\r\n // force cast below is deliberate because we only need 3 fields above.\r\n this._etAlRefAuthor = this.addReferenceAuthorFor(this._newEtAlAuthor);\r\n }\r\n }\r\n }\r\n\r\n onAttachAuthor() {\r\n UtilFns.showModal(this._authorSelectorComponent, this, this.validateAuthor).then(a => {\r\n if (!a) {\r\n return;\r\n }\r\n const author = a;\r\n this.addReferenceAuthorFor(author);\r\n });\r\n }\r\n\r\n onDetachAuthor(ra: ReferenceAuthor) {\r\n if (ra.entityAspect.entityState.isAdded()) {\r\n ra.author.entityAspect.rejectChanges();\r\n ra.entityAspect.rejectChanges();\r\n } else {\r\n ra.entityAspect.setDeleted();\r\n }\r\n\r\n }\r\n\r\n onCreateAuthor() {\r\n const data = this._data;\r\n data.editAuthor = this._uow.authorFactory.create();\r\n data.inSubEditor = true;\r\n }\r\n\r\n onEditAuthor(ra: ReferenceAuthor) {\r\n const data = this._data;\r\n data.editAuthor = ra.author;\r\n data.inSubEditor = true;\r\n }\r\n\r\n onApplyAuthor(author: Author) {\r\n const data = this._data;\r\n if (author && !this._entity.referenceAuthors.some(ra => ra.author == author)) {\r\n this.addReferenceAuthorFor(author);\r\n }\r\n data.editAuthor = null;\r\n data.inSubEditor = false;\r\n }\r\n\r\n\r\n addReferenceAuthorFor(author: Author) {\r\n const maxCounter = _.max(this._entity.referenceAuthors.map(ra => ra.counter)) || 0;\r\n const config = {\r\n referenceId: this._data.entity.referenceId,\r\n authorId: author.authorId,\r\n counter: maxCounter + 1\r\n };\r\n // this will also add it to the referenceAuthors collection\r\n return this._uow.referenceAuthorFactory.create(config);\r\n }\r\n\r\n\r\n validateAuthor(author: Author): string {\r\n if (this._data.entity.referenceAuthors.some(a => a.authorId == author.authorId)) {\r\n return `Author: ${author.authorName} has already been referenced`;\r\n }\r\n }\r\n\r\n\r\n}\r\n","
\r\n
\r\n
\r\n
\r\n \r\n \r\n Of Type \r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n \r\n \r\n Reference No.\r\n Brief Reference\r\n Title\r\n Year of Publication\r\n Abstract Only\r\n Priority\r\n Linkable\r\n Relation Type\r\n \r\n \r\n \r\n \r\n \r\n {{e.relatedReference?.referenceId}}\r\n {{e.relatedReference?.briefReference}}\r\n {{e.relatedReference?.title}}\r\n {{e.relatedReference?.yearOfPublication}}\r\n \r\n \r\n \r\n {{e.relatedReference?.precedence}}\r\n \r\n \r\n \r\n {{e.typeReferenceRelation?.label}}\r\n Detach\r\n \r\n \r\n\r\n\r\n","import { Component, forwardRef, Inject, OnInit, ViewChild } from '@angular/core';\r\nimport { Location } from '@angular/common';\r\nimport { Router } from '@angular/router';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { LocationFns, UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { Reference, ReferenceRelation, TypeReferenceRelation } from '../../entities/EntityModels';\r\nimport { ReferenceListItem } from '../../entities/projections/ReferenceListItem';\r\n\r\nimport { ROUTES } from '../routes';\r\n\r\nimport { ReferenceEditorComponent } from './reference-editor.component';\r\nimport { ReferenceSelectorComponent } from '../reference/reference-selector.component';\r\n\r\n@Component({\r\n selector: 'reference-editor-relations',\r\n\r\n templateUrl: './reference-editor-relations.html',\r\n providers: [provideParent(ReferenceEditorRelationsComponent, EditPropParent)]\r\n})\r\nexport class ReferenceEditorRelationsComponent implements OnInit, EditPropParent {\r\n @ViewChild(ReferenceSelectorComponent, { static: true }) _referenceSelectorComponent: ReferenceSelectorComponent;\r\n\r\n _data: {\r\n entity: Reference,\r\n inSubEditor: boolean,\r\n onCancelMap: {},\r\n };\r\n _inverseRelations: ReferenceRelation[] = [];\r\n _typeReferenceRelations: TypeReferenceRelation[];\r\n _typeReferenceRelation: TypeReferenceRelation = null;\r\n\r\n constructor(@Inject(forwardRef(() => ReferenceEditorComponent)) public _parent: ReferenceEditorComponent,\r\n public _uow: UnitOfWork, public _stateMap: StateMap, public _router: Router, public _location: Location) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n LocationFns.setTab(this._location, 2);\r\n\r\n this._uow.typeReferenceRelationRepository.all().then(r => {\r\n this._typeReferenceRelations = r;\r\n this._typeReferenceRelation = r[0];\r\n });\r\n\r\n this._data = this._parent.data;\r\n this._data.onCancelMap['special'] = this.onCancel.bind(this);\r\n const params = { referenceId: this._entity.referenceId };\r\n if (this._entity.referenceRelations == null || this._entity.referenceRelations.length == 0) {\r\n // fetch if not already populated.\r\n this._uow.referenceRelationRepository.whereWithParams(params);\r\n }\r\n\r\n }\r\n\r\n get _entity() {\r\n return this._data.entity;\r\n }\r\n\r\n getError(propName: string) {\r\n return this._data.entity.getErrorFor(propName);\r\n }\r\n\r\n setTypeReferenceRelation(typeReferenceRelationId: string) {\r\n this._typeReferenceRelation = this.getTypeReferenceRelation(typeReferenceRelationId);\r\n }\r\n\r\n getTypeReferenceRelation(typeReferenceRelationId: string) {\r\n return this._typeReferenceRelations.find(trr => trr.typeReferenceRelationId == typeReferenceRelationId);\r\n }\r\n\r\n navToRef(r: Reference) {\r\n this._router.navigate(UtilFns.asRouterParts(ROUTES.Reference, r.referenceId));\r\n }\r\n\r\n onAttachReference() {\r\n UtilFns.showModal(this._referenceSelectorComponent, this, this.validateReference).then(rli => {\r\n if (rli == null) {\r\n return;\r\n }\r\n this.attachRelatedReference(rli.referenceId, this._typeReferenceRelation);\r\n });\r\n\r\n }\r\n\r\n onDetachReference(referenceRelation: ReferenceRelation) {\r\n const relatedReferenceId = referenceRelation.relatedReferenceId;\r\n const ea = referenceRelation.entityAspect;\r\n if (ea.entityState.isAdded()) {\r\n ea.rejectChanges();\r\n const rr = _.find(this._inverseRelations, x => x.referenceId == relatedReferenceId);\r\n if (rr != null) {\r\n rr.entityAspect.rejectChanges();\r\n }\r\n } else {\r\n ea.setDeleted();\r\n // now delete inverse.\r\n const params = { referenceId: relatedReferenceId };\r\n this._uow.referenceRelationRepository.whereWithParams(params)\r\n .then(rrs => {\r\n const rr = _.find(rrs, x => x.relatedReferenceId == this._entity.referenceId);\r\n if (rr != null) {\r\n rr.entityAspect.setDeleted();\r\n }\r\n });\r\n }\r\n\r\n }\r\n\r\n attachRelatedReference(relatedReferenceId: number, typeReferenceRelation: TypeReferenceRelation) {\r\n return this._uow.referenceRepository.withId(relatedReferenceId).then(r => {\r\n let config = {\r\n referenceId: this._entity.referenceId,\r\n relatedReference: r,\r\n typeReferenceRelationId: typeReferenceRelation.typeReferenceRelationId\r\n };\r\n const rr1 = this._uow.referenceRelationFactory.create(config);\r\n // now create inverse\r\n const invTypeReferenceRelation = this.getTypeReferenceRelation(typeReferenceRelation.inverseTypeReferenceRelationId);\r\n config = {\r\n referenceId: r.referenceId,\r\n relatedReference: this._entity,\r\n typeReferenceRelationId: invTypeReferenceRelation.typeReferenceRelationId\r\n };\r\n const rr2 = this._uow.referenceRelationFactory.create(config);\r\n this._inverseRelations.push(rr2);\r\n });\r\n }\r\n\r\n\r\n validateReference(rli: ReferenceListItem) {\r\n const alreadyExists = this._entity.referenceRelations.some(rr => rr.relatedReferenceId == rli.referenceId);\r\n if (alreadyExists) {\r\n return 'Reference: ' + rli.referenceId + ' has already been referenced.';\r\n }\r\n }\r\n\r\n\r\n onCancel() {\r\n\r\n }\r\n\r\n\r\n}\r\n","

Adding a Special Link

\r\n\r\n \r\n \r\n\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n
\r\n\r\n","import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { UtilFns } from '../../utils/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { Material, SpecialLink, TypeKeyword } from '../../entities/EntityModels';\r\n\r\nimport { MaterialSelectorComponent } from '../material/material-selector.component';\r\n\r\n@Component({\r\n selector: 'special-link-editor',\r\n\r\n templateUrl: './special-link-editor.html',\r\n providers: [provideParent(SpecialLinkEditorComponent, EditPropParent)]\r\n})\r\nexport class SpecialLinkEditorComponent implements OnInit, EditPropParent {\r\n @Input() entity: SpecialLink;\r\n @Output() apply = new EventEmitter();\r\n @ViewChild(MaterialSelectorComponent, { static: true }) _materialSelectorComponent: MaterialSelectorComponent;\r\n\r\n _typeKeywords: TypeKeyword[];\r\n // We can't allow direct entry into the 'new' SpecialLink entity\r\n // because breeze will throw an error if the entity collides with an\r\n // existing one. So we need to check before we add the entity.\r\n\r\n _keyword: string;\r\n _keywordErrorMessage: string;\r\n _material: Material;\r\n _materialErrorMessage: string;\r\n\r\n // constructor( @Inject(forwardRef(() => ReferenceEditorSpecialComponent)) _parent: ReferenceEditorSpecialComponent) {\r\n\r\n // }\r\n\r\n constructor(public _uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._uow.typeKeywordRepository.all().then(r => {\r\n this._typeKeywords = _.sortBy(r, x => x.keyword);\r\n });\r\n\r\n if (this.entity && this.entity.keyword) {\r\n this._keyword = this.entity.keyword;\r\n }\r\n }\r\n\r\n\r\n getError(propName: string) {\r\n if (propName == '_keyword') {\r\n return this._keywordErrorMessage;\r\n }\r\n if (propName == '_material') {\r\n return this._materialErrorMessage;\r\n }\r\n return this.entity.getErrorFor(propName);\r\n }\r\n\r\n canApply() {\r\n this._keywordErrorMessage = this._keyword ? '' : 'A Category must be selected.';\r\n this._materialErrorMessage = this._material ? '' : 'A Material must be selected';\r\n if (this._keywordErrorMessage || this._materialErrorMessage) {\r\n return false;\r\n }\r\n if (!this.entity.entityAspect.hasValidationErrors) {\r\n return false;\r\n }\r\n\r\n const specialLinks = this.entity.reference.specialLinks;\r\n if (specialLinks.some(sl => sl.materialId == this._material.materialId\r\n && sl.keyword == this._keyword)) {\r\n this._keywordErrorMessage = 'A special link for this Category and Material already exists.';\r\n this._materialErrorMessage = this._keywordErrorMessage;\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n onApply(specialLink: SpecialLink) {\r\n if (specialLink == null) {\r\n this.entity.entityAspect.rejectChanges();\r\n } else {\r\n this.entity.keyword = this._keyword;\r\n this.entity.materialId = this._material.materialId;\r\n }\r\n this.apply.emit(specialLink);\r\n }\r\n\r\n onSelectMaterial() {\r\n UtilFns.showModal(this._materialSelectorComponent, this).then(mli => {\r\n if (mli == null) {\r\n return;\r\n }\r\n return this._uow.materialRepository.withId(mli.materialId);\r\n }).then(m => {\r\n this._material = m;\r\n });\r\n }\r\n\r\n}\r\n","
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
0\">\r\n
\r\n \r\n
{{group.key}}
\r\n \r\n \r\n Material\r\n Description\r\n Human Health\r\n Environmental\r\n Linked\r\n \r\n \r\n \r\n \r\n \r\n \r\n {{sl.description()}}\r\n \r\n \r\n \r\n {{ _stateMap.utilFns.formatDate(sl.created) }}\r\n Detach\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n","import { Component, forwardRef, Inject, OnInit } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, ReferenceState, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { Reference, SpecialLink, TypeKeyword } from '../../entities/EntityModels';\r\nimport { ReferenceEditorComponent } from './reference-editor.component';\r\n\r\n@Component({\r\n selector: 'reference-editor-special',\r\n templateUrl: './reference-editor-special.html',\r\n providers: [provideParent(ReferenceEditorSpecialComponent, EditPropParent)]\r\n})\r\nexport class ReferenceEditorSpecialComponent implements OnInit, EditPropParent {\r\n\r\n private _defaultProps: { keyword: string, reason: string };\r\n private _linksDeleted = false;\r\n\r\n _data: {\r\n entity: Reference,\r\n inSubEditor: boolean,\r\n onCancelMap: {},\r\n newSpecialLink?: SpecialLink;\r\n\r\n };\r\n _groupedLinks: {};\r\n _typeKeywords: TypeKeyword[];\r\n\r\n constructor(@Inject(forwardRef(() => ReferenceEditorComponent)) public _parent: ReferenceEditorComponent,\r\n public _uow: UnitOfWork, public _stateMap: StateMap, private _referenceState: ReferenceState) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this._data = this._parent.data;\r\n this._data.onCancelMap['special'] = this.onCancel.bind(this);\r\n this.groupSpecialLinks(this._entity);\r\n\r\n\r\n }\r\n\r\n get _entity() {\r\n return this._data.entity;\r\n }\r\n\r\n getError(propName: string) {\r\n return this._data.entity.getErrorFor(propName);\r\n }\r\n\r\n onCreateLink() {\r\n const data = this._data;\r\n\r\n this.getPreviousLinkProperties(); // In most cases, the keyword and reason are the same for every material special linked to a reference.\r\n\r\n const p = {\r\n keyword: 'ZZZ',\r\n referenceId: this._data.entity.referenceId,\r\n materialId: 0\r\n };\r\n const newSpecialLink = this._uow.specialLinkFactory.create(p);\r\n\r\n newSpecialLink.keyword = this._defaultProps.keyword;\r\n newSpecialLink.reason = this._defaultProps.reason;\r\n\r\n data.newSpecialLink = newSpecialLink;\r\n data.inSubEditor = true;\r\n }\r\n\r\n onApplyLink(specialLink: SpecialLink) {\r\n const data = this._data;\r\n if (specialLink != null) {\r\n this.groupSpecialLinks(this._entity);\r\n }\r\n data.newSpecialLink = null;\r\n data.inSubEditor = false;\r\n }\r\n\r\n onDetachLink(sl: SpecialLink) {\r\n\r\n if (sl.entityAspect.entityState.isAdded() == false && this._linksDeleted == false) {\r\n this._linksDeleted = true;\r\n this._referenceState.recordSpecialLinkDelete(this._data.entity);\r\n }\r\n\r\n sl.entityAspect.setDeleted();\r\n this.groupSpecialLinks(this._entity);\r\n }\r\n\r\n groupSpecialLinks(reference: Reference) {\r\n const r = reference.specialLinks;\r\n const groups = _.groupBy(r, x => x.explanation());\r\n const groupedLinks = _.keys(groups).map(k => {\r\n // var groupLinks = _.sortBy(groups[k], (sl: SpecialLink) => sl.material.principalSynonym().synonymWordOrWebVersion())\r\n const groupLinks = _.sortBy(groups[k], (sl: SpecialLink) => {\r\n return _.get(sl, 'material.principalSynonym().synonymWordOrWebVersion()', '');\r\n });\r\n return { key: k, specialLinks: groupLinks };\r\n });\r\n this._groupedLinks = _.sortBy(groupedLinks, g => g.key);\r\n }\r\n\r\n private getPreviousLinkProperties() {\r\n if (this._data.entity.specialLinks == null || this._data.entity.specialLinks.length < 1) {\r\n this._defaultProps = { keyword: '', reason: null };\r\n } else {\r\n const lastlink = this._data.entity.specialLinks[this._data.entity.specialLinks.length - 1];\r\n this._defaultProps = { keyword: lastlink.keyword, reason: lastlink.reason };\r\n }\r\n return;\r\n }\r\n\r\n onCancel() {\r\n }\r\n\r\n}\r\n","
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { TypePredictionClass } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'type-prediction-class-editor',\r\n templateUrl: './type-prediction-class-editor.html',\r\n providers: [provideParent(TypePredictionClassEditorComponent, EditPropParent)]\r\n})\r\nexport class TypePredictionClassEditorComponent implements OnInit, EditPropParent {\r\n @Input() entity: TypePredictionClass;\r\n\r\n public predictionClassKey: string;\r\n\r\n constructor(public uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n this.predictionClassKey = this.entity.predictionClass; // Work-around due to the type of primary key\r\n }\r\n\r\n checkIfNull(value: string) {\r\n if (value == '') {\r\n return null;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n getError(propName: string) {\r\n if (this.entity == null) {\r\n return;\r\n }\r\n\r\n const err = this.entity.getErrorFor(propName);\r\n if (err) {\r\n return err;\r\n }\r\n return null;\r\n }\r\n}\r\n","
\r\n \r\n {{_adding ? \"Adding a Prediction Class\" : \"Editing a Prediction Class\" }}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n

{{_validationMessage}}

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
Edit
\r\n
Remove
\r\n
Prediction Class
\r\n
Description
\r\n
\r\n
\r\n
\r\n \r\n \r\n
{{p.data.predictionClass}}
\r\n
{{p.data.predictionClassDescription}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n","import { Component, forwardRef, Inject, OnInit, ViewChild } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/edit-prop.component';\r\nimport { EditManager } from '../../utils/common';\r\nimport { TypePredictionClass } from '../../entities/EntityModels';\r\n\r\nimport { PredictionEditData, TypePredictionEditorBaseComponent } from './type-prediction-editor-base.component';\r\nimport { TypePredictionClassEditorComponent } from './type-prediction-class-editor.component';\r\nimport { ConfirmFinishOverrideComponent } from './confirm-finish-override.component';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\n\r\n@Component({\r\n selector: 'type-prediction-classes',\r\n templateUrl: './type-prediction-classes.html',\r\n providers: [provideParent(TypePredictionClassesComponent, EditPropParent)]\r\n})\r\nexport class TypePredictionClassesComponent implements OnInit, EditPropParent {\r\n @ViewChild(ConfirmFinishOverrideComponent, { static: true }) _confirmFinishOverrideComponent: ConfirmFinishOverrideComponent;\r\n @ViewChild(TypePredictionClassEditorComponent) _typePredictionClassEditorComponent: TypePredictionClassEditorComponent;\r\n\r\n private _data: PredictionEditData;\r\n\r\n public _typePredictionClassesEx: SelectableEntity[] = [];\r\n\r\n _edm: EditManager;\r\n private _adding = false;\r\n\r\n private _isLoading = false;\r\n private _selectedTypePredictionClass: TypePredictionClass;\r\n\r\n _validationMessage: string;\r\n\r\n constructor(@Inject(forwardRef(() => TypePredictionEditorBaseComponent)) public _parent: TypePredictionEditorBaseComponent,\r\n private _uow: UnitOfWork, private _stateMap: StateMap) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Type Prediction Classes');\r\n this._edm.pageState.canShowMessage = false;\r\n\r\n this.loadData();\r\n }\r\n\r\n loadData() {\r\n this._isLoading = true;\r\n\r\n this._uow.typePredictionClassRepository.all().then(c => {\r\n this._edm.entities = c;\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n refresh() {\r\n this._isLoading = true;\r\n return this._uow.typePredictionClassRepository.all().then(c => {\r\n this._edm.entities = c;\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._typePredictionClassesEx = [];\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return;\r\n }\r\n\r\n _.clone(this._edm.entities).forEach(element => {\r\n this._typePredictionClassesEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n\r\n this._typePredictionClassesEx = _.sortBy(this._typePredictionClassesEx, e => e.data.predictionClass);\r\n }\r\n\r\n checkIfNull(value: string) {\r\n if (value == '') {\r\n return null;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n getError(propName: string) {\r\n if (this._selectedTypePredictionClass == null) {\r\n return;\r\n }\r\n\r\n const err = this._selectedTypePredictionClass.getErrorFor(propName);\r\n if (err) {\r\n return err;\r\n }\r\n return null;\r\n }\r\n\r\n // EditManager overrides\r\n canApply() {\r\n if (this._edm.editing && this._uow.hasChanges()) {\r\n if (this._edm.currentEntity != null) {\r\n return (!this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canSave() {\r\n if (!this._edm.hasEdits()) {\r\n return false;\r\n }\r\n if (!this._edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) {\r\n return false;\r\n }\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n onAdd() {\r\n this._adding = true;\r\n this._data.inSubEditor = true;\r\n\r\n const params = {\r\n predictionClass: 'None'\r\n };\r\n const p = this._uow.typePredictionClassFactory.create(params);\r\n this._edm.entities.push(p);\r\n this._edm.onSelect(p);\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n\r\n if (this._edm.editing) {\r\n if (this._typePredictionClassEditorComponent.predictionClassKey == null) {\r\n this._validationMessage = 'Please enter a class name.';\r\n return;\r\n }\r\n\r\n if (this._typePredictionClassEditorComponent.predictionClassKey == 'None') {\r\n this._validationMessage = 'Please enter a class name other than None.';\r\n return;\r\n }\r\n\r\n const cnt = this.matchTypePredictionClassEntry(this._typePredictionClassEditorComponent.predictionClassKey);\r\n\r\n if (this._adding && cnt > 0) {\r\n this._validationMessage = 'A Prediction Class with the same name already exists.';\r\n return;\r\n }\r\n\r\n if (this._adding == false && cnt > 1) {\r\n this._validationMessage = 'A Prediction Class with the same name already exists.';\r\n return;\r\n }\r\n\r\n // Work-around for the type of primary key\r\n this._edm.currentEntity.predictionClass = this._typePredictionClassEditorComponent.predictionClassKey;\r\n\r\n this._edm.onApplyCore();\r\n this._adding = false;\r\n this._data.inSubEditor = false;\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edm.editing = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._adding = false;\r\n this._data.inSubEditor = false;\r\n\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n\r\n this.loadData();\r\n }\r\n\r\n onEdit(px: SelectableEntity) {\r\n\r\n if (px == null) {\r\n return;\r\n }\r\n\r\n this._selectedTypePredictionClass = this.filterToTypePredictionClass(px.data.predictionClass);\r\n\r\n if (this._selectedTypePredictionClass == null) {\r\n return;\r\n }\r\n\r\n this._edm.onSelect(this._selectedTypePredictionClass);\r\n\r\n this._data.inSubEditor = true;\r\n }\r\n\r\n onRemove(pcx: SelectableEntity) {\r\n\r\n if (pcx == null) {\r\n return;\r\n }\r\n\r\n this._selectedTypePredictionClass = this.filterToTypePredictionClass(pcx.data.predictionClass);\r\n\r\n if (this._selectedTypePredictionClass == null) {\r\n this._validationMessage = 'Error occurred, could not remove the selected prediction class.';\r\n return;\r\n }\r\n\r\n const messages: string[] = []; // Only needed to satisfy a parameter\r\n this._confirmFinishOverrideComponent.showModal('Confirm Deletion of the Prediction Class',\r\n 'There may be materials assigned to this prediction class that will prevent its removal.', messages).then(ok => {\r\n if (ok) {\r\n if (this._selectedTypePredictionClass.entityAspect.entityState.isAdded()) {\r\n this._selectedTypePredictionClass.entityAspect.rejectChanges();\r\n } else {\r\n this._selectedTypePredictionClass.entityAspect.setDeleted();\r\n }\r\n\r\n _.remove(this._edm.entities, this._selectedTypePredictionClass);\r\n\r\n this.refresh();\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._data.inSubEditor = true; // Has unsaved changes\r\n }\r\n });\r\n }\r\n\r\n onSave() {\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore()\r\n .then(() => {\r\n\r\n this._adding = false;\r\n this._edm.editing = false;\r\n this._data.inSubEditor = false;\r\n\r\n return this.refresh();\r\n })\r\n .catch(err => {\r\n this._edm.setSaveFailedStatus(err);\r\n });\r\n }\r\n }\r\n\r\n filterToTypePredictionClass(predictionClass: string): TypePredictionClass {\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return null;\r\n }\r\n\r\n const pclass = this._edm.entities.filter(e => e.predictionClass == predictionClass);\r\n if (pclass != null && pclass.length > 0) {\r\n return pclass[0];\r\n }\r\n }\r\n\r\n matchTypePredictionClassEntry(predictionClass: string): number {\r\n if (this._edm.entities == null) {\r\n return 0;\r\n }\r\n\r\n const pclass = this._edm.entities.filter(e => e.predictionClass == predictionClass);\r\n if (pclass == null) {\r\n return 0;\r\n }\r\n\r\n return pclass.length;\r\n }\r\n}\r\n","
\r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n","import { Component, Input, OnInit } from '@angular/core';\r\n\r\nimport { provideParent, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/common';\r\n\r\nimport { TypePrediction } from '../../entities/EntityModels';\r\n\r\n@Component({\r\n selector: 'type-prediction-editor',\r\n templateUrl: './type-prediction-editor.html',\r\n providers: [provideParent(TypePredictionEditorComponent, EditPropParent)]\r\n})\r\nexport class TypePredictionEditorComponent implements OnInit, EditPropParent {\r\n @Input() entity: TypePrediction;\r\n\r\n constructor(public uow: UnitOfWork) {\r\n\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n checkIfNull(value: string) {\r\n if (value == '') {\r\n return null;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n getError(propName: string) {\r\n if (this.entity == null) {\r\n return;\r\n }\r\n\r\n const err = this.entity.getErrorFor(propName);\r\n if (err) {\r\n return err;\r\n }\r\n return null;\r\n }\r\n}\r\n","
\r\n \r\n {{_adding ? \"Adding a Prediction Type\" : \"Editing a Prediction Type\" }}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n

{{_validationMessage}}

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
Edit
\r\n
Remove
\r\n
Prediction Name
\r\n
Primary Judgment
\r\n
\r\n
\r\n
\r\n \r\n \r\n
{{p.data.predictionName}}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n\r\n","import { Component, forwardRef, Inject, OnInit, ViewChild } from '@angular/core';\r\nimport * as _ from 'lodash';\r\n\r\nimport { provideParent, StateMap, UnitOfWork } from '../../services/common';\r\nimport { EditPropParent } from '../../controls/edit-prop.component';\r\nimport { EditManager } from '../../utils/common';\r\nimport { TypePrediction } from '../../entities/EntityModels';\r\n\r\nimport { PredictionEditData, TypePredictionEditorBaseComponent } from './type-prediction-editor-base.component';\r\nimport { ConfirmFinishOverrideComponent } from './confirm-finish-override.component';\r\nimport { SelectableEntity } from '../../entities/projections/SelectableEntity';\r\n\r\n@Component({\r\n selector: 'type-predictions',\r\n\r\n templateUrl: './type-predictions.html',\r\n providers: [provideParent(TypePredictionsComponent, EditPropParent)]\r\n})\r\nexport class TypePredictionsComponent implements OnInit, EditPropParent {\r\n @ViewChild(ConfirmFinishOverrideComponent, { static: true }) _confirmFinishOverrideComponent: ConfirmFinishOverrideComponent;\r\n\r\n private _data: PredictionEditData;\r\n\r\n public _typePredictionsEx: SelectableEntity[] = [];\r\n\r\n _edm: EditManager;\r\n private _adding = false;\r\n\r\n private _isLoading = false;\r\n private _selectedTypePrediction: TypePrediction;\r\n\r\n _validationMessage: string;\r\n\r\n constructor(@Inject(forwardRef(() => TypePredictionEditorBaseComponent)) public _parent: TypePredictionEditorBaseComponent, private _uow: UnitOfWork,\r\n private _stateMap: StateMap) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n this._edm = new EditManager(this, this._uow, this._stateMap, 'Type Predictions');\r\n\r\n this.loadData();\r\n }\r\n\r\n loadData() {\r\n this._isLoading = true;\r\n\r\n this._uow.typePredictionRepository.all().then(p => {\r\n this._edm.entities = p;\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n refresh() {\r\n this._isLoading = true;\r\n return this._uow.typePredictionRepository.all().then(p => {\r\n this._edm.entities = p;\r\n this.formatSelectableEntities();\r\n\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n formatSelectableEntities() {\r\n this._typePredictionsEx = [];\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return;\r\n }\r\n\r\n _.clone(this._edm.entities).forEach(element => {\r\n this._typePredictionsEx.push(new SelectableEntity(element, '#FFFFFF'));\r\n });\r\n\r\n this._typePredictionsEx = _.sortBy(this._typePredictionsEx, e => e.data.predictionName);\r\n }\r\n\r\n checkIfNull(value: string) {\r\n if (value == '') {\r\n return null;\r\n } else {\r\n return value;\r\n }\r\n }\r\n\r\n getError(propName: string) {\r\n if (this._selectedTypePrediction == null) {\r\n return;\r\n }\r\n\r\n const err = this._selectedTypePrediction.getErrorFor(propName);\r\n if (err) {\r\n return err;\r\n }\r\n return null;\r\n }\r\n\r\n // EditManager overrides\r\n canApply() {\r\n if (this._edm.editing && this._uow.hasChanges()) {\r\n if (this._edm.currentEntity != null) {\r\n return (!this._edm.currentEntity.entityAspect.hasValidationErrors);\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n canCancel() {\r\n return (this._uow.hasChanges());\r\n }\r\n\r\n canSave() {\r\n if (!this._edm.hasEdits()) {\r\n return false;\r\n }\r\n if (!this._edm.validateBeforeSave()) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n canShowBack() {\r\n if (!this._edm.editing) {\r\n return false;\r\n }\r\n return (!this._uow.hasChanges());\r\n }\r\n\r\n onAdd() {\r\n this._adding = true;\r\n this._data.inSubEditor = true;\r\n\r\n const p = this._uow.typePredictionFactory.create();\r\n this._edm.entities.push(p);\r\n this._edm.onSelect(p);\r\n }\r\n\r\n onApply() {\r\n this._validationMessage = '';\r\n\r\n if (this._edm.editing) {\r\n if (this.isDuplicateTypePredictionEntry(this._edm.currentEntity.predictionName)) {\r\n this._validationMessage = 'A Prediction Type with the same name already exists.';\r\n return;\r\n }\r\n\r\n const cnt = this.numberOfPrimaryJudgements();\r\n\r\n if (cnt > 1) {\r\n this._validationMessage = 'Only one prediction can be marked as a Primary Judgement.';\r\n return;\r\n }\r\n\r\n if (cnt == 0) {\r\n this._validationMessage = 'Warning: there are no Prediction Types marked as the Primary Judgement.';\r\n }\r\n\r\n this._edm.onApplyCore();\r\n this._adding = false;\r\n\r\n this.formatSelectableEntities();\r\n }\r\n\r\n return true;\r\n }\r\n\r\n onBack() {\r\n this._adding = false;\r\n this._edm.editing = false;\r\n }\r\n\r\n onCancel() {\r\n this._validationMessage = '';\r\n\r\n this._adding = false;\r\n this._data.inSubEditor = false;\r\n\r\n this._edm.onCancelCore();\r\n this._edm.entities = null;\r\n\r\n this.loadData();\r\n }\r\n\r\n onEdit(px: SelectableEntity) {\r\n\r\n if (px == null) {\r\n return;\r\n }\r\n\r\n this._selectedTypePrediction = this.filterToTypePredictionById(px.data.typePredictionId);\r\n\r\n if (this._selectedTypePrediction == null) {\r\n return;\r\n }\r\n\r\n this._edm.onSelect(this._selectedTypePrediction);\r\n\r\n this._data.inSubEditor = true;\r\n }\r\n\r\n onRemove(px: SelectableEntity) {\r\n\r\n if (px == null) {\r\n return;\r\n }\r\n\r\n this._selectedTypePrediction = this.filterToTypePredictionById(px.data.typePredictionId);\r\n\r\n if (this._selectedTypePrediction == null) {\r\n this._validationMessage = 'Error occurred, could not remove the selected prediction type.';\r\n return;\r\n }\r\n\r\n const messages: string[] = []; // Only needed to satisfy a parameter\r\n this._confirmFinishOverrideComponent.showModal('Confirm Deletion of the Prediction Type',\r\n 'There may be materials assigned to this prediction type that will prevent its removal.', messages).then(ok => {\r\n if (ok) {\r\n if (this._selectedTypePrediction.entityAspect.entityState.isAdded()) {\r\n this._selectedTypePrediction.entityAspect.rejectChanges();\r\n } else {\r\n this._selectedTypePrediction.entityAspect.setDeleted();\r\n }\r\n\r\n _.remove(this._edm.entities, this._selectedTypePrediction);\r\n\r\n this.refresh();\r\n\r\n this.formatSelectableEntities();\r\n\r\n this._data.inSubEditor = true; // Has unsaved changes\r\n\r\n }\r\n });\r\n }\r\n\r\n onSave() {\r\n if (this._edm.hasEdits()) {\r\n this._edm.onSaveCore().then(() => {\r\n\r\n this._adding = false;\r\n this._edm.editing = false;\r\n\r\n this.refresh();\r\n });\r\n }\r\n\r\n this._data.inSubEditor = false;\r\n\r\n }\r\n\r\n filterToTypePredictionById(typePredictionId: number): TypePrediction {\r\n if (this._edm.entities == null || this._edm.entities.length < 1) {\r\n return null;\r\n }\r\n\r\n const prediction = this._edm.entities.filter(e => e.typePredictionId == typePredictionId);\r\n if (prediction != null && prediction.length > 0) {\r\n return prediction[0];\r\n }\r\n }\r\n\r\n isDuplicateTypePredictionEntry(predictionName: string): boolean {\r\n if (this._edm.entities == null) {\r\n return false;\r\n }\r\n\r\n const pred = this._edm.entities.filter(e => e.predictionName == predictionName);\r\n if (pred != null && pred.length > 1) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n numberOfPrimaryJudgements(): number {\r\n if (this._edm.entities == null) {\r\n return 0;\r\n }\r\n\r\n const primaries = this._edm.entities.filter(e => e.primaryJudgment);\r\n\r\n if (primaries == null) {\r\n return 0;\r\n }\r\n\r\n return primaries.length;\r\n }\r\n}\r\n","

Adding a New Reference Document

\r\n
\r\n {{_validationMessage}}\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n\r\n Selected ReferenceId:\r\n
\r\n {{_selectedReferenceForAdd?.referenceId}}\r\n
\r\n\r\n \r\n
\r\n\r\n\r\n","import { Location } from '@angular/common';\r\nimport {Component, forwardRef, Inject, Input, OnInit, AfterViewInit, ViewChild} from '@angular/core';\r\n\r\nimport {UnitOfWork, StateMap, provideParent, WorkflowEntityState, ReferenceState} from '../../services/common';\r\nimport { PageState, EditPropParent } from '../../controls/common';\r\nimport { Reference } from '../../entities/EntityModels';\r\nimport { ReferenceSelectorComponent } from '../reference/reference-selector.component';\r\nimport {ReferenceDocumentEditData, RIFMDocumentsComponent} from '../docmanagement/rifm-documents.component';\r\n\r\nimport * as _ from 'lodash';\r\nimport {UtilFns} from '../../utils/util-fns';\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\n\r\n@Component({\r\n selector: 'add-reference-document',\r\n templateUrl: './add-reference-document.html',\r\n providers: [provideParent(AddReferenceDocumentComponent, EditPropParent)]\r\n})\r\n\r\nexport class AddReferenceDocumentComponent implements OnInit, AfterViewInit {\r\n @ViewChild(ReferenceSelectorComponent, { static: true }) _referenceSelectorComponent: ReferenceSelectorComponent;\r\n\r\n @Input() documentManagementUrl: string;\r\n\r\n public _data: ReferenceDocumentEditData = new ReferenceDocumentEditData();\r\n\r\n public _loading = false;\r\n public _pageState = new PageState('Add Reference Document');\r\n\r\n // add new reference document variables\r\n public _selectedReferenceForAdd: Reference;\r\n public _filedata: any;\r\n public _fileInputElement: any;\r\n\r\n public _addedSuccessfully = false;\r\n public _lastAddedReferenceId = -1;\r\n public _lastAddedReferenceMessage = '';\r\n public _showAddButton = false;\r\n public _validationMessage = '';\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location, private _httpClient: HttpClient, private _referenceState: ReferenceState,\r\n @Inject(forwardRef(() => RIFMDocumentsComponent)) public _parent: RIFMDocumentsComponent) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n ngAfterViewInit() {\r\n this._fileInputElement = $('#fileInputElement')[0] as HTMLInputElement;\r\n }\r\n\r\n public cancelAdd() {\r\n this._filedata = null;\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n\r\n this._lastAddedReferenceId = -1;\r\n this._lastAddedReferenceMessage = '';\r\n this._selectedReferenceForAdd = null;\r\n }\r\n\r\n onSelectReferenceForAdd() {\r\n\r\n this._validationMessage = '';\r\n\r\n UtilFns.showModal(this._referenceSelectorComponent, this, null).then(rli => {\r\n if (rli == null) {\r\n return;\r\n }\r\n return this._uow.referenceRepository.withId(rli.referenceId).then(r => {\r\n this._selectedReferenceForAdd = r;\r\n\r\n if (this.fileData != null && this._selectedReferenceForAdd != null) {\r\n this.checkIfFileNameMatchReferenceId();\r\n this._showAddButton = true;\r\n }\r\n });\r\n });\r\n }\r\n\r\n public get assignedReferenceId(): number {\r\n return (this._selectedReferenceForAdd != null) ? this._selectedReferenceForAdd.referenceId : -1;\r\n }\r\n\r\n public get fileData(): any {\r\n return this._filedata;\r\n }\r\n\r\n public set fileData(val: any) {\r\n this._filedata = val;\r\n\r\n if (this.fileData != null && this._selectedReferenceForAdd != null) {\r\n this.checkIfFileNameMatchReferenceId();\r\n this._showAddButton = true;\r\n }\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n public checkIfFileNameMatchReferenceId() {\r\n\r\n const fileName = this._filedata.name.split('.')[0];\r\n\r\n this._validationMessage = (this._selectedReferenceForAdd.referenceId + '' == fileName) ? '' : 'File name does not match Reference Id. This is can be ok, just checking...';\r\n }\r\n\r\n // ******************************************************************\r\n // Handle initial file upload\r\n // ******************************************************************\r\n onFileInput(files: FileList) {\r\n this._validationMessage = '';\r\n this.fileData = files.item(0);\r\n }\r\n\r\n // ************************************************************************\r\n // add reference document\r\n // ************************************************************************\r\n public canAddReferenceDocument(): boolean {\r\n return (this.fileData != null && this._selectedReferenceForAdd != null);\r\n }\r\n\r\n public canShowBackFromAddReferenceDocument() {\r\n if (this._addedSuccessfully) {\r\n return true;\r\n }\r\n }\r\n\r\n public onCancel() {\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n this._parent.addCompleted(-1);\r\n }\r\n\r\n public onBackFromAddReferenceDocument() {\r\n this._parent.addCompleted(this._lastAddedReferenceId);\r\n }\r\n\r\n public onSaveAdd() {\r\n\r\n this.addReferenceDocument().subscribe((r) => {\r\n this._addedSuccessfully = r;\r\n\r\n this._showAddButton = false;\r\n\r\n if (this._addedSuccessfully) {\r\n this._lastAddedReferenceMessage = 'Successfully added new document for ReferenceId: ' + this._selectedReferenceForAdd.referenceId;\r\n this._lastAddedReferenceId = this._selectedReferenceForAdd.referenceId;\r\n\r\n this._fileInputElement.value = null;\r\n this._selectedReferenceForAdd = null;\r\n } else {\r\n this._lastAddedReferenceMessage = 'Error adding new Reference Document.';\r\n this._lastAddedReferenceId = -1;\r\n }\r\n });\r\n }\r\n\r\n // ************************************************************************\r\n // web api calls\r\n // ************************************************************************\r\n getAddDocumentURL(): Observable {\r\n const url = this.documentManagementUrl + '/AddRIFMDocument';\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n\r\n const formData: FormData = new FormData();\r\n formData.append('referenceId', this._selectedReferenceForAdd.referenceId + '');\r\n formData.append('fileName', this._selectedReferenceForAdd.referenceId + '.pdf');\r\n formData.append('file', this.fileData);\r\n\r\n return this._httpClient.post(url, formData);\r\n }\r\n\r\n public addReferenceDocument(): Observable {\r\n const subject = new Subject();\r\n\r\n this._validationMessage = '';\r\n this.getAddDocumentURL()\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n this._validationMessage = 'Error occurred, unable to add the new Reference document: ' + data.ExceptionMessage;\r\n subject.next(false);\r\n } else {\r\n this._validationMessage = 'Reference Document added successfully for Reference Id:' + this._selectedReferenceForAdd.referenceId;\r\n subject.next(true);\r\n }\r\n },\r\n (error) => {\r\n this._validationMessage = error.message;\r\n subject.next(false);\r\n });\r\n\r\n return subject.asObservable();\r\n }\r\n\r\n}\r\n","

Editing PDF Pages

\r\n\r\n\r\n For Reference Id: \r\n {{referenceId}}\r\n\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n {{_validationMessage}}\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n \r\n \r\n \tCopy and Download Pages\r\n \r\n \r\n\r\n \r\n Range Start:\r\n \r\n Range End:\r\n \r\n\r\n \r\n Individual Pages:\r\n \r\n\r\n \r\n Please enter pages numbers separated by a comma.\r\n
\r\n\r\n
\r\n\r\n \r\n \r\n\t Add Pages\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n \r\n Insert Before Page:\r\n \r\n \r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n \tDelete Pages\r\n \r\n \r\n\r\n \r\n Range Start:\r\n \r\n Range End:\r\n \r\n\r\n \r\n Individual Pages:\r\n \r\n\r\n \r\n Please enter pages numbers separated by a comma.\r\n
\r\n
\r\n\r\n\r\n","import { Location } from '@angular/common';\r\nimport {Component, forwardRef, Inject, Input, OnInit, AfterViewInit, ViewChild} from '@angular/core';\r\n\r\nimport {UnitOfWork, StateMap, provideParent, WorkflowEntityState, ReferenceState} from '../../services/common';\r\nimport {EditPropParent, PageState} from '../../controls/common';\r\nimport { Reference } from '../../entities/EntityModels';\r\nimport { ReferenceSelectorComponent } from '../reference/reference-selector.component';\r\nimport {ReferenceDocumentEditData, RIFMDocumentsComponent} from '../docmanagement/rifm-documents.component';\r\n// import { ShowAndDownloadPDFComponent } from '../docmanagement/show-and-download-pdf.component';\r\n\r\nimport * as _ from 'lodash';\r\nimport {UtilFns} from '../../utils/util-fns';\r\nimport {Observable} from 'rxjs';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\n\r\nexport enum PageActionType { EXTRACTPAGES, ADDPAGES, REMOVEPAGES }\r\nexport enum InsertType { BYINDEX, BEGINNING, END }\r\n\r\n@Component({\r\n selector: 'edit-pdf-pages',\r\n templateUrl: './edit-pdf-pages.html',\r\n providers: [provideParent(EditPDFPagesComponent, EditPropParent)]\r\n})\r\n\r\nexport class EditPDFPagesComponent implements OnInit, AfterViewInit {\r\n // @ViewChild(ShowAndDownloadPDFComponent) _showAndDownloadPDFComponent: ShowAndDownloadPDFComponent;\r\n\r\n @Input() referenceId: number;\r\n @Input() rifmDocumentId: number;\r\n\r\n public _documentManagementUrl: string;\r\n\r\n public _loading = false;\r\n public _pageState = new PageState('Edit PDF Pages');\r\n\r\n public _filedata: any;\r\n public _fileInputElement: any;\r\n\r\n public _addPageIndex = '';\r\n\r\n public _extractPageRangeStart = '';\r\n public _extractPageRangeEnd = '';\r\n public _extractPageNumberString: string;\r\n\r\n public _removePageRangeStart = '';\r\n public _removePageRangeEnd = '';\r\n public _removePageNumberString: string;\r\n\r\n public _addedPagesSuccessfully = false;\r\n public _extractPagesSuccessfully = false;\r\n public _removePagesSuccessfully = false;\r\n\r\n public _validationMessage = '';\r\n\r\n public _selectedPageActionType = PageActionType.EXTRACTPAGES;\r\n\r\n public _selectedInsertionOptionPageIndex = true;\r\n public _selectedInsertionOptionBeginning = false;\r\n public _selectedInsertionOptionEnd = false;\r\n\r\n public colorUnselected = '#C1CDC1';\r\n public colorSelected = '#C1FFC1';\r\n\r\n public _isLoading = false;\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location, private _httpClient: HttpClient,\r\n @Inject(forwardRef(() => RIFMDocumentsComponent)) public _parent: RIFMDocumentsComponent) {\r\n }\r\n\r\n ngOnInit() {\r\n this._documentManagementUrl = this._stateMap.documentManagementBaseUrl + '/PDFEditing';\r\n\r\n this._extractPageNumberString = '';\r\n this._removePageNumberString = '';\r\n }\r\n\r\n ngAfterViewInit() {\r\n this._fileInputElement = $('#fileInputElement')[0] as HTMLInputElement;\r\n }\r\n\r\n // ************************************************************************\r\n // Page interaction\r\n // ************************************************************************\r\n hasAddPagesEdits(): boolean {\r\n if (this.selectedPageActionType == PageActionType.ADDPAGES) {\r\n return ((this._filedata != null) || this.isValidString(this._addPageIndex));\r\n }\r\n return false;\r\n }\r\n\r\n hasExtractPagesEdits(): boolean {\r\n if (this.selectedPageActionType == PageActionType.EXTRACTPAGES) {\r\n return (this.isValidString(this._extractPageRangeStart) || this.isValidString(this._extractPageRangeEnd) || this.isValidString(this._extractPageNumberString));\r\n }\r\n return false;\r\n }\r\n\r\n hasRemovePagesEdits(): boolean {\r\n if (this.selectedPageActionType == PageActionType.REMOVEPAGES) {\r\n return (this.isValidString(this._removePageRangeStart) || this.isValidString(this._removePageRangeEnd) || this.isValidString(this._removePageNumberString));\r\n }\r\n return false;\r\n }\r\n\r\n public onBack() {\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n\r\n this._parent.editPagesCompleted('');\r\n }\r\n\r\n public onBackAndView() {\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n\r\n this._parent.editPagesCompleted('viewPDF');\r\n }\r\n\r\n resetDisplay() {\r\n this.clearParameterValues();\r\n this._validationMessage = '';\r\n }\r\n\r\n clearParameterValues() {\r\n\r\n this._extractPageRangeStart = '';\r\n this._extractPageRangeEnd = '';\r\n this._extractPageNumberString = '';\r\n\r\n this._removePageRangeStart = '';\r\n this._removePageRangeEnd = '';\r\n this._removePageNumberString = '';\r\n\r\n this._addedPagesSuccessfully = false;\r\n this._extractPagesSuccessfully = false;\r\n this._removePagesSuccessfully = false;\r\n\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n }\r\n\r\n // ************************************************************************\r\n // Parameter Validation\r\n // ************************************************************************\r\n public isValidExtract() {\r\n this._validationMessage = '';\r\n\r\n if (this.canConvertToPageNumber(this._extractPageRangeStart) && !this.canConvertToPageNumber(this._extractPageRangeEnd)) {\r\n this._validationMessage = 'If you enter a range of page numbers, both start and end page numbers must be entered.';\r\n return false;\r\n }\r\n\r\n if (!this.canConvertToPageNumber(this._extractPageRangeStart) && this.canConvertToPageNumber(this._extractPageRangeEnd)) {\r\n this._validationMessage = 'If you enter a range of page numbers, both start and end page numbers must be entered.';\r\n return false;\r\n }\r\n\r\n if (this.isValidString(this._extractPageNumberString)) {\r\n // this method will set an error flag if there are invalid entries\r\n const nums = this.extractAndValidateStringOfNumbers(this._extractPageNumberString);\r\n if (nums == '') {\r\n this._validationMessage = 'Some of the page numbers you entered are invalid numbers.';\r\n return false;\r\n }\r\n }\r\n\r\n if (!this.canConvertToPageNumber(this._extractPageRangeStart) && !this.canConvertToPageNumber(this._extractPageRangeEnd) && !this.isValidString(this._extractPageNumberString)) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public isValidAddPages() {\r\n this._validationMessage = '';\r\n\r\n if (this._selectedInsertionOptionPageIndex) {\r\n if (!this.canConvertToPageNumber(this._addPageIndex)) {\r\n this._validationMessage = 'The page number you entered to add pages is not numeric.';\r\n return false;\r\n }\r\n }\r\n\r\n if (this.fileData == null) {\r\n this._validationMessage = 'Please choose a file with the pages to be added.';\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public isValidRemovePages() {\r\n this._validationMessage = '';\r\n\r\n if (this.canConvertToPageNumber(this._removePageRangeStart) && !this.canConvertToPageNumber(this._removePageRangeEnd)) {\r\n this._validationMessage = 'If you enter a range of page numbers, both start and end page numbers must be entered.';\r\n return false;\r\n }\r\n\r\n if (!this.canConvertToPageNumber(this._removePageRangeStart) && this.canConvertToPageNumber(this._removePageRangeEnd)) {\r\n this._validationMessage = 'If you enter a range of page numbers, both start and end page numbers must be entered.';\r\n return false;\r\n }\r\n\r\n if (this.isValidString(this._removePageNumberString)) {\r\n // this method will set an error flag if there are invalid entries\r\n const nums = this.extractAndValidateStringOfNumbers(this._removePageNumberString);\r\n if (nums == '') {\r\n this._validationMessage = 'Some of the page numbers you entered are invalid numbers.';\r\n return false;\r\n }\r\n }\r\n\r\n if (!this.canConvertToPageNumber(this._removePageRangeStart) && !this.canConvertToPageNumber(this._removePageRangeEnd) && !this.isValidString(this._removePageNumberString)) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n canConvertToPageNumber(teststring: string) {\r\n if (!this.isValidString(teststring)) {\r\n return false;\r\n }\r\n\r\n const testnum = parseInt(teststring, 10);\r\n return !isNaN(testnum) && testnum > -1;\r\n }\r\n\r\n isValidString(teststring: string): boolean {\r\n if (!teststring) {\r\n return false;\r\n }\r\n return (teststring.trim().length > 0);\r\n }\r\n\r\n private extractAndValidateStringOfNumbers(stringOfNumbers: string): string {\r\n let hasParameterErrors = false;\r\n const pageNumbers = stringOfNumbers.split(',').map(function (item) {\r\n const num = Number(item.trim());\r\n if (isNaN(num)) {\r\n hasParameterErrors = true;\r\n } else {\r\n return num;\r\n }\r\n });\r\n\r\n if (hasParameterErrors) {\r\n return '';\r\n }\r\n\r\n const pagesWithBaseZero = this.substractValueFromNumberArray(pageNumbers, 1);\r\n return pagesWithBaseZero.join(',');\r\n }\r\n\r\n private substractValueFromNumberArray(numbers: number[], decrementValue: number): number[] {\r\n if (numbers == null || numbers.length == 0) {\r\n return new Array();\r\n }\r\n\r\n const newNumberValues = numbers.map(function (value) {\r\n return value - decrementValue;\r\n }\r\n );\r\n\r\n return newNumberValues;\r\n }\r\n\r\n // ************************************************************************\r\n // click events\r\n // ************************************************************************\r\n public extractPages() {\r\n this._validationMessage = '';\r\n if (!this.isValidExtract()) {\r\n return false;\r\n }\r\n\r\n this.extractPDFPagesIntoFile();\r\n }\r\n\r\n public addPages() {\r\n this._validationMessage = '';\r\n\r\n if (!this.isValidAddPages()) {\r\n return false;\r\n }\r\n\r\n this.addPagesToPDF();\r\n }\r\n\r\n public removePages() {\r\n this._validationMessage = '';\r\n\r\n if (!this.isValidRemovePages()) {\r\n return false;\r\n }\r\n\r\n this.removePagesFromPDFFile();\r\n }\r\n\r\n public onselectedInsertionOption(type: number) {\r\n if (type == InsertType.BYINDEX) {\r\n this._selectedInsertionOptionPageIndex = true;\r\n this._selectedInsertionOptionBeginning = false;\r\n this._selectedInsertionOptionEnd = false;\r\n } else if (type == InsertType.BEGINNING) {\r\n this._selectedInsertionOptionPageIndex = false;\r\n this._selectedInsertionOptionBeginning = true;\r\n this._selectedInsertionOptionEnd = false;\r\n } else if (type == InsertType.END) {\r\n this._selectedInsertionOptionPageIndex = false;\r\n this._selectedInsertionOptionBeginning = false;\r\n this._selectedInsertionOptionEnd = true;\r\n }\r\n }\r\n\r\n // ******************************************************************\r\n // Handle initial file upload\r\n // ******************************************************************\r\n onFileInput(files: FileList) {\r\n this._filedata = files.item(0);\r\n }\r\n\r\n // *****************************************************************************\r\n // bindable properties\r\n // *****************************************************************************\r\n public get fileData(): any {\r\n return this._filedata;\r\n }\r\n\r\n public set fileData(value: any) {\r\n this._filedata = value;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n public get pdfPageActionType(): typeof PageActionType {\r\n return PageActionType;\r\n }\r\n\r\n public get selectedPageActionType(): PageActionType {\r\n return this._selectedPageActionType;\r\n }\r\n\r\n public set selectedPageActionType(value) {\r\n this._selectedPageActionType = value;\r\n }\r\n\r\n public pageActionButtonColor(desc: string) {\r\n switch (desc) {\r\n case 'extract': {\r\n return (this.selectedPageActionType == PageActionType.EXTRACTPAGES) ? this.colorSelected : this.colorUnselected;\r\n break;\r\n }\r\n case 'add': {\r\n return (this.selectedPageActionType == PageActionType.ADDPAGES) ? this.colorSelected : this.colorUnselected;\r\n break;\r\n }\r\n case 'remove': {\r\n return (this.selectedPageActionType == PageActionType.REMOVEPAGES) ? this.colorSelected : this.colorUnselected;\r\n break;\r\n }\r\n default: {\r\n return this.colorUnselected;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n onSelectPageActionType(type: string) {\r\n this._validationMessage = '';\r\n\r\n if (type == 'extract') {\r\n this.selectedPageActionType = PageActionType.EXTRACTPAGES;\r\n } else if (type == 'add') {\r\n this.selectedPageActionType = PageActionType.ADDPAGES;\r\n this.onselectedInsertionOption(InsertType.BYINDEX);\r\n } else {\r\n this.selectedPageActionType = PageActionType.REMOVEPAGES;\r\n }\r\n }\r\n\r\n // ************************************************************************\r\n // web api calls\r\n // ************************************************************************\r\n getAddPagesURL(): Observable {\r\n\r\n let insertAtEnd = 'false';\r\n let shiftedAddPageIndex = -1;\r\n\r\n if (this._selectedInsertionOptionBeginning) {\r\n shiftedAddPageIndex = 0;\r\n } else if (this._selectedInsertionOptionEnd) {\r\n insertAtEnd = 'true';\r\n } else {\r\n const num = parseInt(this._addPageIndex, 10);\r\n shiftedAddPageIndex = num - 1; // syncfusion pdf api assign the first page numbers as 0\r\n }\r\n\r\n const url = this._documentManagementUrl + '/AddPages';\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n const formData: FormData = new FormData();\r\n formData.append('referenceId', this.referenceId + '');\r\n formData.append('rifmDocumentId', this.rifmDocumentId + '');\r\n formData.append('fileName', this.referenceId + '.pdf');\r\n formData.append('insertPageIndex', shiftedAddPageIndex + '');\r\n formData.append('insertAtEnd', insertAtEnd);\r\n formData.append('file', this.fileData);\r\n\r\n return this._httpClient.post(url, formData);\r\n }\r\n\r\n getExtractPagesURL(): Observable {\r\n\r\n let pageString = '';\r\n if (this.isValidString(this._extractPageNumberString)) {\r\n pageString = this.extractAndValidateStringOfNumbers(this._extractPageNumberString);\r\n }\r\n\r\n // syncfusion pdf api assign the first page numbers as 0 so decrement range by 1\r\n let pageRangeStart = -1;\r\n if (this.isValidString(this._extractPageRangeStart)) {\r\n const num = parseInt(this._extractPageRangeStart, 10);\r\n pageRangeStart = num - 1;\r\n }\r\n\r\n let pageRangeEnd = -1;\r\n if (this.isValidString(this._extractPageRangeEnd)) {\r\n const num = parseInt(this._extractPageRangeEnd, 10);\r\n pageRangeEnd = num - 1;\r\n }\r\n\r\n // tslint:disable-next-line:max-line-length\r\n const url = this._documentManagementUrl + '/ExtractPages?rifmDocumentId=' + this.rifmDocumentId + '&pageNumberEntries=' + pageString + '&pageRangeStart=' + pageRangeStart + '&pageRangeEnd=' + pageRangeEnd;\r\n return this._httpClient.get(url, {responseType: 'blob' as 'json'});\r\n }\r\n\r\n getRemovePDFPagesURL(): Observable {\r\n const fileName = this.referenceId + '.pdf';\r\n\r\n let pageString = '';\r\n if (this.isValidString(this._removePageNumberString)) {\r\n pageString = this.extractAndValidateStringOfNumbers(this._removePageNumberString);\r\n }\r\n\r\n // syncfusion pdf api assign the first page numbers as 0 so decrement range by 1\r\n let pageRangeStart = -1;\r\n if (this.isValidString(this._removePageRangeStart)) {\r\n const num = parseInt(this._removePageRangeStart, 10);\r\n pageRangeStart = num - 1;\r\n }\r\n\r\n let pageRangeEnd = -1;\r\n if (this.isValidString(this._removePageRangeEnd)) {\r\n const num = parseInt(this._removePageRangeEnd, 10);\r\n pageRangeEnd = num - 1;\r\n }\r\n\r\n // tslint:disable-next-line:max-line-length\r\n const url = this._documentManagementUrl + '/RemovePages?rifmDocumentId=' + this.rifmDocumentId + '&fileName=' + fileName + '&pageNumberEntries=' + pageString + '&pageRangeStart=' + pageRangeStart + '&pageRangeEnd=' + pageRangeEnd;\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n return this._httpClient.get(url, {responseType: 'text' as 'json'});\r\n }\r\n\r\n public addPagesToPDF() {\r\n this._addedPagesSuccessfully = false;\r\n this._loading = true;\r\n this._validationMessage = '';\r\n this.getAddPagesURL()\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n this._validationMessage = 'Error occurred, unable to add the new pages: ' + data.ExceptionMessage;\r\n return;\r\n }\r\n\r\n this._addedPagesSuccessfully = true;\r\n\r\n this._validationMessage = 'Pages added to the PDF successfully.';\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._loading = false;\r\n },\r\n () => {\r\n this._loading = false;\r\n });\r\n }\r\n\r\n public extractPDFPagesIntoFile() {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n const extractFileName = 'Extract_' + this.referenceId + '.pdf';\r\n this.getExtractPagesURL()\r\n .subscribe(\r\n (response: Blob) => {\r\n const data = response;\r\n\r\n const file = new Blob([data], {type: 'application/pdf'});\r\n const fileURL = URL.createObjectURL(file);\r\n\r\n // window.open(fileURL);\r\n const a = document.createElement('a');\r\n a.href = fileURL;\r\n a.target = '_blank';\r\n a.download = extractFileName;\r\n document.body.appendChild(a);\r\n a.click();\r\n\r\n this._validationMessage = 'Pages copied to file and downloaded successfully.';\r\n\r\n this.clearParameterValues();\r\n },\r\n (error: any) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n public removePagesFromPDFFile() {\r\n this._isLoading = true;\r\n this._validationMessage = '';\r\n this.getRemovePDFPagesURL()\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n this._validationMessage = 'Error occurred, unable to delete pages from the file: ' + data.ExceptionMessage;\r\n return;\r\n }\r\n\r\n this._validationMessage = 'Pages deleted successfully from PDF file.';\r\n\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._isLoading = false;\r\n },\r\n () => {\r\n console.error('Request completed');\r\n this._isLoading = false;\r\n });\r\n }\r\n\r\n // ************************************************************************\r\n // document management data\r\n // ************************************************************************\r\n public getDocumentManagementPDFEditingUrl(): Promise {\r\n return this._uow.fetch('DocumentManagement/DocumentManagementURL', {}).then(dm => {\r\n return dm[0];\r\n });\r\n }\r\n\r\n // ************************************************************************\r\n // Display pdf in a modal dialogue\r\n // ************************************************************************\r\n /* showReferenceDocument() {\r\n this._showAndDownloadPDFComponent.fileName = this.referenceId + '.pdf';\r\n UtilFns.showModal(this._showAndDownloadPDFComponent, this).then(m => {\r\n return;\r\n });\r\n }*/\r\n}\r\n","

Replacing a Reference Document File

\r\n
\r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Replace file for ReferenceId:\r\n
\r\n {{_data.referenceId}}\r\n
\r\n\r\n \r\n\r\n \r\n\r\n {{_validationMessage}}\r\n
\r\n\r\n","import { Location } from '@angular/common';\r\nimport {Component, forwardRef, Inject, Input, OnInit, AfterViewInit, ViewChild} from '@angular/core';\r\n\r\nimport {UnitOfWork, StateMap, provideParent, WorkflowEntityState, ReferenceState} from '../../services/common';\r\nimport { PageState, EditPropParent } from '../../controls/common';\r\nimport {ReferenceDocumentEditData, RIFMDocumentsComponent} from '../docmanagement/rifm-documents.component';\r\nimport { Reference } from '../../entities/EntityModels';\r\n\r\nimport * as _ from 'lodash';\r\nimport {UtilFns} from '../../utils/util-fns';\r\nimport {Observable} from 'rxjs';\r\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\r\n\r\n@Component({\r\n selector: 'replace-reference-document',\r\n templateUrl: './replace-reference-document.html'\r\n})\r\n\r\nexport class ReplaceReferenceDocumentComponent implements OnInit, AfterViewInit {\r\n @Input() documentManagementUrl: string;\r\n\r\n public _data: ReferenceDocumentEditData = new ReferenceDocumentEditData();\r\n public _workflowReference: Reference;\r\n\r\n public _loading = false;\r\n public _pageState = new PageState('Add Reference Document');\r\n\r\n // add new reference document variables\r\n public _filedata: any;\r\n public _fileInputElement: any;\r\n\r\n public _replacedSuccessfully \t= false;\r\n public _validationMessage \t\t= '';\r\n\r\n constructor(public _uow: UnitOfWork, public _stateMap: StateMap, public _location: Location, private _httpClient: HttpClient, private _referenceState: ReferenceState,\r\n @Inject(forwardRef(() => RIFMDocumentsComponent)) public _parent: RIFMDocumentsComponent) {\r\n\r\n this._data = _parent._data;\r\n }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n ngAfterViewInit() {\r\n this._fileInputElement = $('#fileInputElement')[0] as HTMLInputElement;\r\n }\r\n\r\n public cancelReplace() {\r\n this._filedata = null;\r\n }\r\n\r\n public get fileData(): any {\r\n return this._filedata;\r\n }\r\n\r\n public set fileData(val: any) {\r\n this._filedata = val;\r\n }\r\n\r\n get utilFns() {\r\n return UtilFns;\r\n }\r\n\r\n // ******************************************************************\r\n // Handle initial file upload\r\n // ******************************************************************\r\n onFileInput(files: FileList) {\r\n this._filedata = files.item(0);\r\n }\r\n\r\n public canCancel() {\r\n if (this._replacedSuccessfully) {\r\n return false;\r\n }\r\n return (this.fileData != null);\r\n }\r\n\r\n public canSave() {\r\n return (this.fileData != null);\r\n }\r\n\r\n public canShowBack() {\r\n if (this._replacedSuccessfully) {\r\n return true;\r\n }\r\n\r\n return (this.fileData == null);\r\n }\r\n\r\n public onCancel() {\r\n this._parent.replaceCompleted('Reference Document file replace cancelled.');\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n }\r\n\r\n public onBack() {\r\n this._parent.replaceCompleted('');\r\n }\r\n\r\n public onSave() {\r\n this.replaceReferenceDocumentFile();\r\n }\r\n\r\n // ************************************************************************\r\n // web api calls\r\n // ************************************************************************\r\n getReplaceDocumentURL(): Observable {\r\n const url = this.documentManagementUrl + '/ReplaceRIFMDocument';\r\n const headers = new HttpHeaders();\r\n headers.append('Accept', 'application/json');\r\n\r\n const formData: FormData = new FormData();\r\n formData.append('referenceId', this._data.referenceId + '');\r\n formData.append('rifmDocumentId', this._data.rIFMDocumentId + '');\r\n formData.append('fileName', this._data.referenceId + '.pdf');\r\n formData.append('file', this.fileData);\r\n\r\n return this._httpClient.post(url, formData);\r\n }\r\n\r\n public replaceReferenceDocumentFile() {\r\n this._replacedSuccessfully = false;\r\n this._loading = true;\r\n this._validationMessage = '';\r\n this.getReplaceDocumentURL()\r\n .subscribe(\r\n (response) => {\r\n const data = response;\r\n\r\n if (data.Success == false) {\r\n this._validationMessage = 'Error occurred, unable to replace the Reference Document file: ' + data.ExceptionMessage;\r\n return;\r\n }\r\n\r\n this._replacedSuccessfully = true;\r\n this._parent.replaceCompleted('Reference Document file replaced successfully.');\r\n },\r\n (error) => {\r\n console.error('Request failed with error: ' + error.message);\r\n this._validationMessage = error.message;\r\n this._loading = false;\r\n },\r\n () => {\r\n this._loading = false;\r\n if (this._fileInputElement != null) {\r\n this._fileInputElement.value = null;\r\n }\r\n });\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\r\nimport { Observable } from 'rxjs';\r\nimport { tap } from 'rxjs/operators';\r\nimport { UserManager } from './user-manager';\r\n\r\n@Injectable()\r\nexport class AuthHttpInterceptor implements HttpInterceptor {\r\n\r\n constructor(private userManager: UserManager) {\r\n }\r\n\r\n intercept(request: HttpRequest, next: HttpHandler): Observable> {\r\n // add withCredentials to ensure that auth cookies are sent on CORS requests\r\n request = request.clone({\r\n withCredentials: true\r\n });\r\n\r\n let accessToken: string;\r\n if (request && request.url.includes('RIFMDocumentFileService')) {\r\n accessToken = this.userManager.currentUser.authenticationToken;\r\n } else {\r\n accessToken = this.userManager.accessToken;\r\n }\r\n // add token to http headers\r\n if (accessToken) {\r\n const authReq = request.clone({\r\n headers: request.headers.set('Authorization', 'Bearer ' + accessToken)\r\n });\r\n return next.handle(authReq)\r\n .pipe(tap((event: HttpEvent) => {\r\n }, (err: any) => {\r\n if (err.status === 401) {\r\n this.userManager.logout();\r\n }\r\n }));\r\n } else {\r\n return next.handle(request);\r\n }\r\n\r\n }\r\n}\r\n","import { BrowserModule } from '@angular/platform-browser';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { registerLicense } from '@syncfusion/ej2-base';\r\n// import { BreezeBridgeHttpClientModule } from 'breeze-bridge2-angular';\r\n\r\nimport { appRouterProviders, routes } from './route-provider';\r\n\r\nimport { SERVICE_PROVIDERS } from './services/service-registration';\r\nimport { customExceptionHandlerProvider } from './services/custom-exception-handler-provider';\r\n\r\nimport { AppComponent } from './components/main/app.component';\r\nimport { ExceptionDialogComponent } from './components/main/exception-dialog.component';\r\nimport { LoginComponent } from './components/main/login.component';\r\nimport { PrintToPdfDocComponent } from './components/main/print-to-pdf-doc.component';\r\nimport { ToolBar } from './components/main/toolbar.component';\r\nimport { YesNoComponent } from './components/main/yes-no.component';\r\n\r\nimport { MaterialResolver } from './components/material/material.resolver';\r\nimport { ReferenceResolver } from './components/reference/reference.resolver';\r\n\r\nimport { DefaultTableComponent } from './controls/default-table.component';\r\nimport { EditorHeaderComponent } from './controls/editor-header.component';\r\nimport { EditPropComponent } from './controls/edit-prop.component';\r\nimport { ColumnSorterDirective } from './controls/column-sorter.directive';\r\nimport { DatePickerDirective } from './controls/date-picker-dummy.directive';\r\nimport { HtmlGreekDirective } from './controls/html-greek.directive';\r\nimport { ChemFormulaDirective } from './controls/chem-formula.directive';\r\nimport { PageStatusComponent } from './controls/page-status.control';\r\nimport { TabContainerVert } from './controls/tab-container/tab-container-vert.component';\r\nimport { TabContainer } from './controls/tab-container/tab-container-horz.component';\r\nimport { TabPane } from './controls/tab-container/tab-pane.directive';\r\nimport { FormatUVFiles } from './controls/format-uvfiles.pipe';\r\nimport { PaginatePipe, PaginationControlsComponent } from './controls/ng2-pagination/ng2-pagination';\r\n\r\nimport { ExposureAdditionalMaterialsComponent } from './components/exposure/exposure-additional-materials.component';\r\nimport { ExposureAdditionalMaterialEditorComponent } from './components/exposure/exposure-additional-material-editor.component';\r\nimport { ExposureAdditionalMaterialSurveyMeasureEditorComponent } from './components/exposure/exposure-additional-material-survey-measure-editor.component';\r\nimport { ExposureAdditionalMaterialSurveyMeasuresComponent } from './components/exposure/exposure-additional-material-survey-measures.component';\r\nimport { ExposureComponent } from './components/exposure/exposure.component';\r\nimport { ExposureAdditionalMaterialSurveysComponent } from './components/exposure/exposure-additional-material-surveys.component';\r\nimport { ExposureAdditionalMaterialSurveyEditorComponent } from './components/exposure/exposure-additional-material-survey-editor.component';\r\nimport { ExposureSurveyEditorComponent } from './components/exposure/exposure-survey-editor.component';\r\nimport { ExposureSurveyLastReportComponent } from './components/exposure/exposure-survey-last-report.component';\r\nimport { ExposureSurveysComponent } from './components/exposure/exposure-surveys.component';\r\nimport { ExposureSurveyListsComponent } from './components/exposure/exposure-survey-lists.component';\r\nimport { ExposureSurveyReportsComponent } from './components/exposure/exposure-survey-reports.component';\r\nimport { MaterialExposureCustomSurveyMeasureEditorComponent } from './components/exposure/material-exposure-custom-survey-measure-editor.component';\r\nimport { MaterialExposureCustomSurveyMeasuresComponent } from './components/exposure/material-exposure-custom-survey-measures.component';\r\nimport { MaterialExposureSurveyEditorComponent } from './components/exposure/material-exposure-survey-editor.component';\r\nimport { MaterialExposureSurveyIsomerMeasuresComponent } from './components/exposure/material-exposure-survey-isomer-measures.component';\r\nimport { MaterialExposureSurveyMeasuresComponent } from './components/exposure/material-exposure-survey-measures.component';\r\nimport { MaterialExposureSurveyMeasureEditorComponent } from './components/exposure/material-exposure-survey-measure-editor.component';\r\nimport { MaterialExposureSurveysComponent } from './components/exposure/material-exposure-surveys.component';\r\nimport { RecordExposureSurveyMeasuresComponent } from './components/exposure/record-exposure-survey-measures.component';\r\nimport { TypeCremeVersionsComponent } from './components/exposure/type-creme-versions.component';\r\nimport { TypeCremeVersionEditorComponent } from './components/exposure/type-creme-version-editor.component';\r\n\r\nimport { ClusterHelpVideoComponent } from './components/home/cluster-help-video.component';\r\nimport { ClusterPathFilterComponent } from './components/home/clusterpath-filter.component';\r\nimport { ClusterPathSelectorComponent } from './components/home/clusterpath-selector.component';\r\nimport { CytoscapeGraphComponent } from './components/home/cytoscape-graph.component';\r\nimport { HomePageComponent } from './components/home/home-page.component';\r\nimport { HomeComponent } from './components/home/home.component';\r\nimport { DatabaseSubscriptionComponent } from './components/home/database-subscription.component';\r\nimport { EnvironmentalDataComponent } from './components/home/environmental-data.component';\r\nimport { IFRAAttachmentsComponent } from './components/home/ifra-attachments.component';\r\nimport { IFRASurveyUseComponent } from './components/home/ifra-survey-use.component';\r\nimport { IntroComponent } from './components/home/intro.component';\r\nimport { MarvinSearchComponent } from './components/home/marvin-search.component';\r\nimport { MaterialClustersComponent } from './components/home/material-clusters.component';\r\nimport { MaterialFFIDSComponent } from './components/home/material-ffids.component';\r\nimport { MaterialGroupsComponent } from './components/home/material-groups.component';\r\nimport { ReportDatabaseChangesComponent } from './components/home/report-database-changes.component';\r\nimport { SafetyAssessmentsComponent } from './components/home/safety-assessments.component';\r\nimport { SearchAuthorsComponent } from './components/home/search-authors.component';\r\nimport { SearchResultsComponent } from './components/home/search-results.component';\r\nimport { SearchSynonymsComponent } from './components/home/search-synonyms.component';\r\nimport { SystemRequirementsComponent } from './components/home/system-requirements.component';\r\nimport { ToolsAndModelComponent } from './components/home/tools-and-model.component';\r\nimport { ToolsAndModelsComponent } from './components/home/tools-and-models.component';\r\nimport { ToolsAndModelsLicenseComponent } from './components/home/tools-and-models-license.component';\r\nimport { UserAcknowledgementComponent } from './components/home/user-acknowledgement.component';\r\nimport { WhatsNewComponent } from './components/home/whats-new.component';\r\n\r\nimport { AnalyticalResultComponent } from './components/material/analytical-result.component';\r\nimport { AnalyticalResultsComponent } from './components/material/analytical-results.component';\r\nimport { FlavorComponent } from './components/material/flavor.component';\r\nimport { FlavorStatusesComponent } from './components/material/flavor-statuses.component';\r\nimport { FlavorUsesComponent } from './components/material/flavor-uses.component';\r\nimport { FlavorUsesItemComponent } from './components/material/flavor-uses-item.component';\r\nimport { FlavorVolumesComponent } from './components/material/flavor-volumes.component';\r\nimport { FragranceComponent } from './components/material/fragrance.component';\r\nimport { FragranceUseComponent } from './components/material/fragrance-use.component';\r\nimport { HouseStatusComponent } from './components/material/house-status.component';\r\nimport { HouseStatusesComponent } from './components/material/house-statuses.component';\r\nimport { HumanHealthComponent } from './components/material/human-health.component';\r\nimport { MaterialAdditionalIdentifiersComponent } from './components/material/material-additional-identifiers.component';\r\nimport { MaterialComponent } from './components/material/material.component';\r\nimport { MaterialCompositionComponent } from './components/material/material-composition.component';\r\nimport { MaterialConsumptionsComponent } from './components/material/material-consumptions.component';\r\nimport { MaterialExposureComponent } from './components/material/material-exposure.component';\r\nimport { MaterialFileEditorComponent } from './components/material/material-file-editor.component';\r\nimport { MaterialFileManagerComponent } from './components/material/material-file-manager.component';\r\nimport { MaterialHeaderComponent } from './components/material/material-header.component';\r\nimport { MaterialPartOfCompoundsComponent } from './components/material/material-partof-compounds.component';\r\nimport { MaterialResultsComponent } from './components/material/material-results.component';\r\nimport { MaterialSelectorComponent } from './components/material/material-selector.component';\r\nimport { MaterialSummaryComponent } from './components/material/material-summary.component';\r\nimport { NaturalsComponent } from './components/material/naturals.component';\r\nimport { NaturalOccurrenceComponent } from './components/material/natural-occurrence.component';\r\nimport { NaturalOccurrencesComponent } from './components/material/natural-occurrences.component';\r\nimport { PredictionEnvironmentalComponent } from './components/material/prediction-environmental.component';\r\nimport { PredictionHHAlertComponent } from './components/material/prediction-hh-alert.component';\r\nimport { PredictionHHCramerComponent } from './components/material/prediction-hh-cramer.component';\r\nimport { PredictionHHTTCComponent } from './components/material/prediction-hh-ttc.component';\r\nimport { PredictionHumanHealthComponent } from './components/material/prediction-human-health.component';\r\nimport { PredictionsComponent } from './components/material/predictions.component';\r\nimport { PublicationsComponent } from './components/material/publications.component';\r\nimport { REACHRegistrationComponent } from './components/material/reach-registration.component';\r\nimport { REACHRegistrationsComponent } from './components/material/reach-registrations.component';\r\nimport { RegulatoryStatusComponent } from './components/material/regulatory-status.component';\r\nimport { RegulatoryStatusesComponent } from './components/material/regulatory-statuses.component';\r\nimport { RelationsComponent } from './components/material/relations.component';\r\nimport { RelationsGroupComponent } from './components/material/relations-group.component';\r\nimport { RelationsGroupsComponent } from './components/material/relations-groups.component';\r\nimport { RelationsMaterialComponent } from './components/material/relations-material.component';\r\nimport { RelationsMaterialsComponent } from './components/material/relations-materials.component';\r\nimport { SafetyAssessmentComponent } from './components/material/safety-assessment.component';\r\nimport { StatusNtpComponent } from './components/material/status-ntp.component';\r\nimport { StatusNtpsComponent } from './components/material/status-ntps.component';\r\nimport { StatusRootComponent } from './components/material/status-root.component';\r\nimport { StructureComponent } from './components/material/structure.component';\r\nimport { StructureIdentityComponent } from './components/material/structure-identity.component';\r\nimport { SynonymComponent } from './components/material/synonym.component';\r\nimport { SynonymsComponent } from './components/material/synonyms.component';\r\nimport { SynopsisComponent } from './components/material/synopsis.component';\r\nimport { SynopsisReportComponent } from './components/material/synopsis-report.component';\r\nimport { ToxDataOtherReferencesComponent } from './components/material/tox-data-other.component';\r\nimport { ToxicDataComponent } from './components/material/toxic-data.component';\r\n\r\nimport { AuthorSelectorComponent } from './components/reference/author-selector.component';\r\nimport { ReferenceComponent } from './components/reference/reference.component';\r\nimport { ReferenceDataComponent } from './components/reference/reference-data.component';\r\nimport { ReferenceDataReportComponent } from './components/reference/reference-data-report.component';\r\nimport { ReferenceDetailsComponent } from './components/reference/reference-details.component';\r\nimport { ReferenceHeaderComponent } from './components/reference/reference-header.component';\r\nimport { ReferenceRelationsComponent } from './components/reference/reference-relations.component';\r\nimport { ReferenceResultsComponent } from './components/reference/reference-results.component';\r\nimport { ReferenceSelectorComponent } from './components/reference/reference-selector.component';\r\n\r\nimport { AuthorEditorComponent } from './components/staff/author-editor.component';\r\nimport { SafetyAssessmentCategoryEditorComponent } from './components/staff/safety-assessment-category-editor.component';\r\nimport { ComplianceSelectorComponent } from './components/staff/compliance-selector.component';\r\nimport { ConfirmFinishOverrideComponent } from './components/staff/confirm-finish-override.component';\r\nimport { ExpMaterialEditorComponent } from './components/staff/exp-material-editor.component';\r\nimport { ExpMaterialFromTemplateComponent } from './components/staff/exp-material-from-template.component';\r\nimport { FSAGEditorComponent } from './components/staff/fsag-editor.component';\r\nimport { FSAGSelectorComponent } from './components/staff/fsag-selector.component';\r\nimport { JournalsComponent } from './components/staff/journals.component';\r\nimport { JournalEditorComponent } from './components/staff/journal-editor.component';\r\nimport { JournalReservesComponent } from './components/staff/journal-reserves.component';\r\nimport { JournalReserveEditorComponent } from './components/staff/journal-reserve-editor.component';\r\nimport { JournalNamesComponent } from './components/staff/journal-names.component';\r\nimport { JournalReassignComponent } from './components/staff/journal-reassign.component';\r\nimport { JournalSearchComponent } from './components/staff/journal-search.component';\r\nimport { JournalSubscriptionEditorComponent } from './components/staff/journal-subscription-editor.component';\r\nimport { JournalSubscriptionsComponent } from './components/staff/journal-subscriptions.component';\r\nimport { JournalSelectorComponent } from './components/staff/journal-selector.component';\r\nimport { MaterialEditorBaseComponent } from './components/staff/material-editor-base.component';\r\nimport { MaterialEditorComponent } from './components/staff/material-editor.component';\r\nimport { MaterialReportedUsesComponent } from './components/staff/material-reported-uses.component';\r\nimport { MaterialReportedUseEditorComponent } from './components/staff/material-reported-use-editor.component';\r\nimport { MaterialWorkflowHistoryComponent } from './components/staff/material-workflow-history.component';\r\nimport { PredictionCramerEditorComponent } from './components/staff/prediction-cramer-editor.component';\r\nimport { PredictionsCramerEditorComponent } from './components/staff/predictions-cramer-editor.component';\r\nimport { ProjectEditorComponent } from './components/staff/project-editor.component';\r\nimport { ProjectSelectorComponent } from './components/staff/project-selector.component';\r\nimport { ProtocolEditorComponent } from './components/staff/protocol-editor.component';\r\nimport { ProtocolEditorBiodataComponent } from './components/staff/protocol-editor-biodata.component';\r\nimport { ProtocolEditorSubStudiesComponent } from './components/staff/protocol-editor-substudies.component';\r\nimport { ProtocolMaterialSelectorComponent } from './components/staff/protocol-material-selector.component';\r\nimport { ReferenceAnalyticalResultsComponent } from './components/staff/reference-analytical-results.component';\r\nimport { ReferenceAuditComponent } from './components/staff/reference-audit.component';\r\nimport { ReferenceEditorComponent } from './components/staff/reference-editor.component';\r\nimport { ReferenceEditorAuthorComponent } from './components/staff/reference-editor-author.component';\r\nimport { ReferenceEditorBaseComponent } from './components/staff/reference-editor-base.component';\r\nimport { ReferenceEditorRelationsComponent } from './components/staff/reference-editor-relations.component';\r\nimport { ReferenceEditorSpecialComponent } from './components/staff/reference-editor-special.component';\r\nimport { ReferenceWorkflowStatsComponent } from './components/staff/reference-workflow-stats.component';\r\nimport { ReportingOrganizationEditorComponent } from './components/staff/reporting-organization-editor.component';\r\nimport { SpecialLinkEditorComponent } from './components/staff/special-link-editor.component';\r\nimport { StaffEditingComponent } from './components/staff/staff-editing.component';\r\nimport { SurveyReportedUseComponent } from './components/staff/survey-reported-use.component';\r\nimport { SurveyWhoUsedMostComponent } from './components/staff/survey-whousedmost.component';\r\nimport { TypePredictionClassEditorComponent } from './components/staff/type-prediction-class-editor.component';\r\nimport { TypePredictionClassesComponent } from './components/staff/type-prediction-classes.component';\r\nimport { TypePredictionEditorBaseComponent } from './components/staff/type-prediction-editor-base.component';\r\nimport { TypePredictionEditorComponent } from './components/staff/type-prediction-editor.component';\r\nimport { TypePredictionsComponent } from './components/staff/type-predictions.component';\r\nimport { TypeReferenceRelationEditorComponent } from './components/staff/type-reference-relation-editor.component';\r\nimport { TypeReferenceRelationSelectorComponent } from './components/staff/type-reference-relation-selector.component';\r\nimport { WhatsNewEditorComponent } from './components/staff/whats-new-editor.component';\r\nimport { WhatsNewSelectorComponent } from './components/staff/whats-new-selector.component';\r\nimport { WorkflowActivityReportComponent } from './components/staff/workflow-activity-report.component';\r\nimport { WorkflowMaterialHistoryComponent } from './components/staff/workflow-material-history.component';\r\nimport { WorkflowHistoryComponent } from './components/staff/workflow-history.component';\r\nimport { WorkflowReferenceAssignmentsComponent } from './components/staff/workflow-reference-assignments.component';\r\nimport { AddReferenceDocumentComponent } from './components/docmanagement/add-reference-document.component';\r\nimport { ArchivedDocumentSelectorComponent } from './components/docmanagement/archived-document-selector.component';\r\nimport { DocumentManagementComponent } from './components/docmanagement/document-management.component';\r\nimport { DocumentManagementReportsComponent } from './components/docmanagement/document-management-reports.component';\r\nimport { DocumentSelectorComponent } from './components/docmanagement/document-selector.component';\r\nimport { EditPDFPagesComponent } from './components/docmanagement/edit-pdf-pages.component';\r\nimport { PDFEditorComponent } from './components/docmanagement/pdf-editor.component';\r\nimport { QuickDocumentUploadComponent } from './components/docmanagement/quick-document-upload.component';\r\nimport { ReplaceReferenceDocumentComponent } from './components/docmanagement/replace-reference-document.component';\r\nimport { RIFMArchivedDocumentsComponent } from './components/docmanagement/rifm-archived-documents.component';\r\nimport { RIFMDocumentEditorComponent } from './components/docmanagement/rifm-document-editor.component';\r\nimport { RIFMDocumentsComponent } from './components/docmanagement/rifm-documents.component';\r\nimport { ShowAndDownloadPDFComponent } from './components/docmanagement/show-and-download-pdf.component';\r\n\r\nimport { HTTP_INTERCEPTORS, HttpClientModule, HttpClient } from '@angular/common/http';\r\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\r\nimport { AuthHttpInterceptor } from './services/auth-http-interceptor';\r\nimport { RouterModule } from '@angular/router';\r\nimport {DxButtonModule, DxDataGridModule, DxTooltipModule} from 'devextreme-angular';\r\n\r\nimport { PdfViewerModule, LinkAnnotationService, BookmarkViewService,\r\n MagnificationService, ThumbnailViewService, ToolbarService,\r\n NavigationService, TextSearchService, TextSelectionService,\r\n PrintService, FormDesignerService, FormFieldsService,\r\n AnnotationService } from '@syncfusion/ej2-angular-pdfviewer';\r\nimport { ColorPickerModule, UploaderModule } from '@syncfusion/ej2-angular-inputs';\r\nimport { ToolbarModule } from '@syncfusion/ej2-angular-navigations';\r\n\r\nimport { DataServiceWebApiAdapter } from 'breeze-client/adapter-data-service-webapi';\r\nimport { DataServiceODataAdapter } from 'breeze-client/adapter-data-service-odata';\r\nimport { ModelLibraryBackingStoreAdapter } from 'breeze-client/adapter-model-library-backing-store';\r\nimport { UriBuilderJsonAdapter } from 'breeze-client/adapter-uri-builder-json';\r\nimport { UriBuilderODataAdapter } from 'breeze-client/adapter-uri-builder-odata';\r\n\r\nimport { AjaxHttpClientAdapter } from 'breeze-client/adapter-ajax-httpclient';\r\nimport {MaterialWorkflowService} from './services/material-workflow-service';\r\n\r\n@NgModule({\r\n imports: [\r\n // BreezeBridgeHttpClientModule,\r\n BrowserModule,\r\n FormsModule,\r\n HttpClientModule,\r\n BrowserAnimationsModule,\r\n DxDataGridModule,\r\n DxTooltipModule,\r\n RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' }),\r\n PdfViewerModule,\r\n ToolbarModule,\r\n DxButtonModule\r\n ],\r\n providers: [\r\n appRouterProviders,\r\n MaterialResolver,\r\n MaterialWorkflowService,\r\n ReferenceResolver,\r\n LinkAnnotationService,\r\n BookmarkViewService,\r\n MagnificationService,\r\n ThumbnailViewService,\r\n ToolbarService,\r\n NavigationService,\r\n TextSearchService,\r\n TextSelectionService,\r\n PrintService,\r\n AnnotationService,\r\n FormDesignerService,\r\n FormFieldsService,\r\n SERVICE_PROVIDERS,\r\n customExceptionHandlerProvider,\r\n {\r\n provide: HTTP_INTERCEPTORS,\r\n useClass: AuthHttpInterceptor,\r\n multi: true\r\n },\r\n ],\r\n declarations: [\r\n AppComponent,\r\n ExceptionDialogComponent,\r\n LoginComponent,\r\n PrintToPdfDocComponent,\r\n ToolBar,\r\n YesNoComponent,\r\n\r\n DefaultTableComponent,\r\n EditorHeaderComponent,\r\n EditPropComponent,\r\n FormatUVFiles,\r\n ColumnSorterDirective,\r\n HtmlGreekDirective,\r\n ChemFormulaDirective,\r\n PageStatusComponent,\r\n PaginatePipe,\r\n PaginationControlsComponent,\r\n TabContainerVert,\r\n TabContainer,\r\n TabPane,\r\n DatePickerDirective,\r\n\r\n ExposureAdditionalMaterialsComponent,\r\n ExposureAdditionalMaterialEditorComponent,\r\n ExposureAdditionalMaterialSurveyMeasureEditorComponent,\r\n ExposureAdditionalMaterialSurveyMeasuresComponent,\r\n ExposureComponent,\r\n ExposureAdditionalMaterialSurveysComponent,\r\n ExposureAdditionalMaterialSurveyEditorComponent,\r\n ExposureSurveyEditorComponent,\r\n ExposureSurveyLastReportComponent,\r\n ExposureSurveysComponent,\r\n ExposureSurveyListsComponent,\r\n ExposureSurveyReportsComponent,\r\n MaterialExposureCustomSurveyMeasureEditorComponent,\r\n MaterialExposureCustomSurveyMeasuresComponent,\r\n MaterialExposureSurveyMeasuresComponent,\r\n MaterialExposureSurveyMeasureEditorComponent,\r\n MaterialExposureSurveyIsomerMeasuresComponent,\r\n MaterialExposureSurveysComponent,\r\n MaterialExposureSurveyEditorComponent,\r\n RecordExposureSurveyMeasuresComponent,\r\n TypeCremeVersionsComponent,\r\n TypeCremeVersionEditorComponent,\r\n\r\n ClusterHelpVideoComponent,\r\n ClusterPathFilterComponent,\r\n ClusterPathSelectorComponent,\r\n CytoscapeGraphComponent,\r\n HomeComponent,\r\n HomePageComponent,\r\n DatabaseSubscriptionComponent,\r\n EnvironmentalDataComponent,\r\n IFRAAttachmentsComponent,\r\n IFRASurveyUseComponent,\r\n IntroComponent,\r\n MaterialClustersComponent,\r\n MarvinSearchComponent,\r\n MaterialFFIDSComponent,\r\n MaterialGroupsComponent,\r\n ReportDatabaseChangesComponent,\r\n SafetyAssessmentsComponent,\r\n SearchAuthorsComponent,\r\n SearchResultsComponent,\r\n SearchSynonymsComponent,\r\n SystemRequirementsComponent,\r\n ToolsAndModelComponent,\r\n ToolsAndModelsComponent,\r\n ToolsAndModelsLicenseComponent,\r\n UserAcknowledgementComponent,\r\n WhatsNewComponent,\r\n WhatsNewSelectorComponent,\r\n\r\n AnalyticalResultComponent,\r\n AnalyticalResultsComponent,\r\n FlavorComponent,\r\n FlavorStatusesComponent,\r\n FlavorUsesComponent,\r\n FlavorUsesItemComponent,\r\n FlavorVolumesComponent,\r\n FragranceComponent,\r\n FragranceUseComponent,\r\n HouseStatusComponent,\r\n HouseStatusesComponent,\r\n HumanHealthComponent,\r\n MaterialAdditionalIdentifiersComponent,\r\n MaterialComponent,\r\n MaterialCompositionComponent,\r\n MaterialConsumptionsComponent,\r\n MaterialExposureComponent,\r\n MaterialFileEditorComponent,\r\n MaterialFileManagerComponent,\r\n MaterialHeaderComponent,\r\n MaterialPartOfCompoundsComponent,\r\n MaterialResultsComponent,\r\n MaterialSelectorComponent,\r\n MaterialSummaryComponent,\r\n NaturalsComponent,\r\n NaturalOccurrenceComponent,\r\n NaturalOccurrencesComponent,\r\n PredictionEnvironmentalComponent,\r\n PredictionHHAlertComponent,\r\n PredictionHHCramerComponent,\r\n PredictionHHTTCComponent,\r\n PredictionHumanHealthComponent,\r\n PredictionsComponent,\r\n PublicationsComponent,\r\n REACHRegistrationComponent,\r\n REACHRegistrationsComponent,\r\n RegulatoryStatusComponent,\r\n RegulatoryStatusesComponent,\r\n RelationsComponent,\r\n RelationsGroupComponent,\r\n RelationsGroupsComponent,\r\n RelationsMaterialComponent,\r\n RelationsMaterialsComponent,\r\n SafetyAssessmentComponent,\r\n StatusNtpComponent,\r\n StatusNtpsComponent,\r\n StatusRootComponent,\r\n StructureComponent,\r\n StructureIdentityComponent,\r\n SynonymComponent,\r\n SynonymsComponent,\r\n SynopsisComponent,\r\n SynopsisReportComponent,\r\n ToxDataOtherReferencesComponent,\r\n ToxicDataComponent,\r\n\r\n AuthorSelectorComponent,\r\n SafetyAssessmentCategoryEditorComponent,\r\n ReferenceComponent,\r\n ReferenceDataComponent,\r\n ReferenceDataReportComponent,\r\n ReferenceDetailsComponent,\r\n ReferenceHeaderComponent,\r\n ReferenceRelationsComponent,\r\n ReferenceResultsComponent,\r\n ReferenceSelectorComponent,\r\n\r\n AuthorEditorComponent,\r\n ComplianceSelectorComponent,\r\n ConfirmFinishOverrideComponent,\r\n ExpMaterialEditorComponent,\r\n ExpMaterialFromTemplateComponent,\r\n FSAGEditorComponent,\r\n FSAGSelectorComponent,\r\n JournalsComponent,\r\n JournalEditorComponent,\r\n JournalReserveEditorComponent,\r\n JournalReservesComponent,\r\n JournalNamesComponent,\r\n JournalReassignComponent,\r\n JournalSearchComponent,\r\n JournalSubscriptionEditorComponent,\r\n JournalSubscriptionsComponent,\r\n JournalSelectorComponent,\r\n MaterialEditorBaseComponent,\r\n MaterialEditorComponent,\r\n MaterialReportedUsesComponent,\r\n MaterialReportedUseEditorComponent,\r\n MaterialWorkflowHistoryComponent,\r\n PredictionCramerEditorComponent,\r\n PredictionsCramerEditorComponent,\r\n ProjectEditorComponent,\r\n ProjectSelectorComponent,\r\n ProtocolEditorComponent,\r\n ProtocolEditorBiodataComponent,\r\n ProtocolEditorSubStudiesComponent,\r\n ProtocolMaterialSelectorComponent,\r\n ReferenceAnalyticalResultsComponent,\r\n ReferenceAuditComponent,\r\n ReferenceEditorComponent,\r\n ReferenceEditorAuthorComponent,\r\n ReferenceEditorBaseComponent,\r\n ReferenceEditorRelationsComponent,\r\n ReferenceEditorSpecialComponent,\r\n ReferenceWorkflowStatsComponent,\r\n ReportingOrganizationEditorComponent,\r\n SpecialLinkEditorComponent,\r\n StaffEditingComponent,\r\n SurveyReportedUseComponent,\r\n SurveyWhoUsedMostComponent,\r\n TypePredictionClassEditorComponent,\r\n TypePredictionClassesComponent,\r\n TypePredictionEditorBaseComponent,\r\n TypePredictionEditorComponent,\r\n TypePredictionsComponent,\r\n TypeReferenceRelationEditorComponent,\r\n TypeReferenceRelationSelectorComponent,\r\n WhatsNewEditorComponent,\r\n WhatsNewSelectorComponent,\r\n WorkflowActivityReportComponent,\r\n WorkflowMaterialHistoryComponent,\r\n WorkflowHistoryComponent,\r\n WorkflowReferenceAssignmentsComponent,\r\n\r\n AddReferenceDocumentComponent,\r\n ArchivedDocumentSelectorComponent,\r\n DocumentManagementComponent,\r\n DocumentManagementReportsComponent,\r\n DocumentSelectorComponent,\r\n EditPDFPagesComponent,\r\n QuickDocumentUploadComponent,\r\n PDFEditorComponent,\r\n ReplaceReferenceDocumentComponent,\r\n RIFMArchivedDocumentsComponent,\r\n RIFMDocumentEditorComponent,\r\n RIFMDocumentsComponent,\r\n ShowAndDownloadPDFComponent,\r\n\r\n ],\r\n bootstrap: [AppComponent],\r\n\r\n})\r\nexport class AppModule {\r\n constructor(http: HttpClient) {\r\n ModelLibraryBackingStoreAdapter.register();\r\n // UriBuilderJsonAdapter.register();\r\n UriBuilderODataAdapter.register();\r\n AjaxHttpClientAdapter.register(http);\r\n DataServiceWebApiAdapter.register();\r\n registerLicense('ORg4AjUWIQA/Gnt2VVhiQlFacl9JXGFWfVJpTGpQdk5xdV9DaVZUTWY/P1ZhSXxRdk1iWX1fcnBVQ2hbV0A=;Mgo+DSMBMAY9C3t2VVhiQlFacl9JXGFWfVJpTGpQdk5xdV9DaVZUTWY/P1ZhSXxRdk1iWX1fcnBVQ2hVV0A=');\r\n }\r\n}\r\n","export interface AppConfig {\r\n enableLogging: boolean;\r\n environment?: string;\r\n sentryIoDsn?: string;\r\n}\r\n\r\nexport const Settings = {\r\n enableLogging: true,\r\n environment: null,\r\n sentryIoDsn: null,\r\n\r\n initialize(value: AppConfig) {\r\n this.enableLogging = value.enableLogging;\r\n this.environment = value.environment;\r\n this.sentryIoDsn = value.sentryIoDsn;\r\n }\r\n};\r\n","import * as Raven from 'raven-js';\r\nimport { UserManager } from '../services/user-manager';\r\nimport { Settings } from './app-config';\r\n\r\nexport function configRavenLogging() {\r\n // Configure Sentry.io logging service, this needs to go before NgModule configuration to be able capture errors during the Angular bootstrap process\r\n if (Settings.enableLogging) {\r\n Raven\r\n .config(Settings.sentryIoDsn,\r\n {\r\n environment: Settings.environment,\r\n release: UserManager.versionNo\r\n })\r\n .install();\r\n }\r\n}\r\n","import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\nimport { enableProdMode } from '@angular/core';\r\nimport { AppModule } from './app/app.module';\r\nimport { configRavenLogging } from './app/utils/logging';\r\nimport * as Raven from 'raven-js';\r\nimport { environment } from './environments/environment';\r\n\r\nconfigRavenLogging();\r\n\r\nif (environment.production) {\r\n enableProdMode();\r\n}\r\n\r\nplatformBrowserDynamic().bootstrapModule(AppModule)\r\n .catch((reason: any) => {\r\n Raven.captureException(reason, { tags: { 'location': 'bootstrap' } });\r\n console.error(reason);\r\n });\r\n\r\n","var map = {\n\t\"./af\": 58685,\n\t\"./af.js\": 58685,\n\t\"./ar\": 254,\n\t\"./ar-dz\": 4312,\n\t\"./ar-dz.js\": 4312,\n\t\"./ar-kw\": 32614,\n\t\"./ar-kw.js\": 32614,\n\t\"./ar-ly\": 18630,\n\t\"./ar-ly.js\": 18630,\n\t\"./ar-ma\": 28674,\n\t\"./ar-ma.js\": 28674,\n\t\"./ar-sa\": 49032,\n\t\"./ar-sa.js\": 49032,\n\t\"./ar-tn\": 24730,\n\t\"./ar-tn.js\": 24730,\n\t\"./ar.js\": 254,\n\t\"./az\": 53052,\n\t\"./az.js\": 53052,\n\t\"./be\": 60150,\n\t\"./be.js\": 60150,\n\t\"./bg\": 63069,\n\t\"./bg.js\": 63069,\n\t\"./bm\": 13466,\n\t\"./bm.js\": 13466,\n\t\"./bn\": 18516,\n\t\"./bn-bd\": 90557,\n\t\"./bn-bd.js\": 90557,\n\t\"./bn.js\": 18516,\n\t\"./bo\": 26273,\n\t\"./bo.js\": 26273,\n\t\"./br\": 9588,\n\t\"./br.js\": 9588,\n\t\"./bs\": 19815,\n\t\"./bs.js\": 19815,\n\t\"./ca\": 83331,\n\t\"./ca.js\": 83331,\n\t\"./cs\": 21320,\n\t\"./cs.js\": 21320,\n\t\"./cv\": 72219,\n\t\"./cv.js\": 72219,\n\t\"./cy\": 68266,\n\t\"./cy.js\": 68266,\n\t\"./da\": 66427,\n\t\"./da.js\": 66427,\n\t\"./de\": 67435,\n\t\"./de-at\": 52871,\n\t\"./de-at.js\": 52871,\n\t\"./de-ch\": 12994,\n\t\"./de-ch.js\": 12994,\n\t\"./de.js\": 67435,\n\t\"./dv\": 82357,\n\t\"./dv.js\": 82357,\n\t\"./el\": 95649,\n\t\"./el.js\": 95649,\n\t\"./en-au\": 59961,\n\t\"./en-au.js\": 59961,\n\t\"./en-ca\": 19878,\n\t\"./en-ca.js\": 19878,\n\t\"./en-gb\": 3924,\n\t\"./en-gb.js\": 3924,\n\t\"./en-ie\": 70864,\n\t\"./en-ie.js\": 70864,\n\t\"./en-il\": 91579,\n\t\"./en-il.js\": 91579,\n\t\"./en-in\": 30940,\n\t\"./en-in.js\": 30940,\n\t\"./en-nz\": 16181,\n\t\"./en-nz.js\": 16181,\n\t\"./en-sg\": 44301,\n\t\"./en-sg.js\": 44301,\n\t\"./eo\": 85291,\n\t\"./eo.js\": 85291,\n\t\"./es\": 54529,\n\t\"./es-do\": 53764,\n\t\"./es-do.js\": 53764,\n\t\"./es-mx\": 12584,\n\t\"./es-mx.js\": 12584,\n\t\"./es-us\": 63425,\n\t\"./es-us.js\": 63425,\n\t\"./es.js\": 54529,\n\t\"./et\": 35203,\n\t\"./et.js\": 35203,\n\t\"./eu\": 70678,\n\t\"./eu.js\": 70678,\n\t\"./fa\": 83483,\n\t\"./fa.js\": 83483,\n\t\"./fi\": 96262,\n\t\"./fi.js\": 96262,\n\t\"./fil\": 52521,\n\t\"./fil.js\": 52521,\n\t\"./fo\": 34555,\n\t\"./fo.js\": 34555,\n\t\"./fr\": 63131,\n\t\"./fr-ca\": 88239,\n\t\"./fr-ca.js\": 88239,\n\t\"./fr-ch\": 21702,\n\t\"./fr-ch.js\": 21702,\n\t\"./fr.js\": 63131,\n\t\"./fy\": 267,\n\t\"./fy.js\": 267,\n\t\"./ga\": 23821,\n\t\"./ga.js\": 23821,\n\t\"./gd\": 71753,\n\t\"./gd.js\": 71753,\n\t\"./gl\": 4074,\n\t\"./gl.js\": 4074,\n\t\"./gom-deva\": 92762,\n\t\"./gom-deva.js\": 92762,\n\t\"./gom-latn\": 5969,\n\t\"./gom-latn.js\": 5969,\n\t\"./gu\": 82809,\n\t\"./gu.js\": 82809,\n\t\"./he\": 45402,\n\t\"./he.js\": 45402,\n\t\"./hi\": 315,\n\t\"./hi.js\": 315,\n\t\"./hr\": 10410,\n\t\"./hr.js\": 10410,\n\t\"./hu\": 38288,\n\t\"./hu.js\": 38288,\n\t\"./hy-am\": 67928,\n\t\"./hy-am.js\": 67928,\n\t\"./id\": 71334,\n\t\"./id.js\": 71334,\n\t\"./is\": 86959,\n\t\"./is.js\": 86959,\n\t\"./it\": 34864,\n\t\"./it-ch\": 51124,\n\t\"./it-ch.js\": 51124,\n\t\"./it.js\": 34864,\n\t\"./ja\": 36141,\n\t\"./ja.js\": 36141,\n\t\"./jv\": 29187,\n\t\"./jv.js\": 29187,\n\t\"./ka\": 42136,\n\t\"./ka.js\": 42136,\n\t\"./kk\": 94332,\n\t\"./kk.js\": 94332,\n\t\"./km\": 18607,\n\t\"./km.js\": 18607,\n\t\"./kn\": 84305,\n\t\"./kn.js\": 84305,\n\t\"./ko\": 70234,\n\t\"./ko.js\": 70234,\n\t\"./ku\": 16003,\n\t\"./ku.js\": 16003,\n\t\"./ky\": 75061,\n\t\"./ky.js\": 75061,\n\t\"./lb\": 32786,\n\t\"./lb.js\": 32786,\n\t\"./lo\": 66183,\n\t\"./lo.js\": 66183,\n\t\"./lt\": 50029,\n\t\"./lt.js\": 50029,\n\t\"./lv\": 24169,\n\t\"./lv.js\": 24169,\n\t\"./me\": 68577,\n\t\"./me.js\": 68577,\n\t\"./mi\": 68177,\n\t\"./mi.js\": 68177,\n\t\"./mk\": 50337,\n\t\"./mk.js\": 50337,\n\t\"./ml\": 65260,\n\t\"./ml.js\": 65260,\n\t\"./mn\": 52325,\n\t\"./mn.js\": 52325,\n\t\"./mr\": 14695,\n\t\"./mr.js\": 14695,\n\t\"./ms\": 75334,\n\t\"./ms-my\": 37151,\n\t\"./ms-my.js\": 37151,\n\t\"./ms.js\": 75334,\n\t\"./mt\": 63570,\n\t\"./mt.js\": 63570,\n\t\"./my\": 97963,\n\t\"./my.js\": 97963,\n\t\"./nb\": 88028,\n\t\"./nb.js\": 88028,\n\t\"./ne\": 86638,\n\t\"./ne.js\": 86638,\n\t\"./nl\": 50302,\n\t\"./nl-be\": 66782,\n\t\"./nl-be.js\": 66782,\n\t\"./nl.js\": 50302,\n\t\"./nn\": 33501,\n\t\"./nn.js\": 33501,\n\t\"./oc-lnc\": 50563,\n\t\"./oc-lnc.js\": 50563,\n\t\"./pa-in\": 50869,\n\t\"./pa-in.js\": 50869,\n\t\"./pl\": 65302,\n\t\"./pl.js\": 65302,\n\t\"./pt\": 49687,\n\t\"./pt-br\": 74884,\n\t\"./pt-br.js\": 74884,\n\t\"./pt.js\": 49687,\n\t\"./ro\": 79107,\n\t\"./ro.js\": 79107,\n\t\"./ru\": 33627,\n\t\"./ru.js\": 33627,\n\t\"./sd\": 30355,\n\t\"./sd.js\": 30355,\n\t\"./se\": 83427,\n\t\"./se.js\": 83427,\n\t\"./si\": 11848,\n\t\"./si.js\": 11848,\n\t\"./sk\": 54590,\n\t\"./sk.js\": 54590,\n\t\"./sl\": 20184,\n\t\"./sl.js\": 20184,\n\t\"./sq\": 56361,\n\t\"./sq.js\": 56361,\n\t\"./sr\": 78965,\n\t\"./sr-cyrl\": 81287,\n\t\"./sr-cyrl.js\": 81287,\n\t\"./sr.js\": 78965,\n\t\"./ss\": 25456,\n\t\"./ss.js\": 25456,\n\t\"./sv\": 70451,\n\t\"./sv.js\": 70451,\n\t\"./sw\": 77558,\n\t\"./sw.js\": 77558,\n\t\"./ta\": 51356,\n\t\"./ta.js\": 51356,\n\t\"./te\": 73693,\n\t\"./te.js\": 73693,\n\t\"./tet\": 21243,\n\t\"./tet.js\": 21243,\n\t\"./tg\": 42500,\n\t\"./tg.js\": 42500,\n\t\"./th\": 55768,\n\t\"./th.js\": 55768,\n\t\"./tk\": 77761,\n\t\"./tk.js\": 77761,\n\t\"./tl-ph\": 35780,\n\t\"./tl-ph.js\": 35780,\n\t\"./tlh\": 29590,\n\t\"./tlh.js\": 29590,\n\t\"./tr\": 33807,\n\t\"./tr.js\": 33807,\n\t\"./tzl\": 93857,\n\t\"./tzl.js\": 93857,\n\t\"./tzm\": 60654,\n\t\"./tzm-latn\": 8806,\n\t\"./tzm-latn.js\": 8806,\n\t\"./tzm.js\": 60654,\n\t\"./ug-cn\": 30845,\n\t\"./ug-cn.js\": 30845,\n\t\"./uk\": 19232,\n\t\"./uk.js\": 19232,\n\t\"./ur\": 47052,\n\t\"./ur.js\": 47052,\n\t\"./uz\": 77967,\n\t\"./uz-latn\": 32233,\n\t\"./uz-latn.js\": 32233,\n\t\"./uz.js\": 77967,\n\t\"./vi\": 98615,\n\t\"./vi.js\": 98615,\n\t\"./x-pseudo\": 12320,\n\t\"./x-pseudo.js\": 12320,\n\t\"./yo\": 31313,\n\t\"./yo.js\": 31313,\n\t\"./zh-cn\": 64490,\n\t\"./zh-cn.js\": 64490,\n\t\"./zh-hk\": 55910,\n\t\"./zh-hk.js\": 55910,\n\t\"./zh-mo\": 98262,\n\t\"./zh-mo.js\": 98262,\n\t\"./zh-tw\": 44223,\n\t\"./zh-tw.js\": 44223\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 46700;"],"x_google_ignoreList":[604]}