Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Merge requests
!233
Resolve "Admin panel: "Confirm remove" messages"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Admin panel: "Confirm remove" messages"
316-admin-panel-confirm-remove-messages
into
master
Overview
0
Commits
4
Pipelines
2
Changes
7
Merged
Piotr Gawron
requested to merge
316-admin-panel-confirm-remove-messages
into
master
6 years ago
Overview
0
Commits
4
Pipelines
2
Changes
7
Expand
Closes
#316 (closed)
Edited
6 years ago
by
Piotr Gawron
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
84b59583
4 commits,
6 years ago
7 files
+
148
−
26
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
frontend-js/src/main/js/gui/admin/AbstractAdminPanel.js
+
38
−
4
Options
@@ -5,6 +5,7 @@
var
Panel
=
require
(
'
../Panel
'
);
// noinspection JSUnusedLocalSymbols
var
logger
=
require
(
'
../../logger
'
);
var
Functions
=
require
(
'
../../Functions
'
);
var
Promise
=
require
(
"
bluebird
"
);
@@ -18,15 +19,48 @@ function AbstractAdminPanel(params) {
AbstractAdminPanel
.
prototype
=
Object
.
create
(
Panel
.
prototype
);
AbstractAdminPanel
.
prototype
.
constructor
=
AbstractAdminPanel
;
AbstractAdminPanel
.
prototype
.
_createHeader
=
function
(
name
)
{
AbstractAdminPanel
.
prototype
.
_createHeader
=
function
(
name
)
{
this
.
getElement
().
appendChild
(
Functions
.
createElement
({
type
:
"
h1
"
,
content
:
name
type
:
"
h1
"
,
content
:
name
}));
};
AbstractAdminPanel
.
prototype
.
init
=
function
()
{
AbstractAdminPanel
.
prototype
.
init
=
function
()
{
};
AbstractAdminPanel
.
prototype
.
askConfirmRemoval
=
function
(
params
)
{
return
new
Promise
(
function
(
resolve
)
{
var
html
;
var
content
=
''
;
if
(
params
.
content
)
{
content
=
params
.
content
;
}
if
(
params
.
input
)
{
html
=
'
<form><input type="text" style="z-index:10000" name="name"><br></form>
'
;
}
else
{
html
=
'
<form><span>
'
+
content
+
'
</span><input type="text" style="z-index:10000;visibility: hidden"><br></form>
'
;
}
$
(
html
).
dialog
({
modal
:
true
,
title
:
params
.
title
,
close
:
function
()
{
$
(
this
).
dialog
(
'
destroy
'
).
remove
();
resolve
({
status
:
false
});
},
buttons
:
{
'
OK
'
:
function
()
{
$
(
this
).
dialog
(
'
destroy
'
).
remove
();
resolve
({
reason
:
$
(
'
input[name="name"]
'
).
val
(),
status
:
true
});
},
'
Cancel
'
:
function
()
{
$
(
this
).
dialog
(
'
destroy
'
).
remove
();
resolve
({
status
:
false
});
}
}
});
})
};
module
.
exports
=
AbstractAdminPanel
;
Loading