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
c9f3be2c
Commit
c9f3be2c
authored
May 10, 2017
by
Jessica Forrester
Committed by
GitHub
May 10, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #60 from spadgett/always-toast-project-delete
Always toast project delete
parents
ff35c743
d1a9596a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
31 deletions
+6
-31
origin-web-common-ui.js
dist/origin-web-common-ui.js
+1
-9
origin-web-common.js
dist/origin-web-common.js
+1
-9
origin-web-common.min.js
dist/origin-web-common.min.js
+3
-4
deleteProject.js
src/components/delete-project/deleteProject.js
+1
-9
No files found.
dist/origin-web-common-ui.js
View file @
c9f3be2c
...
@@ -336,14 +336,12 @@ angular.module("openshiftCommonUI")
...
@@ -336,14 +336,12 @@ angular.module("openshiftCommonUI")
;
'use strict'
;
;
'use strict'
;
angular
.
module
(
"openshiftCommonUI"
)
angular
.
module
(
"openshiftCommonUI"
)
.
directive
(
"deleteProject"
,
function
(
$uibModal
,
$location
,
$filter
,
$q
,
hashSizeFilter
,
APIService
,
DataService
,
AlertMessageService
,
NotificationsService
,
Logger
)
{
.
directive
(
"deleteProject"
,
function
(
$uibModal
,
$location
,
$filter
,
$q
,
hashSizeFilter
,
APIService
,
DataService
,
NotificationsService
,
Logger
)
{
return
{
return
{
restrict
:
"E"
,
restrict
:
"E"
,
scope
:
{
scope
:
{
// The name of project to delete
// The name of project to delete
projectName
:
"@"
,
projectName
:
"@"
,
// Alerts object for using inline notifications for success and error alerts, notifications are also sent to enable toast notification display.
alerts
:
"="
,
// Optional display name of the project to delete.
// Optional display name of the project to delete.
displayName
:
"@"
,
displayName
:
"@"
,
// Set to true to disable the delete button.
// Set to true to disable the delete button.
...
@@ -372,11 +370,6 @@ angular.module("openshiftCommonUI")
...
@@ -372,11 +370,6 @@ angular.module("openshiftCommonUI")
replace
:
true
,
replace
:
true
,
link
:
function
(
scope
,
element
,
attrs
)
{
link
:
function
(
scope
,
element
,
attrs
)
{
var
showAlert
=
function
(
alert
)
{
var
showAlert
=
function
(
alert
)
{
if
(
scope
.
stayOnCurrentPage
)
{
scope
.
alerts
[
alert
.
name
]
=
alert
.
data
;
}
else
{
AlertMessageService
.
addAlert
(
alert
);
}
NotificationsService
.
addNotification
(
alert
.
data
);
NotificationsService
.
addNotification
(
alert
.
data
);
};
};
...
@@ -443,7 +436,6 @@ angular.module("openshiftCommonUI")
...
@@ -443,7 +436,6 @@ angular.module("openshiftCommonUI")
message
:
_
.
capitalize
(
formattedResource
)
+
"
\
'"
+
" could not be deleted."
,
message
:
_
.
capitalize
(
formattedResource
)
+
"
\
'"
+
" could not be deleted."
,
details
:
$filter
(
'getErrorDetails'
)(
err
)
details
:
$filter
(
'getErrorDetails'
)(
err
)
};
};
scope
.
alerts
[
projectName
]
=
alert
;
NotificationsService
.
addNotification
(
alert
);
NotificationsService
.
addNotification
(
alert
);
Logger
.
error
(
formattedResource
+
" could not be deleted."
,
err
);
Logger
.
error
(
formattedResource
+
" could not be deleted."
,
err
);
});
});
...
...
dist/origin-web-common.js
View file @
c9f3be2c
...
@@ -507,14 +507,12 @@ angular.module("openshiftCommonUI")
...
@@ -507,14 +507,12 @@ angular.module("openshiftCommonUI")
;
'use strict'
;
;
'use strict'
;
angular
.
module
(
"openshiftCommonUI"
)
angular
.
module
(
"openshiftCommonUI"
)
.
directive
(
"deleteProject"
,
[
"$uibModal"
,
"$location"
,
"$filter"
,
"$q"
,
"hashSizeFilter"
,
"APIService"
,
"DataService"
,
"
AlertMessageService"
,
"NotificationsService"
,
"Logger"
,
function
(
$uibModal
,
$location
,
$filter
,
$q
,
hashSizeFilter
,
APIService
,
DataService
,
AlertMessage
Service
,
NotificationsService
,
Logger
)
{
.
directive
(
"deleteProject"
,
[
"$uibModal"
,
"$location"
,
"$filter"
,
"$q"
,
"hashSizeFilter"
,
"APIService"
,
"DataService"
,
"
NotificationsService"
,
"Logger"
,
function
(
$uibModal
,
$location
,
$filter
,
$q
,
hashSizeFilter
,
APIService
,
Data
Service
,
NotificationsService
,
Logger
)
{
return
{
return
{
restrict
:
"E"
,
restrict
:
"E"
,
scope
:
{
scope
:
{
// The name of project to delete
// The name of project to delete
projectName
:
"@"
,
projectName
:
"@"
,
// Alerts object for using inline notifications for success and error alerts, notifications are also sent to enable toast notification display.
alerts
:
"="
,
// Optional display name of the project to delete.
// Optional display name of the project to delete.
displayName
:
"@"
,
displayName
:
"@"
,
// Set to true to disable the delete button.
// Set to true to disable the delete button.
...
@@ -543,11 +541,6 @@ angular.module("openshiftCommonUI")
...
@@ -543,11 +541,6 @@ angular.module("openshiftCommonUI")
replace
:
true
,
replace
:
true
,
link
:
function
(
scope
,
element
,
attrs
)
{
link
:
function
(
scope
,
element
,
attrs
)
{
var
showAlert
=
function
(
alert
)
{
var
showAlert
=
function
(
alert
)
{
if
(
scope
.
stayOnCurrentPage
)
{
scope
.
alerts
[
alert
.
name
]
=
alert
.
data
;
}
else
{
AlertMessageService
.
addAlert
(
alert
);
}
NotificationsService
.
addNotification
(
alert
.
data
);
NotificationsService
.
addNotification
(
alert
.
data
);
};
};
...
@@ -614,7 +607,6 @@ angular.module("openshiftCommonUI")
...
@@ -614,7 +607,6 @@ angular.module("openshiftCommonUI")
message
:
_
.
capitalize
(
formattedResource
)
+
"
\
'"
+
" could not be deleted."
,
message
:
_
.
capitalize
(
formattedResource
)
+
"
\
'"
+
" could not be deleted."
,
details
:
$filter
(
'getErrorDetails'
)(
err
)
details
:
$filter
(
'getErrorDetails'
)(
err
)
};
};
scope
.
alerts
[
projectName
]
=
alert
;
NotificationsService
.
addNotification
(
alert
);
NotificationsService
.
addNotification
(
alert
);
Logger
.
error
(
formattedResource
+
" could not be deleted."
,
err
);
Logger
.
error
(
formattedResource
+
" could not be deleted."
,
err
);
});
});
...
...
dist/origin-web-common.min.js
View file @
c9f3be2c
...
@@ -129,12 +129,11 @@ cb && cb();
...
@@ -129,12 +129,11 @@ cb && cb();
};
};
}
]
}
]
};
};
}
]),
angular
.
module
(
"openshiftCommonUI"
).
directive
(
"deleteProject"
,
[
"$uibModal"
,
"$location"
,
"$filter"
,
"$q"
,
"hashSizeFilter"
,
"APIService"
,
"DataService"
,
"
AlertMessageService"
,
"NotificationsService"
,
"Logger"
,
function
(
$uibModal
,
$location
,
$filter
,
$q
,
hashSizeFilter
,
APIService
,
DataService
,
AlertMessage
Service
,
NotificationsService
,
Logger
)
{
}
]),
angular
.
module
(
"openshiftCommonUI"
).
directive
(
"deleteProject"
,
[
"$uibModal"
,
"$location"
,
"$filter"
,
"$q"
,
"hashSizeFilter"
,
"APIService"
,
"DataService"
,
"
NotificationsService"
,
"Logger"
,
function
(
$uibModal
,
$location
,
$filter
,
$q
,
hashSizeFilter
,
APIService
,
Data
Service
,
NotificationsService
,
Logger
)
{
return
{
return
{
restrict
:
"E"
,
restrict
:
"E"
,
scope
:{
scope
:{
projectName
:
"@"
,
projectName
:
"@"
,
alerts
:
"="
,
displayName
:
"@"
,
displayName
:
"@"
,
disableDelete
:
"=?"
,
disableDelete
:
"=?"
,
typeNameToConfirm
:
"=?"
,
typeNameToConfirm
:
"=?"
,
...
@@ -150,7 +149,7 @@ return angular.isDefined(attr.buttonOnly) ? "src/components/delete-project/delet
...
@@ -150,7 +149,7 @@ return angular.isDefined(attr.buttonOnly) ? "src/components/delete-project/delet
replace
:
!
0
,
replace
:
!
0
,
link
:
function
(
scope
,
element
,
attrs
)
{
link
:
function
(
scope
,
element
,
attrs
)
{
var
showAlert
=
function
(
alert
)
{
var
showAlert
=
function
(
alert
)
{
scope
.
stayOnCurrentPage
?
scope
.
alerts
[
alert
.
name
]
=
alert
.
data
:
AlertMessageService
.
addAlert
(
alert
),
NotificationsService
.
addNotification
(
alert
.
data
);
NotificationsService
.
addNotification
(
alert
.
data
);
},
navigateToList
=
function
()
{
},
navigateToList
=
function
()
{
if
(
!
scope
.
stayOnCurrentPage
)
{
if
(
!
scope
.
stayOnCurrentPage
)
{
if
(
scope
.
redirectUrl
)
return
void
$location
.
url
(
scope
.
redirectUrl
);
if
(
scope
.
redirectUrl
)
return
void
$location
.
url
(
scope
.
redirectUrl
);
...
@@ -185,7 +184,7 @@ type:"error",
...
@@ -185,7 +184,7 @@ type:"error",
message
:
_
.
capitalize
(
formattedResource
)
+
"' could not be deleted."
,
message
:
_
.
capitalize
(
formattedResource
)
+
"' could not be deleted."
,
details
:
$filter
(
"getErrorDetails"
)(
err
)
details
:
$filter
(
"getErrorDetails"
)(
err
)
};
};
scope
.
alerts
[
projectName
]
=
alert
,
NotificationsService
.
addNotification
(
alert
),
Logger
.
error
(
formattedResource
+
" could not be deleted."
,
err
);
NotificationsService
.
addNotification
(
alert
),
Logger
.
error
(
formattedResource
+
" could not be deleted."
,
err
);
});
});
});
});
}
}
...
...
src/components/delete-project/deleteProject.js
View file @
c9f3be2c
'use strict'
;
'use strict'
;
angular
.
module
(
"openshiftCommonUI"
)
angular
.
module
(
"openshiftCommonUI"
)
.
directive
(
"deleteProject"
,
function
(
$uibModal
,
$location
,
$filter
,
$q
,
hashSizeFilter
,
APIService
,
DataService
,
AlertMessageService
,
NotificationsService
,
Logger
)
{
.
directive
(
"deleteProject"
,
function
(
$uibModal
,
$location
,
$filter
,
$q
,
hashSizeFilter
,
APIService
,
DataService
,
NotificationsService
,
Logger
)
{
return
{
return
{
restrict
:
"E"
,
restrict
:
"E"
,
scope
:
{
scope
:
{
// The name of project to delete
// The name of project to delete
projectName
:
"@"
,
projectName
:
"@"
,
// Alerts object for using inline notifications for success and error alerts, notifications are also sent to enable toast notification display.
alerts
:
"="
,
// Optional display name of the project to delete.
// Optional display name of the project to delete.
displayName
:
"@"
,
displayName
:
"@"
,
// Set to true to disable the delete button.
// Set to true to disable the delete button.
...
@@ -37,11 +35,6 @@ angular.module("openshiftCommonUI")
...
@@ -37,11 +35,6 @@ angular.module("openshiftCommonUI")
replace
:
true
,
replace
:
true
,
link
:
function
(
scope
,
element
,
attrs
)
{
link
:
function
(
scope
,
element
,
attrs
)
{
var
showAlert
=
function
(
alert
)
{
var
showAlert
=
function
(
alert
)
{
if
(
scope
.
stayOnCurrentPage
)
{
scope
.
alerts
[
alert
.
name
]
=
alert
.
data
;
}
else
{
AlertMessageService
.
addAlert
(
alert
);
}
NotificationsService
.
addNotification
(
alert
.
data
);
NotificationsService
.
addNotification
(
alert
.
data
);
};
};
...
@@ -108,7 +101,6 @@ angular.module("openshiftCommonUI")
...
@@ -108,7 +101,6 @@ angular.module("openshiftCommonUI")
message
:
_
.
capitalize
(
formattedResource
)
+
"
\
'"
+
" could not be deleted."
,
message
:
_
.
capitalize
(
formattedResource
)
+
"
\
'"
+
" could not be deleted."
,
details
:
$filter
(
'getErrorDetails'
)(
err
)
details
:
$filter
(
'getErrorDetails'
)(
err
)
};
};
scope
.
alerts
[
projectName
]
=
alert
;
NotificationsService
.
addNotification
(
alert
);
NotificationsService
.
addNotification
(
alert
);
Logger
.
error
(
formattedResource
+
" could not be deleted."
,
err
);
Logger
.
error
(
formattedResource
+
" could not be deleted."
,
err
);
});
});
...
...
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