[MM-37772] Idiomatic naming (URL, URI, API) (#18128)

* s/Url/URL/g & s/Uri/URI/g

* s/Api/API/g
Этот коммит содержится в:
Ben Schumacher
2021-08-16 19:46:44 +02:00
коммит произвёл GitHub
родитель a7f5512ff3
Коммит 757dc96461
155 изменённых файлов: 1680 добавлений и 1681 удалений

Просмотреть файл

@@ -61,7 +61,7 @@ type TestNewConfig struct {
}
type TestNewServiceSettings struct {
SiteUrl *string
SiteURL *string
UseLetsEncrypt *bool
TLSStrictTransportMaxAge *int64
AllowedThemes []string
@@ -483,7 +483,7 @@ func TestUpdateMap(t *testing.T) {
// create a config to make changes
config := TestNewConfig{
TestNewServiceSettings{
SiteUrl: model.NewString("abc.def"),
SiteURL: model.NewString("abc.def"),
UseLetsEncrypt: model.NewBool(false),
TLSStrictTransportMaxAge: model.NewInt64(36),
AllowedThemes: []string{"Hello", "World"},
@@ -505,7 +505,7 @@ func TestUpdateMap(t *testing.T) {
}{
{
Name: "check for Map and string",
configSettings: []string{"TestNewServiceSettings", "SiteUrl"},
configSettings: []string{"TestNewServiceSettings", "SiteURL"},
newVal: []string{"siteurl"},
expected: "siteurl",
},

Просмотреть файл

@@ -245,9 +245,9 @@ func modifyIncomingWebhookCmdF(command *cobra.Command, args []string) (cmdError
if description != "" {
updatedHook.Description = description
}
iconUrl, _ := command.Flags().GetString("icon")
if iconUrl != "" {
updatedHook.IconURL = iconUrl
iconURL, _ := command.Flags().GetString("icon")
if iconURL != "" {
updatedHook.IconURL = iconURL
}
channelLocked, _ := command.Flags().GetBool("lock-to-channel")
updatedHook.ChannelLocked = channelLocked

Просмотреть файл

@@ -218,18 +218,18 @@ func TestModifyIncomingWebhook(t *testing.T) {
modifiedDescription := "myhookincdesc2"
modifiedDisplayName := "myhookincname2"
modifiedIconUrl := "myhookincicon2"
modifiedIconURL := "myhookincicon2"
modifiedChannelLocked := true
modifiedChannelId := th.BasicChannel2.Id
th.CheckCommand(t, "webhook", "modify-incoming", oldHook.Id, "--channel", modifiedChannelId, "--description", modifiedDescription, "--display-name", modifiedDisplayName, "--icon", modifiedIconUrl, "--lock-to-channel", strconv.FormatBool(modifiedChannelLocked))
th.CheckCommand(t, "webhook", "modify-incoming", oldHook.Id, "--channel", modifiedChannelId, "--description", modifiedDescription, "--display-name", modifiedDisplayName, "--icon", modifiedIconURL, "--lock-to-channel", strconv.FormatBool(modifiedChannelLocked))
modifiedHook, err := th.App.GetIncomingWebhook(oldHook.Id)
require.Nil(t, err, "unable to retrieve modified incoming webhook")
successUpdate := modifiedHook.DisplayName != modifiedDisplayName ||
modifiedHook.Description != modifiedDescription ||
modifiedHook.IconURL != modifiedIconUrl ||
modifiedHook.IconURL != modifiedIconURL ||
modifiedHook.ChannelLocked != modifiedChannelLocked ||
modifiedHook.ChannelId != modifiedChannelId
require.False(t, successUpdate, "Failed to update incoming webhook")