3
3
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
4
4
*/
5
5
6
- import { Icon , Gap } from "../components" ;
7
- import { plural } from "@cocalc/util/misc" ;
8
6
import { Button } from "antd" ;
9
- import { Alert , ButtonGroup , ButtonToolbar } from "../antd-bootstrap" ;
10
- import { webapp_client } from "../webapp-client" ;
11
- import { alert_message } from "../alerts" ;
7
+
8
+ import { ResetProjectsConfirmation } from "@cocalc/frontend/account/upgrades/reset-projects" ;
9
+ import { alert_message } from "@cocalc/frontend/alerts" ;
10
+ import {
11
+ Alert ,
12
+ ButtonGroup ,
13
+ ButtonToolbar ,
14
+ } from "@cocalc/frontend/antd-bootstrap" ;
12
15
import {
13
16
React ,
14
17
useActions ,
15
18
useMemo ,
16
- useTypedRedux ,
17
19
useState ,
18
- } from "../app-framework" ;
19
- import { ResetProjectsConfirmation } from "../account/upgrades/reset-projects" ;
20
+ useTypedRedux ,
21
+ } from "@cocalc/frontend/app-framework" ;
22
+ import { Gap , Icon } from "@cocalc/frontend/components" ;
23
+ import { webapp_client } from "@cocalc/frontend/webapp-client" ;
24
+ import { plural } from "@cocalc/util/misc" ;
20
25
21
26
interface Props {
22
27
visible_projects : string [ ] ;
@@ -31,11 +36,9 @@ export const ProjectsListingDescription: React.FC<Props> = ({
31
36
const hidden = useTypedRedux ( "projects" , "hidden" ) ;
32
37
const search : string | undefined = useTypedRedux ( "projects" , "search" ) ;
33
38
const selected_hashtags = useTypedRedux ( "projects" , "selected_hashtags" ) ;
34
- const selected_hashtags_for_filter : {
35
- [ tag : string ] : boolean ;
36
- } = useMemo ( ( ) => {
39
+ const selected_hashtags_for_filter : string [ ] = useMemo ( ( ) => {
37
40
const filter = `${ ! ! hidden } -${ ! ! deleted } ` ;
38
- return selected_hashtags ?. get ( filter ) ?. toJS ( ) ?? { } ;
41
+ return selected_hashtags ?. get ( filter ) ?. toJS ( ) ?? [ ] ;
39
42
} , [ selected_hashtags , deleted , hidden ] ) ;
40
43
41
44
const [ show_alert , set_show_alert ] = useState <
@@ -130,7 +133,7 @@ export const ProjectsListingDescription: React.FC<Props> = ({
130
133
let query = ( search ?? "" ) . toLowerCase ( ) ;
131
134
const hashtags_string = ( ( ) => {
132
135
const result : string [ ] = [ ] ;
133
- for ( const name in selected_hashtags_for_filter ) {
136
+ for ( const name of selected_hashtags_for_filter ) {
134
137
result . push ( name ) ;
135
138
}
136
139
return result ;
@@ -261,7 +264,7 @@ export const ProjectsListingDescription: React.FC<Props> = ({
261
264
return visible_projects . filter (
262
265
( project_id ) =>
263
266
project_map ?. getIn ( [ project_id , "users" , account_id , "group" ] ) !==
264
- "owner"
267
+ "owner" ,
265
268
) ;
266
269
}
267
270
@@ -316,15 +319,15 @@ export const ProjectsListingDescription: React.FC<Props> = ({
316
319
visible_projects . length
317
320
} ${ plural (
318
321
visible_projects . length ,
319
- "project"
322
+ "project" ,
320
323
) } listed here (you own the other ${ plural ( other , "one" ) } ).`;
321
324
} else {
322
325
if ( v . length === 1 ) {
323
326
desc = "You are a collaborator on the one project listed here." ;
324
327
} else {
325
328
desc = `You are a collaborator on ALL of the ${ v . length } ${ plural (
326
329
v . length ,
327
- "project"
330
+ "project" ,
328
331
) } listed here.`;
329
332
}
330
333
}
0 commit comments