foreman_resource_quota 0.6.4 → 0.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92a959b75793d21e8a5cc861335fc1db2a1a6d462714e1c74228b4cfc8b67498
4
- data.tar.gz: 34086e312df966c02a8b260e3d89e29dd1c167b3935d6dd50c129a49c694a3e3
3
+ metadata.gz: 0fc7d72bb33cb797328a1656add6ef5861b91c7ad4273da69a1faf53cfe3005c
4
+ data.tar.gz: ed425c2df6ba263e4314bb6ccef97812102d0703ab41c08d4aaebfc382df4bf4
5
5
  SHA512:
6
- metadata.gz: 0f422cf04766a2a6ec62f9fb4294ecc6b7a63c38542b8990ffcdd82fadb584c5b22d74eb168103914a4a7121144bd5129229d75d63920def6144dc01164743c8
7
- data.tar.gz: 04b9dfdc75b555718bcebca5a765fc14e37cb89cd19512ad86babb795025b1173fa13f6a735601b9f40d67d7647350af9d07d14f3e35ba7c690e441f9e99f2aa
6
+ metadata.gz: 99e464800af7f2e48219666453d1c7958d7826478c60ef09753764af87e034374fd651c07d22d0c23b6a3b770bb84e8589684050a41b6f3ab9d1214378762213
7
+ data.tar.gz: c60c8b5231acb3ec2d9a2dcc41c46884c30ebe82b200212bcace9cd706419975c5b0206bddca6ee750e91ec8afdabb09cf18754a3e6136d22e76a9d72723d61a
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanResourceQuota
4
- VERSION = '0.6.4'
4
+ VERSION = '0.6.5'
5
5
  end
@@ -30,6 +30,7 @@ exports[`ResourceQuotaEmptyState should render 1`] = `
30
30
  icon="pficon pficon-cluster"
31
31
  iconType="pf"
32
32
  secondaryActions={Array []}
33
+ variant="xl"
33
34
  />
34
35
  <Modal
35
36
  actions={Array []}
@@ -14,6 +14,10 @@ import { translate as __ } from 'foremanReact/common/I18n';
14
14
  import './UtilizationProgress.scss';
15
15
  import { findLargestFittingUnit } from '../../../../helper';
16
16
 
17
+ const UTILIZATION_DANGER_THRESHOLD = 80;
18
+ const UTILIZATION_MAX_VALUE = 100;
19
+ const UTILIZATION_MIN_VALUE = 0;
20
+
17
21
  const UtilizationProgress = ({
18
22
  cardId,
19
23
  resourceValue,
@@ -33,8 +37,9 @@ const UtilizationProgress = ({
33
37
 
34
38
  /* resource utilization bar */
35
39
  const resourceProgressVariant = () => {
36
- if (resourceUtilizationPercent < 80) return null;
37
- else if (resourceUtilizationPercent < 100) return ProgressVariant.warning;
40
+ if (resourceUtilizationPercent < UTILIZATION_DANGER_THRESHOLD) return null;
41
+ else if (resourceUtilizationPercent < UTILIZATION_MAX_VALUE)
42
+ return ProgressVariant.warning;
38
43
  return ProgressVariant.danger;
39
44
  };
40
45
 
@@ -50,7 +55,7 @@ const UtilizationProgress = ({
50
55
  </div>
51
56
  );
52
57
  } else if (resourceUtilization == null) {
53
- newPercent = 0;
58
+ newPercent = UTILIZATION_MIN_VALUE;
54
59
  newTooltipText = (
55
60
  <div>
56
61
  <div>{__('No consumption to display.')}</div>
@@ -68,7 +73,7 @@ const UtilizationProgress = ({
68
73
  );
69
74
  const utilizationInUnit = resourceUtilization / utilizationUnit.factor;
70
75
  const valueInUnit = resourceValue / valueUnit.factor;
71
- newPercent = 100;
76
+ newPercent = UTILIZATION_MAX_VALUE;
72
77
  newTooltipText = (
73
78
  <div>
74
79
  {`${utilizationInUnit} ${utilizationUnit.symbol} / ${valueInUnit} ${valueUnit.symbol}`}
@@ -82,7 +87,8 @@ const UtilizationProgress = ({
82
87
  );
83
88
  const utilizationInUnit = resourceUtilization / utilizationUnit.factor;
84
89
  const valueInUnit = resourceValue / valueUnit.factor;
85
- const percent = (100 * resourceUtilization) / resourceValue;
90
+ const percent =
91
+ (UTILIZATION_MAX_VALUE * resourceUtilization) / resourceValue;
86
92
  if (Number.isFinite(percent)) newPercent = percent;
87
93
  else newPercent = 0;
88
94
  newTooltipText = (
@@ -8,4 +8,6 @@ global.console.error = (error, stack) => {
8
8
  };
9
9
 
10
10
  // Increase jest timeout as some tests using multiple http mocks can time out on CI systems.
11
- jest.setTimeout(10000);
11
+ const JEST_TIMEOUT_MS = 10000;
12
+
13
+ jest.setTimeout(JEST_TIMEOUT_MS);
@@ -7,7 +7,6 @@ import thunk from 'redux-thunk';
7
7
  import Immutable from 'seamless-immutable';
8
8
  import { APIMiddleware, reducers as apiReducer } from 'foremanReact/redux/API';
9
9
  import { reducers as fillReducers } from 'foremanReact/components/common/Fill';
10
- import { reducers as foremanModalReducer } from 'foremanReact/components/ForemanModal';
11
10
  import { STATUS } from 'foremanReact/constants';
12
11
  import {
13
12
  render,
@@ -36,7 +35,6 @@ function renderWithRedux(
36
35
  // Adding the reducer in the expected namespaced format
37
36
  const combinedReducers = combineReducers({
38
37
  ...apiReducer,
39
- ...foremanModalReducer,
40
38
  ...fillReducers,
41
39
  });
42
40
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_resource_quota
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ATIX AG
@@ -321,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
321
  - !ruby/object:Gem::Version
322
322
  version: '0'
323
323
  requirements: []
324
- rubygems_version: 4.0.10
324
+ rubygems_version: 4.0.16
325
325
  specification_version: 4
326
326
  summary: Foreman plugin for resource quota
327
327
  test_files: []