forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): update datahub-web client UI code (datahub-project#1806)
* Releases updated version of datahub-web client UI code * Fix typo in yarn lock * Change yarn lock to match yarn registry directories * Previous commit missed some paths * Even more changes to yarnlock missing in previous commit * Include codegen file for typings * Add files to get parity for datahub-web and current OS datahub-midtier * Add in typo fix from previous commit - change to proper license * Implement proper OS fix for person entity picture url * Workarounds for open source DH issues * Fixes institutional memory api and removes unopensourced tabs for datasets * Fixes search dataset deprecation and user search issue as a result of changes * Remove internal only options in the avatar menu
- Loading branch information
1 parent
6d38f5d
commit 2b1efba
Showing
2,634 changed files
with
144,325 additions
and
21,496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
/.ember-cli | ||
/.eslintignore | ||
/.eslintrc.js | ||
/.git/ | ||
/.gitignore | ||
/.watchmanconfig | ||
/.travis.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2020 LinkedIn | ||
|
||
Copyright (c) 2019 | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,48 @@ | ||
@datahub/data-models | ||
============================================================================== | ||
# @datahub/data-models | ||
|
||
[Short description of the addon.] | ||
## Compatibility | ||
|
||
Installation | ||
------------------------------------------------------------------------------ | ||
- Ember.js v3.8 or above | ||
- Ember CLI v2.13 or above | ||
- Node.js v8 or above | ||
|
||
## Installation | ||
|
||
``` | ||
ember install @datahub/data-models | ||
``` | ||
|
||
|
||
Usage | ||
------------------------------------------------------------------------------ | ||
## Usage | ||
|
||
[Longer description of how to use the addon in apps.] | ||
|
||
|
||
Contributing | ||
------------------------------------------------------------------------------ | ||
## Contributing | ||
|
||
### Installation | ||
|
||
* `git clone <repository-url>` | ||
* `cd @datahub/data-models` | ||
* `yarn install` | ||
- `git clone <repository-url>` | ||
- `cd @datahub/data-models` | ||
- `yarn install` | ||
|
||
### Linting | ||
|
||
* `yarn lint:hbs` | ||
* `yarn lint:js` | ||
* `yarn lint:js --fix` | ||
- `yarn lint:hbs` | ||
- `yarn lint:js` | ||
- `yarn lint:js --fix` | ||
|
||
### Running tests | ||
|
||
* `ember test` – Runs the test suite on the current Ember version | ||
* `ember test --server` – Runs the test suite in "watch mode" | ||
* `ember try:each` – Runs the test suite against multiple Ember versions | ||
- `ember test` – Runs the test suite on the current Ember version | ||
- `ember test --server` – Runs the test suite in "watch mode" | ||
- `ember try:each` – Runs the test suite against multiple Ember versions | ||
|
||
### Running the dummy application | ||
|
||
* `ember serve` | ||
* Visit the dummy application at [http://localhost:4200](http://localhost:4200). | ||
- `ember serve` | ||
- Visit the dummy application at [http://localhost:4200](http://localhost:4200). | ||
|
||
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/). | ||
|
||
License | ||
------------------------------------------------------------------------------ | ||
## License | ||
|
||
This project is licensed under the [MIT License](LICENSE.md). | ||
This project is licensed under the [Apache License](LICENSE.md). |
35 changes: 35 additions & 0 deletions
35
datahub-web/@datahub/data-models/addon/api/common/institutional-memory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { IInstitutionalMemory } from '@datahub/metadata-types/types/aspects/institutional-memory'; | ||
import { getJSON, postJSON } from '@datahub/utils/api/fetcher'; | ||
import { ApiVersion, getApiRoot } from '@datahub/utils/api/shared'; | ||
|
||
/** | ||
* Constructs the url for institutional memory | ||
* @param {string} urn - the urn for the entity | ||
*/ | ||
const institutionalMemoryByUrn = (urn: string, entityType: string): string => | ||
`${getApiRoot(ApiVersion.v2)}/${entityType}s/${urn}/institutionalmemory`; | ||
|
||
/** | ||
* Fetches the list of wiki-type url links to documents related to an entity | ||
* @param {string} urn - urn for the entity | ||
*/ | ||
export const readInstitutionalMemory = ( | ||
urn: string, | ||
entityType: string | ||
): Promise<{ elements: Array<IInstitutionalMemory> }> => getJSON({ url: institutionalMemoryByUrn(urn, entityType) }); | ||
|
||
/** | ||
* Returns a view of the full list of wiki-type url links to documents related to an entity. This should be how the | ||
* list appears after any changes by the user (add or delete) | ||
* @param {string} urn - urn for the entity | ||
* @param {Array<IInstitutionalMemory>} wikiLinks - related links snapshot | ||
*/ | ||
export const writeInstitutionalMemory = ( | ||
urn: string, | ||
entityType: string, | ||
wikiLinks: Array<IInstitutionalMemory> | ||
): Promise<void> => | ||
postJSON({ | ||
url: institutionalMemoryByUrn(urn, entityType), | ||
data: { elements: wikiLinks } | ||
}); |
107 changes: 107 additions & 0 deletions
107
datahub-web/@datahub/data-models/addon/api/common/social-actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import { DataModelName } from '@datahub/data-models/constants/entity'; | ||
import { getApiRoot, ApiVersion } from '@datahub/utils/api/shared'; | ||
import { getJSON, postJSON } from '@datahub/utils/api/fetcher'; | ||
import { | ||
ILikesAspect, | ||
ILikeAction, | ||
IFollowsAspect, | ||
IFollowerType | ||
} from '@datahub/metadata-types/types/aspects/social-actions'; | ||
import { encodeUrn } from '@datahub/utils/validators/urn'; | ||
|
||
/** | ||
* Creates a url for a specific entity by urn and the social action we are constructing | ||
* @param {DataModelName} entityType - the type of entity for which we are making this request | ||
* @param {string} urn - identifier for the specific entity for which we want to construct the url | ||
* @param {string} action - the kind of action we are creating | ||
*/ | ||
const getSocialActionsUrl = (entityType: DataModelName, urn: string, action: string): string => | ||
`${getApiRoot(ApiVersion.v2)}/${entityType}/${encodeUrn(urn)}/${action}`; | ||
|
||
/** | ||
* Using the socialActionsUrl as a base, create a function that constructs one specifically for | ||
* like actions | ||
* @param {DataModelName} entityType - type of entity for which we want to construct this url | ||
* @param {string} urn - urn identifier for the specific entity for which we are constructing the url | ||
*/ | ||
const getLikeActionsUrl = (entityType: DataModelName, urn: string): string => | ||
getSocialActionsUrl(entityType, urn, 'likes'); | ||
|
||
/** | ||
* Given a Likes aspect from the backend, returns the actual like actions related to that aspect | ||
* @param actions - the list of like actions that are retrieved from the api | ||
*/ | ||
const getLikeActionsFromAspect = ({ actions }: ILikesAspect): Array<ILikeAction> => actions; | ||
|
||
/** | ||
* Given an entity type and urn, construct a getter for which to retrieve likes information | ||
* @param {DataModelName} entityType - the type of entity for which we want to read like information | ||
* @param {string} urn - the identifier for the entity for which we want to read like information | ||
*/ | ||
export const readLikesForEntity = (entityType: DataModelName, urn: string): Promise<Array<ILikeAction>> => | ||
getJSON({ url: getLikeActionsUrl(entityType, urn) }).then(getLikeActionsFromAspect); | ||
|
||
/** | ||
* Given an entity type and urn, post an update request that adds the user to the list of those who | ||
* like the specified entity | ||
* @param {DataModelName} entityType - the type of entity for which we want to add a like | ||
* @param {string} urn - the identifier for the entity to which to add the user's like action | ||
* @return an updated likes aspect for the entity | ||
*/ | ||
export const addLikeForEntity = (entityType: DataModelName, urn: string): Promise<Array<ILikeAction>> => | ||
postJSON({ url: `${getLikeActionsUrl(entityType, urn)}/add`, data: {} }).then(getLikeActionsFromAspect); | ||
|
||
/** | ||
* Given an entity type and urn, post an update request that removes the user to the list of those | ||
* who like the specified entity | ||
* @param {DataModelName} entityType - the type of entity for which we want to add a like | ||
* @param {string} urn - the identifier for teh entity to which to add the user's like action | ||
* @return an updated likes aspect for the entity | ||
*/ | ||
export const removeLikeForEntity = (entityType: DataModelName, urn: string): Promise<Array<ILikeAction>> => | ||
postJSON({ url: `${getLikeActionsUrl(entityType, urn)}/remove`, data: {} }).then(getLikeActionsFromAspect); | ||
|
||
/** | ||
* Using the socialActionsUrl as a base, create a function that constructs one specifically for | ||
* follow actions | ||
* @param {DataModelName} entityType - the type of entity for which we want to construct this urn | ||
* @param {string} urn - urn identifier for the specific entity instance for which we are | ||
* constructing the url | ||
*/ | ||
const getFollowActionsUrl = (entityType: DataModelName, urn: string): string => | ||
getSocialActionsUrl(entityType, urn, 'follows'); | ||
|
||
/** | ||
* Given the followers aspect from the API response, provided as a convenience function we return | ||
* objects representing the followers themselves | ||
* @param {Array<IFollowAction>} followers - the list of followers presented as | ||
* FollowAction objects | ||
*/ | ||
const getFollowersFromAspect = ({ followers }: IFollowsAspect): Array<IFollowerType> => | ||
followers.map(({ follower }): IFollowerType => follower); | ||
|
||
/** | ||
* Given an entity type and urn, construct a getter for which to retrieve follows information | ||
* @param {DataModelName} entityType - the type of entity for which we want to read follow information | ||
* @param {string} urn - the identifier for the entity for which we want to read follow information | ||
*/ | ||
export const readFollowsForEntity = (entityType: DataModelName, urn: string): Promise<Array<IFollowerType>> => | ||
getJSON({ url: getFollowActionsUrl(entityType, urn) }).then(getFollowersFromAspect); | ||
|
||
/** | ||
* Given an entity type and urn, construct a getter for which to add the user as a follower | ||
* @param {DataModelName} entityType - the type of entity for which we want to add the user as a follower | ||
* @param {string} urn - the identifier for the entity for which we want to update follow information | ||
* @return an updated follow aspect for the entity, if successful | ||
*/ | ||
export const addFollowForEntity = (entityType: DataModelName, urn: string): Promise<Array<IFollowerType>> => | ||
postJSON({ url: `${getFollowActionsUrl(entityType, urn)}/add`, data: {} }).then(getFollowersFromAspect); | ||
|
||
/** | ||
* Given an entity type and urn, construct a getter for which to remove the user as a follower | ||
* @param {DataModelName} entityType - the type of entity for which we want to remove the user as a follower | ||
* @param {string} urn - the identifier for the entity for which we want to update follow information | ||
* @return an updated follow aspect for the entity, if successful | ||
*/ | ||
export const removeFollowForEntity = (entityType: DataModelName, urn: string): Promise<Array<IFollowerType>> => | ||
postJSON({ url: `${getFollowActionsUrl(entityType, urn)}/remove`, data: {} }).then(getFollowersFromAspect); |
Oops, something went wrong.