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
8 years ago
by
kevalbhatt
Committed by
Madhan Neethiraj
8 years ago
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
master
No related merge requests found
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([
'views/business_catalog/SideNavLayoutView'
,
'views/tag/TagDetailLayoutView'
,
],
function
(
Header
,
BusinessCatalogLayoutView
,
SideNavLayoutView
,
TagDetailLayoutView
)
{
var
paramObj
=
Utils
.
getUrlState
.
getQueryParams
(),
url
=
Utils
.
getUrlState
.
getQueryUrl
().
queyParams
[
0
];
App
.
rNHeader
.
show
(
new
Header
());
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
(
_
.
extend
({
'tag'
:
tagName
,
...
...
@@ -190,11 +201,24 @@ define([
},
that
.
preFetchedCollectionLists
)
));
}
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
.
selectTab
();
}
if
(
tagName
)
{
// updating paramObj to check for new queryparam.
paramObj
=
Utils
.
getUrlState
.
getQueryParams
();
if
(
paramObj
&&
paramObj
.
dlttag
)
{
return
false
;
}
App
.
rNContent
.
show
(
new
TagDetailLayoutView
(
_
.
extend
({
'tag'
:
tagName
,
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/business_catalog/SideNavLayoutView.js
View file @
138bc6f1
...
...
@@ -74,7 +74,6 @@ define(['require',
}
},
onRender
:
function
()
{
this
.
bindEvent
();
this
.
renderTagLayoutView
();
this
.
renderSearchLayoutView
();
if
(
Globals
.
taxonomy
)
{
...
...
@@ -83,7 +82,6 @@ define(['require',
this
.
selectTab
();
},
bindEvent
:
function
()
{},
rendeBusinessCatalogLayoutView
:
function
()
{
var
that
=
this
;
require
([
'views/business_catalog/BusinessCatalogLayoutView'
],
function
(
BusinessCatalogLayoutView
)
{
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/entity/CreateEntityLayoutView.js
View file @
138bc6f1
...
...
@@ -583,7 +583,11 @@ define(['require',
that
.
callback
();
}
else
{
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',
that
.
hideLoader
();
}
},
setUrl
:
function
(
url
,
create
)
{
Utils
.
setUrl
({
url
:
url
,
mergeBrowserUrl
:
false
,
trigger
:
true
,
updateTabState
:
function
()
{
return
{
tagUrl
:
this
.
url
,
stateChanged
:
true
};
}
});
},
showLoader
:
function
()
{
this
.
$
(
'.entityLoader'
).
show
();
this
.
$
(
'.entityInputData'
).
hide
();
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/schema/SchemaLayoutView.js
View file @
138bc6f1
...
...
@@ -246,7 +246,7 @@ define(['require',
});
});
},
getSchemaTableColumns
:
function
(
deleteEnity
)
{
getSchemaTableColumns
:
function
()
{
var
that
=
this
,
col
=
{
Check
:
{
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/search/SearchResultLayoutView.js
View file @
138bc6f1
...
...
@@ -126,7 +126,7 @@ define(['require',
* @constructs
*/
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
=
""
;
this
.
entityModel
=
new
VEntity
();
this
.
searchCollection
=
new
VSearchList
();
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/tag/TagDetailLayoutView.js
View file @
138bc6f1
...
...
@@ -44,7 +44,7 @@ define(['require',
* @constructs
*/
initialize
:
function
(
options
)
{
_
.
extend
(
this
,
_
.
pick
(
options
,
'tag'
,
'collection'
,
'entityDefCollection'
,
'typeHeaders'
));
_
.
extend
(
this
,
_
.
pick
(
options
,
'tag'
,
'collection'
,
'entityDefCollection'
,
'typeHeaders'
,
'enumDefCollection'
));
},
bindEvents
:
function
()
{},
onRender
:
function
()
{
...
...
@@ -58,20 +58,26 @@ define(['require',
'tag'
:
that
.
tag
,
'searchType'
:
'basic'
};
that
.
RSearchResultLayoutView
.
show
(
new
SearchResultLayoutView
({
value
:
value
,
entityDefCollection
:
that
.
entityDefCollection
,
typeHeaders
:
that
.
typeHeaders
}));
if
(
that
.
RSearchResultLayoutView
)
{
that
.
RSearchResultLayoutView
.
show
(
new
SearchResultLayoutView
({
value
:
value
,
entityDefCollection
:
that
.
entityDefCollection
,
typeHeaders
:
that
.
typeHeaders
,
tagCollection
:
that
.
collection
,
enumDefCollection
:
that
.
enumDefCollection
}));
}
});
},
renderTagAttributeCompositeView
:
function
()
{
var
that
=
this
;
require
([
'views/tag/TagAttributeDetailLayoutView'
],
function
(
TagAttributeDetailLayoutView
)
{
that
.
RTagAttributeDetailLayoutView
.
show
(
new
TagAttributeDetailLayoutView
({
tag
:
that
.
tag
,
collection
:
that
.
collection
}));
if
(
that
.
RTagAttributeDetailLayoutView
)
{
that
.
RTagAttributeDetailLayoutView
.
show
(
new
TagAttributeDetailLayoutView
({
tag
:
that
.
tag
,
collection
:
that
.
collection
}));
}
});
}
});
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/views/tag/TagLayoutView.js
View file @
138bc6f1
...
...
@@ -97,30 +97,40 @@ define(['require',
}
},
setValues
:
function
(
manual
)
{
var
$firstEl
=
this
.
ui
.
tagsParent
.
find
(
'li a'
)
?
this
.
ui
.
tagsParent
.
find
(
'li a'
).
first
()
:
null
;
if
(
Utils
.
getUrlState
.
isTagTab
())
{
if
(
!
this
.
tag
)
{
this
.
selectFirst
=
false
;
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
({
url
:
this
.
ui
.
tagsParent
.
find
(
'li a'
).
first
()
.
attr
(
"href"
),
url
:
$firstEl
.
attr
(
"href"
),
mergeBrowserUrl
:
false
,
trigger
:
true
,
updateTabState
:
function
()
{
return
{
tagUrl
:
this
.
url
,
stateChanged
:
true
};
}
});
}
}
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
({
url
:
Utils
.
getUrlState
.
getQueryUrl
().
hash
,
url
:
url
,
urlParams
:
query
,
updateTabState
:
function
()
{
return
{
tagUrl
:
this
.
url
,
stateChanged
:
true
};
}
});
var
tag
=
Utils
.
getUrlState
.
getLastValue
();
if
(
this
.
tag
)
{
tag
=
this
.
tag
;
if
(
!
presentTag
)
{
return
false
;
}
this
.
ui
.
tagsParent
.
find
(
'li'
).
removeClass
(
'active'
);
var
target
=
this
.
ui
.
tagsParent
.
find
(
'li'
).
filter
(
function
()
{
...
...
@@ -399,26 +409,14 @@ define(['require',
Utils
.
notifySuccess
({
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
urlObj
=
Utils
.
getUrlState
.
getQueryParams
(
searchUrl
);
if
(
urlObj
&&
urlObj
.
tag
&&
urlObj
.
tag
===
that
.
tagName
)
{
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
);
// to update tag list of search tab fetch typeHeaders.
that
.
typeHeaders
.
fetch
({
reset
:
true
});
}
});
...
...
This diff is collapsed.
Click to expand it.
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