AssignForce190122_Naming_Conventions - revaturelabs/assignforce-force GitHub Wiki
On this page below, you will find a document containing the naming conventions for the AssignForce project. The document also outlines the purpose of each apex class and lightning component and what we aimed to accomplish with it.
What goes here?
- Attribute names
- Event names
- Component names – All start with af
- Classes
Notes
*We want any attribute that is used in multiple components to have the same name*
- Look for an attribute within the Attributes list first before you create an Attribute. If it’s not there, create it there, and then also make a note of it under the component you’re creating.
- As you create attributes here, and your components, please write a description of what the attribute/component is for, preferably in the code using the description attribute, and at least in here
Attributes -
- trainerId: The Id of a user with the role trainer.
- trainers: A list of User objects.
- isAvailable: Boolean for if the user(trainer is available to train a batch).
- hasSkill: Boolean for the user if they have the associated curricula.
- availability: String variable containing the value of the Available custom field on the Trainers object.
- allSkils: A list Skills objects.
- allTrainings: A list of Training object.
- selectedTrainingTrack: The Id of the Training Track that’s passed by afNewBatchFormTrackEvent.
- tab1Shown: Boolean that’s used to switch between the two tabs.
- rooms: A list of Training Room objects.
- currentLocRooms: A list of rooms at the location selected in the afNewBatchForm component (is set to all rooms in the org when no location is specified).
- location: The id of the location that is passed by afNewBatchFormLocationEvent.
- room: Used to hold the information of a specific Training Room object.
- isYes: A boolean to checked if a room is marked as available.
- isRequest: A boolean to checked if a room is available upon request.
- allTrainers: A list of trainers.
- allCoTrainers: A list of Co-Trainers.
- coTrainer: A specific Co-Trainer that is selected.
- endDate: The date a batch is to be scheduled to end.
- hiddenRoom: The Id of the selected room to be saved to the database.
- numWeeks: Holds the number of weeks between the start date and end date of a batch.
- openTrainings: List of Training objects that will still be happening during a given end date.
- roomList: A list of rooms.
- roomsForLocation: List of rooms with a specific location.
- track: The Id of the track displayed in the Training Track input field.
- trainer: Holds the record of the selected trainer.
- startDate: The date a batch should be scheduled to start.
- status: A string attribute, defaulted to “Planned”.
- uncleared: A boolean, defaulted to true, that is set to false when clearing the recordEditForm.
- newBatch: A Map used to pass the information of the new batch in an event.
- userId: Contains the Id of the current user viewing the page.
- filename: Name of the file that has been uploaded.
- fileId: The Id of the uploaded file.
- hasChanged: A boolean, set to false by default, that specifies if a new file has been uploaded.
- PTOId: The Id of the PTO record that is passed in from another component.
- selectedLocation: A String array that storing the list of selected locations.
- selectedYear: Holds the value of the selected year for the chart filter.
- selectedQuarter: Hold the value of the selected quarter.
- dataTemp: A String array used to temporarily store the incoming data.
- AllLocations: A list of type String that holds all locations in the database.
- yearOptions: A dynamic variable that houses the current year, and 2 years previous.
- quarterOptions: A dynamic variable that houses the 4 Quarters of the year.
- locationOptions: A dynamic variable that displays the checkbox options for the location.
- value: Holds the selected values for location.
- chartTitle: A String that holds the title of the Batch Timeline chart.
- data: This attribute sets the data for the chart.
- empPTORecordset: List of records for the lightning:dataTable columns
- keyField: Primary key for list of records
- empCurrentPTODataset: Data for lightning dataTable that involves current PTO
- empFuturePTODataset: Data for lightning dataTable that involves upcoming PTO
- userId: Used to store a value for the current users id
- hasPTO: A boolean used to represent whether a trainer has any batches scheduled
- selectedPTO: This the boolean to toggle if a trainer has been selected.
- empBatchesRecordset: List of records for the lightning:dataTable columns
- empCurrentBatchDataset: Data for lightning dataTable that involves current batches
- empFutureBatchDataset: Data for lightning dataTable that involves future batches
- hasBatches: A boolean used to represent whether a trainer has any batches scheduled
- hasSelected: Checks to see if a trainer was selected.
- hasPending – Boolean to check if there are any pending PTO requests.
- hasApproved – Boolean to check if there are any approved PTO requests.
- ExternalTrainerId – Id for external trainers, used for displaying batches and list view information.
Events -
- Name=TrainerIsSelected type=TrainerSelected: fired by the afTrainerAvailabilityListItem component when the select button is pressed, it sets the trainerId param to that particular user(Trainer).
- trainerId
- Name=roomSelected: fired by the afRoomAvailabilityListItem component when the select button is clicked and passes that room’s ID to another application for further use.
- roomId
- Name=afNewBatchFormTrackEvent: fired by the afNewBatchForm component when a Training Track is selected and passes that Training Track’s ID to another component.
- track
- Name=afNewBatchFormDateEvent: fired by the afNewBatchForm component when the date field is changed and passes the startDate and endDate.
- startDate
- endDate
- Name=afNewBatchFormLocationEvent: fired by the afNewBatchForm component when a location is selected and passes the ID of that location to another component.
- location
- Name=afNewBatchCreatedEvent: fired by the afNewBatchForm component when a new batch is being submitted.
- newMap
- Name=UpdateChartEvent: fired by the FilterChartComponent component to regather the data that needs to be displayed on the chart.
- Data
- Name=SetLocationsEvent: fired by
- name=ExternalTrainerId: fired by afExternalTrainersTabListViewItem component to bring a specific Id to be handled in afExternalTrainerTabBatches
Components -
- afTrainerAvailabilityListItem: List item used to populate the afAvailabilityListContainer
- trainer: The User Object passed to the component used for holding their information
- isAvailable: Boolean for if the user(trainer is available to train a batch)
- hasSkill: Boolean for the user if they have the associated curricula
- selectedSkill: String for the skill that is selected to affect the hasSkill boolean
afRoomAvailabilityListItem
- room: Used to hold the information of a specific Training Room object.
- isYes: A boolean to checked if a room is marked as available.
- isRequest: A boolean to checked if a room is available upon request.
afNewBatchForm
- allTrainers: A list of trainers.
- allCoTrainers: A list of Co-Trainers.
- coTrainer: A specific Co-Trainer that is selected.
- endDate: The date a batch is to be scheduled to end.
- hiddenRoom: The Id of the selected room to be saved to the database.
- numWeeks: Holds the number of weeks between the start date and end date of a batch.
- openTrainings: List of Training objects that will still be happening during a given end date.
- roomList: A list of rooms.
- roomsForLocation: List of rooms with a specific location.
- track: The Id of the track displayed in the Training Track input field.
- trainer: Holds the record of the selected trainer.
- startDate: The date a batch should be scheduled to start.
- status: A string attribute, defaulted to “Planned”.
- uncleared: A boolean, defaulted to true, that is set to false when clearing the recordEditForm.
- newBatch: A Map used to pass the information of the new batch in an event.
- rooms: A list of Training Room objects.
- location: The id of the location that is passed by afNewBatchFormLocationEvent.
afProfileTab
- userId: Contains the Id of the current user viewing the page.
- filename: Name of the file that has been uploaded.
- fileId: The Id of the uploaded file.
- hasChanged: A boolean, set to false by default, that specifies if a new file has been uploaded.
afPTOListItem
- PTOId: The Id of the PTO record that is passed in from another component.
afTrainersTabListView
- trainers: an array of User objects with Trainer or Co-Trainer roles
afTrainersTabListViewItem
- currLoc: String referencing the CurrentLocation__c field on the specified User
- skills: String in the form of comma-separated values, each value the ShortName__c of a TrainingTrack__c the User has a related Skill__c record for
- availability: String referencing the Available__c field on the specified User
- trainerId: the Id of the User being passed in to this component
FullChartLightningComponent.cmp – Holds the afBatchTimeline and FilterChartComponent for page styling
afBatchTimeline.cmp
- chartTitle: The title of the chart that’s being displayed
afTrainersTabBatches.cmp
- empBatchesRecordset: List of records for the lightning:dataTable columns
- empCurrentBatchDataset: Data for lightning dataTable that involves current batches
- empFutureBatchDataset: Data for lightning dataTable that involves future batches
- hasBatches: A boolean used to represent whether a trainer has any batches scheduled
- hasSelected: Checks to see if a trainer was selected.
- keyField: Primary key for list of records
- userId: Used to store a value for the current users id
afTrainersTabPTO.cmp
- empPTORecordset: List of records for the lightning:dataTable columns
- keyField: Primary key for list of records
- empCurrentPTODataset: Data for lightning dataTable that involves current PTO
- empFuturePTODataset: Data for lightning dataTable that involves upcoming PTO
- userId: Used to store a value for the current users id
- hasPTO: A boolean used to represent whether a trainer has any batches scheduled
- selectedPTO: This the boolean to toggle if a trainer has been selected.
afTrainersTabMerge.cmp
- Description: Merge both components afTrainersTabPTO and afTrainersTabBatches to be displayed on the trainers tab.
- Tab: keep track of what tab the user is currently on
JavaScript controllers-
afTrainersTabPTOClicked – change active tab to the PTO tab
- JavaScript class, added initialWidth=’30px’ to give it an initial starting width for the tab. This prevents the issue of a small component from generating
afTrainersTabBatchesClicked – Change active tab to Batches tab
- JavaScript class, added initialWidth=’30px’ to give it an initial starting width for the tab. This prevents the issue of a small component from generating
- Required to be changed- In the trainer tab, remove afTrainersTabPTO and afTrainersTabBatches and replace it with afTrainersTabMerge component in the edit page layout.
Classes -
afTimelineController – Used for grabbing the data from the server for the batch timeline chart
- getTrainingLocations()
- getTrainers()
- wrapTrainingToJSON()
- filterTrainingsByYearLocationQuarter(String[] location, Integer year, Integer quarter)
- filterTrainingsByYearLocation(String[] location, Integer year)
- filterTrainingsByYearQuarter(Integer year, Integer quarter)
- filterTrainingsByYear(Integer year)
afAvailabilityListContainerController – Queries for the rooms, skills, trainers, and training sessions in the org, organizes them, and returns their lists using the following methods:
- getRooms()
- getAllTrainers()
- getAllSkills()
- getAllTrainings()
afNewBatchFormApexController – Used to return data from the database for the batch form component.
- allRooms()
- alTrainers()
- allTrainings()
afPTOTabsApexController -
- getAllPTOs(ID User)
- getBatches(ID User)
afTrainersTabPTOApexController – Used to return data for upcoming and current PTO in data table on trainers tab
- getTrainingPTOById(Id userId)