-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #802 from Worktez/dev-angular
Internal Release 7.3
- Loading branch information
Showing
68 changed files
with
1,164 additions
and
489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* eslint-disable linebreak-style */ | ||
/** ********************************************************* | ||
* Copyright (C) 2022 | ||
* Worktez | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the MIT License | ||
* | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the MIT License for more details. | ||
***********************************************************/ | ||
|
||
/* eslint-disable no-unused-vars */ | ||
/* eslint-disable object-curly-spacing */ | ||
/* eslint-disable no-undef */ | ||
/* eslint-disable eol-last */ | ||
/* eslint-disable indent */ | ||
/* eslint-disable max-len */ | ||
// eslint-disable-next-line no-dupe-else-if | ||
|
||
const { getOrg } = require("../../organization/lib"); | ||
|
||
exports.creatTeamIdCheck = function(request, response) { | ||
let status = 200; | ||
let resultData = ""; | ||
const teamId = request.body.data.TeamId; | ||
const orgDomain = request.body.data.OrganizationDomain; | ||
getOrg(orgDomain).then((orgDoc) => { | ||
for (let i = 0; i < orgDoc.TeamsId.length; i++) { | ||
if (orgDoc.TeamsId[i] == teamId) { | ||
resultData = "teamId Already taken"; | ||
break; | ||
} else { | ||
resultData = "teamId Available"; | ||
} | ||
} | ||
const result = { data: resultData}; | ||
return response.status(status).send(result); | ||
}).catch((err) => { | ||
status = 500; | ||
resultData = "teamId Already taken"; | ||
console.error("Error : " + err); | ||
const result = { data: resultData }; | ||
return response.status(status).send(result); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* eslint-disable linebreak-style */ | ||
/** ********************************************************* | ||
* Copyright (C) 2022 | ||
* Worktez | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the MIT License | ||
* | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the MIT License for more details. | ||
***********************************************************/ | ||
|
||
/* eslint-disable no-unused-vars */ | ||
/* eslint-disable object-curly-spacing */ | ||
/* eslint-disable no-undef */ | ||
/* eslint-disable eol-last */ | ||
/* eslint-disable indent */ | ||
/* eslint-disable max-len */ | ||
// eslint-disable-next-line no-dupe-else-if | ||
|
||
const { getOrg } = require("../../organization/lib"); | ||
|
||
exports.creatTeamNaneCheck = function(request, response) { | ||
let status = 200; | ||
let resultData = ""; | ||
const teamId = request.body.data.TeamId; | ||
const teamName = request.body.data.TeamName; | ||
const orgDomain = request.body.data.OrganizationDomain; | ||
getOrg(orgDomain).then((orgDoc) => { | ||
for (let i = 0; i < orgDoc.TeamsName.length; i++) { | ||
if (orgDoc.TeamsName[i] == teamName) { | ||
resultData = "teamName Already taken"; | ||
break; | ||
} else { | ||
resultData = "teamName Available"; | ||
} | ||
} | ||
const result = { data: resultData}; | ||
return response.status(status).send(result); | ||
}).catch((err) => { | ||
status = 500; | ||
resultData = "teamName Already taken"; | ||
console.error("Error : " + err); | ||
const result = { data: resultData }; | ||
return response.status(status).send(result); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* eslint-disable linebreak-style */ | ||
/** ********************************************************* | ||
* Copyright (C) 2022 | ||
* Worktez | ||
* | ||
* Author : Sanjay Krishna <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the MIT License | ||
* | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the MIT License for more details. | ||
***********************************************************/ | ||
|
||
/* eslint-disable object-curly-spacing*/ | ||
// /* eslint-disable no-undef */ | ||
/* eslint-disable eol-last */ | ||
/* eslint-disable indent */ | ||
/* eslint-disable max-len */ | ||
// eslint-disable-next-line no-dupe-else-if | ||
|
||
const { getAllLabels, getAllTeams } = require("../lib"); | ||
|
||
exports.getAllLabels = function(request, response) { | ||
const orgDomain = request.body.data.OrganizationDomain; | ||
let status = 200; | ||
let result; | ||
const res = {}; | ||
|
||
const p = getAllTeams(orgDomain).then((docs) => { | ||
let p2; | ||
docs.forEach((element) => { | ||
const teamdata = element.data(); | ||
const teamName = teamdata.TeamName; | ||
const teamId = teamdata.TeamId; | ||
res[teamId]={}; | ||
p2 = getAllLabels(orgDomain, teamName).then((data)=>{ | ||
data.forEach((d) => { | ||
res[teamId][d.Scope] = {}; | ||
}); | ||
data.forEach((d) => { | ||
res[teamId][d.Scope][d.DisplayName] = d; | ||
}); | ||
}); | ||
}); | ||
return Promise.resolve(p2); | ||
}).catch((error) => { | ||
status = 500; | ||
console.log("Error: ", error); | ||
}); | ||
return Promise.resolve(p).then(() => { | ||
console.log(res); | ||
result = { data: res }; | ||
return response.status(status).send(result); | ||
}) | ||
.catch((error) => { | ||
result = { data: error }; | ||
console.error("Error Getting labels", error); | ||
return response.status(status).send(result); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* eslint-disable linebreak-style */ | ||
/** ********************************************************* | ||
* Copyright (C) 2022 | ||
* Worktez | ||
* | ||
* Author : Sanjay Krishna <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the MIT License | ||
* | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the MIT License for more details. | ||
***********************************************************/ | ||
|
||
/* eslint-disable object-curly-spacing*/ | ||
// /* eslint-disable no-undef */ | ||
/* eslint-disable eol-last */ | ||
/* eslint-disable indent */ | ||
/* eslint-disable max-len */ | ||
// eslint-disable-next-line no-dupe-else-if | ||
|
||
const { getAllTeams } = require("../lib"); | ||
|
||
exports.getAllTeamData = function(request, response) { | ||
const orgDomain = request.body.data.OrganizationDomain; | ||
let status = 200; | ||
let result; | ||
const teamData = []; | ||
console.log("Orgdomain", orgDomain); | ||
|
||
getAllTeams(orgDomain).then((team) => { | ||
team.forEach((element) => { | ||
teamData.push(element.data()); | ||
}); | ||
result = { data: { status: "OK", resultData: teamData } }; | ||
return response.status(status).send(result); | ||
}).catch((error) => { | ||
status = 500; | ||
result = { data: error }; | ||
console.error("Error Getting Teams", error); | ||
return response.status(status).send(result); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.