Skip to content

Commit

Permalink
[#141] Show pending profiles for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
javieriserte committed Dec 19, 2024
1 parent aa882be commit 8c62aa3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ define(['lodash'], function (_) {
$scope.totalItems = 0;
$scope.currentPage = 1;
$scope.profilesModified = {};

// Todo: remove after debugging issue 141.
$scope.profilePairsJson = [];
$scope.profilesModifiedJson = [];
//

localStorage.removeItem("searchPedigree");
localStorage.removeItem("searchMatches");
Expand All @@ -45,8 +50,9 @@ define(['lodash'], function (_) {
function (response) {
$scope.profiles = response.data;
getProfilesWithDifferentCategory($scope.profiles);
// Todo: Remove after debug issue 141
$scope.profile_json = JSON.stringify($scope.profiles, null, 2);
console.log($scope.profile_json);
//
getUploadStatus($scope.profiles);
$scope.profiles.forEach(
function (element) {
Expand Down Expand Up @@ -282,6 +288,10 @@ define(['lodash'], function (_) {
.findByCode(profile.globalCode)
.then(
function (response) {
// TODO: remove after debugging issue 141
$scope.profilePairsJson.push(
[response.data, profile]
);
return [response.data, profile];
}
)
Expand Down Expand Up @@ -321,11 +331,19 @@ define(['lodash'], function (_) {
.then(
function(categoryInfo) {
$scope.profilesModified = _.fromPairs(categoryInfo);
// Todo: remove after debuggin issue 141
$scope.profilesModifiedJson = JSON.stringify(
$scope.profilesModified, null, 2
);
//
$scope.$apply();
}
);
}

// TODO: remove after debuggin issue 141
$scope.getProfilePairs = function() {
return JSON.stringify($scope.profilePairsJson, null, 2);
};
$scope.isProfileModified = function(globalCode) {
return $scope.profilesModified[globalCode];
};
Expand Down
8 changes: 8 additions & 0 deletions app/assets/javascripts/profileapproval/views/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@
<pre>
<code>{{profile_json}}</code>
</pre>
<span>Modified Profiles:</span><br>
<pre>
<code>{{profilesModifiedJson}}</code>
</pre>
<span>Profile Pairs:</span><br>
<pre>
<code>{{getProfilePairs()}}</code>
</pre>
</div>
</section>
</div>
Expand Down

0 comments on commit 8c62aa3

Please sign in to comment.