Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
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
dataplatform
atlas
Commits
2ac03425
Commit
2ac03425
authored
Apr 01, 2020
by
kevalbhatt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3711 : UI: Classification/Term modal should close after create/update/delete response
parent
36956bc0
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
124 additions
and
70 deletions
+124
-70
common.scss
dashboardv2/public/css/scss/common.scss
+13
-27
CommonViewFunction.js
dashboardv2/public/js/utils/CommonViewFunction.js
+23
-3
Utils.js
dashboardv2/public/js/utils/Utils.js
+18
-4
AssignTermLayoutView.js
dashboardv2/public/js/views/glossary/AssignTermLayoutView.js
+4
-1
AddTagModalView.js
dashboardv2/public/js/views/tag/AddTagModalView.js
+4
-0
common.scss
dashboardv3/public/css/scss/common.scss
+13
-27
CommonViewFunction.js
dashboardv3/public/js/utils/CommonViewFunction.js
+23
-3
Utils.js
dashboardv3/public/js/utils/Utils.js
+18
-4
AssignTermLayoutView.js
dashboardv3/public/js/views/glossary/AssignTermLayoutView.js
+4
-1
AddTagModalView.js
dashboardv3/public/js/views/tag/AddTagModalView.js
+4
-0
No files found.
dashboardv2/public/css/scss/common.scss
View file @
2ac03425
...
...
@@ -274,36 +274,23 @@ pre {
float
:
left
;
}
.button-loader
:after
{
.button-loader
{
position
:
relative
;
padding-left
:
22px
!
important
;
&
:after
{
content
:
"\f021"
;
position
:
absolute
;
left
:
-6px
;
bottom
:
4px
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
left
:
0px
;
top
:
0px
;
font-family
:
FontAwesome
;
background
:
transparent
;
height
:
34px
;
width
:
38px
;
line-height
:
34px
;
text-align
:
center
;
height
:
100%
;
width
:
26px
;
font-size
:
11px
;
animation
:
spin
1000ms
infinite
linear
;
}
@-webkit-keyframes
spin
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
359deg
);
}
}
@keyframes
spin
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
359deg
);
}
}
\ No newline at end of file
dashboardv2/public/js/utils/CommonViewFunction.js
View file @
2ac03425
...
...
@@ -24,18 +24,25 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
require
([
'models/VTag'
],
function
(
VTag
)
{
if
(
options
&&
options
.
guid
&&
options
.
tagName
)
{
var
tagModel
=
new
VTag
(),
noticeRef
=
null
,
notifyObj
=
{
modal
:
true
,
okCloses
:
false
,
okShowLoader
:
true
,
text
:
options
.
msg
,
title
:
options
.
titleMessage
,
okText
:
options
.
okText
,
ok
:
function
(
argument
)
{
ok
:
function
(
notice
)
{
noticeRef
=
notice
;
if
(
options
.
showLoader
)
{
options
.
showLoader
();
}
tagModel
.
deleteAssociation
(
options
.
guid
,
options
.
tagName
,
options
.
associatedGuid
,
{
defaultErrorMessage
:
options
.
tagName
+
Messages
.
deleteErrorMessage
,
success
:
function
(
data
)
{
if
(
noticeRef
)
{
noticeRef
.
remove
();
}
Utils
.
notifySuccess
({
content
:
"Classification "
+
options
.
tagName
+
Messages
.
getAbbreviationMsg
(
false
,
'removeSuccessMessage'
)
});
...
...
@@ -48,6 +55,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
},
cust_error
:
function
(
model
,
response
)
{
if
(
noticeRef
)
{
noticeRef
.
hideButtonLoader
();
}
if
(
options
.
hideLoader
)
{
options
.
hideLoader
();
}
...
...
@@ -789,8 +799,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
collection
=
options
.
collection
,
model
=
options
.
model
,
newModel
=
new
options
.
collection
.
model
(),
noticeRef
=
null
,
ajaxOptions
=
{
success
:
function
(
rModel
,
response
)
{
if
(
noticeRef
)
{
noticeRef
.
remove
();
}
Utils
.
notifySuccess
({
content
:
((
isCategoryView
||
isEntityView
?
"Term"
:
"Category"
)
+
" association is removed successfully"
)
});
...
...
@@ -799,6 +813,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}
},
cust_error
:
function
()
{
if
(
noticeRef
)
{
noticeRef
.
hideButtonLoader
();
}
if
(
options
.
hideLoader
)
{
options
.
hideLoader
();
}
...
...
@@ -806,10 +823,13 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
},
notifyObj
=
{
modal
:
true
,
okCloses
:
false
,
okShowLoader
:
true
,
text
:
options
.
msg
,
title
:
options
.
titleMessage
,
okText
:
options
.
buttonText
,
ok
:
function
(
argument
)
{
ok
:
function
(
notice
)
{
noticeRef
=
notice
;
if
(
options
.
showLoader
)
{
options
.
showLoader
();
}
...
...
@@ -832,7 +852,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}));
}
},
cancel
:
function
(
argument
)
{}
cancel
:
function
()
{}
};
Utils
.
notifyConfirm
(
notifyObj
);
}
...
...
dashboardv2/public/js/utils/Utils.js
View file @
2ac03425
...
...
@@ -184,7 +184,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
confirm
:
true
,
buttons
:
[{
text
:
options
.
cancelText
||
'Cancel'
,
addClass
:
'btn-action btn-md'
,
addClass
:
'btn-action btn-md
cancel
'
,
click
:
function
(
notice
)
{
options
.
cancel
(
notice
);
notice
.
remove
();
...
...
@@ -192,12 +192,26 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
},
{
text
:
options
.
okText
||
'Ok'
,
addClass
:
'btn-atlas btn-md'
,
addClass
:
'btn-atlas btn-md
ok
'
,
click
:
function
(
notice
)
{
options
.
ok
(
notice
);
if
(
options
.
ok
)
{
options
.
ok
(
$
.
extend
({},
notice
,
{
hideButtonLoader
:
function
()
{
notice
.
container
.
find
(
"button.ok"
).
hideButtonLoader
();
},
showButtonLoader
:
function
()
{
notice
.
container
.
find
(
"button.ok"
).
showButtonLoader
();
}
}));
}
if
(
options
.
okShowLoader
)
{
notice
.
container
.
find
(
"button.ok"
).
showButtonLoader
();
}
if
(
options
.
okCloses
!==
false
)
{
notice
.
remove
();
}
}
}
]
},
buttons
:
{
...
...
@@ -872,7 +886,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}
}
$
.
fn
.
showButtonLoader
=
function
()
{
$
(
this
).
css
({
"position"
:
"relative"
}).
attr
(
"disabled"
,
"true"
).
addClass
(
'button-loader'
);
$
(
this
).
attr
(
"disabled"
,
"true"
).
addClass
(
'button-loader'
);
}
$
.
fn
.
hideButtonLoader
=
function
()
{
$
(
this
).
removeClass
(
'button-loader'
).
removeAttr
(
"disabled"
);
...
...
dashboardv2/public/js/views/glossary/AssignTermLayoutView.js
View file @
2ac03425
...
...
@@ -84,7 +84,8 @@ define(['require',
"okText"
:
"Assign"
,
"allowCancel"
:
true
,
"showFooter"
:
this
.
isAttributeRelationView
?
false
:
true
,
"mainClass"
:
"wizard-modal"
"mainClass"
:
"wizard-modal"
,
"okCloses"
:
false
});
this
.
modal
.
open
();
this
.
modal
.
$el
.
find
(
'button.ok'
).
attr
(
"disabled"
,
true
);
...
...
@@ -145,6 +146,7 @@ define(['require',
}
},
assignTerm
:
function
()
{
this
.
modal
.
$el
.
find
(
'button.ok'
).
showButtonLoader
();
this
.
assignTermError
=
false
;
var
that
=
this
,
data
=
[],
...
...
@@ -163,6 +165,7 @@ define(['require',
}
},
cust_error
:
function
()
{
that
.
modal
.
$el
.
find
(
'button.ok'
).
hideButtonLoader
();
that
.
assignTermError
=
true
;
}
},
...
...
dashboardv2/public/js/views/tag/AddTagModalView.js
View file @
2ac03425
...
...
@@ -125,6 +125,7 @@ define(['require',
cancelText
:
"Cancel"
,
mainClass
:
'modal-lg'
,
allowCancel
:
true
,
okCloses
:
false
};
if
(
this
.
tagModel
)
{
modalObj
.
title
=
'Edit Classification'
;
...
...
@@ -134,6 +135,7 @@ define(['require',
this
.
modal
.
open
();
this
.
modal
.
$el
.
find
(
'button.ok'
).
attr
(
"disabled"
,
true
);
this
.
on
(
'ok'
,
function
()
{
that
.
modal
.
$el
.
find
(
'button.ok'
).
showButtonLoader
();
var
tagName
=
this
.
tagModel
?
this
.
tagModel
.
typeName
:
this
.
ui
.
addTagOptions
.
val
(),
tagAttributes
=
{},
tagAttributeNames
=
this
.
$
(
".attrName"
),
...
...
@@ -453,8 +455,10 @@ define(['require',
if
(
that
.
callback
)
{
that
.
callback
();
}
that
.
modal
.
close
();
},
cust_error
:
function
(
model
,
response
)
{
that
.
modal
.
$el
.
find
(
'button.ok'
).
hideButtonLoader
();
if
(
that
.
hideLoader
)
{
that
.
hideLoader
();
}
...
...
dashboardv3/public/css/scss/common.scss
View file @
2ac03425
...
...
@@ -287,36 +287,23 @@ pre {
}
.button-loader
:after
{
.button-loader
{
position
:
relative
;
padding-left
:
22px
!
important
;
&
:after
{
content
:
"\f021"
;
position
:
absolute
;
left
:
-6px
;
bottom
:
4px
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
left
:
0px
;
top
:
0px
;
font-family
:
FontAwesome
;
background
:
transparent
;
height
:
34px
;
width
:
38px
;
line-height
:
34px
;
text-align
:
center
;
height
:
100%
;
width
:
26px
;
font-size
:
11px
;
animation
:
spin
1000ms
infinite
linear
;
}
@-webkit-keyframes
spin
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
359deg
);
}
}
@keyframes
spin
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
359deg
);
}
}
\ No newline at end of file
dashboardv3/public/js/utils/CommonViewFunction.js
View file @
2ac03425
...
...
@@ -24,18 +24,25 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
require
([
'models/VTag'
],
function
(
VTag
)
{
if
(
options
&&
options
.
guid
&&
options
.
tagName
)
{
var
tagModel
=
new
VTag
(),
noticeRef
=
null
,
notifyObj
=
{
modal
:
true
,
okCloses
:
false
,
okShowLoader
:
true
,
text
:
options
.
msg
,
title
:
options
.
titleMessage
,
okText
:
options
.
okText
,
ok
:
function
(
argument
)
{
ok
:
function
(
notice
)
{
noticeRef
=
notice
;
if
(
options
.
showLoader
)
{
options
.
showLoader
();
}
tagModel
.
deleteAssociation
(
options
.
guid
,
options
.
tagName
,
options
.
associatedGuid
,
{
defaultErrorMessage
:
options
.
tagName
+
Messages
.
deleteErrorMessage
,
success
:
function
(
data
)
{
if
(
noticeRef
)
{
noticeRef
.
remove
();
}
Utils
.
notifySuccess
({
content
:
"Classification "
+
options
.
tagName
+
Messages
.
getAbbreviationMsg
(
false
,
'removeSuccessMessage'
)
});
...
...
@@ -48,6 +55,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
},
cust_error
:
function
(
model
,
response
)
{
if
(
noticeRef
)
{
noticeRef
.
hideButtonLoader
();
}
if
(
options
.
hideLoader
)
{
options
.
hideLoader
();
}
...
...
@@ -809,8 +819,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
collection
=
options
.
collection
,
model
=
options
.
model
,
newModel
=
new
options
.
collection
.
model
(),
noticeRef
=
null
,
ajaxOptions
=
{
success
:
function
(
rModel
,
response
)
{
if
(
noticeRef
)
{
noticeRef
.
remove
();
}
Utils
.
notifySuccess
({
content
:
((
isCategoryView
||
isEntityView
?
"Term"
:
"Category"
)
+
" association is removed successfully"
)
});
...
...
@@ -819,6 +833,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}
},
cust_error
:
function
()
{
if
(
noticeRef
)
{
noticeRef
.
hideButtonLoader
();
}
if
(
options
.
hideLoader
)
{
options
.
hideLoader
();
}
...
...
@@ -826,10 +843,13 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
},
notifyObj
=
{
modal
:
true
,
okCloses
:
false
,
okShowLoader
:
true
,
text
:
options
.
msg
,
title
:
options
.
titleMessage
,
okText
:
options
.
buttonText
,
ok
:
function
(
argument
)
{
ok
:
function
(
notice
)
{
noticeRef
=
notice
;
if
(
options
.
showLoader
)
{
options
.
showLoader
();
}
...
...
@@ -852,7 +872,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum
}));
}
},
cancel
:
function
(
argument
)
{}
cancel
:
function
()
{}
};
Utils
.
notifyConfirm
(
notifyObj
);
}
...
...
dashboardv3/public/js/utils/Utils.js
View file @
2ac03425
...
...
@@ -190,7 +190,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
confirm
:
true
,
buttons
:
[{
text
:
options
.
cancelText
||
'Cancel'
,
addClass
:
'btn-action btn-md'
,
addClass
:
'btn-action btn-md
cancel
'
,
click
:
function
(
notice
)
{
options
.
cancel
(
notice
);
notice
.
remove
();
...
...
@@ -198,12 +198,26 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
},
{
text
:
options
.
okText
||
'Ok'
,
addClass
:
'btn-atlas btn-md'
,
addClass
:
'btn-atlas btn-md
ok
'
,
click
:
function
(
notice
)
{
options
.
ok
(
notice
);
if
(
options
.
ok
)
{
options
.
ok
(
$
.
extend
({},
notice
,
{
hideButtonLoader
:
function
()
{
notice
.
container
.
find
(
"button.ok"
).
hideButtonLoader
();
},
showButtonLoader
:
function
()
{
notice
.
container
.
find
(
"button.ok"
).
showButtonLoader
();
}
}));
}
if
(
options
.
okShowLoader
)
{
notice
.
container
.
find
(
"button.ok"
).
showButtonLoader
();
}
if
(
options
.
okCloses
!==
false
)
{
notice
.
remove
();
}
}
}
]
},
buttons
:
{
...
...
@@ -920,7 +934,7 @@ define(['require', 'utils/Globals', 'pnotify', 'utils/Messages', 'utils/Enums',
}
$
.
fn
.
showButtonLoader
=
function
()
{
$
(
this
).
css
({
"position"
:
"relative"
}).
attr
(
"disabled"
,
"true"
).
addClass
(
'button-loader'
);
$
(
this
).
attr
(
"disabled"
,
"true"
).
addClass
(
'button-loader'
);
}
$
.
fn
.
hideButtonLoader
=
function
()
{
$
(
this
).
removeClass
(
'button-loader'
).
removeAttr
(
"disabled"
);
...
...
dashboardv3/public/js/views/glossary/AssignTermLayoutView.js
View file @
2ac03425
...
...
@@ -84,7 +84,8 @@ define(['require',
"okText"
:
"Assign"
,
"allowCancel"
:
true
,
"showFooter"
:
this
.
isAttributeRelationView
?
false
:
true
,
"mainClass"
:
"wizard-modal"
"mainClass"
:
"wizard-modal"
,
"okCloses"
:
false
});
this
.
modal
.
open
();
this
.
modal
.
$el
.
find
(
'button.ok'
).
attr
(
"disabled"
,
true
);
...
...
@@ -145,6 +146,7 @@ define(['require',
}
},
assignTerm
:
function
()
{
this
.
modal
.
$el
.
find
(
'button.ok'
).
showButtonLoader
();
this
.
assignTermError
=
false
;
var
that
=
this
,
data
=
[],
...
...
@@ -163,6 +165,7 @@ define(['require',
}
},
cust_error
:
function
()
{
that
.
modal
.
$el
.
find
(
'button.ok'
).
hideButtonLoader
();
that
.
assignTermError
=
true
;
}
},
...
...
dashboardv3/public/js/views/tag/AddTagModalView.js
View file @
2ac03425
...
...
@@ -125,6 +125,7 @@ define(['require',
cancelText
:
"Cancel"
,
mainClass
:
'modal-lg'
,
allowCancel
:
true
,
okCloses
:
false
};
if
(
this
.
tagModel
)
{
modalObj
.
title
=
'Edit Classification'
;
...
...
@@ -134,6 +135,7 @@ define(['require',
this
.
modal
.
open
();
this
.
modal
.
$el
.
find
(
'button.ok'
).
attr
(
"disabled"
,
true
);
this
.
on
(
'ok'
,
function
()
{
that
.
modal
.
$el
.
find
(
'button.ok'
).
showButtonLoader
();
var
tagName
=
this
.
tagModel
?
this
.
tagModel
.
typeName
:
this
.
ui
.
addTagOptions
.
val
(),
tagAttributes
=
{},
tagAttributeNames
=
this
.
$
(
".attrName"
),
...
...
@@ -453,8 +455,10 @@ define(['require',
if
(
that
.
callback
)
{
that
.
callback
();
}
that
.
modal
.
close
();
},
cust_error
:
function
(
model
,
response
)
{
that
.
modal
.
$el
.
find
(
'button.ok'
).
hideButtonLoader
();
if
(
that
.
hideLoader
)
{
that
.
hideLoader
();
}
...
...
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