Merge pull request #1376 from cptran777/update-jitacl-contact-and-getconfig

Add jitacl contact to configs update getconfigs to take default value
This commit is contained in:
Charlie Tran 2018-09-12 15:58:09 -07:00 committed by GitHub
commit a1ade0a867
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 4 deletions

View File

@ -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

View File

@ -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'

View File

@ -60,6 +60,13 @@ export default class DatasetController extends Controller {
*/
jitAclAccessWhitelist: Array<DatasetPlatform>;
/**
* 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<string, string>}

View File

@ -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')

View File

@ -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<K>} [defaultValue] if provided, will default if key is not found in config
* @returns {IAppConfigOrProperty<K>}
* @memberof Configurator
*/
static getConfig<K extends keyof IAppConfig | undefined>(key?: K): IAppConfigOrProperty<K> {
static getConfig<K extends keyof IAppConfig | undefined>(
key?: K,
options: { useDefault?: boolean; default?: IAppConfigOrProperty<K> } = {}
): IAppConfigOrProperty<K> {
// 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(<keyof IAppConfig>key)
? <IAppConfigOrProperty<K>>deepClone(appConfig[<keyof IAppConfig>key])
: <IAppConfigOrProperty<K>>deepClone(appConfig);
: options.useDefault
? <IAppConfigOrProperty<K>>options.default
: <IAppConfigOrProperty<K>>deepClone(appConfig);
}
}

View File

@ -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}}

View File

@ -8,6 +8,7 @@
{{dataset-aclaccess
acls=acls
aclMoreInfoLink=@aclMoreInfoLink
jitAclContact=jitAclContact
hasValidAclRequest=hasValidAclRequest
userAclRequest=userAclRequest
userHasAclAccess=userHasAclAccess

View File

@ -164,6 +164,7 @@
urn=encodedUrn
aclMoreInfoLink=wikiLinks.jitAcl
isJitAclAccessEnabled=isJitAclAccessEnabled
jitAclContact=jitAclContact
}}
{{/tabs.tabpanel}}

View File

@ -8,6 +8,7 @@ import { DatasetPlatform } from 'wherehows-web/constants';
interface IAppConfig {
isInternal: boolean | void;
JitAclAccessWhitelist: Array<DatasetPlatform> | void;
jitAclContact: string;
shouldShowDatasetLineage: boolean;
shouldShowDatasetHealth: boolean;
// confidence threshold for filtering out higher quality suggestions