Remove key_map_type edit preference
The key_map_type preference was only used by CodeMirror in the GWT UI. Since the GWT UI is gone this preference is no longer needed. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I962a3ab57c60a0a2a84e1f3e1992f78f005e5346
This commit is contained in:
@@ -1503,7 +1503,6 @@ link:#edit-preferences-info[EditPreferencesInfo] entity.
|
||||
|
||||
)]}'
|
||||
{
|
||||
"key_map_type": "VIM",
|
||||
"tab_size": 4,
|
||||
"line_length": 80,
|
||||
"indent_unit": 2,
|
||||
@@ -1535,7 +1534,6 @@ link:#edit-preferences-info[EditPreferencesInfo] entity.
|
||||
Content-Type: application/json;charset=UTF-8
|
||||
|
||||
{
|
||||
"key_map_type": "VIM",
|
||||
"tab_size": 4,
|
||||
"line_length": 80,
|
||||
"indent_unit": 2,
|
||||
@@ -1562,7 +1560,6 @@ link:#edit-preferences-info[EditPreferencesInfo] entity.
|
||||
|
||||
)]}'
|
||||
{
|
||||
"key_map_type": "VIM",
|
||||
"tab_size": 4,
|
||||
"line_length": 80,
|
||||
"cursor_blink_rate": 530,
|
||||
@@ -2564,9 +2561,6 @@ preferences of a user.
|
||||
[options="header",cols="1,^1,5"]
|
||||
|===========================================
|
||||
|Field Name ||Description
|
||||
|`key_map_type` ||
|
||||
The CodeMirror key map. Currently only a subset of key maps are
|
||||
supported: `DEFAULT`, `EMACS`, `SUBLIME`, `VIM`.
|
||||
|`tab_size` ||
|
||||
Number of spaces that should be used to display one tab.
|
||||
|`line_length` ||
|
||||
|
||||
@@ -30,7 +30,6 @@ public class EditPreferencesInfo {
|
||||
public Boolean indentWithTabs;
|
||||
public Boolean autoCloseBrackets;
|
||||
public Boolean showBase;
|
||||
public KeyMapType keyMapType;
|
||||
|
||||
public static EditPreferencesInfo defaults() {
|
||||
EditPreferencesInfo i = new EditPreferencesInfo();
|
||||
@@ -48,7 +47,6 @@ public class EditPreferencesInfo {
|
||||
i.indentWithTabs = false;
|
||||
i.autoCloseBrackets = false;
|
||||
i.showBase = false;
|
||||
i.keyMapType = KeyMapType.DEFAULT;
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
// Copyright (C) 2015 The Android Open Source Project
|
||||
//
|
||||
// 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 com.google.gerrit.extensions.client;
|
||||
|
||||
public enum KeyMapType {
|
||||
DEFAULT,
|
||||
EMACS,
|
||||
SUBLIME,
|
||||
VIM
|
||||
}
|
||||
@@ -26,7 +26,6 @@ import com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailFormat;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy;
|
||||
import com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat;
|
||||
import com.google.gerrit.extensions.client.KeyMapType;
|
||||
import com.google.gerrit.extensions.client.MenuItem;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -194,8 +193,6 @@ public abstract class Preferences {
|
||||
|
||||
public abstract Optional<Boolean> showBase();
|
||||
|
||||
public abstract Optional<KeyMapType> keyMapType();
|
||||
|
||||
@AutoValue.Builder
|
||||
public abstract static class Builder {
|
||||
abstract Builder tabSize(@Nullable Integer val);
|
||||
@@ -226,8 +223,6 @@ public abstract class Preferences {
|
||||
|
||||
abstract Builder showBase(@Nullable Boolean val);
|
||||
|
||||
abstract Builder keyMapType(@Nullable KeyMapType val);
|
||||
|
||||
abstract Edit build();
|
||||
}
|
||||
|
||||
@@ -247,7 +242,6 @@ public abstract class Preferences {
|
||||
.indentWithTabs(info.indentWithTabs)
|
||||
.autoCloseBrackets(info.autoCloseBrackets)
|
||||
.showBase(info.showBase)
|
||||
.keyMapType(info.keyMapType)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -267,7 +261,6 @@ public abstract class Preferences {
|
||||
info.indentWithTabs = indentWithTabs().orElse(null);
|
||||
info.autoCloseBrackets = autoCloseBrackets().orElse(null);
|
||||
info.showBase = showBase().orElse(null);
|
||||
info.keyMapType = keyMapType().orElse(null);
|
||||
return info;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
import com.google.gerrit.acceptance.NoHttpd;
|
||||
import com.google.gerrit.extensions.client.EditPreferencesInfo;
|
||||
import com.google.gerrit.extensions.client.KeyMapType;
|
||||
import org.junit.Test;
|
||||
|
||||
@NoHttpd
|
||||
@@ -42,7 +41,6 @@ public class EditPreferencesIT extends AbstractDaemonTest {
|
||||
assertThat(out.indentWithTabs).isNull();
|
||||
assertThat(out.autoCloseBrackets).isNull();
|
||||
assertThat(out.showBase).isNull();
|
||||
assertThat(out.keyMapType).isEqualTo(KeyMapType.DEFAULT);
|
||||
|
||||
// change some default values
|
||||
out.lineLength = 80;
|
||||
@@ -59,7 +57,6 @@ public class EditPreferencesIT extends AbstractDaemonTest {
|
||||
out.indentWithTabs = true;
|
||||
out.autoCloseBrackets = true;
|
||||
out.showBase = true;
|
||||
out.keyMapType = KeyMapType.EMACS;
|
||||
|
||||
EditPreferencesInfo info = gApi.accounts().id(admin.id().toString()).setEditPreferences(out);
|
||||
|
||||
@@ -91,6 +88,5 @@ public class EditPreferencesIT extends AbstractDaemonTest {
|
||||
assertThat(out.indentWithTabs).isEqualTo(in.indentWithTabs);
|
||||
assertThat(out.autoCloseBrackets).isEqualTo(in.autoCloseBrackets);
|
||||
assertThat(out.showBase).isEqualTo(in.showBase);
|
||||
assertThat(out.keyMapType).isEqualTo(in.keyMapType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user