Deprecate admin advisor (#26045)
* Deprecate admin advisor * Webapp portion * More webapp deprecation * More cleanup * Linting * emoved metric ack dialog from annoucenemet bar * Cleanued up uninsed i18n strings * Updated test * fixed types * Updating server test * Updated i18n * Updated cypress test: * Updated cypress test: --------- Co-authored-by: harshil Sharma <harshilsharma63@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
dc8fc773dc
Коммит
e9b9d4ff60
@@ -146,20 +146,6 @@ func (_m *SystemStore) SaveOrUpdate(system *model.System) error {
|
||||
return r0
|
||||
}
|
||||
|
||||
// SaveOrUpdateWithWarnMetricHandling provides a mock function with given fields: system
|
||||
func (_m *SystemStore) SaveOrUpdateWithWarnMetricHandling(system *model.System) error {
|
||||
ret := _m.Called(system)
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(*model.System) error); ok {
|
||||
r0 = rf(system)
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Update provides a mock function with given fields: system
|
||||
func (_m *SystemStore) Update(system *model.System) error {
|
||||
ret := _m.Called(system)
|
||||
|
||||
@@ -22,7 +22,6 @@ func TestSystemStore(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
t.Run("InsertIfExists", func(t *testing.T) {
|
||||
testInsertIfExists(t, rctx, ss)
|
||||
})
|
||||
t.Run("SaveOrUpdateWithWarnMetricHandling", func(t *testing.T) { testSystemStoreSaveOrUpdateWithWarnMetricHandling(t, rctx, ss) })
|
||||
t.Run("GetByNameNoEntries", func(t *testing.T) { testSystemStoreGetByNameNoEntries(t, rctx, ss) })
|
||||
}
|
||||
|
||||
@@ -73,33 +72,6 @@ func testSystemStoreSaveOrUpdate(t *testing.T, rctx request.CTX, ss store.Store)
|
||||
assert.Equal(t, system.Value, res.Value)
|
||||
}
|
||||
|
||||
func testSystemStoreSaveOrUpdateWithWarnMetricHandling(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
system := &model.System{Name: model.NewId(), Value: "value"}
|
||||
|
||||
err := ss.System().SaveOrUpdateWithWarnMetricHandling(system)
|
||||
require.NoError(t, err)
|
||||
|
||||
_, err = ss.System().GetByName(model.SystemWarnMetricLastRunTimestampKey)
|
||||
assert.Error(t, err)
|
||||
|
||||
system.Name = "warn_metric_number_of_active_users_100"
|
||||
system.Value = model.WarnMetricStatusRunonce
|
||||
err = ss.System().SaveOrUpdateWithWarnMetricHandling(system)
|
||||
require.NoError(t, err)
|
||||
|
||||
val1, nerr := ss.System().GetByName(model.SystemWarnMetricLastRunTimestampKey)
|
||||
assert.NoError(t, nerr)
|
||||
|
||||
system.Name = "warn_metric_number_of_active_users_100"
|
||||
system.Value = model.WarnMetricStatusAck
|
||||
err = ss.System().SaveOrUpdateWithWarnMetricHandling(system)
|
||||
require.NoError(t, err)
|
||||
|
||||
val2, nerr := ss.System().GetByName(model.SystemWarnMetricLastRunTimestampKey)
|
||||
assert.NoError(t, nerr)
|
||||
assert.Equal(t, val1, val2)
|
||||
}
|
||||
|
||||
func testSystemStoreGetByNameNoEntries(t *testing.T, rctx request.CTX, ss store.Store) {
|
||||
res, nErr := ss.System().GetByName(model.SystemFirstAdminVisitMarketplace)
|
||||
_, ok := nErr.(*store.ErrNotFound)
|
||||
|
||||
Ссылка в новой задаче
Block a user