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
871f3176
Commit
871f3176
authored
May 09, 2017
by
Sam Padgett
Committed by
GitHub
May 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #64 from spadgett/cascade-delete
DataService.delete should cascade by default
parents
23923bd9
26496544
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
22 deletions
+36
-22
origin-web-common-services.js
dist/origin-web-common-services.js
+10
-6
origin-web-common.js
dist/origin-web-common.js
+10
-6
origin-web-common.min.js
dist/origin-web-common.min.js
+6
-4
dataService.js
src/services/dataService.js
+10
-6
No files found.
dist/origin-web-common-services.js
View file @
871f3176
...
...
@@ -1146,14 +1146,18 @@ angular.module('openshiftCommonServices')
var
deferred
=
$q
.
defer
();
var
self
=
this
;
var
data
,
headers
=
{};
var
data
=
{
kind
:
"DeleteOptions"
,
apiVersion
:
"v1"
,
// Default to "Foreground" (cascading) if no propagationPolicy was given.
propagationPolicy
:
opts
.
propagationPolicy
||
"Foreground"
};
var
headers
=
{
'Content-Type'
:
'application/json'
};
// Differentiate between 0 and undefined
if
(
_
.
has
(
opts
,
'gracePeriodSeconds'
))
{
data
=
{
kind
:
"DeleteOptions"
,
apiVersion
:
"v1"
,
gracePeriodSeconds
:
opts
.
gracePeriodSeconds
};
headers
[
'Content-Type'
]
=
'application/json'
;
data
.
gracePeriodSeconds
=
opts
.
gracePeriodSeconds
;
}
this
.
_getNamespace
(
resource
,
context
,
opts
).
then
(
function
(
ns
){
$http
(
angular
.
extend
({
...
...
dist/origin-web-common.js
View file @
871f3176
...
...
@@ -2492,14 +2492,18 @@ angular.module('openshiftCommonServices')
var
deferred
=
$q
.
defer
();
var
self
=
this
;
var
data
,
headers
=
{};
var
data
=
{
kind
:
"DeleteOptions"
,
apiVersion
:
"v1"
,
// Default to "Foreground" (cascading) if no propagationPolicy was given.
propagationPolicy
:
opts
.
propagationPolicy
||
"Foreground"
};
var
headers
=
{
'Content-Type'
:
'application/json'
};
// Differentiate between 0 and undefined
if
(
_
.
has
(
opts
,
'gracePeriodSeconds'
))
{
data
=
{
kind
:
"DeleteOptions"
,
apiVersion
:
"v1"
,
gracePeriodSeconds
:
opts
.
gracePeriodSeconds
};
headers
[
'Content-Type'
]
=
'application/json'
;
data
.
gracePeriodSeconds
=
opts
.
gracePeriodSeconds
;
}
this
.
_getNamespace
(
resource
,
context
,
opts
).
then
(
function
(
ns
){
$http
(
angular
.
extend
({
...
...
dist/origin-web-common.min.js
View file @
871f3176
...
...
@@ -1025,12 +1025,14 @@ var key = this._uniqueKey(resource, null, context, _.get(opts, "http.params")),
return
callback
&&
deferred
.
promise
.
then
(
callback
),
this
.
_isCached
(
key
)
?
deferred
.
resolve
(
this
.
_data
(
key
))
:
this
.
_listInFlight
(
key
)
||
this
.
_startListOp
(
resource
,
context
,
opts
),
deferred
.
promise
;
},
DataService
.
prototype
[
"delete"
]
=
function
(
resource
,
name
,
context
,
opts
)
{
resource
=
APIService
.
toResourceGroupVersion
(
resource
),
opts
=
opts
||
{};
var
data
,
deferred
=
$q
.
defer
(),
self
=
this
,
headers
=
{};
return
_
.
has
(
opts
,
"gracePeriodSeconds"
)
&&
(
data
=
{
var
data
,
deferred
=
$q
.
defer
(),
self
=
this
,
headers
=
{},
data
=
{
kind
:
"DeleteOptions"
,
apiVersion
:
"v1"
,
gracePeriodSeconds
:
opts
.
gracePeriodSeconds
},
headers
[
"Content-Type"
]
=
"application/json"
),
this
.
_getNamespace
(
resource
,
context
,
opts
).
then
(
function
(
ns
)
{
propagationPolicy
:
opts
.
propagationPolicy
||
"Foreground"
},
headers
=
{
"Content-Type"
:
"application/json"
};
return
_
.
has
(
opts
,
"gracePeriodSeconds"
)
&&
(
data
.
gracePeriodSeconds
=
opts
.
gracePeriodSeconds
),
this
.
_getNamespace
(
resource
,
context
,
opts
).
then
(
function
(
ns
)
{
$http
(
angular
.
extend
({
method
:
"DELETE"
,
auth
:{},
...
...
src/services/dataService.js
View file @
871f3176
...
...
@@ -147,14 +147,18 @@ angular.module('openshiftCommonServices')
var
deferred
=
$q
.
defer
();
var
self
=
this
;
var
data
,
headers
=
{};
var
data
=
{
kind
:
"DeleteOptions"
,
apiVersion
:
"v1"
,
// Default to "Foreground" (cascading) if no propagationPolicy was given.
propagationPolicy
:
opts
.
propagationPolicy
||
"Foreground"
};
var
headers
=
{
'Content-Type'
:
'application/json'
};
// Differentiate between 0 and undefined
if
(
_
.
has
(
opts
,
'gracePeriodSeconds'
))
{
data
=
{
kind
:
"DeleteOptions"
,
apiVersion
:
"v1"
,
gracePeriodSeconds
:
opts
.
gracePeriodSeconds
};
headers
[
'Content-Type'
]
=
'application/json'
;
data
.
gracePeriodSeconds
=
opts
.
gracePeriodSeconds
;
}
this
.
_getNamespace
(
resource
,
context
,
opts
).
then
(
function
(
ns
){
$http
(
angular
.
extend
({
...
...
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