Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
origin-web-common
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Java-于龙
origin-web-common
Commits
346e3146
Commit
346e3146
authored
Aug 25, 2017
by
Sam Padgett
Committed by
GitHub
Aug 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #156 from spadgett/fix-projects-list-failure
Fix runtime error when ProjectsService.list() fails
parents
d980b0e1
a9347180
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
4 deletions
+24
-4
origin-web-common-services.js
dist/origin-web-common-services.js
+7
-1
origin-web-common.js
dist/origin-web-common.js
+7
-1
origin-web-common.min.js
dist/origin-web-common.min.js
+3
-1
dataService.js
src/services/dataService.js
+5
-0
projects.js
src/services/projects.js
+2
-1
No files found.
dist/origin-web-common-services.js
View file @
346e3146
...
@@ -2565,6 +2565,11 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
...
@@ -2565,6 +2565,11 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
return
new
URI
({
protocol
:
protocol
,
hostname
:
hostPort
}).
toString
();
return
new
URI
({
protocol
:
protocol
,
hostname
:
hostPort
}).
toString
();
};
};
// Used by ProjectsService when a list fails.
DataService
.
prototype
.
createData
=
function
(
array
)
{
return
new
Data
(
array
);
};
// Immutables are flagged here as we should not need to fetch them more than once.
// Immutables are flagged here as we should not need to fetch them more than once.
var
IMMUTABLE_RESOURCE
=
{
var
IMMUTABLE_RESOURCE
=
{
imagestreamimages
:
true
imagestreamimages
:
true
...
@@ -3024,8 +3029,9 @@ angular.module('openshiftCommonServices')
...
@@ -3024,8 +3029,9 @@ angular.module('openshiftCommonServices')
return
projectData
;
return
projectData
;
},
function
(
error
)
{
},
function
(
error
)
{
// If the request fails, don't try to list projects again without `forceRefresh`.
// If the request fails, don't try to list projects again without `forceRefresh`.
cachedProjectData
=
{}
;
cachedProjectData
=
DataService
.
createData
([])
;
cachedProjectDataIncomplete
=
true
;
cachedProjectDataIncomplete
=
true
;
return
$q
.
reject
();
});
});
},
},
...
...
dist/origin-web-common.js
View file @
346e3146
...
@@ -4433,6 +4433,11 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
...
@@ -4433,6 +4433,11 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
return
new
URI
({
protocol
:
protocol
,
hostname
:
hostPort
}).
toString
();
return
new
URI
({
protocol
:
protocol
,
hostname
:
hostPort
}).
toString
();
};
};
// Used by ProjectsService when a list fails.
DataService
.
prototype
.
createData
=
function
(
array
)
{
return
new
Data
(
array
);
};
// Immutables are flagged here as we should not need to fetch them more than once.
// Immutables are flagged here as we should not need to fetch them more than once.
var
IMMUTABLE_RESOURCE
=
{
var
IMMUTABLE_RESOURCE
=
{
imagestreamimages
:
true
imagestreamimages
:
true
...
@@ -4892,8 +4897,9 @@ angular.module('openshiftCommonServices')
...
@@ -4892,8 +4897,9 @@ angular.module('openshiftCommonServices')
return
projectData
;
return
projectData
;
},
function
(
error
)
{
},
function
(
error
)
{
// If the request fails, don't try to list projects again without `forceRefresh`.
// If the request fails, don't try to list projects again without `forceRefresh`.
cachedProjectData
=
{}
;
cachedProjectData
=
DataService
.
createData
([])
;
cachedProjectDataIncomplete
=
true
;
cachedProjectDataIncomplete
=
true
;
return
$q
.
reject
();
});
});
},
},
...
...
dist/origin-web-common.min.js
View file @
346e3146
...
@@ -1783,6 +1783,8 @@ return new URI({
...
@@ -1783,6 +1783,8 @@ return new URI({
protocol
:
protocol
,
protocol
:
protocol
,
hostname
:
hostPort
hostname
:
hostPort
}).
toString
();
}).
toString
();
},
DataService
.
prototype
.
createData
=
function
(
array
)
{
return
new
Data
(
array
);
};
};
var
IMMUTABLE_RESOURCE
=
{
var
IMMUTABLE_RESOURCE
=
{
imagestreamimages
:
!
0
imagestreamimages
:
!
0
...
@@ -2021,7 +2023,7 @@ list:function(forceRefresh) {
...
@@ -2021,7 +2023,7 @@ list:function(forceRefresh) {
return
cachedProjectData
&&
!
forceRefresh
?
(
Logger
.
debug
(
"ProjectsService: returning cached project data"
),
$q
.
when
(
cachedProjectData
))
:(
Logger
.
debug
(
"ProjectsService: listing projects, force refresh"
,
forceRefresh
),
DataService
.
list
(
"projects"
,
{}).
then
(
function
(
projectData
)
{
return
cachedProjectData
&&
!
forceRefresh
?
(
Logger
.
debug
(
"ProjectsService: returning cached project data"
),
$q
.
when
(
cachedProjectData
))
:(
Logger
.
debug
(
"ProjectsService: listing projects, force refresh"
,
forceRefresh
),
DataService
.
list
(
"projects"
,
{}).
then
(
function
(
projectData
)
{
return
cachedProjectData
=
projectData
,
projectData
;
return
cachedProjectData
=
projectData
,
projectData
;
},
function
(
error
)
{
},
function
(
error
)
{
cachedProjectData
=
{},
cachedProjectDataIncomplete
=
!
0
;
return
cachedProjectData
=
DataService
.
createData
([]),
cachedProjectDataIncomplete
=
!
0
,
$q
.
reject
()
;
}));
}));
},
},
isProjectListIncomplete
:
function
()
{
isProjectListIncomplete
:
function
()
{
...
...
src/services/dataService.js
View file @
346e3146
...
@@ -1359,6 +1359,11 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
...
@@ -1359,6 +1359,11 @@ DataService.prototype.createStream = function(resource, name, context, opts, isR
return
new
URI
({
protocol
:
protocol
,
hostname
:
hostPort
}).
toString
();
return
new
URI
({
protocol
:
protocol
,
hostname
:
hostPort
}).
toString
();
};
};
// Used by ProjectsService when a list fails.
DataService
.
prototype
.
createData
=
function
(
array
)
{
return
new
Data
(
array
);
};
// Immutables are flagged here as we should not need to fetch them more than once.
// Immutables are flagged here as we should not need to fetch them more than once.
var
IMMUTABLE_RESOURCE
=
{
var
IMMUTABLE_RESOURCE
=
{
imagestreamimages
:
true
imagestreamimages
:
true
...
...
src/services/projects.js
View file @
346e3146
...
@@ -105,8 +105,9 @@ angular.module('openshiftCommonServices')
...
@@ -105,8 +105,9 @@ angular.module('openshiftCommonServices')
return
projectData
;
return
projectData
;
},
function
(
error
)
{
},
function
(
error
)
{
// If the request fails, don't try to list projects again without `forceRefresh`.
// If the request fails, don't try to list projects again without `forceRefresh`.
cachedProjectData
=
{}
;
cachedProjectData
=
DataService
.
createData
([])
;
cachedProjectDataIncomplete
=
true
;
cachedProjectDataIncomplete
=
true
;
return
$q
.
reject
();
});
});
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment