@@ -43,19 +43,21 @@ class DepartmentSectionFactory {
4343
4444 teamGrid . innerHTML = '' ;
4545 department . teams . forEach ( ( team ) => {
46- /** @type {HTMLAnchorElement } */
47- const teamCardElement = teamCardTemplate . cloneNode ( true ) ;
48- teamCardElement . href = `/careers/maps/${ team . slug } ` ;
46+ if ( team . jobs && Object . keys ( team . jobs ) . length > 0 ) {
47+ /** @type {HTMLAnchorElement } */
48+ const teamCardElement = teamCardTemplate . cloneNode ( true ) ;
49+ teamCardElement . href = `/careers/maps/${ team . slug } ` ;
4950
50- /** @type {HTMLElement } */
51- const teamNameElement = teamCardElement . querySelector ( '[data-template-id="cm-team-name"]' ) ;
52- teamNameElement . textContent = teamNameElement . textContent . replace ( '{team_name}' , team . name ) ;
51+ /** @type {HTMLElement } */
52+ const teamNameElement = teamCardElement . querySelector ( '[data-template-id="cm-team-name"]' ) ;
53+ teamNameElement . textContent = teamNameElement . textContent . replace ( '{team_name}' , team . name ) ;
5354
54- /** @type {HTMLElement } */
55- const teamLinkElement = teamCardElement . querySelector ( '[data-template-id="cm-team-link"]' ) ;
56- teamLinkElement . textContent = teamLinkElement . textContent . replace ( '{team_name}' , team . name ) ;
55+ /** @type {HTMLElement } */
56+ const teamLinkElement = teamCardElement . querySelector ( '[data-template-id="cm-team-link"]' ) ;
57+ teamLinkElement . textContent = teamLinkElement . textContent . replace ( '{team_name}' , team . name ) ;
5758
58- teamGrid . appendChild ( teamCardElement ) ;
59+ teamGrid . appendChild ( teamCardElement ) ;
60+ }
5961 } ) ;
6062
6163 return departmentSection ;
0 commit comments