Skip to content

Commit e3f0525

Browse files
matejkubinecioana-manigadependabot[bot]JiriCtvrtkacatalinaadam
authored
PMM-13652 Native Navigation (#4192)
* PMM-13700 Help center page (#3901) * PMM-13700 created help center page * PMM-13700 added help center unit tests * PMM-13700 fixed majority of comments * PMM-13700 added all styling with sx * PMM-13700 fixed latest comments * PMM-13700 small fixes * PMM-13700 code style fixes * PMM-13700 small changes to card style * PMM-13700 fixed colored top border * PMM-13700 changed value to MUI spacing system --------- Co-authored-by: Matej Kubinec <[email protected]> * PMM-13722 PMM Navigation - Iframe communication (#3787) * PMM-13722 Switch to turborepo, add grafana plugin, shared package * PMM-13722 Update build & switch to yarn * PMM-13722 Fix directory * PMM-13722 Temporarily keep comments in grafana plugin * PMM-13722 Create subroute for UI with navigation & allow embedding * PMM-13722 Move nvmrc * PMM-13722 Cleanup files * PMM-13722 Handle navigation between iframe and PMM * PMM-13722 Add most menu items & handle dashboard variables * PMM-13722 Don't enable pmm-compat unitl navigation is ready * PMM-13722 Refactoring & fixes * PMM-13722 Use correct path for plugin & add description * PMM-13722 Fix plugin image * PMM-13722 Fix updates page * PMM-13722 Improve setup for turborepo * PMM-13722 Sync Grafana theme to PMM UI (light) * PMM-13722 Refactor messenger & add unit tests * PMM-13722 Adjust styles after grafana upgrade * PMM-13722 Handle linking to home page * PMM-13722 Update documentation and cleanup code * PMM-13722 Added in license, author fields and misc cleanup * PMM-13722 Adjust styling * PMM-13722 Add in some navigation items * PMM-13722 Run linter * PMM-13722 Format code * PMM-13722 Fix home link * PMM-13722 Address feedback, remove logs * PMM-13722 Change grafana_image to oss * PMM-13722 Adjust according to comments * PMM-13722 Re-enable kiosk mode, shortcuts & search * PMM-13722 Replace require with import * PMM-13722 Handle anonymous mode * PMM-13722 Fix lint * Bump crate-ci/typos from 1.33.1 to 1.34.0 (#4190) Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.33.1 to 1.34.0. - [Release notes](https://github.com/crate-ci/typos/releases) - [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md) - [Commits](crate-ci/typos@b1ae8d9...392b78f) --- updated-dependencies: - dependency-name: crate-ci/typos dependency-version: 1.34.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * PMM-12548 Doc for Mongolog query source. (#4171) * PMM-12548 Basic mentions. * PMM-12548 Extended mongolog description. * linguistic review * formatting and toc * formatting * Update documentation/docs/install-pmm/install-pmm-client/connect-database/mongodb/mongolog.md Co-authored-by: Nurlan Moldomurov <[email protected]> * feedback from Nurlan * merged topics * formatting * formatting * formatting * formatting * formatting * formatting * format * Update documentation/docs/install-pmm/install-pmm-client/connect-database/mongodb/mongodb.md Co-authored-by: Nurlan Moldomurov <[email protected]> * PMM-12548 Changes to doc. --------- Co-authored-by: Catalina A <[email protected]> Co-authored-by: Catalina A <[email protected]> Co-authored-by: Nurlan Moldomurov <[email protected]> * PMM-13978 Perfschema query examples (#4172) * PMM-13978 Limitation of perfschema examples. * PMM-13978 Format. * linguistic review * feedback from Jiri * format * added requirements * feedback from Nurlan * PMM-13978 Add refresh rate mention. * PMM-13978 Minimum requirements. * PMM-13978 Mention about read permissions. * formatting * PMM-13978 Changes. * PMM-13978 Typo. --------- Co-authored-by: Catalina A <[email protected]> Co-authored-by: Catalina A <[email protected]> * [DOCS] Improve HA topic (#3511) * replicated PMM2 improvements to HA * wording improvements * wording * Update documentation/docs/install-pmm/HA.md Co-authored-by: Nurlan Moldomurov <[email protected]> * updated pmm 2 references * PMM-13727 Fix env variables and ports * PMM-7 Fix PG env variables. * fix: HA documentation * fix: advisor check variables * Update documentation/docs/install-pmm/HA.md Co-authored-by: Santo <[email protected]> * moved HA topic after PMM set up * Revert "moved HA topic after PMM set up" This reverts commit 6f3f86b. * fixed links * chore: add HA descriptions * Update documentation/docs/install-pmm/install-pmm-server/deployment-options/docker/preview_env_var.md Co-authored-by: Santo <[email protected]> * chore: fix links in README.md * reorganize * FORMATTING * simplified names * formatting * rewording * wording * removed extra spaces * formatting * formatting * feedback from Nailya * feedback from Nailya --------- Co-authored-by: Nurlan Moldomurov <[email protected]> Co-authored-by: Alex Demidoff <[email protected]> Co-authored-by: Santo <[email protected]> Co-authored-by: Jiří Čtvrtka <[email protected]> * PMM-14151 Fix TlsSkipVerify value in GetAgent response (#4198) * PMM-13722 Handle browser history & document title * PMM-13722 Add in missing prop value * PMM-13722 Add in missing provider value in tests --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiří Čtvrtka <[email protected]> Co-authored-by: Catalina A <[email protected]> Co-authored-by: Catalina A <[email protected]> Co-authored-by: Nurlan Moldomurov <[email protected]> Co-authored-by: Alex Demidoff <[email protected]> Co-authored-by: Santo <[email protected]> Co-authored-by: Jiří Čtvrtka <[email protected]> Co-authored-by: Alex Demidoff <[email protected]> * PMM-13699 Native Navigation - Sidebar (#4211) * PMM-13699 Add improved sidebar * PMM-13699 Fix unit tests * PMM-13699 Improve sidebar styling * PMM-13699 Adjust help center page * PMM-13699 Use different icons for theme switch * PMM-13699 Refactor icons * PMM-13699 Add welcome card for help center * PMM-13699 Improve Card presentation add base dark mode color * PMM-13699 Adjust styling * PMM-13699 Add unit tests * PMM-13699 Adjust welcome card and handle navigation permission * PMM-13699 Improve grafana full screen * PMM-13699 Handle anonymous mode sign in * PMM-13699 Improve drawer styling * PMM-13699 Colorize scrollbars & remove margin on Grafana page * PMM-13699 Make sidebar open button more accessible * PMM-13699 Fix build errors * PMM-13699 Fix unit tests * PMM-13699 Fix lint * PMM-13699 Add other dashboards link * PMM-13699 Address some comments from design review * PMM-13699 Fix keyboard shortcuts triggering * PMM-13699 Adjust navitem styling * PMM-13699 Fix unit tests & build * PMM-13699 Fix spacing on navigation heading * PMM-13699 Refactor navitem styles * PMM-13699 Refactoring * PMM-13699 Highlight only leaf node * PMM-13699 Provide tooltips for menu items * PMM-13699 Adjust tooltip delay & provide description to view shortcuts button * PMM-13699 Set owner and group for UI folders * PMM-13699 Add margin to leaf navitem * PMM-13699 Improve sidebar animation * PMM-13699 Cache lazy loaded icons * PMM-13699 Improve navitem styles * PMM-13699 Lint and update unit tests * PMM-13699 Update contact support link * PMM-13699 Fix tooltip * PMM-13699 Store sidebar expanded state in local storage * PMM-13699 Fix lint error * PMM-13699 Add in dependency * PMM-13652 Enable native navigation by default * PMM-13652 Match navitem variables with v3 * PMM 13702 theme toggle button compatibility dark theme (#4682) * PMM-13702:UI theme toggle button and compatibility with dark theme * resolve errors * Please enter the commit message for your changes. Lines starting * resolve unit testes errros * resolve lint errors * ci: retrigger checks * return docker-compose yml to it start version * revert vite config * revert code * PMM-13702: Step A — ThemeProvider/Context + wrap in main (no messenger yet) * add chamges in ui/apps/pmm-compat/src/compat * resolve lint erros in compat * theme: broadcast CHANGE_THEME on local toggle and persist preferences; restore App/NavItem to baseline * tests/theme: remove unused useGrafanaThemeSyncOnce and vitest.config; tidy setupTests * revert file ui/apps/pmm-compat/src/contexts/theme/theme.provider * PMM-13702: refactor GrafanaProvider – clean messenger typing, remove html attrs, fully typed without any * refactoring code in compat.ts * refactoring code in theme.ts * refactor code in setTheme * revert docker-compose * resolve issues after review * add new file apps/pmm-compat/src/utils/themeEvent * clear code * resolve feedback from Matej in grafana.provider * revert some changes in GrafanaProvider * delete setTheme file and add logic in useColorMode * resolve issue with GrafanaProvider * resolve feedback review LOCATION_CHANGE in GrafanaProvider * delete parseThemeChangedEvent * PMM-13707 Onboarding tour (#4691) * PMM-13707 Add product tour * PMM-13707 Add in alerting tour & improve tour handling * PMM-13707 Add in check for "Add service" button * PMM-13707 Refactoring * PMM-13707 Add in unit tests for tour components * PMM-13707 Add in documentation links * PMM-13707 Update WelcomeCard and HelpCenter tests * PMM-13707 Add in missing docs link * PMM-13707 Show help page upon first login * PMM-13707 Add in survey url * PMM-13707 Enable api calls for correct roles * PMM-13707 Improve spacing of buttons on welcome card * PMM-13707 Optimize imports & refactoring * PMM-13707 Reset product tour after upgrade * PMM-13707 Resolve copilot comments * PMM-14510 Fix auto-collapsing issue on native navigation (#4738) * PMM-14510 Fix auto-collapsing issue on native navigation * PMM-14510 Memoize navitem active state * PMM-14510 Refactor findActiveNavItem to prefer deep nested item * PMM-13652 Improve location sending (#4745) * PMM-13652 Improve location sending * PMM-13652 Revert and remove POP check * PMM-13652 Refactor check before sending location to Grafana * PMM-14253 Update flow (#4525) * PMM-14253 Add update modal * PMM-14253 Add second modal * PMM-14253 Add version info * PMM-14254 Add snooze count & snooze timestamp * PMM-14253 Fix unit test * PMM-14253 Fix snooze count * PMM-14253 Add snooze api route * PMM-14253 Add settings for snooze duration * PMM-14253 * PMM-14253 Update FE with new snooze endpoint * PMM-14253 Fix FE build * PMM-14253 Refactor api * PMM-14253 Refactor FE to handle updated apid * PMM-14253 Add api and unit tests * PMM-14253 Change copyright date * PMM-14253 Use Assert.Empty * PMM-14253 Extend unit tests * PMM-14253 Add in unit tests for FE * PMM-14253 Refactor delayed rendering * PMM-14253 Run lint and format * PMM-14253 Extend user unit test * PMM-14253 Add tests around user flags * PMM-14253 Run gen & format * PMM-14253 Add check for release delay * PMM-14253 Unify different utils and types folders * PMM-14253 Remove todo * PMM-14253 Remove .only from test suite * PMM-14253 Fix import * PMM-14253 Update modal content * PMM-14253 Fix unit test for UpdateModal * PMM-14253 Cleanup code * PMM-14253 Use correct miliseconds for hour * PMM-14253 Resolve copilot comments * PMM-14253 Refactor UpdateModal and improve dark mode support * PMM-14253 Improve loading & * PMM-14253 Remove snooze update endpoint * PMM-14253 Remove unused import * PMM-14253 Fix snooze count check * PMM-13253 Make gen & format * PMM-14253 Update apit test for snooze * PMM-14253 Initialize userClient and update snoozed_at check * PMM-14253 Remove testing code * PMM-14253 Make default snooze duration a constant * PMM-14253 Correctly set snooze duration in database * PMM-14253 Reorder migrations correctly * PMM-14253 Move comment to previous position * PMM-13652 Correctly handle update clients page on native navigation (#4751) * PMM-13652 Correcly handle update clients page on native navigation * PMM-13652 Make home link props optional * PMM-13652 Add Valkey dashboards to menu (#4778) * PMM-13652 Update navigation titles, add missing items & fix bugs (#4783) * PMM-13652 Disable pmm-compat by default * PMM-13652 Merge all migrations into one --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: ioana-maniga <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiří Čtvrtka <[email protected]> Co-authored-by: Catalina A <[email protected]> Co-authored-by: Catalina A <[email protected]> Co-authored-by: Nurlan Moldomurov <[email protected]> Co-authored-by: Alex Demidoff <[email protected]> Co-authored-by: Santo <[email protected]> Co-authored-by: Jiří Čtvrtka <[email protected]> Co-authored-by: Alex Demidoff <[email protected]> Co-authored-by: dmitri-saricev-3pillargloball <[email protected]>
1 parent 66e9ff5 commit e3f0525

File tree

434 files changed

+19374
-940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

434 files changed

+19374
-940
lines changed

api-tests/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ build:
1010
go test -c -v ./inventory
1111
go test -c -v ./management
1212
go test -c -v ./server
13+
go test -c -v ./user
1314

1415
run:
1516
go test -count=1 -p 1 -v ./... 2>&1 | tee pmm-api-tests-output.txt

api-tests/init.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import (
4444
managementClient "github.com/percona/pmm/api/management/v1/json/client"
4545
platformClient "github.com/percona/pmm/api/platform/v1/json/client"
4646
serverClient "github.com/percona/pmm/api/server/v1/json/client"
47+
userClient "github.com/percona/pmm/api/user/v1/json/client"
4748
"github.com/percona/pmm/utils/tlsconfig"
4849
)
4950

@@ -203,6 +204,7 @@ func init() {
203204
alertingClient.Default = alertingClient.New(transport, nil)
204205
advisorClient.Default = advisorClient.New(transport, nil)
205206
actionsClient.Default = actionsClient.New(transport, nil)
207+
userClient.Default = userClient.New(transport, nil)
206208

207209
// do not run tests if server is not available
208210
_, err = serverClient.Default.ServerService.Readiness(nil)

api-tests/user/snooze_test.go

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// Copyright (C) 2023 Percona LLC
2+
//
3+
// This program is free software: you can redistribute it and/or modify
4+
// it under the terms of the GNU Affero General Public License as published by
5+
// the Free Software Foundation, either version 3 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful,
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU Affero General Public License for more details.
12+
//
13+
// You should have received a copy of the GNU Affero General Public License
14+
// along with this program. If not, see <https://www.gnu.org/licenses/>.
15+
16+
package user
17+
18+
import (
19+
"testing"
20+
"time"
21+
22+
"github.com/AlekSi/pointer"
23+
"github.com/stretchr/testify/assert"
24+
"github.com/stretchr/testify/require"
25+
26+
_ "github.com/percona/pmm/api-tests"
27+
userClient "github.com/percona/pmm/api/user/v1/json/client"
28+
userService "github.com/percona/pmm/api/user/v1/json/client/user_service"
29+
)
30+
31+
func TestUpdateSnoozing(t *testing.T) {
32+
t.Run("provides default snooze information in user info", func(t *testing.T) {
33+
res, err := userClient.Default.UserService.GetUser(nil)
34+
35+
require.NoError(t, err)
36+
37+
assert.Empty(t, res.Payload.SnoozedPMMVersion)
38+
assert.Equal(t, time.Time{}, time.Time(res.Payload.SnoozedAt))
39+
assert.Equal(t, int64(0), res.Payload.SnoozeCount)
40+
})
41+
42+
t.Run("snoozes the update", func(t *testing.T) {
43+
res, err1 := userClient.Default.UserService.UpdateUser(&userService.UpdateUserParams{
44+
Body: userService.UpdateUserBody{
45+
SnoozedPMMVersion: pointer.ToString("1.0.0"),
46+
},
47+
})
48+
49+
require.NoError(t, err1)
50+
51+
assert.Equal(t, "1.0.0", res.Payload.SnoozedPMMVersion)
52+
assert.WithinDuration(t, time.Now(), time.Time(res.Payload.SnoozedAt), 1*time.Second)
53+
assert.Equal(t, int64(1), res.Payload.SnoozeCount)
54+
})
55+
56+
t.Run("increments the snooze count", func(t *testing.T) {
57+
res, err := userClient.Default.UserService.UpdateUser(&userService.UpdateUserParams{
58+
Body: userService.UpdateUserBody{
59+
SnoozedPMMVersion: pointer.ToString("1.0.0"),
60+
},
61+
})
62+
63+
require.NoError(t, err)
64+
65+
assert.Equal(t, "1.0.0", res.Payload.SnoozedPMMVersion)
66+
assert.WithinDuration(t, time.Now(), time.Time(res.Payload.SnoozedAt), 1*time.Second)
67+
assert.Equal(t, int64(2), res.Payload.SnoozeCount)
68+
})
69+
70+
t.Run("resets the snooze count when version is different", func(t *testing.T) {
71+
res, err := userClient.Default.UserService.UpdateUser(&userService.UpdateUserParams{
72+
Body: userService.UpdateUserBody{
73+
SnoozedPMMVersion: pointer.ToString("2.0.0"),
74+
},
75+
})
76+
77+
require.NoError(t, err)
78+
79+
assert.Equal(t, "2.0.0", res.Payload.SnoozedPMMVersion)
80+
assert.WithinDuration(t, time.Now(), time.Time(res.Payload.SnoozedAt), 1*time.Second)
81+
assert.Equal(t, int64(1), res.Payload.SnoozeCount)
82+
})
83+
}

api/server/v1/json/client/server_service/change_settings_responses.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/server/v1/json/client/server_service/get_settings_responses.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/server/v1/json/v1.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@
312312
"description": "True if Query Analytics for PMM's internal PG database is enabled.",
313313
"type": "boolean",
314314
"x-order": 17
315+
},
316+
"update_snooze_duration": {
317+
"type": "string",
318+
"title": "Duration for which an update is snoozed",
319+
"x-order": 18
315320
}
316321
},
317322
"x-order": 0
@@ -489,6 +494,11 @@
489494
"type": "boolean",
490495
"x-nullable": true,
491496
"x-order": 13
497+
},
498+
"update_snooze_duration": {
499+
"description": "A number of full days for which an update is snoozed, i.e. a multiple of 24h: 2592000s, 43200m, 720h.",
500+
"type": "string",
501+
"x-order": 14
492502
}
493503
}
494504
}
@@ -631,6 +641,11 @@
631641
"description": "True if Query Analytics for PMM's internal PG database is enabled.",
632642
"type": "boolean",
633643
"x-order": 17
644+
},
645+
"update_snooze_duration": {
646+
"type": "string",
647+
"title": "Duration for which an update is snoozed",
648+
"x-order": 18
634649
}
635650
},
636651
"x-order": 0

api/server/v1/server.pb.go

Lines changed: 62 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)