ydb-embedded-ui 4.8.0 → 4.8.1

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.8.1](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.8.0...v4.8.1) (2023-06-26)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **Tenants:** fix tenant link ([#439](https://github.com/ydb-platform/ydb-embedded-ui/issues/439)) ([432c621](https://github.com/ydb-platform/ydb-embedded-ui/commit/432c621eb2fb2ffd5a747299af930236d5cc06f7))
9
+
3
10
  ## [4.8.0](https://github.com/ydb-platform/ydb-embedded-ui/compare/v4.7.0...v4.8.0) (2023-06-26)
4
11
 
5
12
 
@@ -120,19 +120,13 @@ enum Panel {
120
120
  UserSettings = 'UserSettings',
121
121
  }
122
122
 
123
- function AsideNavigation(props: AsideNavigationProps) {
123
+ export const useGetLeftNavigationItems = () => {
124
124
  const location = useLocation();
125
125
  const history = useHistory();
126
126
 
127
- const [visiblePanel, setVisiblePanel] = useState<Panel>();
128
-
129
127
  const [initialTenantPage, setInitialTenantPage] = useSetting<string>(TENANT_INITIAL_PAGE_KEY);
130
128
  const {tenantPage = initialTenantPage} = useTypedSelector((state) => state.tenant);
131
129
 
132
- const setIsCompact = (compact: boolean) => {
133
- props.setSettingValue(ASIDE_HEADER_COMPACT_KEY, JSON.stringify(compact));
134
- };
135
-
136
130
  const {pathname} = location;
137
131
  const queryParams = parseQuery(location);
138
132
 
@@ -183,6 +177,20 @@ function AsideNavigation(props: AsideNavigationProps) {
183
177
  });
184
178
  }, [tenantPage, isTenantPage, setInitialTenantPage, history, queryParams]);
185
179
 
180
+ return menuItems;
181
+ };
182
+
183
+ function AsideNavigation(props: AsideNavigationProps) {
184
+ const history = useHistory();
185
+
186
+ const [visiblePanel, setVisiblePanel] = useState<Panel>();
187
+
188
+ const setIsCompact = (compact: boolean) => {
189
+ props.setSettingValue(ASIDE_HEADER_COMPACT_KEY, JSON.stringify(compact));
190
+ };
191
+
192
+ const menuItems = useGetLeftNavigationItems();
193
+
186
194
  return (
187
195
  <React.Fragment>
188
196
  <AsideHeader
@@ -18,14 +18,9 @@ import {AutoFetcher} from '../../utils/autofetcher';
18
18
  import routes, {createHref} from '../../routes';
19
19
  import {formatCPU, formatBytesToGigabyte, formatNumber} from '../../utils';
20
20
  import {withSearch} from '../../HOCS';
21
- import {DEFAULT_TABLE_SETTINGS, TENANT_INITIAL_PAGE_KEY} from '../../utils/constants';
22
- import {TENANT_PAGES_IDS} from '../../store/reducers/tenant/constants';
21
+ import {DEFAULT_TABLE_SETTINGS} from '../../utils/constants';
23
22
  import {getTenantsInfo} from '../../store/reducers/tenants/tenants';
24
- import {
25
- changeFilter,
26
- getSettingValue,
27
- ProblemFilterValues,
28
- } from '../../store/reducers/settings/settings';
23
+ import {changeFilter, ProblemFilterValues} from '../../store/reducers/settings/settings';
29
24
 
30
25
  import {clusterName} from '../../store';
31
26
  import {TenantTabsGroups, TENANT_INFO_TABS} from '../Tenant/TenantPages';
@@ -115,7 +110,6 @@ class Tenants extends React.Component {
115
110
  filter,
116
111
  handleSearchQuery,
117
112
  additionalTenantsInfo = {},
118
- savedTenantInitialTab,
119
113
  } = this.props;
120
114
 
121
115
  const filteredTenantsBySearch = tenants.filter((item) => {
@@ -124,7 +118,6 @@ class Tenants extends React.Component {
124
118
  });
125
119
  const filteredTenants = Tenants.filterTenants(filteredTenantsBySearch, filter);
126
120
 
127
- const initialTenantGeneralTab = savedTenantInitialTab || TENANT_PAGES_IDS.query;
128
121
  const initialTenantInfoTab = TENANT_INFO_TABS[0].id;
129
122
 
130
123
  const getTenantBackend = (tenant) => {
@@ -154,7 +147,6 @@ class Tenants extends React.Component {
154
147
  name: value,
155
148
  backend,
156
149
  [TenantTabsGroups.info]: initialTenantInfoTab,
157
- [TenantTabsGroups.general]: initialTenantGeneralTab,
158
150
  })}
159
151
  />
160
152
  {additionalTenantsInfo.name && additionalTenantsInfo.name(value, row)}
@@ -360,7 +352,6 @@ const mapStateToProps = (state) => {
360
352
  loading,
361
353
  error,
362
354
  filter: state.settings.problemFilter,
363
- savedTenantInitialTab: getSettingValue(state, TENANT_INITIAL_PAGE_KEY),
364
355
  };
365
356
  };
366
357
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "4.8.0",
3
+ "version": "4.8.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],