From c6a2bc48f6224b598929abec0602317242e8eb95 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Mon, 6 Dec 2021 16:49:24 -0800 Subject: [PATCH] Ticket 44386: Edit via More Actions button on custom queries --- .gitattributes | 1 - .../api/ldk/buttons/ShowEditUIButton.java | 103 ------------------ 2 files changed, 104 deletions(-) delete mode 100644 api/src/org/labkey/api/ldk/buttons/ShowEditUIButton.java diff --git a/.gitattributes b/.gitattributes index 0f1063e5372..72f1ef4e1f7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -814,7 +814,6 @@ api/src/org/labkey/api/laboratory/NavItem.java -text api/src/org/labkey/api/laboratory/SettingsNavItem.java -text api/src/org/labkey/api/laboratory/SummaryNavItem.java -text api/src/org/labkey/api/laboratory/TabbedReportItem.java -text -api/src/org/labkey/api/ldk/buttons/ShowEditUIButton.java -text api/src/org/labkey/api/ldk/table/AbstractTableCustomizer.java -text api/src/org/labkey/api/ldk/table/ButtonConfigFactory.java -text api/src/org/labkey/api/ldk/table/QueryCache.java -text diff --git a/api/src/org/labkey/api/ldk/buttons/ShowEditUIButton.java b/api/src/org/labkey/api/ldk/buttons/ShowEditUIButton.java deleted file mode 100644 index 65b7348650f..00000000000 --- a/api/src/org/labkey/api/ldk/buttons/ShowEditUIButton.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2014-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * 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 org.labkey.api.ldk.buttons; - -import org.labkey.api.data.TableInfo; -import org.labkey.api.ldk.table.SimpleButtonConfigFactory; -import org.labkey.api.module.Module; -import org.labkey.api.security.permissions.Permission; -import org.labkey.api.util.PageFlowUtil; - -import java.util.Map; - -/** - * User: bimber - * Date: 7/14/13 - * Time: 4:05 PM - */ -public class ShowEditUIButton extends SimpleButtonConfigFactory -{ - protected String _schemaName; - protected String _queryName; - private Map _urlParamMap = null; - private boolean _copyFilters = true; - - protected Class[] _perms; - - public ShowEditUIButton(Module owner, String schemaName, String queryName, Class... perms) - { - this(owner, schemaName, queryName, "Edit Records", perms); - } - - public ShowEditUIButton(Module owner, String schemaName, String queryName, String label, Class... perms) - { - super(owner, label, ""); - - _schemaName = schemaName; - _queryName = queryName; - _perms = perms; - } - - @Override - public boolean isAvailable(TableInfo ti) - { - if (!super.isAvailable(ti)) - return false; - - for (Class perm : _perms) - { - if (!ti.getUserSchema().getContainer().hasPermission(ti.getUserSchema().getUser(), perm)) - return false; - } - - return true; - } - - public void setCopyFilters(boolean copyFilters) - { - _copyFilters = copyFilters; - } - - public void setUrlParamMap(Map urlParamMap) - { - _urlParamMap = urlParamMap; - } - - protected String getHandlerName() - { - return "LDK.Utils.editUIButtonHandler"; - } - - @Override - protected String getJsHandler(TableInfo ti) - { - String ret = getHandlerName() + "(" + PageFlowUtil.jsString(ti.getPublicSchemaName()) + "," + PageFlowUtil.jsString(ti.getPublicName()) + ",dataRegionName, {"; - - String delim = ""; - if (_urlParamMap != null) - { - for (String key : _urlParamMap.keySet()) - { - ret += delim + PageFlowUtil.jsString(key) + ":" + PageFlowUtil.jsString(_urlParamMap.get(key)); - delim = ","; - } - } - - ret += "}, " + _copyFilters + ");"; - - return ret; - } -}