-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#4226 - Display logout button on annotation page if dashboard access …
…is disabled - Added logout button to the annotation action bar if the menu bar is not accessible - If menubar is accessible, the logout button should always be there - If logging out while auto-login is enabled, make sure to pass the skip-auto-login parameter to the login page - Allow items in the annotation action bar to grow which allows the logout button to be positioned at the far right - Improve scaling of the annotation action bar when window is resized
- Loading branch information
Showing
10 changed files
with
181 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...p/clarin/webanno/ui/annotation/actionbar/closesession/CloseSessionActionBarExtension.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Licensed to the Technische Universität Darmstadt under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The Technische Universität Darmstadt | ||
* licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package de.tudarmstadt.ukp.clarin.webanno.ui.annotation.actionbar.closesession; | ||
|
||
import org.apache.wicket.markup.html.panel.Panel; | ||
import org.springframework.core.annotation.Order; | ||
|
||
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.actionbar.ActionBarExtension; | ||
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.page.AnnotationPageBase; | ||
import de.tudarmstadt.ukp.clarin.webanno.ui.annotation.config.AnnotationUIAutoConfiguration; | ||
import de.tudarmstadt.ukp.inception.ui.core.menubar.MenuBar; | ||
|
||
/** | ||
* <p> | ||
* This class is exposed as a Spring Component via | ||
* {@link AnnotationUIAutoConfiguration#annotationCloseSessionActionBarExtension}. | ||
* </p> | ||
*/ | ||
@Order(10000) | ||
public class CloseSessionActionBarExtension | ||
implements ActionBarExtension | ||
{ | ||
@Override | ||
public boolean accepts(AnnotationPageBase aPage) | ||
{ | ||
return aPage.visitChildren(MenuBar.class, (c, v) -> { | ||
v.stop(!((MenuBar) c).isVisible()); | ||
}); | ||
} | ||
|
||
@Override | ||
public Panel createActionBarItem(String aId, AnnotationPageBase aPage) | ||
{ | ||
return new CloseSessionPanel(aId, aPage); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...udarmstadt/ukp/clarin/webanno/ui/annotation/actionbar/closesession/CloseSessionPanel.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
Licensed to the Technische Universität Darmstadt under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The Technische Universität Darmstadt | ||
licenses this file to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<html xmlns:wicket="http://wicket.apache.org"> | ||
|
||
<body> | ||
<wicket:panel> | ||
<div class="d-flex flex-grow-1"> | ||
<div class="flex-grow-1" /> | ||
<div class="action-bar-group"> | ||
<div class="btn-group"> | ||
<button wicket:id="logoutButton" class="btn btn-action-bar" type="button" wicket:message="title:logOut"> | ||
<div class="text-nowrap"> | ||
<i class="fas fa-sign-out-alt"/> | ||
</div> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</wicket:panel> | ||
</body> | ||
|
||
</html> |
48 changes: 48 additions & 0 deletions
48
...udarmstadt/ukp/clarin/webanno/ui/annotation/actionbar/closesession/CloseSessionPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Licensed to the Technische Universität Darmstadt under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The Technische Universität Darmstadt | ||
* licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package de.tudarmstadt.ukp.clarin.webanno.ui.annotation.actionbar.closesession; | ||
|
||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
import org.apache.wicket.markup.html.panel.Panel; | ||
import org.apache.wicket.spring.injection.annot.SpringBean; | ||
|
||
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.page.AnnotationPageBase; | ||
import de.tudarmstadt.ukp.clarin.webanno.security.config.LoginProperties; | ||
import de.tudarmstadt.ukp.clarin.webanno.security.config.PreauthenticationProperties; | ||
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxLink; | ||
import de.tudarmstadt.ukp.clarin.webanno.ui.core.logout.LogoutPanel; | ||
|
||
public class CloseSessionPanel | ||
extends Panel | ||
{ | ||
private static final long serialVersionUID = -9213541738534665790L; | ||
|
||
private @SpringBean PreauthenticationProperties preauthenticationProperties; | ||
private @SpringBean LoginProperties securityProperties; | ||
|
||
public CloseSessionPanel(String aId, AnnotationPageBase aPage) | ||
{ | ||
super(aId); | ||
queue(new LambdaAjaxLink("logoutButton", this::actionLogout)); | ||
} | ||
|
||
private void actionLogout(AjaxRequestTarget aTarget) | ||
{ | ||
LogoutPanel.actionLogout(this, preauthenticationProperties, securityProperties); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ redo=Redo | |
moveUp=Up | ||
moveDown=Down | ||
busy=Busy... | ||
logOut=Log out | ||
|
||
enabled=Enabled | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters