@influitive/profile-card
Advanced tools
| .profileCard { | ||
| font-family: "Proxima Nova", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; | ||
| line-height: 20px; | ||
| font-weight: 400; | ||
| font-size: 0.875rem; | ||
| margin: 0; | ||
| } | ||
| .profileName { | ||
| cursor: pointer; | ||
| border: 0; | ||
| padding: inherit; | ||
| background-color: transparent; | ||
| box-shadow: none; | ||
| font-family: inherit; | ||
| font-size: inherit; | ||
| color: inherit; | ||
| } | ||
| .profileName:hover { | ||
| background-color: transparent; | ||
| box-shadow: none; | ||
| } | ||
| .error { | ||
| padding: 0px 24px; | ||
| margin-top: 15px; | ||
| } | ||
| .loading { | ||
| text-align: center; | ||
| padding: 24px; | ||
| } | ||
| .avatar { | ||
| margin-top: 4px; | ||
| border-radius: 50%; | ||
| height: 64px; | ||
| width: 64px; | ||
| } | ||
| .cardSection { | ||
| display: -ms-flexbox; | ||
| display: flex; | ||
| padding: 24px; | ||
| } | ||
| .detailsColumn { | ||
| box-sizing: content-box; | ||
| display: -ms-flexbox; | ||
| display: flex; | ||
| -ms-flex-direction: column; | ||
| flex-direction: column; | ||
| padding-left: 24px; | ||
| width: 198px; | ||
| } | ||
| .name { | ||
| font-weight: normal; | ||
| margin: 0; | ||
| font-size: 1rem; | ||
| line-height: 28px; | ||
| } | ||
| .title { | ||
| white-space: nowrap; | ||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| } | ||
| .actions { | ||
| padding-top: 8px; | ||
| } | ||
| :global(.messageButton) { | ||
| margin-left: 4px !important; | ||
| } | ||
| :global(.action) { | ||
| box-sizing: border-box; | ||
| box-shadow: none; | ||
| float: right; | ||
| } |
+1
-1
| { | ||
| "name": "@influitive/profile-card", | ||
| "version": "3.1.4", | ||
| "version": "3.1.5", | ||
| "dependencies": { | ||
@@ -5,0 +5,0 @@ "@influitive/jwt": "^2.1.2", |
+17
-0
@@ -66,1 +66,18 @@ This application was scaffolded via [create-infl-app](https://gitlab.influitive.io/influitive/create-infl-app) | ||
| The master branch is v2 while there is also a v3 branch. Changes need to be duplicated in both branches. | ||
| - before releasing, make sure you remove node_modules and re-install. There seems to be an error when publishing where there is no lib folder, but getting fresh node_modules seems to somehow fix it. | ||
| - you can try `npm publish --dry-run`, I haven't tested this yet, but it should list all the files without actually publishing. | ||
| ### Infl-fe | ||
| To run locally in infl-fe for testing purposes, follow these steps: | ||
| 1. In Profile Card (v3), run: | ||
| - `npm run buildmodule` | ||
| - `npm pack` | ||
| - copy resulting .tgz file name | ||
| 2. In Infl-fe stop it running then run: | ||
| - `rm -rf node_modules` | ||
| - `yarn cache clean` | ||
| - `yarn add ../profile-card/<tgz file> --ignore-engines | ||
| - `yarn install --ignore-engines` | ||
| - `yarn start` |
@@ -7,3 +7,4 @@ export default { | ||
| INITIALIZE_CARD: 'INITIALIZE_CARD', | ||
| HIDE_PROFILE: 'HIDE_PROFILE' | ||
| HIDE_PROFILE: 'HIDE_PROFILE', | ||
| SET_MESSAGE_URL: 'SET_MESSAGE_URL' | ||
| }; |
| import axios from 'axios'; | ||
| import * as R from 'ramda'; | ||
| import i18n from '../localization'; | ||
@@ -11,2 +12,3 @@ import actions from './action-types'; | ||
| dispatch(fetchProfile(id, profileCardId)); | ||
| dispatch(fetchMessageUrl(id, profileCardId)); | ||
| } | ||
@@ -88,1 +90,19 @@ }; | ||
| }; | ||
| export const fetchMessageUrl = (memberId, profileCardId) => { | ||
| return (dispatch) => | ||
| axios.get('/api/features/public') | ||
| .then(R.path(['data', 'data'])) | ||
| .then( | ||
| R.pipe( | ||
| features => features.includes('inbox_v2') ? `/chat?p=${memberId}` : `/inbox/${memberId}`, | ||
| messageUrl => dispatch({ | ||
| type: actions.SET_MESSAGE_URL, | ||
| payload: { messageUrl, profileCardId } | ||
| }) | ||
| )) | ||
| .catch(() => dispatch({ | ||
| type: actions.SET_MESSAGE_URL, | ||
| payload: { messageUrl: `/inbox/${memberId}`, profileCardId } | ||
| })); | ||
| }; |
@@ -22,3 +22,4 @@ import React, { Component } from 'react'; | ||
| disableViewProfile: PropTypes.bool.isRequired, | ||
| disableMessage: PropTypes.bool.isRequired | ||
| disableMessage: PropTypes.bool.isRequired, | ||
| messageUrl: PropTypes.string.isRequired, | ||
| } | ||
@@ -41,3 +42,3 @@ | ||
| return ( | ||
| <Action className="c-action c-message" href={`/inbox/${this.props.id}`}> | ||
| <Action className="c-action c-message" href={this.props.messageUrl}> | ||
| {this.props.t('Message')} | ||
@@ -44,0 +45,0 @@ </Action> |
@@ -41,3 +41,4 @@ import React, { Component } from 'react'; | ||
| disableViewProfile={this.props.disableViewProfile} | ||
| disableMessage={this.props.disableMessage} /> | ||
| disableMessage={this.props.disableMessage} | ||
| messageUrl={this.props.profileDetails.messageUrl} /> | ||
| </Section> | ||
@@ -44,0 +45,0 @@ ); |
@@ -46,2 +46,8 @@ /* eslint complexity: "off" */ | ||
| } | ||
| case actions.SET_MESSAGE_URL: { | ||
| return { | ||
| ...state, | ||
| messageUrl: action.payload.messageUrl | ||
| }; | ||
| } | ||
| default: { | ||
@@ -48,0 +54,0 @@ return state; |
@@ -37,2 +37,5 @@ /* eslint complexity: "off" */ | ||
| } | ||
| case actions.SET_MESSAGE_URL: { | ||
| return updateProfileCard(state, action); | ||
| } | ||
| default: { | ||
@@ -39,0 +42,0 @@ return state; |
@@ -229,1 +229,27 @@ import deepFreeze from 'deep-freeze'; | ||
| }); | ||
| it('will update the profile messageUrl', () => { | ||
| const messageUrl = '/chat?p=12345'; | ||
| const expectedState = { | ||
| ...initialState, | ||
| '0': { | ||
| ...cardInitialState, | ||
| id: 0, | ||
| messageUrl | ||
| } | ||
| }; | ||
| let newState = sut(initialState, { | ||
| type: actions.INITIALIZE_CARD, | ||
| payload: { | ||
| profileCardId: 0 | ||
| } | ||
| }); | ||
| const resultState = sut(newState, { | ||
| type: actions.SET_MESSAGE_URL, | ||
| payload: { profileCardId: 0, messageUrl } | ||
| }); | ||
| expect(resultState).toEqual(expectedState); | ||
| }); |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _default = { | ||
| FETCH_PROFILE: 'FETCH_PROFILE', | ||
| SHOW_PROFILE: 'SHOW_PROFILE', | ||
| PROFILE_FETCHED: 'PROFILE_FETCHED', | ||
| PROFILE_ERROR: 'PROFILE_ERROR', | ||
| INITIALIZE_CARD: 'INITIALIZE_CARD', | ||
| HIDE_PROFILE: 'HIDE_PROFILE' | ||
| }; | ||
| exports.default = _default; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.initializeProfileCard = exports.hideProfile = exports.toggleProfile = void 0; | ||
| var _axios = _interopRequireDefault(require("axios")); | ||
| var _localization = _interopRequireDefault(require("../localization")); | ||
| var _actionTypes = _interopRequireDefault(require("./action-types")); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| var toggleProfile = function toggleProfile(id, profileCardId) { | ||
| return function (dispatch, getState) { | ||
| if (getState()[profileCardId].isOpen) { | ||
| dispatch(hideProfile(profileCardId)); | ||
| } else { | ||
| dispatch(fetchProfile(id, profileCardId)); | ||
| } | ||
| }; | ||
| }; | ||
| exports.toggleProfile = toggleProfile; | ||
| var fetchProfile = function fetchProfile(id, profileCardId) { | ||
| return function (dispatch) { | ||
| dispatch(showProfile(profileCardId)); | ||
| return _axios.default.get("/api/people/".concat(id, ".json")).then(function (response) { | ||
| dispatch(profileFetched(profileCardId, id, response.data.data.attributes, response.data.data.links.avatar)); | ||
| }).catch(function () { | ||
| dispatch(profileFetchedError(profileCardId)); | ||
| }); | ||
| }; | ||
| }; | ||
| var profileFetched = function profileFetched(profileCardId, id, details, avatarUrl) { | ||
| return { | ||
| type: _actionTypes.default.PROFILE_FETCHED, | ||
| payload: { | ||
| profileCardId: profileCardId, | ||
| id: id, | ||
| name: details.name, | ||
| company: details.company, | ||
| title: details.title, | ||
| level: details.level, | ||
| avatarUrl: avatarUrl | ||
| } | ||
| }; | ||
| }; | ||
| var showProfile = function showProfile(profileCardId) { | ||
| return { | ||
| type: _actionTypes.default.SHOW_PROFILE, | ||
| payload: { | ||
| profileCardId: profileCardId | ||
| } | ||
| }; | ||
| }; | ||
| var hideProfile = function hideProfile(profileCardId) { | ||
| return { | ||
| type: _actionTypes.default.HIDE_PROFILE, | ||
| payload: { | ||
| profileCardId: profileCardId | ||
| } | ||
| }; | ||
| }; | ||
| exports.hideProfile = hideProfile; | ||
| var profileFetchedError = function profileFetchedError(profileCardId) { | ||
| return { | ||
| type: _actionTypes.default.PROFILE_ERROR, | ||
| payload: { | ||
| profileCardId: profileCardId, | ||
| errorMsg: _localization.default.t('Profile details could not be loaded.') | ||
| } | ||
| }; | ||
| }; | ||
| var initializeProfileCard = function initializeProfileCard(profileCardId) { | ||
| return { | ||
| type: _actionTypes.default.INITIALIZE_CARD, | ||
| payload: { | ||
| profileCardId: profileCardId | ||
| } | ||
| }; | ||
| }; | ||
| exports.initializeProfileCard = initializeProfileCard; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.themePrimaryColors = void 0; | ||
| var _color = _interopRequireDefault(require("color")); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| var themePrimaryColors = function themePrimaryColors(color) { | ||
| return [color, // [0] $primary | ||
| (0, _color.default)(color).saturate(0.048).darken(0.38).hex(), //[1] $primary-dark | ||
| (0, _color.default)(color).desaturate(0.145).lighten(0.467).hex(), // [2] $primary-mid | ||
| (0, _color.default)(color).rotate(1).saturate(0.103).lighten(1.27).hex() //[3] $primary-light | ||
| ]; | ||
| }; | ||
| exports.themePrimaryColors = themePrimaryColors; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _react = _interopRequireWildcard(require("react")); | ||
| var _reactI18next = require("react-i18next"); | ||
| var _propTypes = _interopRequireDefault(require("prop-types")); | ||
| var _button = _interopRequireDefault(require("@influitive/secret-garden/lib/button")); | ||
| var _styled = _interopRequireDefault(require("@emotion/styled")); | ||
| var _styledSystem = require("styled-system"); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
| function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
| function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
| function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
| function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
| function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
| function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
| function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
| function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
| function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
| function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
| var Action = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)(_button.default, { | ||
| target: "elblljk0" | ||
| })("margin-left:", (0, _styledSystem.themeGet)('spacing.1'), "px;"); | ||
| var Actions = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)('div', { | ||
| target: "elblljk1" | ||
| })("display:flex;flex-direction:row-reverse;padding-top:", (0, _styledSystem.themeGet)('spacing.2'), "px;"); | ||
| var Footer = | ||
| /*#__PURE__*/ | ||
| function (_Component) { | ||
| _inherits(Footer, _Component); | ||
| function Footer() { | ||
| var _getPrototypeOf2; | ||
| var _this; | ||
| _classCallCheck(this, Footer); | ||
| for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
| args[_key] = arguments[_key]; | ||
| } | ||
| _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Footer)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
| _defineProperty(_assertThisInitialized(_this), "_message", function () { | ||
| if (_this.props.disableMessage) return null; | ||
| return _react.default.createElement(Action, { | ||
| className: "c-action c-message", | ||
| href: "/inbox/".concat(_this.props.id) | ||
| }, _this.props.t('Message')); | ||
| }); | ||
| _defineProperty(_assertThisInitialized(_this), "_viewProfile", function () { | ||
| if (_this.props.disableViewProfile) return null; | ||
| return _react.default.createElement(Action, { | ||
| className: "c-action c-view-profile", | ||
| href: "/profiles/".concat(_this.props.id) | ||
| }, _this.props.t('View Profile')); | ||
| }); | ||
| return _this; | ||
| } | ||
| _createClass(Footer, [{ | ||
| key: "render", | ||
| value: function render() { | ||
| if (this.props.disableMessage && this.props.disableViewProfile) return null; | ||
| return _react.default.createElement(Actions, { | ||
| className: "c-actions" | ||
| }, this._message(), this._viewProfile()); | ||
| } | ||
| }]); | ||
| return Footer; | ||
| }(_react.Component); | ||
| _defineProperty(Footer, "propsTypes", { | ||
| id: _propTypes.default.string.isRequired, | ||
| disableViewProfile: _propTypes.default.bool.isRequired, | ||
| disableMessage: _propTypes.default.bool.isRequired | ||
| }); | ||
| var _default = (0, _reactI18next.withNamespaces)()(Footer); | ||
| exports.default = _default; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _react = _interopRequireWildcard(require("react")); | ||
| var _propTypes = _interopRequireDefault(require("prop-types")); | ||
| var _lodash = _interopRequireDefault(require("lodash.isempty")); | ||
| var _details = _interopRequireDefault(require("./details")); | ||
| var _actions = _interopRequireDefault(require("./actions")); | ||
| var _error = _interopRequireDefault(require("./error")); | ||
| var _loading = _interopRequireDefault(require("./loading")); | ||
| var _styled = _interopRequireDefault(require("@emotion/styled")); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
| function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
| function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
| function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
| function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
| function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
| function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
| function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
| function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
| function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
| function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
| var Section = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)('section', { | ||
| target: "e1129j2v0" | ||
| })("display:flex;flex-direction:column;"); | ||
| var CardDetails = | ||
| /*#__PURE__*/ | ||
| function (_Component) { | ||
| _inherits(CardDetails, _Component); | ||
| function CardDetails() { | ||
| _classCallCheck(this, CardDetails); | ||
| return _possibleConstructorReturn(this, _getPrototypeOf(CardDetails).apply(this, arguments)); | ||
| } | ||
| _createClass(CardDetails, [{ | ||
| key: "render", | ||
| value: function render() { | ||
| if ((0, _lodash.default)(this.props.profileDetails.details) && (0, _lodash.default)(this.props.profileDetails.errorMsg)) { | ||
| return _react.default.createElement(_loading.default, null); | ||
| } | ||
| if (!(0, _lodash.default)(this.props.profileDetails.errorMsg)) { | ||
| return _react.default.createElement(_error.default, { | ||
| errorMsg: this.props.profileDetails.errorMsg | ||
| }); | ||
| } | ||
| return _react.default.createElement(Section, { | ||
| "data-id": "card-details" | ||
| }, _react.default.createElement(_details.default, { | ||
| details: this.props.profileDetails.details | ||
| }), _react.default.createElement(_actions.default, { | ||
| id: this.props.profileDetails.details.id, | ||
| disableViewProfile: this.props.disableViewProfile, | ||
| disableMessage: this.props.disableMessage | ||
| })); | ||
| } | ||
| }]); | ||
| return CardDetails; | ||
| }(_react.Component); | ||
| exports.default = CardDetails; | ||
| _defineProperty(CardDetails, "propsTypes", { | ||
| profileDetails: _propTypes.default.object.isRequired, | ||
| disableViewProfile: _propTypes.default.bool.isRequired, | ||
| disableMessage: _propTypes.default.bool.isRequired | ||
| }); |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _react = _interopRequireWildcard(require("react")); | ||
| var _reactI18next = require("react-i18next"); | ||
| var _propTypes = _interopRequireDefault(require("prop-types")); | ||
| var _lodash = _interopRequireDefault(require("lodash.isempty")); | ||
| var _styled = _interopRequireDefault(require("@emotion/styled")); | ||
| var _avatar = _interopRequireDefault(require("@influitive/secret-garden/lib/avatar")); | ||
| var _heading = _interopRequireDefault(require("@influitive/secret-garden/lib/heading")); | ||
| var _text = _interopRequireDefault(require("@influitive/secret-garden/lib/text")); | ||
| var _styledSystem = require("styled-system"); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
| function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
| function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
| function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
| function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
| function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
| function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
| function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
| function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
| function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
| function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
| var DetailsContainer = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)('div', { | ||
| target: "e10gnlfo0" | ||
| })("display:flex;"); | ||
| var AvatarContainer = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)(_avatar.default, { | ||
| target: "e10gnlfo1" | ||
| })("margin-top:", (0, _styledSystem.themeGet)('spacing.1'), "px;flex-shrink:0;"); | ||
| var Attributes = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)('div', { | ||
| target: "e10gnlfo2" | ||
| })("padding-left:", (0, _styledSystem.themeGet)('spacing.4'), "px;width:194px;"); | ||
| var Attribute = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)(_text.default, { | ||
| target: "e10gnlfo3" | ||
| })("line-height:20px;"); | ||
| var Name = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)(_heading.default, { | ||
| target: "e10gnlfo4" | ||
| })("line-height:28px !important;"); | ||
| var Title = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)('div', { | ||
| target: "e10gnlfo5" | ||
| })("white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"); | ||
| var Details = | ||
| /*#__PURE__*/ | ||
| function (_Component) { | ||
| _inherits(Details, _Component); | ||
| function Details() { | ||
| var _getPrototypeOf2; | ||
| var _this; | ||
| _classCallCheck(this, Details); | ||
| for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
| args[_key] = arguments[_key]; | ||
| } | ||
| _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Details)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
| _defineProperty(_assertThisInitialized(_this), "_showTitle", function () { | ||
| if ((0, _lodash.default)(_this.props.details.title)) return null; | ||
| return _react.default.createElement(Title, { | ||
| className: "c-title" | ||
| }, _react.default.createElement(Attribute, { | ||
| variant: "small" | ||
| }, _this.props.details.title)); | ||
| }); | ||
| _defineProperty(_assertThisInitialized(_this), "_showCompany", function () { | ||
| if ((0, _lodash.default)(_this.props.details.company)) return null; | ||
| return _react.default.createElement("div", { | ||
| className: "c-company" | ||
| }, _react.default.createElement(Attribute, { | ||
| variant: "small" | ||
| }, _this._showAt(), _this.props.details.company)); | ||
| }); | ||
| _defineProperty(_assertThisInitialized(_this), "_showAt", function () { | ||
| if ((0, _lodash.default)(_this.props.details.title)) return ''; | ||
| return _this.props.t('at '); | ||
| }); | ||
| _defineProperty(_assertThisInitialized(_this), "_showLevel", function () { | ||
| if ((0, _lodash.default)(_this.props.details.level)) return null; | ||
| return _react.default.createElement(Attribute, { | ||
| variant: "small", | ||
| className: "c-level" | ||
| }, _this.props.t('Level:'), " ", _this.props.details.level); | ||
| }); | ||
| return _this; | ||
| } | ||
| _createClass(Details, [{ | ||
| key: "render", | ||
| value: function render() { | ||
| var _this$props$details = this.props.details, | ||
| avatarUrl = _this$props$details.avatarUrl, | ||
| name = _this$props$details.name; | ||
| return _react.default.createElement(DetailsContainer, { | ||
| className: "c-details-container" | ||
| }, _react.default.createElement(AvatarContainer, { | ||
| className: "c-avatar-container", | ||
| size: "large", | ||
| url: avatarUrl, | ||
| alt: name | ||
| }), _react.default.createElement(Attributes, null, _react.default.createElement(Name, { | ||
| className: "c-name", | ||
| level: 3 | ||
| }, name), this._showTitle(), this._showCompany(), this._showLevel())); | ||
| } | ||
| }]); | ||
| return Details; | ||
| }(_react.Component); | ||
| _defineProperty(Details, "propsTypes", { | ||
| details: _propTypes.default.object.isRequired, | ||
| theme: _propTypes.default.object.isRequired | ||
| }); | ||
| var _default = (0, _reactI18next.withNamespaces)()(Details); | ||
| exports.default = _default; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _react = _interopRequireWildcard(require("react")); | ||
| var _propTypes = _interopRequireDefault(require("prop-types")); | ||
| var _text = _interopRequireDefault(require("@influitive/secret-garden/lib/text")); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
| function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
| function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
| function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
| function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
| function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
| function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
| function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
| function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
| function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
| function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
| var Error = | ||
| /*#__PURE__*/ | ||
| function (_Component) { | ||
| _inherits(Error, _Component); | ||
| function Error() { | ||
| _classCallCheck(this, Error); | ||
| return _possibleConstructorReturn(this, _getPrototypeOf(Error).apply(this, arguments)); | ||
| } | ||
| _createClass(Error, [{ | ||
| key: "render", | ||
| value: function render() { | ||
| return _react.default.createElement(_text.default, { | ||
| className: "c-error-message" | ||
| }, this.props.errorMsg); | ||
| } | ||
| }]); | ||
| return Error; | ||
| }(_react.Component); | ||
| exports.default = Error; | ||
| _defineProperty(Error, "propsTypes", { | ||
| errorMsg: _propTypes.default.string.isRequired | ||
| }); |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _react = _interopRequireWildcard(require("react")); | ||
| var _styled = _interopRequireDefault(require("@emotion/styled")); | ||
| var _styledSystem = require("styled-system"); | ||
| var _skeletonPreloader = require("@influitive/secret-garden/lib/skeleton-preloader"); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
| function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
| function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
| function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
| function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
| function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
| function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
| function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
| function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
| function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
| var SkeletonPreloader = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)('div', { | ||
| target: "e9yu2q60" | ||
| })(_skeletonPreloader.pulsatingAnimation); | ||
| var Avatar = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)(_skeletonPreloader.PreloaderElement, { | ||
| target: "e9yu2q61" | ||
| })("border-radius:100%;height:60px;overflow:hidden;width:60px;"); | ||
| var Attributes = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)(_skeletonPreloader.PreloaderElement, { | ||
| target: "e9yu2q62" | ||
| })("height:60px;margin-left:", (0, _styledSystem.themeGet)('spacing.4'), "px;width:194px;"); | ||
| var DetailsContainer = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)('div', { | ||
| target: "e9yu2q63" | ||
| })("display:flex;"); | ||
| var Action = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)(_skeletonPreloader.PreloaderElement, { | ||
| target: "e9yu2q64" | ||
| })("float:right;height:36px;margin:", (0, _styledSystem.themeGet)('spacing.2'), "px 0 0 ", (0, _styledSystem.themeGet)('spacing.1'), "px;width:60px;"); | ||
| var Loading = | ||
| /*#__PURE__*/ | ||
| function (_Component) { | ||
| _inherits(Loading, _Component); | ||
| function Loading() { | ||
| _classCallCheck(this, Loading); | ||
| return _possibleConstructorReturn(this, _getPrototypeOf(Loading).apply(this, arguments)); | ||
| } | ||
| _createClass(Loading, [{ | ||
| key: "render", | ||
| value: function render() { | ||
| return _react.default.createElement(SkeletonPreloader, null, _react.default.createElement(DetailsContainer, null, _react.default.createElement(Avatar, { | ||
| className: "c-avatar" | ||
| }), _react.default.createElement(Attributes, { | ||
| className: "c-attributes" | ||
| })), _react.default.createElement(Action, null), _react.default.createElement(Action, null)); | ||
| } | ||
| }]); | ||
| return Loading; | ||
| }(_react.Component); | ||
| exports.default = Loading; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _react = _interopRequireWildcard(require("react")); | ||
| var _propTypes = _interopRequireDefault(require("prop-types")); | ||
| var _lodash = _interopRequireDefault(require("lodash.isempty")); | ||
| var _styled = _interopRequireDefault(require("@emotion/styled")); | ||
| var _popover = _interopRequireDefault(require("@influitive/secret-garden/lib/popover")); | ||
| var _cardDetails = _interopRequireDefault(require("./card-details")); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
| function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
| function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
| function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
| function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
| function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
| function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
| function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
| function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
| function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
| function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
| var UnstyledButton = | ||
| /*#__PURE__*/ | ||
| (0, _styled.default)('button', { | ||
| target: "el81auj0" | ||
| })("cursor:pointer;background:transparent;border:none;box-shadow:none;padding:0;width:100%;text-align:inherit;font-size:inherit;font-family:inherit;white-space:normal;display:inherit;align-items:inherit;&:hover{background-color:transparent;box-shadow:none;}"); | ||
| var ProfileCard = | ||
| /*#__PURE__*/ | ||
| function (_Component) { | ||
| _inherits(ProfileCard, _Component); | ||
| function ProfileCard() { | ||
| var _getPrototypeOf2; | ||
| var _this; | ||
| _classCallCheck(this, ProfileCard); | ||
| for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
| args[_key] = arguments[_key]; | ||
| } | ||
| _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ProfileCard)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
| _defineProperty(_assertThisInitialized(_this), "popoverContent", function () { | ||
| return _react.default.createElement(_cardDetails.default, { | ||
| profileDetails: _this.props.profileDetails, | ||
| disableViewProfile: _this.props.disableViewProfile, | ||
| disableMessage: _this.props.disableMessage | ||
| }); | ||
| }); | ||
| _defineProperty(_assertThisInitialized(_this), "renderToWrapper", function () { | ||
| return _react.default.createElement(UnstyledButton, { | ||
| onClick: _this.props.toggleProfile, | ||
| "data-fs": _this.props['data-fs'], | ||
| "data-qa": _this.props['data-qa'] | ||
| }, _this.props.children); | ||
| }); | ||
| return _this; | ||
| } | ||
| _createClass(ProfileCard, [{ | ||
| key: "render", | ||
| value: function render() { | ||
| if ((0, _lodash.default)(this.props.profileDetails)) return null; | ||
| return _react.default.createElement(_popover.default, { | ||
| className: "c-profile-card", | ||
| place: this.props.position || 'below', | ||
| onOuterAction: this.props.hideProfile, | ||
| body: this.popoverContent(), | ||
| isOpen: this.props.profileDetails.isOpen | ||
| }, this.renderToWrapper()); | ||
| } | ||
| }]); | ||
| return ProfileCard; | ||
| }(_react.Component); | ||
| exports.default = ProfileCard; | ||
| _defineProperty(ProfileCard, "propsTypes", { | ||
| hideProfile: _propTypes.default.func.isRequired, | ||
| toggleProfile: _propTypes.default.func.isRequired, | ||
| profileDetails: _propTypes.default.object.isRequired, | ||
| disableViewProfile: _propTypes.default.bool.isRequired, | ||
| disableMessage: _propTypes.default.bool.isRequired, | ||
| 'data-qa': _propTypes.default.string, | ||
| 'data-fs': _propTypes.default.string | ||
| }); |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _react = _interopRequireWildcard(require("react")); | ||
| var _propTypes = _interopRequireDefault(require("prop-types")); | ||
| var _reactRedux = require("react-redux"); | ||
| var _themeProvider = _interopRequireDefault(require("@influitive/secret-garden/lib/theme-provider")); | ||
| var _profileCard = require("../actions/profile-card"); | ||
| var _profileCard2 = _interopRequireDefault(require("../components/profile-card")); | ||
| var _fromHub = require("../from-hub"); | ||
| var _colorsUtil = require("../colors-util"); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
| function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
| function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
| function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
| function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
| function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
| function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
| function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
| function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
| function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
| function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
| var themeOverrides = {}; | ||
| if (_fromHub.hubPrimaryColor) { | ||
| themeOverrides['colors'] = { | ||
| primary: (0, _colorsUtil.themePrimaryColors)(_fromHub.hubPrimaryColor) | ||
| }; | ||
| } | ||
| if (_fromHub.hubCustomFont.enabled && _fromHub.hubCustomFont.url) { | ||
| themeOverrides['fonts'] = { | ||
| family: [_fromHub.hubCustomFont.name] | ||
| }; | ||
| } | ||
| var ProfileCard = | ||
| /*#__PURE__*/ | ||
| function (_Component) { | ||
| _inherits(ProfileCard, _Component); | ||
| function ProfileCard() { | ||
| var _getPrototypeOf2; | ||
| var _this; | ||
| _classCallCheck(this, ProfileCard); | ||
| for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
| args[_key] = arguments[_key]; | ||
| } | ||
| _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ProfileCard)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
| _defineProperty(_assertThisInitialized(_this), "handleResize", function () { | ||
| _this.props.hideProfile(_this.props.profileCardId); | ||
| }); | ||
| _defineProperty(_assertThisInitialized(_this), "handleHideProfile", function () { | ||
| var _this$props = _this.props, | ||
| hideProfile = _this$props.hideProfile, | ||
| profileCardId = _this$props.profileCardId; | ||
| hideProfile(profileCardId); | ||
| }); | ||
| _defineProperty(_assertThisInitialized(_this), "handleToggleProfile", function () { | ||
| var _this$props2 = _this.props, | ||
| id = _this$props2.id, | ||
| profileCardId = _this$props2.profileCardId, | ||
| toggleProfile = _this$props2.toggleProfile; | ||
| toggleProfile(id, profileCardId); | ||
| }); | ||
| return _this; | ||
| } | ||
| _createClass(ProfileCard, [{ | ||
| key: "componentDidMount", | ||
| value: function componentDidMount() { | ||
| this.props.initializeProfileCard(this.props.profileCardId); | ||
| window.addEventListener('resize', this.handleResize); | ||
| } | ||
| }, { | ||
| key: "componentWillUnmount", | ||
| value: function componentWillUnmount() { | ||
| window.removeEventListener('resize', this.handleResize); | ||
| } | ||
| }, { | ||
| key: "render", | ||
| value: function render() { | ||
| if (this.props.anonymous) { | ||
| return _react.default.createElement(_themeProvider.default, { | ||
| theme: themeOverrides | ||
| }, this.props.children); | ||
| } | ||
| var _this$props3 = this.props, | ||
| disableMessage = _this$props3.disableMessage, | ||
| disableViewProfile = _this$props3.disableViewProfile, | ||
| position = _this$props3.position, | ||
| profileCardId = _this$props3.profileCardId, | ||
| profileDetails = _this$props3.profileDetails; | ||
| return _react.default.createElement(_themeProvider.default, { | ||
| theme: themeOverrides | ||
| }, _react.default.createElement(_profileCard2.default, { | ||
| "data-fs": this.props['data-fs'], | ||
| "data-qa": this.props['data-qa'], | ||
| disableMessage: disableMessage, | ||
| disableViewProfile: disableViewProfile, | ||
| hideProfile: this.handleHideProfile, | ||
| position: position, | ||
| profileDetails: profileDetails[profileCardId], | ||
| toggleProfile: this.handleToggleProfile | ||
| }, this.props.children)); | ||
| } | ||
| }]); | ||
| return ProfileCard; | ||
| }(_react.Component); | ||
| _defineProperty(ProfileCard, "propsTypes", { | ||
| profileCardId: _propTypes.default.string.isRequired, | ||
| profileDetails: _propTypes.default.object.isRequired, | ||
| theme: _propTypes.default.object.isRequired, | ||
| disableViewProfile: _propTypes.default.bool.isRequired, | ||
| disableMessage: _propTypes.default.bool.isRequired, | ||
| anonymous: _propTypes.default.bool | ||
| }); | ||
| _defineProperty(ProfileCard, "defaultProps", { | ||
| anonymous: false | ||
| }); | ||
| var _default = (0, _reactRedux.connect)(function (state) { | ||
| return { | ||
| profileDetails: state | ||
| }; | ||
| }, { | ||
| initializeProfileCard: _profileCard.initializeProfileCard, | ||
| hideProfile: _profileCard.hideProfile, | ||
| toggleProfile: _profileCard.toggleProfile | ||
| })(ProfileCard); | ||
| exports.default = _default; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.hubCustomFont = exports.hubPrimaryColor = exports.is_admin = exports.advocate_to_advocate_enabled = void 0; | ||
| var R = _interopRequireWildcard(require("ramda")); | ||
| function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
| // Defaults used for testing environment. | ||
| var _a2a_enabled = true; | ||
| var _is_admin = false; // Needs to be here to avoid node tests from failing | ||
| // on access to nonexistant window object. | ||
| if (typeof window !== 'undefined') { | ||
| var a2aPath = ['_infl', 'settings', 'hub', 'advocate_to_advocate_enabled']; | ||
| _a2a_enabled = R.pathOr(_a2a_enabled, a2aPath, window); | ||
| _is_admin = R.pathOr(_is_admin, ['_infl', 'currentContact', 'isAdmin'], window); | ||
| } | ||
| var advocate_to_advocate_enabled = _a2a_enabled; | ||
| exports.advocate_to_advocate_enabled = advocate_to_advocate_enabled; | ||
| var is_admin = _is_admin; | ||
| exports.is_admin = is_admin; | ||
| var hubPrimaryColor = R.path(['_inflTheme', 'themeColorPrimary'], window); | ||
| exports.hubPrimaryColor = hubPrimaryColor; | ||
| var hubCustomFont = R.path(['_inflTheme', 'customFont'], window) || {}; | ||
| exports.hubCustomFont = hubCustomFont; |
-123
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _react = _interopRequireWildcard(require("react")); | ||
| var _propTypes = _interopRequireDefault(require("prop-types")); | ||
| var _reactRedux = require("react-redux"); | ||
| var _redux = require("redux"); | ||
| var _reduxThunk = _interopRequireDefault(require("redux-thunk")); | ||
| var _profileCards = _interopRequireDefault(require("./reducers/profile-cards")); | ||
| var _profileCard = _interopRequireDefault(require("./containers/profile-card")); | ||
| var _fromHub = require("./from-hub"); | ||
| var _reactI18next = require("react-i18next"); | ||
| var _localization = _interopRequireDefault(require("./localization")); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
| function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } | ||
| function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
| function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
| function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | ||
| function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } | ||
| function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
| function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | ||
| function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | ||
| function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } | ||
| function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | ||
| function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
| var createStoreWithMiddleware = (0, _redux.applyMiddleware)(_reduxThunk.default)(_redux.createStore); | ||
| var store = createStoreWithMiddleware(_profileCards.default); | ||
| var shouldDisable = function shouldDisable(disable) { | ||
| if (disable) return true; | ||
| if (_fromHub.is_admin) return false; | ||
| return !_fromHub.advocate_to_advocate_enabled; | ||
| }; | ||
| var Index = | ||
| /*#__PURE__*/ | ||
| function (_Component) { | ||
| _inherits(Index, _Component); | ||
| function Index() { | ||
| var _getPrototypeOf2; | ||
| var _this; | ||
| _classCallCheck(this, Index); | ||
| for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
| args[_key] = arguments[_key]; | ||
| } | ||
| _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Index)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
| _defineProperty(_assertThisInitialized(_this), "componentWillMount", function () { | ||
| _this.disableMessage = shouldDisable(_this.props.disableMessage); | ||
| _this.disableViewProfile = shouldDisable(_this.props.disableViewProfile); | ||
| _this.profileCardId = _this._generateProfileCardId(); | ||
| }); | ||
| _defineProperty(_assertThisInitialized(_this), "_generateProfileCardId", function () { | ||
| return 'profile-card-id-' + Math.random(); | ||
| }); | ||
| return _this; | ||
| } | ||
| _createClass(Index, [{ | ||
| key: "render", | ||
| value: function render() { | ||
| return _react.default.createElement(_reactRedux.Provider, { | ||
| store: store | ||
| }, _react.default.createElement(_reactI18next.I18nextProvider, { | ||
| i18n: _localization.default | ||
| }, _react.default.createElement(_profileCard.default, _extends({}, this.props, { | ||
| disableMessage: this.disableMessage, | ||
| disableViewProfile: this.disableViewProfile, | ||
| profileCardId: this.profileCardId | ||
| })))); | ||
| } | ||
| }]); | ||
| return Index; | ||
| }(_react.Component); | ||
| exports.default = Index; | ||
| _defineProperty(Index, "propsTypes", { | ||
| id: _propTypes.default.string.isRequired, | ||
| disableViewProfile: _propTypes.default.bool, | ||
| disableMessage: _propTypes.default.bool | ||
| }); | ||
| _defineProperty(Index, "defaultProps", { | ||
| disableViewProfile: false, | ||
| disableMessage: false | ||
| }); |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _locizeLauncher = require("@influitive/locize-launcher"); | ||
| var options = { | ||
| defaultNs: 'ProfileCard', | ||
| ns: 'ProfileCard' | ||
| }; | ||
| var i18n = (0, _locizeLauncher.i18nLocizeInstance)(process.env.LOCIZE_PROJECT_ID, process.env.LOCIZE_API_KEY, options); | ||
| var _default = i18n; | ||
| exports.default = _default; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _actionTypes = _interopRequireDefault(require("../actions/action-types")); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
| function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
| var profileCard = function profileCard() { | ||
| var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
| var action = arguments.length > 1 ? arguments[1] : undefined; | ||
| switch (action.type) { | ||
| case _actionTypes.default.INITIALIZE_CARD: | ||
| { | ||
| return { | ||
| id: action.payload.profileCardId, | ||
| details: {}, | ||
| errorMsg: '', | ||
| isOpen: false | ||
| }; | ||
| } | ||
| case _actionTypes.default.SHOW_PROFILE: | ||
| { | ||
| return _objectSpread({}, state, { | ||
| isOpen: true | ||
| }); | ||
| } | ||
| case _actionTypes.default.HIDE_PROFILE: | ||
| { | ||
| return _objectSpread({}, state, { | ||
| errorMsg: '', | ||
| isOpen: false | ||
| }); | ||
| } | ||
| case _actionTypes.default.PROFILE_FETCHED: | ||
| { | ||
| return _objectSpread({}, state, { | ||
| details: { | ||
| id: action.payload.id, | ||
| name: action.payload.name, | ||
| company: action.payload.company, | ||
| title: action.payload.title, | ||
| level: action.payload.level, | ||
| avatarUrl: action.payload.avatarUrl | ||
| } | ||
| }); | ||
| } | ||
| case _actionTypes.default.PROFILE_ERROR: | ||
| { | ||
| return _objectSpread({}, state, { | ||
| errorMsg: action.payload.errorMsg | ||
| }); | ||
| } | ||
| default: | ||
| { | ||
| return state; | ||
| } | ||
| } | ||
| }; | ||
| var _default = profileCard; | ||
| exports.default = _default; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _actionTypes = _interopRequireDefault(require("../actions/action-types")); | ||
| var _profileCard = _interopRequireDefault(require("./profile-card")); | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
| function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
| var initialState = {}; | ||
| var updateProfileCard = function updateProfileCard(state, action) { | ||
| return _objectSpread({}, state, _defineProperty({}, action.payload.profileCardId, (0, _profileCard.default)(state[action.payload.profileCardId], action))); | ||
| }; | ||
| var profileCards = function profileCards() { | ||
| var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
| var action = arguments.length > 1 ? arguments[1] : undefined; | ||
| switch (action.type) { | ||
| case _actionTypes.default.INITIALIZE_CARD: | ||
| { | ||
| return _objectSpread({}, state, _defineProperty({}, action.payload.profileCardId, (0, _profileCard.default)(state, action))); | ||
| } | ||
| case _actionTypes.default.SHOW_PROFILE: | ||
| { | ||
| return updateProfileCard(state, action); | ||
| } | ||
| case _actionTypes.default.HIDE_PROFILE: | ||
| { | ||
| return updateProfileCard(state, action); | ||
| } | ||
| case _actionTypes.default.PROFILE_FETCHED: | ||
| { | ||
| return updateProfileCard(state, action); | ||
| } | ||
| case _actionTypes.default.PROFILE_ERROR: | ||
| { | ||
| return updateProfileCard(state, action); | ||
| } | ||
| default: | ||
| { | ||
| return state; | ||
| } | ||
| } | ||
| }; | ||
| var _default = profileCards; | ||
| exports.default = _default; |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
83
25.76%4
-33.33%445286
-10.56%36
-28%1195
-40.72%