mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-01 05:13:15 +00:00
Merge pull request #1225 from theseyi/remove-ownership-flags
removes obsolete flags for ownership feature gate
This commit is contained in:
commit
62c2bd5837
@ -197,9 +197,6 @@ public class Application extends Controller {
|
|||||||
config.put("appVersion", APP_VERSION);
|
config.put("appVersion", APP_VERSION);
|
||||||
config.put("isInternal", IS_INTERNAL);
|
config.put("isInternal", IS_INTERNAL);
|
||||||
config.set("wikiLinks", wikiLinks());
|
config.set("wikiLinks", wikiLinks());
|
||||||
// Ownership tab is currently in a UX revamp, this flag will determine whether to show it or not
|
|
||||||
// under certain environments
|
|
||||||
config.put("showOwnership", WHZ_DS_OWNERSHIP_TAB);
|
|
||||||
config.set("JitAclAccessWhitelist", Json.toJson(StringUtils.split(JIT_ACL_WHITELIST, ',')));
|
config.set("JitAclAccessWhitelist", Json.toJson(StringUtils.split(JIT_ACL_WHITELIST, ',')));
|
||||||
config.set("tracking", trackingInfo());
|
config.set("tracking", trackingInfo());
|
||||||
// In a staging environment, we can trigger this flag to be true so that the UI can handle based on
|
// In a staging environment, we can trigger this flag to be true so that the UI can handle based on
|
||||||
|
@ -15,8 +15,7 @@ import {
|
|||||||
minRequiredConfirmedOwners,
|
minRequiredConfirmedOwners,
|
||||||
validConfirmedOwners,
|
validConfirmedOwners,
|
||||||
isRequiredMinOwnersNotConfirmed,
|
isRequiredMinOwnersNotConfirmed,
|
||||||
isConfirmedOwner,
|
isConfirmedOwner
|
||||||
isSystemGeneratedOwner
|
|
||||||
} from 'wherehows-web/constants/datasets/owner';
|
} from 'wherehows-web/constants/datasets/owner';
|
||||||
import { OwnerSource, OwnerType } from 'wherehows-web/utils/api/datasets/owners';
|
import { OwnerSource, OwnerType } from 'wherehows-web/utils/api/datasets/owners';
|
||||||
import Notifications, { NotificationEvent } from 'wherehows-web/services/notifications';
|
import Notifications, { NotificationEvent } from 'wherehows-web/services/notifications';
|
||||||
@ -174,12 +173,9 @@ export default class DatasetAuthors extends Component {
|
|||||||
* @memberof DatasetAuthors
|
* @memberof DatasetAuthors
|
||||||
*/
|
*/
|
||||||
systemGeneratedOwners: ComputedProperty<Array<IOwner>> = computed('suggestedOwners', function() {
|
systemGeneratedOwners: ComputedProperty<Array<IOwner>> = computed('suggestedOwners', function() {
|
||||||
const showOwnership = get(this, 'showOwnership');
|
|
||||||
// Creates a copy of suggested owners since using it directly seems to invoke a "modified twice in the
|
// Creates a copy of suggested owners since using it directly seems to invoke a "modified twice in the
|
||||||
// same render" error
|
// same render" error
|
||||||
return showOwnership === 'show'
|
return (get(this, 'suggestedOwners') || []).slice(0);
|
||||||
? (get(this, 'suggestedOwners') || []).slice(0)
|
|
||||||
: get(this, 'owners').filter(isSystemGeneratedOwner);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -142,14 +142,6 @@ const isConfirmedOwner = ({ source }: IOwner): boolean => source === OwnerSource
|
|||||||
*/
|
*/
|
||||||
const confirmedOwners = arrayFilter(isConfirmedOwner);
|
const confirmedOwners = arrayFilter(isConfirmedOwner);
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks that an owner is a system generated owner
|
|
||||||
* @param {IOwner} { source, idType }
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
const isSystemGeneratedOwner = ({ source, idType }: IOwner): boolean =>
|
|
||||||
source !== OwnerSource.Ui && idType === OwnerIdType.User;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks that the required minimum number of confirmed users is met with the type Owner and idType User
|
* Checks that the required minimum number of confirmed users is met with the type Owner and idType User
|
||||||
* @param {Array<IOwner>} owners the list of owners to check
|
* @param {Array<IOwner>} owners the list of owners to check
|
||||||
@ -168,6 +160,5 @@ export {
|
|||||||
updateOwner,
|
updateOwner,
|
||||||
confirmOwner,
|
confirmOwner,
|
||||||
isConfirmedOwner,
|
isConfirmedOwner,
|
||||||
confirmedOwners,
|
confirmedOwners
|
||||||
isSystemGeneratedOwner
|
|
||||||
};
|
};
|
||||||
|
@ -66,13 +66,6 @@ export default class DatasetController extends Controller {
|
|||||||
*/
|
*/
|
||||||
jitAclAccessWhitelist: Array<DatasetPlatform>;
|
jitAclAccessWhitelist: Array<DatasetPlatform>;
|
||||||
|
|
||||||
/**
|
|
||||||
* Flag indicating whether or not to show the ownership revamp tab information
|
|
||||||
* @type {string}
|
|
||||||
* @memberof DatasetController
|
|
||||||
*/
|
|
||||||
showOwnership: string;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag indicating the dataset policy is derived from an upstream source
|
* Flag indicating the dataset policy is derived from an upstream source
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
|
@ -105,14 +105,10 @@ export default class DatasetRoute extends Route {
|
|||||||
const jitAclAccessWhitelist: IAppConfig['jitAclAccessWhitelist'] = <IAppConfig['jitAclAccessWhitelist']>configuratorService.getConfig<
|
const jitAclAccessWhitelist: IAppConfig['jitAclAccessWhitelist'] = <IAppConfig['jitAclAccessWhitelist']>configuratorService.getConfig<
|
||||||
IAppConfig['jitAclAccessWhitelist']
|
IAppConfig['jitAclAccessWhitelist']
|
||||||
>('JitAclAccessWhitelist');
|
>('JitAclAccessWhitelist');
|
||||||
const showOwnership = <IAppConfig['showOwnership']>configuratorService.getConfig<IAppConfig['showOwnership']>(
|
|
||||||
'showOwnership'
|
|
||||||
);
|
|
||||||
|
|
||||||
setProperties(controller, {
|
setProperties(controller, {
|
||||||
isInternal: !!isInternal,
|
isInternal: !!isInternal,
|
||||||
jitAclAccessWhitelist: jitAclAccessWhitelist || [],
|
jitAclAccessWhitelist: jitAclAccessWhitelist || []
|
||||||
showOwnership: showOwnership || 'hide'
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,21 +31,6 @@
|
|||||||
|
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
{{#unless (eq showOwnership "show")}}
|
|
||||||
<td>
|
|
||||||
{{#if owner.modifiedTime}}
|
|
||||||
{{moment-calendar owner.modifiedTime sameElse="MMM Do YYYY, h:mm a"}}
|
|
||||||
{{else}}
|
|
||||||
|
|
||||||
<span
|
|
||||||
class="nacho-button nacho-button--small dataset-author-record__indicator--disabled">
|
|
||||||
Not Saved
|
|
||||||
</span>
|
|
||||||
|
|
||||||
{{/if}}
|
|
||||||
</td>
|
|
||||||
{{/unless}}
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
{{ember-selector
|
{{ember-selector
|
||||||
class=(unless isOwnerMutable "nacho-select--hidden-state")
|
class=(unless isOwnerMutable "nacho-select--hidden-state")
|
||||||
|
@ -1,31 +1,4 @@
|
|||||||
{{#if (eq showOwnership "hide")}}
|
<section class="dataset-author">
|
||||||
<section class="dataset-author-user-lookup">
|
|
||||||
<header>
|
|
||||||
<h2 class="dataset-author-user-lookup__header">
|
|
||||||
Add an Owner
|
|
||||||
</h2>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="dataset-author-user-lookup__container">
|
|
||||||
{{user-lookup didFindUser=(action "addOwner")}}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if (eq showOwnership "hide")}}
|
|
||||||
<p class="dataset-author__required-count">
|
|
||||||
{{#if requiredMinNotConfirmed}}
|
|
||||||
|
|
||||||
Add <strong>{{ownersRequiredCount}}</strong> owner(s) with ID Type - <code>USER</code>
|
|
||||||
, Ownership Type - <code>Data Owner</code>, and who is also <code>Active</code>
|
|
||||||
|
|
||||||
{{/if}}
|
|
||||||
</p>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if (eq showOwnership "show")}}
|
|
||||||
|
|
||||||
<section class="dataset-author">
|
|
||||||
<header>
|
<header>
|
||||||
<h2 class="dataset-author__header">
|
<h2 class="dataset-author__header">
|
||||||
Owners
|
Owners
|
||||||
@ -67,7 +40,6 @@
|
|||||||
{{dataset-author
|
{{dataset-author
|
||||||
owner=confirmedOwner
|
owner=confirmedOwner
|
||||||
ownerTypes=ownerTypes
|
ownerTypes=ownerTypes
|
||||||
showOwnership=showOwnership
|
|
||||||
removeOwner=(action "removeOwner")
|
removeOwner=(action "removeOwner")
|
||||||
confirmSuggestedOwner=(action "confirmSuggestedOwner")
|
confirmSuggestedOwner=(action "confirmSuggestedOwner")
|
||||||
updateOwnerType=(action "updateOwnerType")
|
updateOwnerType=(action "updateOwnerType")
|
||||||
@ -91,59 +63,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{{else}}
|
<section class="dataset-author">
|
||||||
|
|
||||||
<section class="dataset-author">
|
|
||||||
<header>
|
|
||||||
<h2 class="dataset-author__header">
|
|
||||||
Owners Confirmed
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<p class="dataset-author__byline">
|
|
||||||
These are dataset ownership records that have been manually entered / confirmed by a human
|
|
||||||
</p>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
{{#if confirmedOwners.length}}
|
|
||||||
|
|
||||||
<table class="nacho-table nacho-table--bordered dataset-owner-table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="dataset-author-column--wide">LDAP Username</th>
|
|
||||||
<th>Full Name</th>
|
|
||||||
<th class="dataset-author-column--narrow">ID Type</th>
|
|
||||||
<th>Last Modified</th>
|
|
||||||
<th>
|
|
||||||
Ownership Type
|
|
||||||
|
|
||||||
<!--TODO: DSS-6716-->
|
|
||||||
<!-- DRY out with wrapper component that takes the link as an attribute-->
|
|
||||||
<a target="_blank" href="https://iwww.corp.linkedin.com/wiki/cf/display/DWH/Metadata+Acquisition#ProjectOverview-ownership">
|
|
||||||
<sup>
|
|
||||||
<span class="glyphicon glyphicon-question-sign" title="Link to more information"></span>
|
|
||||||
</sup>
|
|
||||||
</a>
|
|
||||||
</th>
|
|
||||||
<th>Remove Owner</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
{{#each confirmedOwners as |confirmedOwner|}}
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
{{dataset-author owner=confirmedOwner ownerTypes=ownerTypes removeOwner=(action "removeOwner") confirmSuggestedOwner=(action
|
|
||||||
"confirmSuggestedOwner") updateOwnerType=(action "updateOwnerType") }}
|
|
||||||
</tbody>
|
|
||||||
{{else}} {{/each}}
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{{else}} {{empty-state heading="No Confirmed Owners" subHead="Search for users above to add to the list of owners" }} {{/if}}
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if (eq showOwnership "show")}}
|
|
||||||
<section class="dataset-author">
|
|
||||||
{{datasets/owners/suggested-owners
|
{{datasets/owners/suggested-owners
|
||||||
owners=systemGeneratedOwners
|
owners=systemGeneratedOwners
|
||||||
ownerTypes=ownerTypes
|
ownerTypes=ownerTypes
|
||||||
@ -152,67 +72,6 @@
|
|||||||
confirmSuggestedOwner=(action "confirmSuggestedOwner")
|
confirmSuggestedOwner=(action "confirmSuggestedOwner")
|
||||||
updateOwnerType=(action "updateOwnerType")}}
|
updateOwnerType=(action "updateOwnerType")}}
|
||||||
</section>
|
</section>
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if systemGeneratedOwners}}
|
|
||||||
|
|
||||||
{{#unless (eq showOwnership "show")}}
|
|
||||||
|
|
||||||
<section class="dataset-author">
|
|
||||||
<header>
|
|
||||||
<h2 class="dataset-author__header">
|
|
||||||
System Suggested Owners
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<p class="dataset-author__byline">
|
|
||||||
These are dataset ownership records, suggested based on information derived from the source metadata.
|
|
||||||
</p>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<table class="nacho-table nacho-table--bordered dataset-owner-table">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="dataset-author-column--wide">LDAP Username</th>
|
|
||||||
<th>Full Name</th>
|
|
||||||
<th class="dataset-author-column--narrow">ID Type</th>
|
|
||||||
<th>Source</th>
|
|
||||||
<th>Last Modified</th>
|
|
||||||
<th>
|
|
||||||
Ownership Type
|
|
||||||
|
|
||||||
<!--TODO: DSS-6716-->
|
|
||||||
<!-- DRY out with wrapper component that takes the link as an attribute-->
|
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
href="https://iwww.corp.linkedin.com/wiki/cf/display/DWH/Metadata+Acquisition#ProjectOverview-ownership">
|
|
||||||
<sup>
|
|
||||||
<span class="glyphicon glyphicon-question-sign"
|
|
||||||
title="Link to more information"></span>
|
|
||||||
</sup>
|
|
||||||
</a>
|
|
||||||
</th>
|
|
||||||
<th class="dataset-owner-table--wrap">Add Suggested Owner</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
{{#each systemGeneratedOwners as |systemGeneratedOwner|}}
|
|
||||||
{{dataset-author
|
|
||||||
owner=systemGeneratedOwner
|
|
||||||
ownerTypes=ownerTypes
|
|
||||||
commonOwners=commonOwners
|
|
||||||
removeOwner=(action "removeOwner")
|
|
||||||
confirmSuggestedOwner=(action "confirmSuggestedOwner")
|
|
||||||
updateOwnerType=(action "updateOwnerType")
|
|
||||||
}}
|
|
||||||
{{/each}}
|
|
||||||
</tbody>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{{/unless}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<section class="action-bar">
|
<section class="action-bar">
|
||||||
<div class="container action-bar__content">
|
<div class="container action-bar__content">
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
owners=owners
|
owners=owners
|
||||||
suggestedOwners=suggestedOwners
|
suggestedOwners=suggestedOwners
|
||||||
ownerTypes=ownerTypes
|
ownerTypes=ownerTypes
|
||||||
showOwnership=showOwnership
|
|
||||||
save=(action "saveOwnerChanges")
|
save=(action "saveOwnerChanges")
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
{{/tabs.tabpanel}}
|
{{/tabs.tabpanel}}
|
||||||
|
|
||||||
{{#tabs.tabpanel tabIds.Ownership}}
|
{{#tabs.tabpanel tabIds.Ownership}}
|
||||||
{{datasets/containers/dataset-ownership urn=encodedUrn showOwnership=showOwnership}}
|
{{datasets/containers/dataset-ownership urn=encodedUrn}}
|
||||||
{{/tabs.tabpanel}}
|
{{/tabs.tabpanel}}
|
||||||
|
|
||||||
{{#tabs.tabpanel tabIds.Compliance}}
|
{{#tabs.tabpanel tabIds.Compliance}}
|
||||||
|
@ -4,15 +4,6 @@ const suggestion = { identifierType: 'same', confidenceLevel: 0.6 };
|
|||||||
* @type {Array<{isDirty: boolean; privacyPolicyExists: boolean; suggestionAuthority: boolean; suggestion?: {}; __requiresReview__: boolean; __msg__: string}>
|
* @type {Array<{isDirty: boolean; privacyPolicyExists: boolean; suggestionAuthority: boolean; suggestion?: {}; __requiresReview__: boolean; __msg__: string}>
|
||||||
*/
|
*/
|
||||||
const mockFieldChangeSets = [
|
const mockFieldChangeSets = [
|
||||||
{
|
|
||||||
isDirty: true,
|
|
||||||
privacyPolicyExists: true,
|
|
||||||
suggestionAuthority: false,
|
|
||||||
suggestion,
|
|
||||||
identifierType: 'other',
|
|
||||||
__requiresReview__: true,
|
|
||||||
__msg__: 'Suggestion exists but user has not affirmed or ignored suggestion (suggestionAuthority)'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
isDirty: true,
|
isDirty: true,
|
||||||
privacyPolicyExists: false,
|
privacyPolicyExists: false,
|
||||||
|
@ -45,14 +45,20 @@ test('it should remove an owner when removeOwner is invoked', function(assert) {
|
|||||||
|
|
||||||
test('it should update a suggested owner to confirmed', function(assert) {
|
test('it should update a suggested owner to confirmed', function(assert) {
|
||||||
assert.expect(3);
|
assert.expect(3);
|
||||||
|
const [owner, suggestedOwner] = owners;
|
||||||
|
const resolvedOwners = [owner];
|
||||||
|
const suggestedOwners = [suggestedOwner];
|
||||||
|
|
||||||
const initialLength = owners.length;
|
const initialLength = resolvedOwners.length;
|
||||||
let userName, confirmedOwner;
|
let userName, confirmedOwner;
|
||||||
|
|
||||||
this.set('owners', owners);
|
this.set('owners', resolvedOwners);
|
||||||
this.set('ownerTypes', ownerTypes);
|
this.set('ownerTypes', ownerTypes);
|
||||||
this.set('saveOwnerChanges', noop);
|
this.set('saveOwnerChanges', noop);
|
||||||
this.render(hbs`{{dataset-authors owners=owners ownerTypes=ownerTypes save=(action saveOwnerChanges)}}`);
|
this.set('suggestedOwners', suggestedOwners);
|
||||||
|
this.render(
|
||||||
|
hbs`{{dataset-authors owners=owners suggestedOwners=suggestedOwners ownerTypes=ownerTypes save=(action saveOwnerChanges)}}`
|
||||||
|
);
|
||||||
|
|
||||||
assert.equal(
|
assert.equal(
|
||||||
this.get('owners.length'),
|
this.get('owners.length'),
|
||||||
@ -60,7 +66,8 @@ test('it should update a suggested owner to confirmed', function(assert) {
|
|||||||
`the list of owners is ${initialLength} before adding confirmed owner`
|
`the list of owners is ${initialLength} before adding confirmed owner`
|
||||||
);
|
);
|
||||||
|
|
||||||
triggerEvent('.confirm-suggested-dataset-author', 'click');
|
triggerEvent('.dataset-authors-suggested__info__trigger', 'click');
|
||||||
|
triggerEvent('.suggested-owner-card__owner-info__add button', 'click');
|
||||||
|
|
||||||
userName = this.get('current-user.currentUser.userName');
|
userName = this.get('current-user.currentUser.userName');
|
||||||
confirmedOwner = this.get('owners').findBy('confirmedBy', userName);
|
confirmedOwner = this.get('owners').findBy('confirmedBy', userName);
|
||||||
|
@ -35,7 +35,7 @@ test('it renders', async function(assert) {
|
|||||||
JSON.stringify([])
|
JSON.stringify([])
|
||||||
]);
|
]);
|
||||||
|
|
||||||
this.render(hbs`{{datasets/containers/dataset-ownership urn=urn showOwnership="show"}}`);
|
this.render(hbs`{{datasets/containers/dataset-ownership urn=urn}}`);
|
||||||
|
|
||||||
await waitUntil(() => find(lookupClass));
|
await waitUntil(() => find(lookupClass));
|
||||||
assert.equal(
|
assert.equal(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user