studiokit-scaffolding-js 4.5.4 → 4.5.6-alpha.3

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.
@@ -21,7 +21,7 @@ declare const Parchment: {
21
21
  };
22
22
  export interface ImageValue {
23
23
  src: string;
24
- alt: string;
24
+ alt?: string;
25
25
  width: string;
26
26
  height: string;
27
27
  }
@@ -62,8 +62,12 @@ var Image = /** @class */ (function (_super) {
62
62
  Image.create = function (value) {
63
63
  var _a, _b, _c;
64
64
  var node = _super.create.call(this, this.tagName);
65
- // Adding a default value for images already saved in the db
66
- node.setAttribute('alt', (_a = value.alt) !== null && _a !== void 0 ? _a : 'Statement Image');
65
+ if ((_a = value.alt) === null || _a === void 0 ? void 0 : _a.trim()) {
66
+ node.setAttribute('alt', value.alt);
67
+ }
68
+ else {
69
+ node.className = 'alt-text-missing';
70
+ }
67
71
  node.setAttribute('src', value.src);
68
72
  // Setting up the height and width to be reactive when an image is getting resize
69
73
  node.setAttribute('height', (_b = value.height) !== null && _b !== void 0 ? _b : 'auto');
@@ -75,7 +79,7 @@ var Image = /** @class */ (function (_super) {
75
79
  return {
76
80
  width: node.getAttribute('width'),
77
81
  height: node.getAttribute('height'),
78
- alt: node.getAttribute('alt'),
82
+ alt: node.getAttribute('alt') || undefined,
79
83
  src: node.getAttribute('src')
80
84
  };
81
85
  };
@@ -27,7 +27,7 @@
27
27
  --color-light-red: #f5ccd1;
28
28
  --color-dark-gold: #7d882d;
29
29
  --color-light-green: #e4f1d4;
30
- --color-orange: #ef7d2f;
30
+ --color-orange: #ee701b;
31
31
  --color-light-orange: #f8f5e6;
32
32
  --color-dark-yellow: #b2a44a;
33
33
  --color-dark-grey: #30363d;
@@ -1,5 +1,5 @@
1
1
  import { History } from 'history';
2
- import { Store } from 'redux';
2
+ import { AnyAction, Store } from 'redux';
3
3
  import { Persistor, PersistState } from 'redux-persist';
4
4
  import { BaseReduxState } from '../types';
5
5
  export declare type CustomStore<TReduxState extends BaseReduxState> = Store<TReduxState & {
@@ -7,6 +7,8 @@ export declare type CustomStore<TReduxState extends BaseReduxState> = Store<TRed
7
7
  }, any> & {
8
8
  dispatch: unknown;
9
9
  };
10
+ export declare const stripState: (obj: any, parentKey?: any) => any;
11
+ export declare const actionTransformer: (action: AnyAction) => any;
10
12
  declare const configureStore: <TReduxState extends BaseReduxState<import("../types").BaseModelsState<import("../types").Group, import("../types").BaseSearchModelsState<import("../types").Group>>>>(history: History<any>) => {
11
13
  store: CustomStore<TReduxState>;
12
14
  persistor: Persistor;
@@ -29,6 +29,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
29
29
  return (mod && mod.__esModule) ? mod : { "default": mod };
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.actionTransformer = exports.stripState = void 0;
32
33
  var Sentry = __importStar(require("@sentry/react"));
33
34
  var connected_react_router_1 = require("connected-react-router");
34
35
  var lodash_1 = require("lodash");
@@ -43,49 +44,52 @@ var actionCreator_1 = require("./actionCreator");
43
44
  var actions_1 = require("./actions");
44
45
  var configureReducers_1 = __importDefault(require("./configureReducers"));
45
46
  var rootSaga_1 = __importDefault(require("./sagas/rootSaga"));
46
- var sensitiveKeys = ['puid', 'employeeNumber', 'access_token', 'refresh_token', 'password', 'Password'];
47
- var stripSensitiveData = function (obj) {
47
+ var keysToFilter = ['puid', 'employeeNumber', 'access_token', 'refresh_token', 'password', 'Password', 'content'];
48
+ var filterData = function (obj) {
48
49
  return lodash_1.transform(obj, function (result, value, key) {
49
- if (sensitiveKeys.includes(key)) {
50
+ if (keysToFilter.includes(key)) {
50
51
  result[key] = '[Filtered]';
51
52
  return;
52
53
  }
53
- result[key] = lodash_1.isPlainObject(value) ? stripSensitiveData(value) : value;
54
+ result[key] = lodash_1.isPlainObject(value) || lodash_1.isArray(value) ? filterData(value) : value;
54
55
  });
55
56
  };
56
57
  var stripState = function (obj, parentKey) {
57
58
  return lodash_1.transform(obj, function (result, value, key) {
58
59
  if (lodash_1.isPlainObject(value)) {
59
- result[key] = stripState(value, key);
60
+ result[key] = exports.stripState(value, key);
60
61
  }
61
62
  else if (key === 'id' || parentKey === '_metadata') {
62
63
  result[key] = value;
63
64
  }
64
65
  });
65
66
  };
67
+ exports.stripState = stripState;
68
+ var actionTransformer = function (action) {
69
+ var _a;
70
+ // action breadcrumb filtering
71
+ if (
72
+ // do not track API responses
73
+ action.type === studiokit_net_js_1.NET_ACTION.FETCH_RESULT_RECEIVED ||
74
+ action.type === studiokit_net_js_1.NET_ACTION.TRANSIENT_FETCH_RESULT_RECEIVED ||
75
+ // do not track modal actions
76
+ action.type === actions_1.ACTION.MODAL_ENTERING ||
77
+ action.type === actions_1.ACTION.MODAL_EXITED ||
78
+ // do not track API requests for tokens
79
+ (action.type === studiokit_net_js_1.NET_ACTION.DATA_REQUESTED && ((_a = action.data) === null || _a === void 0 ? void 0 : _a.modelName) === 'getToken')) {
80
+ return null;
81
+ }
82
+ return filterData(action);
83
+ };
84
+ exports.actionTransformer = actionTransformer;
66
85
  var configureStore = function (history) {
67
86
  var appConfig = configuration_1.getAppConfig();
68
87
  var sentryReduxEnhancer = Sentry.createReduxEnhancer({
69
88
  stateTransformer: function (state) {
70
89
  // Transform the state to remove unneeded data
71
- return stripState(state);
90
+ return exports.stripState(state);
72
91
  },
73
- actionTransformer: function (action) {
74
- var _a;
75
- // action breadcrumb filtering
76
- if (
77
- // do not track API responses
78
- action.type === studiokit_net_js_1.NET_ACTION.FETCH_RESULT_RECEIVED ||
79
- action.type === studiokit_net_js_1.NET_ACTION.TRANSIENT_FETCH_RESULT_RECEIVED ||
80
- // do not track modal actions
81
- action.type === actions_1.ACTION.MODAL_ENTERING ||
82
- action.type === actions_1.ACTION.MODAL_EXITED ||
83
- // do not track API requests for tokens
84
- (action.type === studiokit_net_js_1.NET_ACTION.DATA_REQUESTED && ((_a = action.data) === null || _a === void 0 ? void 0 : _a.modelName) === 'getToken')) {
85
- return null;
86
- }
87
- return stripSensitiveData(action);
88
- }
92
+ actionTransformer: exports.actionTransformer
89
93
  });
90
94
  var sagaMiddleware = redux_saga_1.default();
91
95
  var reduxRouterMiddleware = connected_react_router_1.routerMiddleware(history);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "studiokit-scaffolding-js",
3
- "version": "4.5.4",
3
+ "version": "4.5.6-alpha.3",
4
4
  "description": "Common scaffolding for Studio apps at Purdue",
5
5
  "repository": "https://gitlab.com/purdue-informatics/studiokit/studiokit-scaffolding-js",
6
6
  "license": "MIT",