@next-libs/cmdb-instances 6.7.1 → 6.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,50 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.7.5](https://github.com/easyops-cn/next-libs/compare/@next-libs/cmdb-instances@6.7.4...@next-libs/cmdb-instances@6.7.5) (2021-10-22)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **cmdb-instances:** instance-list icon tooltip translation issue ([10e6c0f](https://github.com/easyops-cn/next-libs/commit/10e6c0f07e8cce58414049716e8eb96ebded7ba0))
12
+
13
+
14
+
15
+
16
+
17
+ ## [6.7.4](https://github.com/easyops-cn/next-libs/compare/@next-libs/cmdb-instances@6.7.3...@next-libs/cmdb-instances@6.7.4) (2021-10-22)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **cmdb-instance:** 修复显示设置_object_id字段 ([da3c688](https://github.com/easyops-cn/next-libs/commit/da3c688bf2eba62ed96c386a4901649ecbca8eb3))
23
+
24
+
25
+
26
+
27
+
28
+ ## [6.7.3](https://github.com/easyops-cn/next-libs/compare/@next-libs/cmdb-instances@6.7.2...@next-libs/cmdb-instances@6.7.3) (2021-10-22)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **cmdb-instance:** 修复实例来源筛选后删除筛选条件未清空控件选择的值 ([8e34847](https://github.com/easyops-cn/next-libs/commit/8e34847489b181ad8499cdc3ecbaae9340dc51ff))
34
+
35
+
36
+
37
+
38
+
39
+ ## [6.7.2](https://github.com/easyops-cn/next-libs/compare/@next-libs/cmdb-instances@6.7.1...@next-libs/cmdb-instances@6.7.2) (2021-10-20)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * **cmdb-instance:** 父模型实例列表显示实例来源字段修改 ([3db0d91](https://github.com/easyops-cn/next-libs/commit/3db0d91b1541e368912caf48f7fa5b74e07c29f5))
45
+
46
+
47
+
48
+
49
+
6
50
  ## [6.7.1](https://github.com/easyops-cn/next-libs/compare/@next-libs/cmdb-instances@6.7.0...@next-libs/cmdb-instances@6.7.1) (2021-10-20)
7
51
 
8
52
  **Note:** Version bump only for package @next-libs/cmdb-instances
@@ -33,8 +33,8 @@ exports.K = K;
33
33
  K["TITLE_PLACEHOLDER"] = "TITLE_PLACEHOLDER";
34
34
  K["CLICK_TO_FILTER"] = "CLICK_TO_FILTER";
35
35
  K["CLICK_TO_CANCEL_FILTER"] = "CLICK_TO_CANCEL_FILTER";
36
- K["CLICK_TO_HIDDEN"] = " CLICK_TO_HIDDEN";
37
- K["CLICK_TO_SHOW"] = " CLICK_TO_SHOW";
36
+ K["CLICK_TO_HIDDEN"] = "CLICK_TO_HIDDEN";
37
+ K["CLICK_TO_SHOW"] = "CLICK_TO_SHOW";
38
38
  K["RELATED_TO_ME"] = "RELATED_TO_ME";
39
39
  K["DISPLAY_OMITTED_INFORMATION"] = "DISPLAY_OMITTED_INFORMATION";
40
40
  K["CLEAR"] = "CLEAR";
@@ -681,7 +681,8 @@ function InstanceList(props) {
681
681
  aliveHosts: checked
682
682
  });
683
683
  (_props$onAliveHostsCh = props.onAliveHostsChange) === null || _props$onAliveHostsCh === void 0 ? void 0 : _props$onAliveHostsCh.call(props, checked);
684
- };
684
+ }; // istanbul ignore next
685
+
685
686
 
