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
138bc6f1
Commit
138bc6f1
authored
May 17, 2017
by
kevalbhatt
Committed by
Madhan Neethiraj
May 19, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1812: On browser refresh if, tag is doesn't exist, then URL should update with the first tag.
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
f0f7fe2c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
47 deletions
+67
-47
Router.js
dashboardv2/public/js/router/Router.js
+25
-1
SideNavLayoutView.js
...dv2/public/js/views/business_catalog/SideNavLayoutView.js
+0
-2
CreateEntityLayoutView.js
dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
+5
-11
SchemaLayoutView.js
dashboardv2/public/js/views/schema/SchemaLayoutView.js
+1
-1
SearchResultLayoutView.js
dashboardv2/public/js/views/search/SearchResultLayoutView.js
+1
-1
TagDetailLayoutView.js
dashboardv2/public/js/views/tag/TagDetailLayoutView.js
+16
-10
TagLayoutView.js
dashboardv2/public/js/views/tag/TagLayoutView.js
+19
-21
No files found.
dashboardv2/public/js/router/Router.js
View file @
138bc6f1
...
@@ -181,8 +181,19 @@ define([
...
@@ -181,8 +181,19 @@ define([
'views/business_catalog/SideNavLayoutView'
,
'views/business_catalog/SideNavLayoutView'
,
'views/tag/TagDetailLayoutView'
,
'views/tag/TagDetailLayoutView'
,
],
function
(
Header
,
BusinessCatalogLayoutView
,
SideNavLayoutView
,
TagDetailLayoutView
)
{
],
function
(
Header
,
BusinessCatalogLayoutView
,
SideNavLayoutView
,
TagDetailLayoutView
)
{
var
paramObj
=
Utils
.
getUrlState
.
getQueryParams
(),
url
=
Utils
.
getUrlState
.
getQueryUrl
().
queyParams
[
0
];
App
.
rNHeader
.
show
(
new
Header
());
App
.
rNHeader
.
show
(
new
Header
());
if
(
!
App
.
rSideNav
.
currentView
)
{
if
(
!
App
.
rSideNav
.
currentView
)
{
if
(
paramObj
&&
paramObj
.
dlttag
)
{
Utils
.
setUrl
({
url
:
url
,
trigger
:
false
,
updateTabState
:
function
()
{
return
{
tagUrl
:
this
.
url
,
stateChanged
:
true
};
}
});
}
App
.
rSideNav
.
show
(
new
SideNavLayoutView
(
App
.
rSideNav
.
show
(
new
SideNavLayoutView
(
_
.
extend
({
_
.
extend
({
'tag'
:
tagName
,
'tag'
:
tagName
,
...
@@ -190,11 +201,24 @@ define([
...
@@ -190,11 +201,24 @@ define([
},
that
.
preFetchedCollectionLists
)
},
that
.
preFetchedCollectionLists
)
));
));
}
else
{
}
else
{
if
(
paramObj
&&
paramObj
.
dlttag
)
{
Utils
.
setUrl
({
url
:
url
,
trigger
:
false
,
updateTabState
:
function
()
{
return
{
tagUrl
:
this
.
url
,
stateChanged
:
true
};
}
});
}
App
.
rSideNav
.
currentView
.
RTagLayoutView
.
currentView
.
manualRender
(
tagName
);
App
.
rSideNav
.
currentView
.
RTagLayoutView
.
currentView
.
manualRender
(
tagName
);
App
.
rSideNav
.
currentView
.
selectTab
();
App
.
rSideNav
.
currentView
.
selectTab
();
}
}
if
(
tagName
)
{
if
(
tagName
)
{
// updating paramObj to check for new queryparam.
paramObj
=
Utils
.
getUrlState
.
getQueryParams
();
if
(
paramObj
&&
paramObj
.
dlttag
)
{
return
false
;
}
App
.
rNContent
.
show
(
new
TagDetailLayoutView
(
App
.
rNContent
.
show
(
new
TagDetailLayoutView
(
_
.
extend
({
_
.
extend
({
'tag'
:
tagName
,
'tag'
:
tagName
,
...
...
dashboardv2/public/js/views/business_catalog/SideNavLayoutView.js
View file @
138bc6f1
...
@@ -74,7 +74,6 @@ define(['require',
...
@@ -74,7 +74,6 @@ define(['require',
}
}
},
},
onRender
:
function
()
{
onRender
:
function
()
{
this
.
bindEvent
();
this
.
renderTagLayoutView
();
this
.
renderTagLayoutView
();
this
.
renderSearchLayoutView
();
this
.
renderSearchLayoutView
();
if
(
Globals
.
taxonomy
)
{
if
(
Globals
.
taxonomy
)
{
...
@@ -83,7 +82,6 @@ define(['require',
...
@@ -83,7 +82,6 @@ define(['require',
this
.
selectTab
();
this
.
selectTab
();
},
},
bindEvent
:
function
()
{},
rendeBusinessCatalogLayoutView
:
function
()
{
rendeBusinessCatalogLayoutView
:
function
()
{
var
that
=
this
;
var
that
=
this
;
require
([
'views/business_catalog/BusinessCatalogLayoutView'
],
function
(
BusinessCatalogLayoutView
)
{
require
([
'views/business_catalog/BusinessCatalogLayoutView'
],
function
(
BusinessCatalogLayoutView
)
{
...
...
dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
View file @
138bc6f1
...
@@ -583,7 +583,11 @@ define(['require',
...
@@ -583,7 +583,11 @@ define(['require',
that
.
callback
();
that
.
callback
();
}
else
{
}
else
{
if
(
model
.
mutatedEntities
&&
model
.
mutatedEntities
.
CREATE
&&
_
.
isArray
(
model
.
mutatedEntities
.
CREATE
)
&&
model
.
mutatedEntities
.
CREATE
[
0
]
&&
model
.
mutatedEntities
.
CREATE
[
0
].
guid
)
{
if
(
model
.
mutatedEntities
&&
model
.
mutatedEntities
.
CREATE
&&
_
.
isArray
(
model
.
mutatedEntities
.
CREATE
)
&&
model
.
mutatedEntities
.
CREATE
[
0
]
&&
model
.
mutatedEntities
.
CREATE
[
0
].
guid
)
{
that
.
setUrl
(
'#!/detailPage/'
+
(
model
.
mutatedEntities
.
CREATE
[
0
].
guid
),
true
);
Utils
.
setUrl
({
url
:
'#!/detailPage/'
+
(
model
.
mutatedEntities
.
CREATE
[
0
].
guid
),
mergeBrowserUrl
:
false
,
trigger
:
true
});
}
}
}
}
},
},
...
@@ -599,16 +603,6 @@ define(['require',
...
@@ -599,16 +603,6 @@ define(['require',
that
.
hideLoader
();
that
.
hideLoader
();
}
}
},
},
setUrl
:
function
(
url
,
create
)
{
Utils
.
setUrl
({
url
:
url
,
mergeBrowserUrl
:
false
,
trigger
:
true
,
updateTabState
:
function
()
{
return
{
tagUrl
:
this
.
url
,
stateChanged
:
true
};
}
});
},
showLoader
:
function
()
{
showLoader
:
function
()
{
this
.
$
(
'.entityLoader'
).
show
();
this
.
$
(
'.entityLoader'
).
show
();
this
.
$
(
'.entityInputData'
).
hide
();
this
.
$
(
'.entityInputData'
).
hide
();
...
...
dashboardv2/public/js/views/schema/SchemaLayoutView.js
View file @
138bc6f1
...
@@ -246,7 +246,7 @@ define(['require',
...
@@ -246,7 +246,7 @@ define(['require',
});
});
});
});
},
},
getSchemaTableColumns
:
function
(
deleteEnity
)
{
getSchemaTableColumns
:
function
()
{
var
that
=
this
,
var
that
=
this
,
col
=
{
col
=
{
Check
:
{
Check
:
{
...
...
dashboardv2/public/js/views/search/SearchResultLayoutView.js
View file @
138bc6f1
...
@@ -126,7 +126,7 @@ define(['require',
...
@@ -126,7 +126,7 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'initialView'
,
'entityDefCollection'
,
'typeHeaders'
,
'searchVent'
,
'enumDefCollection'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'value'
,
'initialView'
,
'entityDefCollection'
,
'typeHeaders'
,
'searchVent'
,
'enumDefCollection'
,
'tagCollection'
));
var
pagination
=
""
;
var
pagination
=
""
;
this
.
entityModel
=
new
VEntity
();
this
.
entityModel
=
new
VEntity
();
this
.
searchCollection
=
new
VSearchList
();
this
.
searchCollection
=
new
VSearchList
();
...
...
dashboardv2/public/js/views/tag/TagDetailLayoutView.js
View file @
138bc6f1
...
@@ -44,7 +44,7 @@ define(['require',
...
@@ -44,7 +44,7 @@ define(['require',
* @constructs
* @constructs
*/
*/
initialize
:
function
(
options
)
{
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'tag'
,
'collection'
,
'entityDefCollection'
,
'typeHeaders'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'tag'
,
'collection'
,
'entityDefCollection'
,
'typeHeaders'
,
'enumDefCollection'
));
},
},
bindEvents
:
function
()
{},
bindEvents
:
function
()
{},
onRender
:
function
()
{
onRender
:
function
()
{
...
@@ -58,20 +58,26 @@ define(['require',
...
@@ -58,20 +58,26 @@ define(['require',
'tag'
:
that
.
tag
,
'tag'
:
that
.
tag
,
'searchType'
:
'basic'
'searchType'
:
'basic'
};
};
that
.
RSearchResultLayoutView
.
show
(
new
SearchResultLayoutView
({
if
(
that
.
RSearchResultLayoutView
)
{
value
:
value
,
that
.
RSearchResultLayoutView
.
show
(
new
SearchResultLayoutView
({
entityDefCollection
:
that
.
entityDefCollection
,
value
:
value
,
typeHeaders
:
that
.
typeHeaders
entityDefCollection
:
that
.
entityDefCollection
,
}));
typeHeaders
:
that
.
typeHeaders
,
tagCollection
:
that
.
collection
,
enumDefCollection
:
that
.
enumDefCollection
}));
}
});
});
},
},
renderTagAttributeCompositeView
:
function
()
{
renderTagAttributeCompositeView
:
function
()
{
var
that
=
this
;
var
that
=
this
;
require
([
'views/tag/TagAttributeDetailLayoutView'
],
function
(
TagAttributeDetailLayoutView
)
{
require
([
'views/tag/TagAttributeDetailLayoutView'
],
function
(
TagAttributeDetailLayoutView
)
{
that
.
RTagAttributeDetailLayoutView
.
show
(
new
TagAttributeDetailLayoutView
({
if
(
that
.
RTagAttributeDetailLayoutView
)
{
tag
:
that
.
tag
,
that
.
RTagAttributeDetailLayoutView
.
show
(
new
TagAttributeDetailLayoutView
({
collection
:
that
.
collection
tag
:
that
.
tag
,
}));
collection
:
that
.
collection
}));
}
});
});
}
}
});
});
...
...
dashboardv2/public/js/views/tag/TagLayoutView.js
View file @
138bc6f1
...
@@ -97,30 +97,40 @@ define(['require',
...
@@ -97,30 +97,40 @@ define(['require',
}
}
},
},
setValues
:
function
(
manual
)
{
setValues
:
function
(
manual
)
{
var
$firstEl
=
this
.
ui
.
tagsParent
.
find
(
'li a'
)
?
this
.
ui
.
tagsParent
.
find
(
'li a'
).
first
()
:
null
;
if
(
Utils
.
getUrlState
.
isTagTab
())
{
if
(
Utils
.
getUrlState
.
isTagTab
())
{
if
(
!
this
.
tag
)
{
if
(
!
this
.
tag
)
{
this
.
selectFirst
=
false
;
this
.
selectFirst
=
false
;
this
.
ui
.
tagsParent
.
find
(
'li'
).
first
().
addClass
(
'active'
);
this
.
ui
.
tagsParent
.
find
(
'li'
).
first
().
addClass
(
'active'
);
if
(
this
.
ui
.
tagsParent
.
find
(
'li a'
).
first
().
length
)
{
if
(
$firstEl
&&
$firstEl
.
length
)
{
url
:
$firstEl
.
attr
(
"href"
),
Utils
.
setUrl
({
Utils
.
setUrl
({
url
:
this
.
ui
.
tagsParent
.
find
(
'li a'
).
first
()
.
attr
(
"href"
),
url
:
$firstEl
.
attr
(
"href"
),
mergeBrowserUrl
:
false
,
mergeBrowserUrl
:
false
,
trigger
:
true
,
updateTabState
:
function
()
{
updateTabState
:
function
()
{
return
{
tagUrl
:
this
.
url
,
stateChanged
:
true
};
return
{
tagUrl
:
this
.
url
,
stateChanged
:
true
};
}
}
});
});
}
}
}
else
{
}
else
{
var
presentTag
=
this
.
collection
.
fullCollection
.
findWhere
({
name
:
this
.
tag
}),
url
=
Utils
.
getUrlState
.
getQueryUrl
().
hash
,
tag
=
this
.
tag
,
query
=
null
;
if
(
!
presentTag
)
{
tag
=
$firstEl
.
data
(
'name'
);
url
=
$firstEl
&&
$firstEl
.
length
?
$firstEl
.
attr
(
"href"
)
:
'#!/tag'
;
query
=
$firstEl
&&
$firstEl
.
length
?
{
dlttag
:
true
}
:
null
}
Utils
.
setUrl
({
Utils
.
setUrl
({
url
:
Utils
.
getUrlState
.
getQueryUrl
().
hash
,
url
:
url
,
urlParams
:
query
,
updateTabState
:
function
()
{
updateTabState
:
function
()
{
return
{
tagUrl
:
this
.
url
,
stateChanged
:
true
};
return
{
tagUrl
:
this
.
url
,
stateChanged
:
true
};
}
}
});
});
var
tag
=
Utils
.
getUrlState
.
getLastValue
();
if
(
!
presentTag
)
{
if
(
this
.
tag
)
{
return
false
;
tag
=
this
.
tag
;
}
}
this
.
ui
.
tagsParent
.
find
(
'li'
).
removeClass
(
'active'
);
this
.
ui
.
tagsParent
.
find
(
'li'
).
removeClass
(
'active'
);
var
target
=
this
.
ui
.
tagsParent
.
find
(
'li'
).
filter
(
function
()
{
var
target
=
this
.
ui
.
tagsParent
.
find
(
'li'
).
filter
(
function
()
{
...
@@ -399,26 +409,14 @@ define(['require',
...
@@ -399,26 +409,14 @@ define(['require',
Utils
.
notifySuccess
({
Utils
.
notifySuccess
({
content
:
"Tag "
+
that
.
tagName
+
Messages
.
deleteSuccessMessage
content
:
"Tag "
+
that
.
tagName
+
Messages
.
deleteSuccessMessage
});
});
// if deleted tag is prviously searched then remove that tag url from save state of tab.
var
searchUrl
=
Globals
.
saveApplicationState
.
tabState
.
searchUrl
;
var
searchUrl
=
Globals
.
saveApplicationState
.
tabState
.
searchUrl
;
var
urlObj
=
Utils
.
getUrlState
.
getQueryParams
(
searchUrl
);
var
urlObj
=
Utils
.
getUrlState
.
getQueryParams
(
searchUrl
);
if
(
urlObj
&&
urlObj
.
tag
&&
urlObj
.
tag
===
that
.
tagName
)
{
if
(
urlObj
&&
urlObj
.
tag
&&
urlObj
.
tag
===
that
.
tagName
)
{
Globals
.
saveApplicationState
.
tabState
.
searchUrl
=
"#!/search"
;
Globals
.
saveApplicationState
.
tabState
.
searchUrl
=
"#!/search"
;
}
}
that
.
ui
.
tagsParent
.
find
(
'li.active'
).
removeClass
(
'active'
);
if
(
that
.
tagDeleteData
.
prev
().
length
===
0
)
{
that
.
tagDeleteData
.
next
().
addClass
(
'active'
);
}
else
{
that
.
tagDeleteData
.
prev
().
addClass
(
'active'
);
}
Utils
.
setUrl
({
url
:
that
.
ui
.
tagsParent
.
find
(
'li.active'
).
find
(
"a"
).
attr
(
"href"
),
mergeBrowserUrl
:
false
,
trigger
:
true
,
updateTabState
:
function
()
{
return
{
tagUrl
:
that
.
url
,
stateChanged
:
true
};
}
});
that
.
collection
.
remove
(
deleteTagData
);
that
.
collection
.
remove
(
deleteTagData
);
// to update tag list of search tab fetch typeHeaders.
that
.
typeHeaders
.
fetch
({
reset
:
true
});
that
.
typeHeaders
.
fetch
({
reset
:
true
});
}
}
});
});
...
...
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