diff --git a/wherehows-frontend/app/controllers/Application.java b/wherehows-frontend/app/controllers/Application.java index c7f55fd652..670362bdab 100644 --- a/wherehows-frontend/app/controllers/Application.java +++ b/wherehows-frontend/app/controllers/Application.java @@ -92,6 +92,9 @@ public class Application extends Controller { private static final String WHZ_WIKI_LINKS__EXPORT_POLICY = Play.application().configuration().getString("links.wiki.exportPolicy", ""); + private static final String WHZ_LINKS__JIT_ACL_CONTACT = + Play.application().configuration().getString("links.jitAcl.contact", ""); + private static final String DB_WHEREHOWS_URL = Play.application().configuration().getString("database.opensource.url"); private static final String WHZ_DB_DSCLASSNAME = @@ -209,6 +212,7 @@ public class Application extends Controller { config.put("suggestionConfidenceThreshold", Integer.parseInt(WHZ_SUGGESTION_CONFIDENCE_THRESHOLD)); config.set("wikiLinks", wikiLinks()); config.set("JitAclAccessWhitelist", Json.toJson(StringUtils.split(JIT_ACL_WHITELIST, ','))); + config.put("jitAclContact", WHZ_LINKS__JIT_ACL_CONTACT); config.set("tracking", trackingInfo()); // In a staging environment, we can trigger this flag to be true so that the UI can handle based on // such config and alert users that their changes will not affect production data diff --git a/wherehows-web/app/components/datasets/containers/dataset-acl-access.ts b/wherehows-web/app/components/datasets/containers/dataset-acl-access.ts index 145a72be25..644f6c3892 100644 --- a/wherehows-web/app/components/datasets/containers/dataset-acl-access.ts +++ b/wherehows-web/app/components/datasets/containers/dataset-acl-access.ts @@ -76,6 +76,11 @@ export default class DatasetAclAccessContainer extends Component { */ isJitAclAccessEnabled: boolean; + /** + * Who to contact in case of error + */ + jitAclContact: string; + /** * Request object for the current user requesting access control * @type {IRequestAccessControlEntry} @@ -170,7 +175,9 @@ export default class DatasetAclAccessContainer extends Component { notify(NotificationEvent.confirm, { header: 'Successfully processed ACL request', - content: `${message} Your access should be enabled within 15 minutes. Contact ask_acl@linkedin.com if you're still having issues after that time.`, + content: `${message} Your access should be enabled within 15 minutes. Contact ${ + this.jitAclContact + } if you're still having issues after that time.`, dialogActions, confirmButtonText: false, dismissButtonText: 'Dismiss' diff --git a/wherehows-web/app/controllers/datasets/dataset.ts b/wherehows-web/app/controllers/datasets/dataset.ts index 7422355cc4..4ab9185e44 100644 --- a/wherehows-web/app/controllers/datasets/dataset.ts +++ b/wherehows-web/app/controllers/datasets/dataset.ts @@ -60,6 +60,13 @@ export default class DatasetController extends Controller { */ jitAclAccessWhitelist: Array; + /** + * String to indicate who to contact for acl issues + * @type {string} + * @memberof DatasetController + */ + jitAclContact: string; + /** * References the collection of help links with references to external pages of help information * @type {Record} diff --git a/wherehows-web/app/routes/datasets/dataset.ts b/wherehows-web/app/routes/datasets/dataset.ts index 9afc961047..5e3bbe3d80 100644 --- a/wherehows-web/app/routes/datasets/dataset.ts +++ b/wherehows-web/app/routes/datasets/dataset.ts @@ -95,6 +95,7 @@ export default class DatasetRoute extends Route { setProperties(controller, { isInternal: !!getConfig('isInternal'), jitAclAccessWhitelist: getConfig('JitAclAccessWhitelist') || [], + jitAclContact: getConfig('jitAclContact', { useDefault: true, default: 'your ACL admin' }), shouldShowDatasetLineage: getConfig('shouldShowDatasetLineage'), shouldShowDatasetHealth: getConfig('shouldShowDatasetHealth'), wikiLinks: getConfig('wikiLinks') diff --git a/wherehows-web/app/services/configurator.ts b/wherehows-web/app/services/configurator.ts index 57514d6263..0ec034ad53 100644 --- a/wherehows-web/app/services/configurator.ts +++ b/wherehows-web/app/services/configurator.ts @@ -51,15 +51,21 @@ export default class Configurator extends Service { * @static * @template K * @param {K} [key] if provided, the value is returned with that key on the config hash is returned + * @param {IAppConfigOrProperty} [defaultValue] if provided, will default if key is not found in config * @returns {IAppConfigOrProperty} * @memberof Configurator */ - static getConfig(key?: K): IAppConfigOrProperty { + static getConfig( + key?: K, + options: { useDefault?: boolean; default?: IAppConfigOrProperty } = {} + ): IAppConfigOrProperty { // Ensure that the application configuration has been successfully cached assert('Please ensure you have invoked the `load` method successfully prior to calling `getConfig`.', configLoaded); return typeof key === 'string' && appConfig.hasOwnProperty(key) ? >deepClone(appConfig[key]) - : >deepClone(appConfig); + : options.useDefault + ? >options.default + : >deepClone(appConfig); } } diff --git a/wherehows-web/app/templates/components/dataset-aclaccess.hbs b/wherehows-web/app/templates/components/dataset-aclaccess.hbs index 3e025f70f3..700b58a230 100644 --- a/wherehows-web/app/templates/components/dataset-aclaccess.hbs +++ b/wherehows-web/app/templates/components/dataset-aclaccess.hbs @@ -217,7 +217,7 @@ {{empty-state heading="There are no users in this dataset's ACL" - subHead="If you feel this is in error, please contact ask_acl@linkedin.com" + subHead=(concat "If you feel this is in error, please contact " jitAclContact) }} {{/if}} diff --git a/wherehows-web/app/templates/components/datasets/containers/dataset-acl-access.hbs b/wherehows-web/app/templates/components/datasets/containers/dataset-acl-access.hbs index 503b77ccb8..af86faedb0 100644 --- a/wherehows-web/app/templates/components/datasets/containers/dataset-acl-access.hbs +++ b/wherehows-web/app/templates/components/datasets/containers/dataset-acl-access.hbs @@ -8,6 +8,7 @@ {{dataset-aclaccess acls=acls aclMoreInfoLink=@aclMoreInfoLink + jitAclContact=jitAclContact hasValidAclRequest=hasValidAclRequest userAclRequest=userAclRequest userHasAclAccess=userHasAclAccess diff --git a/wherehows-web/app/templates/datasets/dataset.hbs b/wherehows-web/app/templates/datasets/dataset.hbs index 4c39d319de..42d8b43cfb 100644 --- a/wherehows-web/app/templates/datasets/dataset.hbs +++ b/wherehows-web/app/templates/datasets/dataset.hbs @@ -164,6 +164,7 @@ urn=encodedUrn aclMoreInfoLink=wikiLinks.jitAcl isJitAclAccessEnabled=isJitAclAccessEnabled + jitAclContact=jitAclContact }} {{/tabs.tabpanel}} diff --git a/wherehows-web/app/typings/api/configurator/configurator.d.ts b/wherehows-web/app/typings/api/configurator/configurator.d.ts index d2ac9dbff5..f189dbb8bd 100644 --- a/wherehows-web/app/typings/api/configurator/configurator.d.ts +++ b/wherehows-web/app/typings/api/configurator/configurator.d.ts @@ -8,6 +8,7 @@ import { DatasetPlatform } from 'wherehows-web/constants'; interface IAppConfig { isInternal: boolean | void; JitAclAccessWhitelist: Array | void; + jitAclContact: string; shouldShowDatasetLineage: boolean; shouldShowDatasetHealth: boolean; // confidence threshold for filtering out higher quality suggestions