mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-31 10:49:00 +00:00 
			
		
		
		
	 ef065d0e1d
			
		
	
	
		ef065d0e1d
		
	
	
	
	
		
			
			refactors comments feature: initial get comments and create comment updates tsconfig to support es2017 object prototype methods: values, entries, creates user-avatar component, adds styles, converts constants files to ts updates comment editor. updates styling. adds auto focus on click adds comment deletion adds confirmation dialog for comment deletion adds string union generic constraint type. adds comment stream header. adds comment update feature. adds style modifications and additions for comment components. refactors actions for comments using strategy pattern to allow for abstraction. adds dataset-constants constants module
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { CommentTypeUnion } from 'wherehows-web/typings/api/datasets/comments';
 | |
| 
 | |
| /**
 | |
|  * List of CrUD actions that can be performed on a stream comment
 | |
|  */
 | |
| type StreamCommentActionsUnion = 'create' | 'update' | 'destroy';
 | |
| 
 | |
| /**
 | |
|  * List of CrUD actions that can be performed on the dataset stream
 | |
|  */
 | |
| type DatasetStreamActionsUnion = 'add' | 'modify' | 'destroy';
 | |
| 
 | |
| /**
 | |
|  * Common options to pass to the editor component on instantiation
 | |
|  * @type {object}
 | |
|  */
 | |
| const baseCommentEditorOptions = {
 | |
|   disableDoubleReturn: true,
 | |
|   disableExtraSpaces: true,
 | |
|   disableEditing: true
 | |
| };
 | |
| 
 | |
| /**
 | |
|  * Options relevant to the new comment editor
 | |
|  * @type {object}
 | |
|  */
 | |
| const newCommentEditorOptions = {
 | |
|   placeholder: {
 | |
|     text: 'Type here. You can format text by selecting it, and/or using keyboard shortcuts like cmd-b, e.t.c',
 | |
|     hideOnClick: false
 | |
|   }
 | |
| };
 | |
| 
 | |
| /**
 | |
|  * List of Dataset Comment types
 | |
|  * @type {ReadonlyArray<CommentTypeUnion>}
 | |
|  */
 | |
| const CommentTypes: ReadonlyArray<CommentTypeUnion> = Object.freeze<CommentTypeUnion>([
 | |
|   'Comment',
 | |
|   'Question',
 | |
|   'Description',
 | |
|   'Partition',
 | |
|   'ETL Schedule',
 | |
|   'Grain',
 | |
|   'DQ Issue'
 | |
| ]);
 | |
| 
 | |
| export {
 | |
|   baseCommentEditorOptions,
 | |
|   newCommentEditorOptions,
 | |
|   CommentTypes,
 | |
|   StreamCommentActionsUnion,
 | |
|   DatasetStreamActionsUnion
 | |
| };
 |