diff --git a/wherehows-frontend/app/controllers/Application.java b/wherehows-frontend/app/controllers/Application.java index 93acd25b89..f408a71bac 100644 --- a/wherehows-frontend/app/controllers/Application.java +++ b/wherehows-frontend/app/controllers/Application.java @@ -197,9 +197,6 @@ public class Application extends Controller { config.put("appVersion", APP_VERSION); config.put("isInternal", IS_INTERNAL); 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("tracking", trackingInfo()); // In a staging environment, we can trigger this flag to be true so that the UI can handle based on diff --git a/wherehows-web/app/components/dataset-authors.ts b/wherehows-web/app/components/dataset-authors.ts index d245d055f4..695de4d313 100644 --- a/wherehows-web/app/components/dataset-authors.ts +++ b/wherehows-web/app/components/dataset-authors.ts @@ -15,8 +15,7 @@ import { minRequiredConfirmedOwners, validConfirmedOwners, isRequiredMinOwnersNotConfirmed, - isConfirmedOwner, - isSystemGeneratedOwner + isConfirmedOwner } from 'wherehows-web/constants/datasets/owner'; import { OwnerSource, OwnerType } from 'wherehows-web/utils/api/datasets/owners'; import Notifications, { NotificationEvent } from 'wherehows-web/services/notifications'; @@ -174,12 +173,9 @@ export default class DatasetAuthors extends Component { * @memberof DatasetAuthors */ systemGeneratedOwners: ComputedProperty> = 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 // same render" error - return showOwnership === 'show' - ? (get(this, 'suggestedOwners') || []).slice(0) - : get(this, 'owners').filter(isSystemGeneratedOwner); + return (get(this, 'suggestedOwners') || []).slice(0); }); /** diff --git a/wherehows-web/app/constants/datasets/owner.ts b/wherehows-web/app/constants/datasets/owner.ts index b20bbf076e..fcb431e822 100644 --- a/wherehows-web/app/constants/datasets/owner.ts +++ b/wherehows-web/app/constants/datasets/owner.ts @@ -142,14 +142,6 @@ const isConfirmedOwner = ({ source }: IOwner): boolean => source === OwnerSource */ 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 * @param {Array} owners the list of owners to check @@ -168,6 +160,5 @@ export { updateOwner, confirmOwner, isConfirmedOwner, - confirmedOwners, - isSystemGeneratedOwner + confirmedOwners }; diff --git a/wherehows-web/app/controllers/datasets/dataset.ts b/wherehows-web/app/controllers/datasets/dataset.ts index 88216cf2a3..4840b87e30 100644 --- a/wherehows-web/app/controllers/datasets/dataset.ts +++ b/wherehows-web/app/controllers/datasets/dataset.ts @@ -66,13 +66,6 @@ export default class DatasetController extends Controller { */ jitAclAccessWhitelist: Array; - /** - * 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 * @type {boolean} diff --git a/wherehows-web/app/routes/datasets/dataset.ts b/wherehows-web/app/routes/datasets/dataset.ts index 46f504d3b0..4df06c2df0 100644 --- a/wherehows-web/app/routes/datasets/dataset.ts +++ b/wherehows-web/app/routes/datasets/dataset.ts @@ -105,14 +105,10 @@ export default class DatasetRoute extends Route { const jitAclAccessWhitelist: IAppConfig['jitAclAccessWhitelist'] = configuratorService.getConfig< IAppConfig['jitAclAccessWhitelist'] >('JitAclAccessWhitelist'); - const showOwnership = configuratorService.getConfig( - 'showOwnership' - ); setProperties(controller, { isInternal: !!isInternal, - jitAclAccessWhitelist: jitAclAccessWhitelist || [], - showOwnership: showOwnership || 'hide' + jitAclAccessWhitelist: jitAclAccessWhitelist || [] }); } diff --git a/wherehows-web/app/templates/components/dataset-author.hbs b/wherehows-web/app/templates/components/dataset-author.hbs index 08092af47f..da1a7d1ecf 100644 --- a/wherehows-web/app/templates/components/dataset-author.hbs +++ b/wherehows-web/app/templates/components/dataset-author.hbs @@ -31,21 +31,6 @@ {{/unless}} -{{#unless (eq showOwnership "show")}} - - {{#if owner.modifiedTime}} - {{moment-calendar owner.modifiedTime sameElse="MMM Do YYYY, h:mm a"}} - {{else}} - - - Not Saved - - - {{/if}} - -{{/unless}} - {{ember-selector class=(unless isOwnerMutable "nacho-select--hidden-state") diff --git a/wherehows-web/app/templates/components/dataset-authors.hbs b/wherehows-web/app/templates/components/dataset-authors.hbs index 72cc127b82..1182be7376 100644 --- a/wherehows-web/app/templates/components/dataset-authors.hbs +++ b/wherehows-web/app/templates/components/dataset-authors.hbs @@ -1,31 +1,4 @@ -{{#if (eq showOwnership "hide")}} -
-
-

- Add an Owner -

-
- -
- {{user-lookup didFindUser=(action "addOwner")}} -
-
-{{/if}} - -{{#if (eq showOwnership "hide")}} -

- {{#if requiredMinNotConfirmed}} - - Add {{ownersRequiredCount}} owner(s) with ID Type - USER - , Ownership Type - Data Owner, and who is also Active - - {{/if}} -

-{{/if}} - -{{#if (eq showOwnership "show")}} - -
+

Owners @@ -67,7 +40,6 @@ {{dataset-author owner=confirmedOwner ownerTypes=ownerTypes - showOwnership=showOwnership removeOwner=(action "removeOwner") confirmSuggestedOwner=(action "confirmSuggestedOwner") updateOwnerType=(action "updateOwnerType") @@ -91,59 +63,7 @@

-{{else}} - -
-
-

- Owners Confirmed -

- - -
- - {{#if confirmedOwners.length}} - - - - - - - - - - - - - - {{#each confirmedOwners as |confirmedOwner|}} - - - {{dataset-author owner=confirmedOwner ownerTypes=ownerTypes removeOwner=(action "removeOwner") confirmSuggestedOwner=(action - "confirmSuggestedOwner") updateOwnerType=(action "updateOwnerType") }} - - {{else}} {{/each}} -
LDAP UsernameFull NameID TypeLast Modified - Ownership Type - - - - - - - - - Remove Owner
- - {{else}} {{empty-state heading="No Confirmed Owners" subHead="Search for users above to add to the list of owners" }} {{/if}} -
- -{{/if}} - -{{#if (eq showOwnership "show")}} -
+
{{datasets/owners/suggested-owners owners=systemGeneratedOwners ownerTypes=ownerTypes @@ -152,67 +72,6 @@ confirmSuggestedOwner=(action "confirmSuggestedOwner") updateOwnerType=(action "updateOwnerType")}}
-{{/if}} - -{{#if systemGeneratedOwners}} - - {{#unless (eq showOwnership "show")}} - -
-
-

- System Suggested Owners -

- - -
- - - - - - - - - - - - - - - - {{#each systemGeneratedOwners as |systemGeneratedOwner|}} - {{dataset-author - owner=systemGeneratedOwner - ownerTypes=ownerTypes - commonOwners=commonOwners - removeOwner=(action "removeOwner") - confirmSuggestedOwner=(action "confirmSuggestedOwner") - updateOwnerType=(action "updateOwnerType") - }} - {{/each}} - - -
LDAP UsernameFull NameID TypeSourceLast Modified - Ownership Type - - - - - - - - - Add Suggested Owner
-
- - {{/unless}} -{{/if}}
diff --git a/wherehows-web/app/templates/components/datasets/containers/dataset-ownership.hbs b/wherehows-web/app/templates/components/datasets/containers/dataset-ownership.hbs index 802cd855d2..c4df7405ad 100644 --- a/wherehows-web/app/templates/components/datasets/containers/dataset-ownership.hbs +++ b/wherehows-web/app/templates/components/datasets/containers/dataset-ownership.hbs @@ -34,7 +34,6 @@ owners=owners suggestedOwners=suggestedOwners ownerTypes=ownerTypes - showOwnership=showOwnership save=(action "saveOwnerChanges") }} diff --git a/wherehows-web/app/templates/datasets/dataset.hbs b/wherehows-web/app/templates/datasets/dataset.hbs index 3bdfd4fba1..3128581ea8 100644 --- a/wherehows-web/app/templates/datasets/dataset.hbs +++ b/wherehows-web/app/templates/datasets/dataset.hbs @@ -105,7 +105,7 @@ {{/tabs.tabpanel}} {{#tabs.tabpanel tabIds.Ownership}} - {{datasets/containers/dataset-ownership urn=encodedUrn showOwnership=showOwnership}} + {{datasets/containers/dataset-ownership urn=encodedUrn}} {{/tabs.tabpanel}} {{#tabs.tabpanel tabIds.Compliance}} diff --git a/wherehows-web/tests/helpers/datasets/compliance-policy/field-changeset-constants.ts b/wherehows-web/tests/helpers/datasets/compliance-policy/field-changeset-constants.ts index 0faf776b79..7f16054b27 100644 --- a/wherehows-web/tests/helpers/datasets/compliance-policy/field-changeset-constants.ts +++ b/wherehows-web/tests/helpers/datasets/compliance-policy/field-changeset-constants.ts @@ -4,15 +4,6 @@ const suggestion = { identifierType: 'same', confidenceLevel: 0.6 }; * @type {Array<{isDirty: boolean; privacyPolicyExists: boolean; suggestionAuthority: boolean; suggestion?: {}; __requiresReview__: boolean; __msg__: string}> */ 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, privacyPolicyExists: false, diff --git a/wherehows-web/tests/integration/components/dataset-authors-test.js b/wherehows-web/tests/integration/components/dataset-authors-test.js index 82cb3e3871..1dfcc424d9 100644 --- a/wherehows-web/tests/integration/components/dataset-authors-test.js +++ b/wherehows-web/tests/integration/components/dataset-authors-test.js @@ -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) { assert.expect(3); + const [owner, suggestedOwner] = owners; + const resolvedOwners = [owner]; + const suggestedOwners = [suggestedOwner]; - const initialLength = owners.length; + const initialLength = resolvedOwners.length; let userName, confirmedOwner; - this.set('owners', owners); + this.set('owners', resolvedOwners); this.set('ownerTypes', ownerTypes); 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( 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` ); - 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'); confirmedOwner = this.get('owners').findBy('confirmedBy', userName); diff --git a/wherehows-web/tests/integration/components/datasets/containers/dataset-ownership-test.js b/wherehows-web/tests/integration/components/datasets/containers/dataset-ownership-test.js index d75fd0a8f4..11c7601f00 100644 --- a/wherehows-web/tests/integration/components/datasets/containers/dataset-ownership-test.js +++ b/wherehows-web/tests/integration/components/datasets/containers/dataset-ownership-test.js @@ -35,7 +35,7 @@ test('it renders', async function(assert) { 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)); assert.equal(