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
98bcc4fe
Unverified
Commit
98bcc4fe
authored
Jan 02, 2018
by
Sam Padgett
Committed by
GitHub
Jan 02, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #265 from benjaminapetersen/trello/api-groups/services/projects
Update projects service to use getPreferredVersion
parents
13decab9
ceec8534
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 @
98bcc4fe
...
@@ -3131,6 +3131,7 @@ angular.module('openshiftCommonServices')
...
@@ -3131,6 +3131,7 @@ angular.module('openshiftCommonServices')
function
(
$location
,
function
(
$location
,
$q
,
$q
,
$rootScope
,
$rootScope
,
APIService
,
AuthService
,
AuthService
,
AuthorizationService
,
AuthorizationService
,
DataService
,
DataService
,
...
@@ -3141,6 +3142,8 @@ angular.module('openshiftCommonServices')
...
@@ -3141,6 +3142,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'
);
...
@@ -3176,7 +3179,7 @@ angular.module('openshiftCommonServices')
...
@@ -3176,7 +3179,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
)
...
@@ -3226,7 +3229,7 @@ angular.module('openshiftCommonServices')
...
@@ -3226,7 +3229,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
)
{
...
@@ -3245,14 +3248,14 @@ angular.module('openshiftCommonServices')
...
@@ -3245,14 +3248,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
...
@@ -3276,7 +3279,7 @@ angular.module('openshiftCommonServices')
...
@@ -3276,7 +3279,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
)
{
...
@@ -3287,11 +3290,11 @@ angular.module('openshiftCommonServices')
...
@@ -3287,11 +3290,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 @
98bcc4fe
...
@@ -5177,9 +5177,10 @@ angular.module('openshiftCommonServices')
...
@@ -5177,9 +5177,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
,
...
@@ -5190,6 +5191,8 @@ angular.module('openshiftCommonServices')
...
@@ -5190,6 +5191,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'
);
...
@@ -5225,7 +5228,7 @@ angular.module('openshiftCommonServices')
...
@@ -5225,7 +5228,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
)
...
@@ -5275,7 +5278,7 @@ angular.module('openshiftCommonServices')
...
@@ -5275,7 +5278,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
)
{
...
@@ -5294,14 +5297,14 @@ angular.module('openshiftCommonServices')
...
@@ -5294,14 +5297,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
...
@@ -5325,7 +5328,7 @@ angular.module('openshiftCommonServices')
...
@@ -5325,7 +5328,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
)
{
...
@@ -5336,11 +5339,11 @@ angular.module('openshiftCommonServices')
...
@@ -5336,11 +5339,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 @
98bcc4fe
...
@@ -2323,8 +2323,8 @@ token ? (authLogger.log("LocalStorageUserStore.setToken", token, ttl), localStor
...
@@ -2323,8 +2323,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
);
...
@@ -2342,7 +2342,7 @@ projectPromise:$.Deferred(),
...
@@ -2342,7 +2342,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
()
{
...
@@ -2359,7 +2359,7 @@ error_description:description
...
@@ -2359,7 +2359,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
();
...
@@ -2369,12 +2369,12 @@ isProjectListIncomplete:function() {
...
@@ -2369,12 +2369,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
...
@@ -2392,17 +2392,17 @@ name:name
...
@@ -2392,17 +2392,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 @
98bcc4fe
...
@@ -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