686
687
  const handleConfirm = selectAttrIds => {
687
688
  setState({
@@ -757,10 +758,12 @@ function InstanceList(props) {
757
758
  }
758
759
 
759
760
  return defaultFields;
760
- };
761
+ }; // istanbul ignore next
762
+
761
763
 
762
764
  const handleReset = () => {
763
765
  const fieldIds = handleDefaultFields();
766
+ modelData.isAbstract && fieldIds.push("_object_id");
764
767
  setState({
765
768
  fieldIds
766
769
  });
@@ -980,7 +983,7 @@ function InstanceList(props) {
980
983
  })), state.instanceSourceQuery && /*#__PURE__*/_react.default.createElement(_antd.Tag, {
981
984
  closable: true,
982
985
  onClose: () => {
983
- onInstanceSourceChange(undefined);
986
+ onInstanceSourceChange(null);
984
987
  }
985
988
  }, _i18next.default.t(`${_constants.NS_LIBS_CMDB_INSTANCES}:${_constants.K.INSTANCE_SOURCE_TAG_TEXT}`, {
986
989
  query: (inheritanceModelIdNameMap === null || inheritanceModelIdNameMap === void 0 ? void 0 : inheritanceModelIdNameMap[state.instanceSourceQuery]) || state.instanceSourceQuery
@@ -1009,7 +1012,7 @@ function InstanceList(props) {
1009
1012
  onInstanceSourceChange: onInstanceSourceChange,
1010
1013
  instanceSourceQuery: state.instanceSourceQuery,
1011
1014
  inheritanceModelIdNameMap: inheritanceModelIdNameMap,
1012
- showFilterInstanceSource: props.showFilterInstanceSource,
1015
+ filterInstanceSourceDisabled: props.filterInstanceSourceDisabled,
1013
1016
  autoBreakLine: state.autoBreakLine,
1014
1017
  relationLinkDisabled: props.relationLinkDisabled,
1015
1018
  pageSizeOptions: props.pageSizeOptions,
@@ -131,7 +131,9 @@ function InstanceListModal(props) {
131
131
  permission: props.permission,
132
132
  aliveHosts: fixAliveHosts,
133
133
  fixAliveHosts: fixAliveHosts,
134
+ instanceSourceQuery: props.instanceSourceQuery,
134
135
  searchDisabled: props.searchDisabled,
136
+ filterInstanceSourceDisabled: props.filterInstanceSourceDisabled,
135
137
  advancedSearchDisabled: props.advancedSearchDisabled,
136
138
  aliveHostsDisabled: props.aliveHostsDisabled,
137
139
  relatedToMeDisabled: props.relatedToMeDisabled,
@@ -244,7 +244,7 @@ class LegacyInstanceListTable extends _react.default.Component {
244
244
  mergedColumns = [{
245
245
  title: this.instanceSourceTitle,
246
246
  dataIndex: "_object_id",
247
- ...(this.props.showFilterInstanceSource ? {
247
+ ...(!this.props.filterInstanceSourceDisabled ? {
248
248
  filters: (0, _lodash.map)(this.inheritanceModelIdNameMap, (value, key) => ({
249
249
  text: value,
250
250
  value: key
@@ -137,11 +137,13 @@ class Settings extends _react.default.Component {
137
137
  }
138
138
 
139
139
  render() {
140
+ var _this$state$nextField;
141
+
140
142
  const {
141
143
  title
142
144
  } = this.props;
143
145
  const filterList = this.state.filterList;
144
- const count = this.state.nextFields.length;
146
+ const count = (_this$state$nextField = this.state.nextFields) === null || _this$state$nextField === void 0 ? void 0 : _this$state$nextField.filter(v => v !== "_object_id").length;
145
147
 
146
148
  const extraAttrIds = _constants.extraFieldAttrs.map(extraFieldAttr => extraFieldAttr.id);
147
149
 
@@ -25,8 +25,8 @@ export var K;
25
25
  K["TITLE_PLACEHOLDER"] = "TITLE_PLACEHOLDER";
26
26
  K["CLICK_TO_FILTER"] = "CLICK_TO_FILTER";
27
27
  K["CLICK_TO_CANCEL_FILTER"] = "CLICK_TO_CANCEL_FILTER";
28
- K["CLICK_TO_HIDDEN"] = " CLICK_TO_HIDDEN";
29
- K["CLICK_TO_SHOW"] = " CLICK_TO_SHOW";
28
+ K["CLICK_TO_HIDDEN"] = "CLICK_TO_HIDDEN";
29
+ K["CLICK_TO_SHOW"] = "CLICK_TO_SHOW";
30
30
  K["RELATED_TO_ME"] = "RELATED_TO_ME";
31
31
  K["DISPLAY_OMITTED_INFORMATION"] = "DISPLAY_OMITTED_INFORMATION";
32
32
  K["CLEAR"] = "CLEAR";
@@ -673,7 +673,8 @@ export function InstanceList(props) {
673
673
  aliveHosts: checked
674
674
  });
675
675
  (_props$onAliveHostsCh = props.onAliveHostsChange) === null || _props$onAliveHostsCh === void 0 ? void 0 : _props$onAliveHostsCh.call(props, checked);
676
- };
676
+ }; // istanbul ignore next
677
+
677
678
 
678
679
  var handleConfirm = selectAttrIds => {
679
680
  setState({
@@ -748,10 +749,12 @@ export function InstanceList(props) {
748
749
  }
749
750
 
750
751
  return defaultFields;
751
- };
752
+ }; // istanbul ignore next
753
+
752
754
 
753
755
  var handleReset = () => {
754
756
  var fieldIds = handleDefaultFields();
757
+ modelData.isAbstract && fieldIds.push("_object_id");
755
758
  setState({
756
759
  fieldIds
757
760
  });
@@ -971,7 +974,7 @@ export function InstanceList(props) {
971
974
  })), state.instanceSourceQuery && /*#__PURE__*/React.createElement(Tag, {
972
975
  closable: true,
973
976
  onClose: () => {
974
- onInstanceSourceChange(undefined);
977
+ onInstanceSourceChange(null);
975
978
  }
976
979
  }, i18n.t("".concat(NS_LIBS_CMDB_INSTANCES, ":").concat(K.INSTANCE_SOURCE_TAG_TEXT), {
977
980
  query: (inheritanceModelIdNameMap === null || inheritanceModelIdNameMap === void 0 ? void 0 : inheritanceModelIdNameMap[state.instanceSourceQuery]) || state.instanceSourceQuery
@@ -1000,7 +1003,7 @@ export function InstanceList(props) {
1000
1003
  onInstanceSourceChange: onInstanceSourceChange,
1001
1004
  instanceSourceQuery: state.instanceSourceQuery,
1002
1005
  inheritanceModelIdNameMap: inheritanceModelIdNameMap,
1003
- showFilterInstanceSource: props.showFilterInstanceSource,
1006
+ filterInstanceSourceDisabled: props.filterInstanceSourceDisabled,
1004
1007
  autoBreakLine: state.autoBreakLine,
1005
1008
  relationLinkDisabled: props.relationLinkDisabled,
1006
1009
  pageSizeOptions: props.pageSizeOptions,
@@ -117,7 +117,9 @@ export function InstanceListModal(props) {
117
117
  permission: props.permission,
118
118
  aliveHosts: fixAliveHosts,
119
119
  fixAliveHosts: fixAliveHosts,
120
+ instanceSourceQuery: props.instanceSourceQuery,
120
121
  searchDisabled: props.searchDisabled,
122
+ filterInstanceSourceDisabled: props.filterInstanceSourceDisabled,
121
123
  advancedSearchDisabled: props.advancedSearchDisabled,
122
124
  aliveHostsDisabled: props.aliveHostsDisabled,
123
125
  relatedToMeDisabled: props.relatedToMeDisabled,
@@ -226,7 +226,7 @@ export class LegacyInstanceListTable extends React.Component {
226
226
  mergedColumns = [_objectSpread(_objectSpread({
227
227
  title: this.instanceSourceTitle,
228
228
  dataIndex: "_object_id"
229
- }, this.props.showFilterInstanceSource ? {
229
+ }, !this.props.filterInstanceSourceDisabled ? {
230
230
  filters: map(this.inheritanceModelIdNameMap, (value, key) => ({
231
231
  text: value,
232
232
  value: key
@@ -128,11 +128,13 @@ export class Settings extends React.Component {
128
128
  }
129
129
 
130
130
  render() {
131
+ var _this$state$nextField;
132
+
131
133
  var {
132
134
  title
133
135
  } = this.props;
134
136
  var filterList = this.state.filterList;
135
- var count = this.state.nextFields.length;
137
+ var count = (_this$state$nextField = this.state.nextFields) === null || _this$state$nextField === void 0 ? void 0 : _this$state$nextField.filter(v => v !== "_object_id").length;
136
138
  var extraAttrIds = extraFieldAttrs.map(extraFieldAttr => extraFieldAttr.id);
137
139
  var attrs = filterList.filter(attr => !extraAttrIds.includes(attr.id));
138
140
  var extraAttrs = filterList.filter(attr => extraAttrIds.includes(attr.id));
@@ -23,8 +23,8 @@ export declare enum K {
23
23
  TITLE_PLACEHOLDER = "TITLE_PLACEHOLDER",
24
24
  CLICK_TO_FILTER = "CLICK_TO_FILTER",
25
25
  CLICK_TO_CANCEL_FILTER = "CLICK_TO_CANCEL_FILTER",
26
- CLICK_TO_HIDDEN = " CLICK_TO_HIDDEN",
27
- CLICK_TO_SHOW = " CLICK_TO_SHOW",
26
+ CLICK_TO_HIDDEN = "CLICK_TO_HIDDEN",
27
+ CLICK_TO_SHOW = "CLICK_TO_SHOW",
28
28
  RELATED_TO_ME = "RELATED_TO_ME",
29
29
  DISPLAY_OMITTED_INFORMATION = "DISPLAY_OMITTED_INFORMATION",
30
30
  CLEAR = "CLEAR",
@@ -35,7 +35,7 @@ interface InstanceListProps {
35
35
  selectDisabled?: boolean;
36
36
  pageSizeOptions?: string[];
37
37
  showSizeChanger?: boolean;
38
- showFilterInstanceSource?: boolean;
38
+ filterInstanceSourceDisabled?: boolean;
39
39
  instanceSourceQuery?: string;
40
40
  onSearchExecute?(data: InstanceApi_PostSearchRequestBody, v3Data: InstanceApi_PostSearchV3RequestBody): Promise<InstanceApi_PostSearchV3ResponseBody> | void;
41
41
  onSearch?(value: string): void;
@@ -13,11 +13,13 @@ export interface InstanceListModalProps {
13
13
  presetConfigs?: InstanceListPresetConfigs;
14
14
  permission?: string[];
15
15
  aq?: Query[];
16
+ instanceSourceQuery?: string;
16
17
  searchDisabled?: boolean;
17
18
  advancedSearchDisabled?: boolean;
18
19
  aliveHostsDisabled?: boolean;
19
20
  relatedToMeDisabled?: boolean;
20
21
  moreButtonsDisabled?: boolean;
22
+ filterInstanceSourceDisabled?: boolean;
21
23
  sortDisabled?: boolean;
22
24
  selectDisabled?: boolean;
23
25
  singleSelect?: boolean;
@@ -27,7 +27,7 @@ export interface InstanceListTableProps extends WithTranslation {
27
27
  sortDisabled?: boolean;
28
28
  instanceSourceQuery?: string;
29
29
  inheritanceModelIdNameMap?: Record<string, string>;
30
- showFilterInstanceSource?: boolean;
30
+ filterInstanceSourceDisabled?: boolean;
31
31
  onClickItem?(evt: React.MouseEvent<HTMLAnchorElement, MouseEvent>, id: string): void;
32
32
  onPaginationChange?(pagination: ReadPaginationChangeDetail): void;
33
33
  onSortingChange?(sorting: ReadSortingChangeDetail): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-libs/cmdb-instances",
3
- "version": "6.7.1",
3
+ "version": "6.7.5",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "https://github.com/easyops-cn/next-libs/tree/master/libs/cmdb-instances",
6
6
  "license": "GPL-3.0",
@@ -50,5 +50,5 @@
50
50
  "immutability-helper": "^3.1.1",
51
51
  "marked": "^2.1.3"
52
52
  },
53
- "gitHead": "5dc29fc3114ddda2713689a7bb1803af84a9d02e"
53
+ "gitHead": "480d248e637b35ab4fcfd1d4d87e40dbaf61e9a3"
54
54
  }