Skip to content

Commit

Permalink
Fix deprecation warnings and deprecate old CI actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nukeop committed Oct 25, 2023
1 parent 350a3f0 commit 713d00f
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 229 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI job - new
name: CI job

on:
push:
Expand Down
117 changes: 0 additions & 117 deletions .github/workflows/build.yml

This file was deleted.

83 changes: 39 additions & 44 deletions packages/ui/lib/components/LibraryListTypeToggle/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Button } from 'semantic-ui-react';
import { withHandlers } from 'recompose';

import styles from './styles.scss';

Expand All @@ -13,44 +12,45 @@ export const LIST_TYPE = Object.freeze({
});

const LibraryListTypeToggle = ({
toggleSimpleList,
toggleAlbumGrid,
// toggleAlbumList,
toggleFolderTree,
toggleListType,
listType
}) => (
<Button.Group className={styles.library_list_type_toggle}>
<Button
data-testid='library-list-type-toggle-simple-list'
inverted
icon='unordered list'
onClick={toggleSimpleList}
active={listType === LIST_TYPE.SIMPLE_LIST}
/>
<Button
data-testid='library-list-type-toggle-album-grid'
inverted
icon='th'
onClick={toggleAlbumGrid}
active={listType === LIST_TYPE.ALBUM_GRID}
/>
{
// TODO: To be developed and re-enabled later
// <Button
// inverted icon='bars' onClick={toggleAlbumList}
// active={listType === LIST_TYPE.ALBUM_LIST}
//
// />
}
<Button
data-testid='library-list-type-toggle-folder-tree'
inverted
icon='folder'
onClick={toggleFolderTree}
active={listType === LIST_TYPE.FOLDER_TREE}
/>
</Button.Group>
);
}) => {
const toggleSimpleList = () => toggleListType(LIST_TYPE.SIMPLE_LIST);
const toggleAlbumGrid = () => toggleListType(LIST_TYPE.ALBUM_GRID);
const toggleAlbumList = () => toggleListType(LIST_TYPE.ALBUM_LIST);
const toggleFolderTree = () => toggleListType(LIST_TYPE.FOLDER_TREE);

return (
<Button.Group className={styles.library_list_type_toggle}>
<Button
data-testid='library-list-type-toggle-simple-list'
inverted
icon='unordered list'
onClick={toggleSimpleList}
active={listType === LIST_TYPE.SIMPLE_LIST} />
<Button
data-testid='library-list-type-toggle-album-grid'
inverted
icon='th'
onClick={toggleAlbumGrid}
active={listType === LIST_TYPE.ALBUM_GRID} />
{
// TODO: To be developed and re-enabled later
// <Button
// inverted icon='bars' onClick={toggleAlbumList}
// active={listType === LIST_TYPE.ALBUM_LIST}
//
// />
}
<Button
data-testid='library-list-type-toggle-folder-tree'
inverted
icon='folder'
onClick={toggleFolderTree}
active={listType === LIST_TYPE.FOLDER_TREE} />
</Button.Group>
);
};


LibraryListTypeToggle.propTypes = {
Expand All @@ -59,9 +59,4 @@ LibraryListTypeToggle.propTypes = {
listType: PropTypes.string
};

export default withHandlers({
toggleSimpleList: ({ toggleListType }) => () => toggleListType(LIST_TYPE.SIMPLE_LIST),
toggleAlbumGrid: ({ toggleListType }) => () => toggleListType(LIST_TYPE.ALBUM_GRID),
toggleAlbumList: ({ toggleListType }) => () => toggleListType(LIST_TYPE.ALBUM_LIST),
toggleFolderTree: ({ toggleListType }) => () => toggleListType(LIST_TYPE.FOLDER_TREE)
})(LibraryListTypeToggle);
export default LibraryListTypeToggle;
125 changes: 58 additions & 67 deletions packages/ui/lib/components/UserPluginsItem/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import { Button, Icon } from 'semantic-ui-react';
import { compose, withHandlers } from 'recompose';

import Loader from '../Loader';
import common from '../../common.scss';
Expand All @@ -15,69 +14,70 @@ const UserPluginsItem = ({
image,
author,
loading,
error,
handleDelete,
handleAuthorClick
}) => (
<div
className={cx(
common.nuclear,
styles.user_plugins_item,
{ loading, error }
)}
>
{
image && !loading &&
error
}) => {
const handleDelete = () => {
deleteUserPlugin(path);
};
const handleAuthorClick = () => {
onAuthorClick(author);
};

return (
<div
className={cx(
common.nuclear,
styles.user_plugins_item,
{ loading, error }
)}
>
{image && !loading &&
<div className={styles.plugin_icon}>
<img src={image}/>
</div>
}
{
loading &&
<div className={styles.plugin_icon}>
<Loader type='small' />
</div>
}
<img src={image} />
</div>}
{loading &&
<div className={styles.plugin_icon}>
<Loader type='small' />
</div>}

<div className={styles.plugin_info}>
<div className={styles.plugin_name}>
{name}
</div>
<div className={styles.plugin_path}>
<label>Installed from:</label>
<span>{path}</span>
</div>
<div className={styles.plugin_description}>
{description}
</div>
<div className={styles.plugin_info}>
<div className={styles.plugin_name}>
{name}
</div>
<div className={styles.plugin_path}>
<label>Installed from:</label>
<span>{path}</span>
</div>
<div className={styles.plugin_description}>
{description}
</div>

<div className={styles.plugin_footer}>
<div className={styles.plugin_author}>
<label>Author:</label>
<span className={styles.link} onClick={handleAuthorClick}>
{author}
</span>
<div className={styles.plugin_footer}>
<div className={styles.plugin_author}>
<label>Author:</label>
<span className={styles.link} onClick={handleAuthorClick}>
{author}
</span>
</div>
<Button basic inverted icon
className={styles.delete_button}
onClick={handleDelete}
>
<Icon name='trash alternate outline' />
Uninstall
</Button>
</div>
<Button basic inverted icon
className={styles.delete_button}
onClick={handleDelete}
>
<Icon name='trash alternate outline'/>
Uninstall
</Button>
</div>

<div className={styles.error_footer}>
{
error &&
<div className={styles.error_message}>
This plugin could not be loaded correctly.
</div>
}
<div className={styles.error_footer}>
{error &&
<div className={styles.error_message}>
This plugin could not be loaded correctly.
</div>}
</div>
</div>
</div>
</div>
);
);
};

UserPluginsItem.propTypes = {
path: PropTypes.string,
Expand All @@ -96,13 +96,4 @@ UserPluginsItem.propTypes = {
onAuthorClick: PropTypes.func
};

export default compose(
withHandlers({
handleDelete: ({path, deleteUserPlugin}) => () => {
deleteUserPlugin(path);
},
handleAuthorClick: ({author, onAuthorClick}) => () => {
onAuthorClick(author);
}
})
)(UserPluginsItem);
export default UserPluginsItem;

0 comments on commit 713d00f

Please sign in to comment.