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
ceec8534
Unverified
Commit
ceec8534
authored
Dec 08, 2017
by
benjaminapetersen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update projects service to use getPreferredVersion
parent
623cb787
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
31 deletions
+40
-31
origin-web-common-services.js
dist/origin-web-common-services.js
+10
-7
origin-web-common.js
dist/origin-web-common.js
+11
-8
origin-web-common.min.js
dist/origin-web-common.min.js
+9
-9
projects.js
src/services/projects.js
+10
-7
No files found.
dist/origin-web-common-services.js
View file @
ceec8534
...
@@ -3112,6 +3112,7 @@ angular.module('openshiftCommonServices')
...
@@ -3112,6 +3112,7 @@ angular.module('openshiftCommonServices')
function
(
$location
,
function
(
$location
,
$q
,
$q
,
$rootScope
,
$rootScope
,
APIService
,
AuthService
,
AuthService
,
AuthorizationService
,
AuthorizationService
,
DataService
,
DataService
,
...
@@ -3122,6 +3123,8 @@ angular.module('openshiftCommonServices')
...
@@ -3122,6 +3123,8 @@ angular.module('openshiftCommonServices')
// Cache project data when we can so we don't request it on every page load.
// Cache project data when we can so we don't request it on every page load.
var
cachedProjectData
;
var
cachedProjectData
;
var
cachedProjectDataIncomplete
=
false
;
var
cachedProjectDataIncomplete
=
false
;
var
projectsVersion
=
APIService
.
getPreferredVersion
(
'projects'
);
var
projectRequestsVersion
=
APIService
.
getPreferredVersion
(
'projectrequests'
);
var
clearCachedProjectData
=
function
()
{
var
clearCachedProjectData
=
function
()
{
Logger
.
debug
(
'ProjectsService: clearing project cache'
);
Logger
.
debug
(
'ProjectsService: clearing project cache'
);
...
@@ -3157,7 +3160,7 @@ angular.module('openshiftCommonServices')
...
@@ -3157,7 +3160,7 @@ angular.module('openshiftCommonServices')
project
:
undefined
project
:
undefined
};
};
return
DataService
return
DataService
.
get
(
'projects'
,
projectName
,
context
,
{
errorNotification
:
false
})
.
get
(
projectsVersion
,
projectName
,
context
,
{
errorNotification
:
false
})
.
then
(
function
(
project
)
{
.
then
(
function
(
project
)
{
return
AuthorizationService
return
AuthorizationService
.
getProjectRules
(
projectName
)
.
getProjectRules
(
projectName
)
...
@@ -3207,7 +3210,7 @@ angular.module('openshiftCommonServices')
...
@@ -3207,7 +3210,7 @@ angular.module('openshiftCommonServices')
}
}
Logger
.
debug
(
'ProjectsService: listing projects, force refresh'
,
forceRefresh
);
Logger
.
debug
(
'ProjectsService: listing projects, force refresh'
,
forceRefresh
);
return
DataService
.
list
(
'projects'
,
{}).
then
(
function
(
projectData
)
{
return
DataService
.
list
(
projectsVersion
,
{}).
then
(
function
(
projectData
)
{
cachedProjectData
=
projectData
;
cachedProjectData
=
projectData
;
return
projectData
;
return
projectData
;
},
function
(
error
)
{
},
function
(
error
)
{
...
@@ -3226,14 +3229,14 @@ angular.module('openshiftCommonServices')
...
@@ -3226,14 +3229,14 @@ angular.module('openshiftCommonServices')
// Wrap `DataService.watch` so we can update the cached projects
// Wrap `DataService.watch` so we can update the cached projects
// list on changes. TODO: We might want to disable watches entirely
// list on changes. TODO: We might want to disable watches entirely
// if we know the project list is large.
// if we know the project list is large.
return
DataService
.
watch
(
'projects'
,
context
,
function
(
projectData
)
{
return
DataService
.
watch
(
projectsVersion
,
context
,
function
(
projectData
)
{
cachedProjectData
=
projectData
;
cachedProjectData
=
projectData
;
callback
(
projectData
);
callback
(
projectData
);
});
});
},
},
update
:
function
(
projectName
,
data
)
{
update
:
function
(
projectName
,
data
)
{
return
DataService
.
update
(
'projects'
,
projectName
,
cleanEditableAnnotations
(
data
),
{
return
DataService
.
update
(
projectsVersion
,
projectName
,
cleanEditableAnnotations
(
data
),
{
projectName
:
projectName
projectName
:
projectName
},
{
},
{
errorNotification
:
false
errorNotification
:
false
...
@@ -3257,7 +3260,7 @@ angular.module('openshiftCommonServices')
...
@@ -3257,7 +3260,7 @@ angular.module('openshiftCommonServices')
description
:
description
description
:
description
};
};
return
DataService
return
DataService
.
create
(
'projectrequests'
,
null
,
projectRequest
,
{})
.
create
(
projectRequestsVersion
,
null
,
projectRequest
,
{})
.
then
(
function
(
project
)
{
.
then
(
function
(
project
)
{
RecentlyViewedProjectsService
.
addProjectUID
(
project
.
metadata
.
uid
);
RecentlyViewedProjectsService
.
addProjectUID
(
project
.
metadata
.
uid
);
if
(
cachedProjectData
)
{
if
(
cachedProjectData
)
{
...
@@ -3268,11 +3271,11 @@ angular.module('openshiftCommonServices')
...
@@ -3268,11 +3271,11 @@ angular.module('openshiftCommonServices')
},
},
canCreate
:
function
()
{
canCreate
:
function
()
{
return
DataService
.
get
(
"projectrequests"
,
null
,
{},
{
errorNotification
:
false
});
return
DataService
.
get
(
projectRequestsVersion
,
null
,
{},
{
errorNotification
:
false
});
},
},
delete
:
function
(
project
)
{
delete
:
function
(
project
)
{
return
DataService
.
delete
(
'projects'
,
project
.
metadata
.
name
,
{}).
then
(
function
(
deletedProject
)
{
return
DataService
.
delete
(
projectsVersion
,
project
.
metadata
.
name
,
{}).
then
(
function
(
deletedProject
)
{
if
(
cachedProjectData
)
{
if
(
cachedProjectData
)
{
cachedProjectData
.
update
(
project
,
'DELETED'
);
cachedProjectData
.
update
(
project
,
'DELETED'
);
}
}
...
...
dist/origin-web-common.js
View file @
ceec8534
...
@@ -5144,9 +5144,10 @@ angular.module('openshiftCommonServices')
...
@@ -5144,9 +5144,10 @@ angular.module('openshiftCommonServices')
angular
.
module
(
'openshiftCommonServices'
)
angular
.
module
(
'openshiftCommonServices'
)
.
factory
(
'ProjectsService'
,
.
factory
(
'ProjectsService'
,
[
"$location"
,
"$q"
,
"$rootScope"
,
"AuthService"
,
"AuthorizationService"
,
"DataService"
,
"Logger"
,
"RecentlyViewedProjectsService"
,
"annotationNameFilter"
,
function
(
$location
,
[
"$location"
,
"$q"
,
"$rootScope"
,
"A
PIService"
,
"A
uthService"
,
"AuthorizationService"
,
"DataService"
,
"Logger"
,
"RecentlyViewedProjectsService"
,
"annotationNameFilter"
,
function
(
$location
,
$q
,
$q
,
$rootScope
,
$rootScope
,
APIService
,
AuthService
,
AuthService
,
AuthorizationService
,
AuthorizationService
,
DataService
,
DataService
,
...
@@ -5157,6 +5158,8 @@ angular.module('openshiftCommonServices')
...
@@ -5157,6 +5158,8 @@ angular.module('openshiftCommonServices')
// Cache project data when we can so we don't request it on every page load.
// Cache project data when we can so we don't request it on every page load.
var
cachedProjectData
;
var
cachedProjectData
;
var
cachedProjectDataIncomplete
=
false
;
var
cachedProjectDataIncomplete
=
false
;
var
projectsVersion
=
APIService
.
getPreferredVersion
(
'projects'
);
var
projectRequestsVersion
=
APIService
.
getPreferredVersion
(
'projectrequests'
);
var
clearCachedProjectData
=
function
()
{
var
clearCachedProjectData
=
function
()
{
Logger
.
debug
(
'ProjectsService: clearing project cache'
);
Logger
.
debug
(
'ProjectsService: clearing project cache'
);
...
@@ -5192,7 +5195,7 @@ angular.module('openshiftCommonServices')
...
@@ -5192,7 +5195,7 @@ angular.module('openshiftCommonServices')
project
:
undefined
project
:
undefined
};
};
return
DataService
return
DataService
.
get
(
'projects'
,
projectName
,
context
,
{
errorNotification
:
false
})
.
get
(
projectsVersion
,
projectName
,
context
,
{
errorNotification
:
false
})
.
then
(
function
(
project
)
{
.
then
(
function
(
project
)
{
return
AuthorizationService
return
AuthorizationService
.
getProjectRules
(
projectName
)
.
getProjectRules
(
projectName
)
...
@@ -5242,7 +5245,7 @@ angular.module('openshiftCommonServices')
...
@@ -5242,7 +5245,7 @@ angular.module('openshiftCommonServices')
}
}
Logger
.
debug
(
'ProjectsService: listing projects, force refresh'
,
forceRefresh
);
Logger
.
debug
(
'ProjectsService: listing projects, force refresh'
,
forceRefresh
);
return
DataService
.
list
(
'projects'
,
{}).
then
(
function
(
projectData
)
{
return
DataService
.
list
(
projectsVersion
,
{}).
then
(
function
(
projectData
)
{
cachedProjectData
=
projectData
;
cachedProjectData
=
projectData
;
return
projectData
;
return
projectData
;
},
function
(
error
)
{
},
function
(
error
)
{
...
@@ -5261,14 +5264,14 @@ angular.module('openshiftCommonServices')
...
@@ -5261,14 +5264,14 @@ angular.module('openshiftCommonServices')
// Wrap `DataService.watch` so we can update the cached projects
// Wrap `DataService.watch` so we can update the cached projects
// list on changes. TODO: We might want to disable watches entirely
// list on changes. TODO: We might want to disable watches entirely
// if we know the project list is large.
// if we know the project list is large.
return
DataService
.
watch
(
'projects'
,
context
,
function
(
projectData
)
{
return
DataService
.
watch
(
projectsVersion
,
context
,
function
(
projectData
)
{
cachedProjectData
=
projectData
;
cachedProjectData
=
projectData
;
callback
(
projectData
);
callback
(
projectData
);
});
});
},
},
update
:
function
(
projectName
,
data
)
{
update
:
function
(
projectName
,
data
)
{
return
DataService
.
update
(
'projects'
,
projectName
,
cleanEditableAnnotations
(
data
),
{
return
DataService
.
update
(
projectsVersion
,
projectName
,
cleanEditableAnnotations
(
data
),
{
projectName
:
projectName
projectName
:
projectName
},
{
},
{
errorNotification
:
false
errorNotification
:
false
...
@@ -5292,7 +5295,7 @@ angular.module('openshiftCommonServices')
...
@@ -5292,7 +5295,7 @@ angular.module('openshiftCommonServices')
description
:
description
description
:
description
};
};
return
DataService
return
DataService
.
create
(
'projectrequests'
,
null
,
projectRequest
,
{})
.
create
(
projectRequestsVersion
,
null
,
projectRequest
,
{})
.
then
(
function
(
project
)
{
.
then
(
function
(
project
)
{
RecentlyViewedProjectsService
.
addProjectUID
(
project
.
metadata
.
uid
);
RecentlyViewedProjectsService
.
addProjectUID
(
project
.
metadata
.
uid
);
if
(
cachedProjectData
)
{
if
(
cachedProjectData
)
{
...
@@ -5303,11 +5306,11 @@ angular.module('openshiftCommonServices')
...
@@ -5303,11 +5306,11 @@ angular.module('openshiftCommonServices')
},
},
canCreate
:
function
()
{
canCreate
:
function
()
{
return
DataService
.
get
(
"projectrequests"
,
null
,
{},
{
errorNotification
:
false
});
return
DataService
.
get
(
projectRequestsVersion
,
null
,
{},
{
errorNotification
:
false
});
},
},
delete
:
function
(
project
)
{
delete
:
function
(
project
)
{
return
DataService
.
delete
(
'projects'
,
project
.
metadata
.
name
,
{}).
then
(
function
(
deletedProject
)
{
return
DataService
.
delete
(
projectsVersion
,
project
.
metadata
.
name
,
{}).
then
(
function
(
deletedProject
)
{
if
(
cachedProjectData
)
{
if
(
cachedProjectData
)
{
cachedProjectData
.
update
(
project
,
'DELETED'
);
cachedProjectData
.
update
(
project
,
'DELETED'
);
}
}
...
...
dist/origin-web-common.min.js
View file @
ceec8534
...
@@ -2325,8 +2325,8 @@ token ? (authLogger.log("LocalStorageUserStore.setToken", token, ttl), localStor
...
@@ -2325,8 +2325,8 @@ token ? (authLogger.log("LocalStorageUserStore.setToken", token, ttl), localStor
}
}
};
};
}
];
}
];
}),
angular
.
module
(
"openshiftCommonServices"
).
factory
(
"ProjectsService"
,
[
"$location"
,
"$q"
,
"$rootScope"
,
"A
uthService"
,
"AuthorizationService"
,
"DataService"
,
"Logger"
,
"RecentlyViewedProjectsService"
,
"annotationNameFilter"
,
function
(
$location
,
$q
,
$rootScop
e
,
AuthService
,
AuthorizationService
,
DataService
,
Logger
,
RecentlyViewedProjectsService
,
annotationNameFilter
)
{
}),
angular
.
module
(
"openshiftCommonServices"
).
factory
(
"ProjectsService"
,
[
"$location"
,
"$q"
,
"$rootScope"
,
"A
PIService"
,
"AuthService"
,
"AuthorizationService"
,
"DataService"
,
"Logger"
,
"RecentlyViewedProjectsService"
,
"annotationNameFilter"
,
function
(
$location
,
$q
,
$rootScope
,
APIServic
e
,
AuthService
,
AuthorizationService
,
DataService
,
Logger
,
RecentlyViewedProjectsService
,
annotationNameFilter
)
{
var
cachedProjectData
,
cachedProjectDataIncomplete
=
!
1
,
clearCachedProjectData
=
function
()
{
var
cachedProjectData
,
cachedProjectDataIncomplete
=
!
1
,
projectsVersion
=
APIService
.
getPreferredVersion
(
"projects"
),
projectRequestsVersion
=
APIService
.
getPreferredVersion
(
"projectrequests"
),
clearCachedProjectData
=
function
()
{
Logger
.
debug
(
"ProjectsService: clearing project cache"
),
cachedProjectData
=
null
,
cachedProjectDataIncomplete
=
!
1
;
Logger
.
debug
(
"ProjectsService: clearing project cache"
),
cachedProjectData
=
null
,
cachedProjectDataIncomplete
=
!
1
;
};
};
AuthService
.
onUserChanged
(
clearCachedProjectData
),
AuthService
.
onLogout
(
clearCachedProjectData
);
AuthService
.
onUserChanged
(
clearCachedProjectData
),
AuthService
.
onLogout
(
clearCachedProjectData
);
...
@@ -2344,7 +2344,7 @@ projectPromise:$.Deferred(),
...
@@ -2344,7 +2344,7 @@ projectPromise:$.Deferred(),
projectName
:
projectName
,
projectName
:
projectName
,
project
:
void
0
project
:
void
0
};
};
return
DataService
.
get
(
"projects"
,
projectName
,
context
,
{
return
DataService
.
get
(
projectsVersion
,
projectName
,
context
,
{
errorNotification
:
!
1
errorNotification
:
!
1
}).
then
(
function
(
project
)
{
}).
then
(
function
(
project
)
{
return
AuthorizationService
.
getProjectRules
(
projectName
).
then
(
function
()
{
return
AuthorizationService
.
getProjectRules
(
projectName
).
then
(
function
()
{
...
@@ -2361,7 +2361,7 @@ error_description:description
...
@@ -2361,7 +2361,7 @@ error_description:description
});
});
},
},
list
:
function
(
forceRefresh
)
{
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
(
projectsVersion
,
{}).
then
(
function
(
projectData
)
{
return
cachedProjectData
=
projectData
,
projectData
;
return
cachedProjectData
=
projectData
,
projectData
;
},
function
(
error
)
{
},
function
(
error
)
{
return
cachedProjectData
=
DataService
.
createData
([]),
cachedProjectDataIncomplete
=
!
0
,
$q
.
reject
();
return
cachedProjectData
=
DataService
.
createData
([]),
cachedProjectDataIncomplete
=
!
0
,
$q
.
reject
();
...
@@ -2371,12 +2371,12 @@ isProjectListIncomplete:function() {
...
@@ -2371,12 +2371,12 @@ isProjectListIncomplete:function() {
return
cachedProjectDataIncomplete
;
return
cachedProjectDataIncomplete
;
},
},
watch
:
function
(
context
,
callback
)
{
watch
:
function
(
context
,
callback
)
{
return
DataService
.
watch
(
"projects"
,
context
,
function
(
projectData
)
{
return
DataService
.
watch
(
projectsVersion
,
context
,
function
(
projectData
)
{
cachedProjectData
=
projectData
,
callback
(
projectData
);
cachedProjectData
=
projectData
,
callback
(
projectData
);
});
});
},
},
update
:
function
(
projectName
,
data
)
{
update
:
function
(
projectName
,
data
)
{
return
DataService
.
update
(
"projects"
,
projectName
,
cleanEditableAnnotations
(
data
),
{
return
DataService
.
update
(
projectsVersion
,
projectName
,
cleanEditableAnnotations
(
data
),
{
projectName
:
projectName
projectName
:
projectName
},
{
},
{
errorNotification
:
!
1
errorNotification
:
!
1
...
@@ -2394,17 +2394,17 @@ name:name
...
@@ -2394,17 +2394,17 @@ name:name
displayName
:
displayName
,
displayName
:
displayName
,
description
:
description
description
:
description
};
};
return
DataService
.
create
(
"projectrequests"
,
null
,
projectRequest
,
{}).
then
(
function
(
project
)
{
return
DataService
.
create
(
projectRequestsVersion
,
null
,
projectRequest
,
{}).
then
(
function
(
project
)
{
return
RecentlyViewedProjectsService
.
addProjectUID
(
project
.
metadata
.
uid
),
cachedProjectData
&&
cachedProjectData
.
update
(
project
,
"ADDED"
),
project
;
return
RecentlyViewedProjectsService
.
addProjectUID
(
project
.
metadata
.
uid
),
cachedProjectData
&&
cachedProjectData
.
update
(
project
,
"ADDED"
),
project
;
});
});
},
},
canCreate
:
function
()
{
canCreate
:
function
()
{
return
DataService
.
get
(
"projectrequests"
,
null
,
{},
{
return
DataService
.
get
(
projectRequestsVersion
,
null
,
{},
{
errorNotification
:
!
1
errorNotification
:
!
1
});
});
},
},
"delete"
:
function
(
project
)
{
"delete"
:
function
(
project
)
{
return
DataService
[
"delete"
](
"projects"
,
project
.
metadata
.
name
,
{}).
then
(
function
(
deletedProject
)
{
return
DataService
[
"delete"
](
projectsVersion
,
project
.
metadata
.
name
,
{}).
then
(
function
(
deletedProject
)
{
return
cachedProjectData
&&
cachedProjectData
.
update
(
project
,
"DELETED"
),
deletedProject
;
return
cachedProjectData
&&
cachedProjectData
.
update
(
project
,
"DELETED"
),
deletedProject
;
});
});
}
}
...
...
src/services/projects.js
View file @
ceec8534
...
@@ -5,6 +5,7 @@ angular.module('openshiftCommonServices')
...
@@ -5,6 +5,7 @@ angular.module('openshiftCommonServices')
function
(
$location
,
function
(
$location
,
$q
,
$q
,
$rootScope
,
$rootScope
,
APIService
,
AuthService
,
AuthService
,
AuthorizationService
,
AuthorizationService
,
DataService
,
DataService
,
...
@@ -15,6 +16,8 @@ angular.module('openshiftCommonServices')
...
@@ -15,6 +16,8 @@ angular.module('openshiftCommonServices')
// Cache project data when we can so we don't request it on every page load.
// Cache project data when we can so we don't request it on every page load.
var
cachedProjectData
;
var
cachedProjectData
;
var
cachedProjectDataIncomplete
=
false
;
var
cachedProjectDataIncomplete
=
false
;
var
projectsVersion
=
APIService
.
getPreferredVersion
(
'projects'
);
var
projectRequestsVersion
=
APIService
.
getPreferredVersion
(
'projectrequests'
);
var
clearCachedProjectData
=
function
()
{
var
clearCachedProjectData
=
function
()
{
Logger
.
debug
(
'ProjectsService: clearing project cache'
);
Logger
.
debug
(
'ProjectsService: clearing project cache'
);
...
@@ -50,7 +53,7 @@ angular.module('openshiftCommonServices')
...
@@ -50,7 +53,7 @@ angular.module('openshiftCommonServices')
project
:
undefined
project
:
undefined
};
};
return
DataService
return
DataService
.
get
(
'projects'
,
projectName
,
context
,
{
errorNotification
:
false
})
.
get
(
projectsVersion
,
projectName
,
context
,
{
errorNotification
:
false
})
.
then
(
function
(
project
)
{
.
then
(
function
(
project
)
{
return
AuthorizationService
return
AuthorizationService
.
getProjectRules
(
projectName
)
.
getProjectRules
(
projectName
)
...
@@ -100,7 +103,7 @@ angular.module('openshiftCommonServices')
...
@@ -100,7 +103,7 @@ angular.module('openshiftCommonServices')
}
}
Logger
.
debug
(
'ProjectsService: listing projects, force refresh'
,
forceRefresh
);
Logger
.
debug
(
'ProjectsService: listing projects, force refresh'
,
forceRefresh
);
return
DataService
.
list
(
'projects'
,
{}).
then
(
function
(
projectData
)
{
return
DataService
.
list
(
projectsVersion
,
{}).
then
(
function
(
projectData
)
{
cachedProjectData
=
projectData
;
cachedProjectData
=
projectData
;
return
projectData
;
return
projectData
;
},
function
(
error
)
{
},
function
(
error
)
{
...
@@ -119,14 +122,14 @@ angular.module('openshiftCommonServices')
...
@@ -119,14 +122,14 @@ angular.module('openshiftCommonServices')
// Wrap `DataService.watch` so we can update the cached projects
// Wrap `DataService.watch` so we can update the cached projects
// list on changes. TODO: We might want to disable watches entirely
// list on changes. TODO: We might want to disable watches entirely
// if we know the project list is large.
// if we know the project list is large.
return
DataService
.
watch
(
'projects'
,
context
,
function
(
projectData
)
{
return
DataService
.
watch
(
projectsVersion
,
context
,
function
(
projectData
)
{
cachedProjectData
=
projectData
;
cachedProjectData
=
projectData
;
callback
(
projectData
);
callback
(
projectData
);
});
});
},
},
update
:
function
(
projectName
,
data
)
{
update
:
function
(
projectName
,
data
)
{
return
DataService
.
update
(
'projects'
,
projectName
,
cleanEditableAnnotations
(
data
),
{
return
DataService
.
update
(
projectsVersion
,
projectName
,
cleanEditableAnnotations
(
data
),
{
projectName
:
projectName
projectName
:
projectName
},
{
},
{
errorNotification
:
false
errorNotification
:
false
...
@@ -150,7 +153,7 @@ angular.module('openshiftCommonServices')
...
@@ -150,7 +153,7 @@ angular.module('openshiftCommonServices')
description
:
description
description
:
description
};
};
return
DataService
return
DataService
.
create
(
'projectrequests'
,
null
,
projectRequest
,
{})
.
create
(
projectRequestsVersion
,
null
,
projectRequest
,
{})
.
then
(
function
(
project
)
{
.
then
(
function
(
project
)
{
RecentlyViewedProjectsService
.
addProjectUID
(
project
.
metadata
.
uid
);
RecentlyViewedProjectsService
.
addProjectUID
(
project
.
metadata
.
uid
);
if
(
cachedProjectData
)
{
if
(
cachedProjectData
)
{
...
@@ -161,11 +164,11 @@ angular.module('openshiftCommonServices')
...
@@ -161,11 +164,11 @@ angular.module('openshiftCommonServices')
},
},
canCreate
:
function
()
{
canCreate
:
function
()
{
return
DataService
.
get
(
"projectrequests"
,
null
,
{},
{
errorNotification
:
false
});
return
DataService
.
get
(
projectRequestsVersion
,
null
,
{},
{
errorNotification
:
false
});
},
},
delete
:
function
(
project
)
{
delete
:
function
(
project
)
{
return
DataService
.
delete
(
'projects'
,
project
.
metadata
.
name
,
{}).
then
(
function
(
deletedProject
)
{
return
DataService
.
delete
(
projectsVersion
,
project
.
metadata
.
name
,
{}).
then
(
function
(
deletedProject
)
{
if
(
cachedProjectData
)
{
if
(
cachedProjectData
)
{
cachedProjectData
.
update
(
project
,
'DELETED'
);
cachedProjectData
.
update
(
project
,
'DELETED'
);
}
}
...
...
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