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
d1a9596a
Commit
d1a9596a
authored
May 05, 2017
by
Samuel Padgett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always toast project delete
Use toast notifications always instead of inline alerts.
parent
23923bd9
Show 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 @
d1a9596a
...
...
@@ -336,14 +336,12 @@ angular.module("openshiftCommonUI")
;
'use strict'
;
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
{
restrict
:
"E"
,
scope
:
{
// The name of project to delete
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.
displayName
:
"@"
,
// Set to true to disable the delete button.
...
...
@@ -372,11 +370,6 @@ angular.module("openshiftCommonUI")
replace
:
true
,
link
:
function
(
scope
,
element
,
attrs
)
{
var
showAlert
=
function
(
alert
)
{
if
(
scope
.
stayOnCurrentPage
)
{
scope
.
alerts
[
alert
.
name
]
=
alert
.
data
;
}
else
{
AlertMessageService
.
addAlert
(
alert
);
}
NotificationsService
.
addNotification
(
alert
.
data
);
};
...
...
@@ -443,7 +436,6 @@ angular.module("openshiftCommonUI")
message
:
_
.
capitalize
(
formattedResource
)
+
"
\
'"
+
" could not be deleted."
,
details
:
$filter
(
'getErrorDetails'
)(
err
)
};
scope
.
alerts
[
projectName
]
=
alert
;
NotificationsService
.
addNotification
(
alert
);
Logger
.
error
(
formattedResource
+
" could not be deleted."
,
err
);
});
...
...
dist/origin-web-common.js
View file @
d1a9596a
...
...
@@ -507,14 +507,12 @@ angular.module("openshiftCommonUI")
;
'use strict'
;
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
{
restrict
:
"E"
,
scope
:
{
// The name of project to delete
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.
displayName
:
"@"
,
// Set to true to disable the delete button.
...
...
@@ -543,11 +541,6 @@ angular.module("openshiftCommonUI")
replace
:
true
,
link
:
function
(
scope
,
element
,
attrs
)
{
var
showAlert
=
function
(
alert
)
{
if
(
scope
.
stayOnCurrentPage
)
{
scope
.
alerts
[
alert
.
name
]
=
alert
.
data
;
}
else
{
AlertMessageService
.
addAlert
(
alert
);
}
NotificationsService
.
addNotification
(
alert
.
data
);
};
...
...
@@ -614,7 +607,6 @@ angular.module("openshiftCommonUI")
message
:
_
.
capitalize
(
formattedResource
)
+
"
\
'"
+
" could not be deleted."
,
details
:
$filter
(
'getErrorDetails'
)(
err
)
};
scope
.
alerts
[
projectName
]
=
alert
;
NotificationsService
.
addNotification
(
alert
);
Logger
.
error
(
formattedResource
+
" could not be deleted."
,
err
);
});
...
...
dist/origin-web-common.min.js
View file @
d1a9596a
...
...
@@ -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
{
restrict
:
"E"
,
scope
:{
projectName
:
"@"
,
alerts
:
"="
,
displayName
:
"@"
,
disableDelete
:
"=?"
,
typeNameToConfirm
:
"=?"
,
...
...
@@ -150,7 +149,7 @@ return angular.isDefined(attr.buttonOnly) ? "src/components/delete-project/delet
replace
:
!
0
,
link
:
function
(
scope
,
element
,
attrs
)
{
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
()
{
if
(
!
scope
.
stayOnCurrentPage
)
{
if
(
scope
.
redirectUrl
)
return
void
$location
.
url
(
scope
.
redirectUrl
);
...
...
@@ -185,7 +184,7 @@ type:"error",
message
:
_
.
capitalize
(
formattedResource
)
+
"' could not be deleted."
,
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 @
d1a9596a
'use strict'
;
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
{
restrict
:
"E"
,
scope
:
{
// The name of project to delete
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.
displayName
:
"@"
,
// Set to true to disable the delete button.
...
...
@@ -37,11 +35,6 @@ angular.module("openshiftCommonUI")
replace
:
true
,
link
:
function
(
scope
,
element
,
attrs
)
{
var
showAlert
=
function
(
alert
)
{
if
(
scope
.
stayOnCurrentPage
)
{
scope
.
alerts
[
alert
.
name
]
=
alert
.
data
;
}
else
{
AlertMessageService
.
addAlert
(
alert
);
}
NotificationsService
.
addNotification
(
alert
.
data
);
};
...
...
@@ -108,7 +101,6 @@ angular.module("openshiftCommonUI")
message
:
_
.
capitalize
(
formattedResource
)
+
"
\
'"
+
" could not be deleted."
,
details
:
$filter
(
'getErrorDetails'
)(
err
)
};
scope
.
alerts
[
projectName
]
=
alert
;
NotificationsService
.
addNotification
(
alert
);
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