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
f304f59f
Commit
f304f59f
authored
Apr 27, 2020
by
kevalbhatt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3757 : Classic UI: Add import business metadata feature
parent
2b38550b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
128 additions
and
56 deletions
+128
-56
theme.scss
dashboardv2/public/css/scss/theme.scss
+1
-1
Router.js
dashboardv2/public/js/router/Router.js
+13
-12
ImportLayoutView_tmpl.html
...dv2/public/js/templates/import/ImportLayoutView_tmpl.html
+2
-2
Header.html
dashboardv2/public/js/templates/site/Header.html
+26
-2
UrlLinks.js
dashboardv2/public/js/utils/UrlLinks.js
+6
-0
GlossaryLayoutView.js
dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
+9
-5
ImportLayoutView.js
dashboardv2/public/js/views/import/ImportLayoutView.js
+27
-23
Header.js
dashboardv2/public/js/views/site/Header.js
+34
-2
theme.scss
dashboardv3/public/css/scss/theme.scss
+1
-1
Header.html
dashboardv3/public/js/templates/site/Header.html
+1
-1
ImportLayoutView.js
dashboardv3/public/js/views/import/ImportLayoutView.js
+8
-7
No files found.
dashboardv2/public/css/scss/theme.scss
View file @
f304f59f
...
...
@@ -668,7 +668,7 @@ td.searchTableName:hover {
}
&
:hover
>
.dropdown-menu
{
display
:
block
;
display
:
table
;
}
}
...
...
dashboardv2/public/js/router/Router.js
View file @
f304f59f
...
...
@@ -55,6 +55,7 @@ define([
this
.
bindCommonEvents
();
this
.
listenTo
(
this
,
'route'
,
this
.
postRouteExecute
,
this
);
this
.
searchVent
=
new
Backbone
.
Wreqr
.
EventAggregator
();
this
.
importVent
=
new
Backbone
.
Wreqr
.
EventAggregator
();
this
.
glossaryCollection
=
new
VGlossaryList
([],
{
comparator
:
function
(
item
)
{
return
item
.
get
(
"name"
);
...
...
@@ -130,14 +131,15 @@ define([
// console.log("Post-Route Change Operations can be performed here !!");
// console.log("Route changed: ", name);
},
getHeaderOptions
:
function
(
Header
)
{
getHeaderOptions
:
function
(
Header
,
options
)
{
var
that
=
this
;
return
{
view
:
App
.
rNHeader
,
manualRender
:
function
()
{
this
.
view
.
currentView
.
manualRender
();
},
render
:
function
()
{
return
new
Header
();
return
new
Header
(
_
.
extend
({
importVent
:
that
.
importVent
},
that
.
preFetchedCollectionLists
,
that
.
sharedObj
,
options
)
);
}
}
},
...
...
@@ -238,22 +240,18 @@ define([
],
function
(
Header
,
GlossaryDetailLayoutView
,
SideNavLayoutView
)
{
var
paramObj
=
Utils
.
getUrlState
.
getQueryParams
();
that
.
renderViewIfNotExists
(
that
.
getHeaderOptions
(
Header
));
var
options
=
_
.
extend
({},
that
.
preFetchedCollectionLists
,
that
.
sharedObj
,
{
'guid'
:
id
,
'value'
:
paramObj
,
importVent
:
that
.
importVent
})
that
.
renderViewIfNotExists
({
view
:
App
.
rSideNav
,
manualRender
:
function
()
{
this
.
view
.
currentView
.
RGlossaryLayoutView
.
currentView
.
manualRender
(
_
.
extend
({},
{
'guid'
:
id
,
'value'
:
paramObj
})
);
this
.
view
.
currentView
.
RGlossaryLayoutView
.
currentView
.
manualRender
(
options
);
this
.
view
.
currentView
.
selectTab
();
},
render
:
function
()
{
return
new
SideNavLayoutView
(
_
.
extend
({},
that
.
preFetchedCollectionLists
,
that
.
sharedObj
,
{
'guid'
:
id
,
'value'
:
paramObj
})
)
return
new
SideNavLayoutView
(
options
)
}
});
App
.
rNContent
.
show
(
new
GlossaryDetailLayoutView
(
_
.
extend
({
'guid'
:
id
,
'value'
:
paramObj
},
that
.
preFetchedCollectionLists
,
that
.
sharedObj
)));
App
.
rNContent
.
show
(
new
GlossaryDetailLayoutView
(
options
));
});
}
},
...
...
@@ -273,13 +271,14 @@ define([
if
(
Utils
.
getUrlState
.
isTagTab
())
{
this
.
view
.
currentView
.
RTagLayoutView
.
currentView
.
manualRender
();
}
else
if
(
Utils
.
getUrlState
.
isGlossaryTab
())
{
this
.
view
.
currentView
.
RGlossaryLayoutView
.
currentView
.
manualRender
(
_
.
extend
({
"isTrigger"
:
true
},
{
"value"
:
paramObj
}));
this
.
view
.
currentView
.
RGlossaryLayoutView
.
currentView
.
manualRender
(
_
.
extend
({
"isTrigger"
:
true
,
"value"
:
paramObj
}));
}
},
render
:
function
()
{
return
new
SideNavLayoutView
(
_
.
extend
({
'searchVent'
:
that
.
searchVent
'searchVent'
:
that
.
searchVent
,
'importVent'
:
that
.
importVent
},
that
.
preFetchedCollectionLists
,
that
.
sharedObj
)
)
}
...
...
@@ -296,6 +295,8 @@ define([
}
else
{
if
(
App
.
rNContent
.
currentView
)
{
App
.
rNContent
.
currentView
.
destroy
();
}
else
{
App
.
rNContent
.
$el
.
empty
();
}
}
});
...
...
dashboardv2/public/js/templates/
glossary/ImportGlossary
LayoutView_tmpl.html
→
dashboardv2/public/js/templates/
import/Import
LayoutView_tmpl.html
View file @
f304f59f
...
...
@@ -14,4 +14,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<form
action=
{{importUrl}}
id=
"importGlossary"
class=
"dropzone single-file-center"
></form>
\ No newline at end of file
<form
id=
"importGlossary"
class=
"dropzone single-file-center"
></form>
\ No newline at end of file
dashboardv2/public/js/templates/site/Header.html
View file @
f304f59f
...
...
@@ -37,12 +37,36 @@
<table
class=
"header-menu"
>
<tr>
<td><a
class=
"show-stat"
href=
"javascript:void(0);"
title=
"Statistics"
><i
class=
"fa fa-bar-chart"
></i></a></td>
<td><a
target=
"_blank"
href=
"http://atlas.apache.org/"
><i
class=
"fa fa-question-circle"
></i></a></td>
<td>
<a
href=
"javascript:void(0);"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
class=
"user-dropdown"
><i
class=
"fa fa-user user-circle "
></i><span
class=
"userName"
></span></a>
<ul
class=
"dropdown-menu pull-right multi-level"
>
<li><a
href=
"javascript:void(0)"
data-id=
'administrator'
>
Administration
</a></li>
<li
class=
"aboutAtlas"
><a
href=
"javascript:void(0)"
>
About
</a></li>
<li
class=
"dropdown-submenu"
>
<a
tabindex=
"-1"
href=
"javascript:void(0)"
>
Bulk Import
</span></a>
<ul
class=
"dropdown-menu multi-level"
>
<li
class=
"dropdown-submenu"
>
<a
tabindex=
"-1"
href=
"javascript:void(0)"
>
Business Metadata
</span></a>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"{{businessMetadataImportTempUrl}}"
>
Download Import template
</a></li>
<li
data-id=
'businessMetadataImport'
><a
href=
"javascript:void(0)"
>
Import Business Metadata
</a></li>
</ul>
</li>
<li
class=
"dropdown-submenu"
>
<a
tabindex=
"-1"
href=
"javascript:void(0)"
>
Glossary
</span></a>
<ul
class=
"dropdown-menu"
>
<li><a
href=
"{{glossaryImportTempUrl}}"
>
Download Import template
</a></li>
<li
data-id=
'glossaryImport'
><a
href=
"javascript:void(0)"
>
Import Glossary
</a></li>
</ul>
</li>
</ul>
</li>
<li
class=
"dropdown-submenu"
>
<a
tabindex=
"-1"
href=
"javascript:void(0)"
>
Help
</span></a>
<ul
class=
"dropdown-menu"
>
<li><a
target=
"_blank"
href=
"http://atlas.apache.org/"
>
Documentation
</a></li>
<li
class=
"aboutAtlas"
><a
href=
"javascript:void(0)"
>
About
</a></li>
</ul>
</li>
<li
role=
"separator"
class=
"divider"
></li>
<li><a
data-id=
"uiSwitch"
href=
"javascript:void(0)"
>
Switch to New
</a></li>
<li>
...
...
dashboardv2/public/js/utils/UrlLinks.js
View file @
f304f59f
...
...
@@ -202,6 +202,12 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require
glossaryImportUrl
:
function
()
{
return
this
.
glossaryApiUrl
()
+
'/import'
;
},
businessMetadataImportTempUrl
:
function
()
{
return
this
.
entitiesApiUrl
()
+
'/businessmetadata/import/template'
;
},
businessMetadataImportUrl
:
function
()
{
return
this
.
entitiesApiUrl
()
+
'/businessmetadata/import'
;
},
categoryApiUrl
:
function
(
options
)
{
var
guid
=
options
&&
options
.
guid
,
list
=
options
&&
options
.
list
,
...
...
dashboardv2/public/js/views/glossary/GlossaryLayoutView.js
View file @
f304f59f
...
...
@@ -97,7 +97,7 @@ define(['require',
* @constructs
*/
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'associatedTerms'
,
'guid'
,
'value'
,
'glossaryCollection'
,
'glossary'
,
'isAssignTermView'
,
'isAssignCategoryView'
,
'isAssignEntityView'
,
'isAssignAttributeRelationView'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'associatedTerms'
,
'guid'
,
'value'
,
'glossaryCollection'
,
'glossary'
,
'isAssignTermView'
,
'isAssignCategoryView'
,
'isAssignEntityView'
,
'isAssignAttributeRelationView'
,
'importVent'
));
this
.
viewType
=
"term"
;
this
.
isAssignView
=
this
.
isAssignTermView
||
this
.
isAssignCategoryView
||
this
.
isAssignEntityView
||
this
.
isAssignAttributeRelationView
;
this
.
bindEvents
();
...
...
@@ -142,6 +142,9 @@ define(['require',
that
[
$
(
this
).
find
(
'a'
).
data
(
'fn'
)](
e
)
});
}
this
.
importVent
.
on
(
"Import:Glossary:Update"
,
function
(
options
)
{
that
.
getGlossary
();
});
},
onRender
:
function
()
{
this
.
changeLoaderState
(
true
);
...
...
@@ -772,12 +775,13 @@ define(['require',
onClickImportGlossary
:
function
()
{
var
that
=
this
;
require
([
'views/
glossary/ImportGlossary
LayoutView'
],
function
(
Import
Glossary
LayoutView
)
{
var
view
=
new
Import
Glossary
LayoutView
({
'views/
import/Import
LayoutView'
],
function
(
ImportLayoutView
)
{
var
view
=
new
ImportLayoutView
({
callback
:
function
()
{
that
.
getGlossary
();
}
},
isGlossary
:
true
});
});
}
...
...
dashboardv2/public/js/views/
glossary/ImportGlossary
LayoutView.js
→
dashboardv2/public/js/views/
import/Import
LayoutView.js
View file @
f304f59f
...
...
@@ -19,25 +19,19 @@
define
([
"require"
,
"backbone"
,
"hbs!tmpl/
glossary/ImportGlossary
LayoutView_tmpl"
,
"hbs!tmpl/
import/Import
LayoutView_tmpl"
,
"modules/Modal"
,
'utils/CommonViewFunction'
,
"utils/Utils"
,
"utils/UrlLinks"
,
"dropzone"
],
function
(
require
,
Backbone
,
Import
Glossary
LayoutViewTmpl
,
Modal
,
CommonViewFunction
,
Utils
,
UrlLinks
,
dropzone
)
{
var
Import
Glossary
LayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
/** @lends Import
Glossary
LayoutView */
],
function
(
require
,
Backbone
,
ImportLayoutViewTmpl
,
Modal
,
CommonViewFunction
,
Utils
,
UrlLinks
,
dropzone
)
{
var
ImportLayoutView
=
Backbone
.
Marionette
.
LayoutView
.
extend
(
/** @lends ImportLayoutView */
{
_viewName
:
"Import
Glossary
LayoutView"
,
_viewName
:
"ImportLayoutView"
,
template
:
ImportGlossaryLayoutViewTmpl
,
templateHelpers
:
function
()
{
return
{
importUrl
:
UrlLinks
.
glossaryImportUrl
()
};
},
template
:
ImportLayoutViewTmpl
,
/** Layout sub regions */
regions
:
{},
...
...
@@ -50,14 +44,14 @@ define([
return
events
;
},
/**
* intialize a new Import
Glossary
LayoutView Layout
* intialize a new ImportLayoutView Layout
* @constructs
*/
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
"callback"
));
_
.
extend
(
this
,
_
.
pick
(
options
,
"callback"
,
"isGlossary"
));
var
that
=
this
;
this
.
modal
=
new
Modal
({
title
:
"Import Glossary
"
,
title
:
this
.
isGlossary
?
"Import Glossary"
:
"Import Business Metadata
"
,
content
:
this
,
cancelText
:
"Cancel"
,
okText
:
"upload"
,
...
...
@@ -88,7 +82,7 @@ define([
var
headers
=
{};
headers
[
CommonViewFunction
.
restCsrfCustomHeader
]
=
'""'
;
this
.
$
(
"#importGlossary"
).
dropzone
({
url
:
UrlLinks
.
glossary
ImportUrl
(),
url
:
that
.
isGlossary
?
UrlLinks
.
glossaryImportUrl
()
:
UrlLinks
.
businessMetadata
ImportUrl
(),
clickable
:
true
,
acceptedFiles
:
".csv,.xls,.xlsx"
,
autoProcessQueue
:
false
,
...
...
@@ -107,12 +101,21 @@ define([
this
.
removeAllFiles
();
this
.
addFile
(
file
);
},
success
:
function
(
file
,
response
)
{
that
.
modal
.
trigger
(
"cancel"
);
Utils
.
notifySuccess
({
content
:
"File: "
+
file
.
name
+
" added successfully"
});
that
.
callback
();
success
:
function
(
file
,
response
,
responseObj
)
{
var
success
=
true
;
if
(
response
.
failedImportInfoList
&&
response
.
failedImportInfoList
.
length
)
{
success
=
false
;
Utils
.
defaultErrorHandler
(
null
,
file
.
xhr
,
{
defaultErrorMessage
:
response
.
failedImportInfoList
[
0
].
remarks
});
}
if
(
success
)
{
that
.
modal
.
trigger
(
"cancel"
);
Utils
.
notifySuccess
({
content
:
"File: "
+
file
.
name
+
" imported successfully"
});
}
if
(
that
.
callback
&&
((
response
.
successImportInfoList
&&
response
.
successImportInfoList
.
length
>
0
)
||
success
))
{
that
.
callback
();
}
},
error
:
function
(
file
,
response
,
responseObj
)
{
Utils
.
defaultErrorHandler
(
null
,
responseObj
,
{
defaultErrorMessage
:
(
response
.
errorMessage
)
||
response
});
...
...
@@ -124,5 +127,5 @@ define([
}
}
);
return
Import
Glossary
LayoutView
;
return
ImportLayoutView
;
});
\ No newline at end of file
dashboardv2/public/js/views/site/Header.js
View file @
f304f59f
...
...
@@ -29,6 +29,12 @@ define(['require',
var
Header
=
Marionette
.
LayoutView
.
extend
({
template
:
tmpl
,
regions
:
{},
templateHelpers
:
function
()
{
return
{
glossaryImportTempUrl
:
UrlLinks
.
glossaryImportTempUrl
(),
businessMetadataImportTempUrl
:
UrlLinks
.
businessMetadataImportTempUrl
()
};
},
ui
:
{
backButton
:
"[data-id='backButton']"
,
menuHamburger
:
"[data-id='menuHamburger']"
,
...
...
@@ -36,7 +42,9 @@ define(['require',
clearGlobalSearch
:
"[data-id='clearGlobalSearch']"
,
signOut
:
"[data-id='signOut']"
,
administrator
:
"[data-id='administrator']"
,
uiSwitch
:
"[data-id='uiSwitch']"
uiSwitch
:
"[data-id='uiSwitch']"
,
glossaryImport
:
"[data-id='glossaryImport']"
,
businessMetadataImport
:
"[data-id='businessMetadataImport']"
},
events
:
function
()
{
var
events
=
{};
...
...
@@ -76,15 +84,22 @@ define(['require',
updateTabState
:
true
});
};
events
[
'click '
+
this
.
ui
.
glossaryImport
]
=
function
()
{
this
.
onClickImport
(
true
);
};
events
[
'click '
+
this
.
ui
.
businessMetadataImport
]
=
function
()
{
this
.
onClickImport
()
};
return
events
;
},
initialize
:
function
(
options
)
{
this
.
bindEvent
();
this
.
options
=
options
;
},
setSearchBoxWidth
:
function
(
options
)
{
var
atlasHeaderWidth
=
this
.
$el
.
find
(
".atlas-header"
).
width
(),
minusWidth
=
(
Utils
.
getUrlState
.
isDetailPage
()
||
Utils
.
getUrlState
.
isBSDetail
())
?
413
:
263
;
minusWidth
=
(
Utils
.
getUrlState
.
isDetailPage
()
||
Utils
.
getUrlState
.
isBSDetail
())
?
360
:
210
;
if
(
options
&&
options
.
updateWidth
)
{
atlasHeaderWidth
=
options
.
updateWidth
(
atlasHeaderWidth
);
}
...
...
@@ -276,6 +291,23 @@ define(['require',
}
}
};
},
onClickImport
:
function
(
isGlossary
)
{
var
that
=
this
;
require
([
'views/import/ImportLayoutView'
],
function
(
ImportLayoutView
)
{
var
view
=
new
ImportLayoutView
({
callback
:
function
()
{
if
(
isGlossary
)
{
that
.
options
.
importVent
.
trigger
(
"Import:Glossary:Update"
);
}
else
{
that
.
options
.
importVent
.
trigger
(
"Import:BM:Update"
);
}
},
isGlossary
:
isGlossary
});
});
}
});
return
Header
;
...
...
dashboardv3/public/css/scss/theme.scss
View file @
f304f59f
...
...
@@ -780,7 +780,7 @@ td.searchTableName:hover {
}
&
:hover
>
.dropdown-menu
{
display
:
block
;
display
:
table
;
}
}
...
...
dashboardv3/public/js/templates/site/Header.html
View file @
f304f59f
...
...
@@ -44,7 +44,7 @@
<ul
class=
"dropdown-menu pull-right multi-level"
role=
"menu"
aria-labelledby=
"dropdownMenu"
>
<li><a
href=
"javascript:void(0)"
data-id=
'administrator'
>
Administration
</a></li>
<li
class=
"dropdown-submenu"
>
<a
tabindex=
"-1"
href=
"javascript:void(0)"
>
Help
</span></a>
<a
tabindex=
"-1"
href=
"javascript:void(0)"
>
Help
</span></a>
<ul
class=
"dropdown-menu"
>
<li><a
target=
"_blank"
href=
"http://atlas.apache.org/"
>
Documentation
</a></li>
<li
class=
"aboutAtlas"
><a
href=
"javascript:void(0)"
>
About
</a></li>
...
...
dashboardv3/public/js/views/import/ImportLayoutView.js
View file @
f304f59f
...
...
@@ -101,18 +101,19 @@ define([
this
.
removeAllFiles
();
this
.
addFile
(
file
);
},
success
:
function
(
file
,
response
)
{
if
(
response
.
successImportInfoList
.
length
&&
response
.
failedImportInfoList
.
length
===
0
)
{
success
:
function
(
file
,
response
,
responseObj
)
{
var
success
=
true
;
if
(
response
.
failedImportInfoList
&&
response
.
failedImportInfoList
.
length
)
{
success
=
false
;
Utils
.
defaultErrorHandler
(
null
,
file
.
xhr
,
{
defaultErrorMessage
:
response
.
failedImportInfoList
[
0
].
remarks
});
}
if
(
success
)
{
that
.
modal
.
trigger
(
"cancel"
);
Utils
.
notifySuccess
({
content
:
"File: "
+
file
.
name
+
" imported successfully"
});
}
else
if
(
response
.
failedImportInfoList
.
length
)
{
Utils
.
notifyError
({
content
:
response
.
failedImportInfoList
[
0
].
remarks
});
}
if
(
that
.
callback
)
{
if
(
that
.
callback
&&
((
response
.
successImportInfoList
&&
response
.
successImportInfoList
.
length
>
0
)
||
success
)
)
{
that
.
callback
();
}
},
...
...
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