|
1
|
|
|
var TeamCultureAPI = {}; |
|
2
|
|
|
|
|
3
|
|
|
TeamCultureAPI.baseURL = "/tc/api/v1"; |
|
4
|
|
|
|
|
5
|
|
|
TeamCultureAPI.TeamCulture = function(teamSize, gcDirUrl, narrativeText, operatingContext, whatWeValue, howWeWork) { |
|
6
|
|
|
this.team_size = teamSize; |
|
7
|
|
|
this.gc_directory_url = gcDirUrl; |
|
8
|
|
|
this.narrative_text = narrativeText; |
|
9
|
|
|
this.operating_context = operatingContext; |
|
10
|
|
|
this.what_we_value = whatWeValue; |
|
11
|
|
|
this.how_we_work = howWeWork; |
|
12
|
|
|
}; |
|
13
|
|
|
|
|
14
|
|
|
TeamCultureAPI.parseTeamCultureResponse = function(responseText) { |
|
15
|
|
|
var json = JSON.parse(responseText); |
|
16
|
|
|
return new TeamCultureAPI.TeamCulture(json.team_size, json.gc_directory_url, json.narrative_text, json.operating_context, json.what_we_value, json.how_we_work); |
|
17
|
|
|
}; |
|
18
|
|
|
|
|
19
|
|
|
TeamCultureAPI.localizeTeamCulture = function() { |
|
20
|
|
|
if (siteContent) { |
|
|
|
|
|
|
21
|
|
|
document.getElementById("jobPosterTeamCultureLabel").innerHTML = siteContent.teamCulture; |
|
22
|
|
|
document.getElementById("jobPosterTeamSize_label").innerHTML = siteContent.teamSize; |
|
23
|
|
|
document.getElementById("jobPosterGcDirLink_label").innerHTML = siteContent.gcDirectoryLink; |
|
24
|
|
|
|
|
25
|
|
|
//document.getElementById("jobPosterOperatingContext_label").innerHTML = siteContent.operatingContextLabel; |
|
26
|
|
|
//document.getElementById("jobPosterWhatWeValue_label").innerHTML = siteContent.whatWeValueLabel; |
|
27
|
|
|
//document.getElementById("jobPosterHowWeWork_label").innerHTML = siteContent.howWeWorkLabel; |
|
28
|
|
|
} |
|
29
|
|
|
}; |
|
30
|
|
|
|
|
31
|
|
|
TeamCultureAPI.loadTeamCultureSummary = function(managerProfileId) { |
|
32
|
|
|
TeamCultureAPI.getTeamCulture(managerProfileId, function(response) { |
|
33
|
|
|
var teamCulture = TeamCultureAPI.parseTeamCultureResponse(response); |
|
34
|
|
|
TeamCultureAPI.populateTeamCultureSummary(teamCulture); |
|
35
|
|
|
}); |
|
36
|
|
|
}; |
|
37
|
|
|
|
|
38
|
|
|
TeamCultureAPI.populateTeamCultureSummary = function(teamCulture) { |
|
39
|
|
|
document.getElementById('jobPosterTeamSize').innerHTML = teamCulture.team_size; |
|
40
|
|
|
document.getElementById('jobPosterGcDirLink').href = teamCulture.gc_directory_url; |
|
41
|
|
|
document.getElementById('jobPosterTeamNarrativeText').innerHTML = teamCulture.narrative_text; |
|
42
|
|
|
|
|
43
|
|
|
document.getElementById('jobPosterOperatingContext_text').innerHTML = teamCulture.operating_context; |
|
44
|
|
|
document.getElementById('jobPosterWhatWeValue_text').innerHTML = teamCulture.what_we_value; |
|
45
|
|
|
document.getElementById('jobPosterHowWeWork_text').innerHTML = teamCulture.how_we_work; |
|
46
|
|
|
}; |
|
47
|
|
|
|
|
48
|
|
|
TeamCultureAPI.getTeamCulture = function(managerProfileId, responseCallback) { |
|
49
|
|
|
var url = TeamCultureAPI.baseURL + '/' + TalentCloudAPI.getLanguageFromCookie() + '/getTeamCultureByManagerProfile/' + managerProfileId; |
|
|
|
|
|
|
50
|
|
|
DataAPI.sendRequest(url, "GET", {}, null, function(request) { |
|
|
|
|
|
|
51
|
|
|
responseCallback(request.response); |
|
52
|
|
|
}); |
|
53
|
|
|
}; |