-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #355 from superdesk/content-lists-superdesk
Superdesk articles support in content lists
- Loading branch information
Showing
14 changed files
with
357 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ dist/ | |
*.egg-info | ||
*.pyc | ||
src/ | ||
!client/publisher-extension/src | ||
yarn.lock | ||
build | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import classNames from "classnames"; | ||
|
||
import DropdownScrollable from "./DropdownScrollable"; | ||
|
||
const SourceSelect = props => { | ||
let selectedSource = {id: 'publisher', name: 'All published articles'}; | ||
|
||
if (props.selectedSource) selectedSource = props.selectedSource; | ||
|
||
return ( | ||
<React.Fragment> | ||
<div className="subnav__spacer subnav__spacer--no-margin" /> | ||
<div | ||
className={classNames( | ||
"subnav__content-bar sd-flex-no-shrink sd-margin-x--0" | ||
)} | ||
> | ||
<DropdownScrollable | ||
button={ | ||
<button className="dropdown__toggle navbtn navbtn--text-only dropdown-toggle"> | ||
{selectedSource.name} | ||
<span className="dropdown__caret" /> | ||
</button> | ||
} | ||
classes="dropdown--align-right" | ||
> | ||
<li> | ||
<button onClick={() => props.setSource(null)}> | ||
All published articles | ||
</button> | ||
</li> | ||
<li className="dropdown__menu-divider" /> | ||
{props.sources.map(item => ( | ||
<li key={"sourceSelect-" + item.id}> | ||
<button onClick={() => props.setSource(item)}> | ||
{item.name} | ||
</button> | ||
</li> | ||
))} | ||
</DropdownScrollable> | ||
</div> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
SourceSelect.propTypes = { | ||
sources: PropTypes.array.isRequired, | ||
selectedSource: PropTypes.shape({ | ||
id: PropTypes.string.isRequired, | ||
name: PropTypes.string.isRequired, | ||
}), | ||
setSource: PropTypes.func.isRequired | ||
}; | ||
|
||
export default SourceSelect; |
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 @@ | ||
dist |
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,5 @@ | ||
{ | ||
"extension": ["ts", ".tsx"], | ||
"spec": "src/**/*.spec.*", | ||
"require": "ts-node/register" | ||
} |
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,19 @@ | ||
{ | ||
"private": true, | ||
"name": "superdesk-publisher-extension", | ||
"main": "dist/src/extension.js", | ||
"scripts": { | ||
"compile": "tsc -p src", | ||
"compile-e2e": "echo 'No end-to-end tests defined'", | ||
"watch": "tsc -watch -p src", | ||
"test": "mocha", | ||
"debug-tests": "mocha --inspect-brk" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "9.1.1", | ||
"mocha": "8.4.0", | ||
"superdesk-code-style": "1.3.0", | ||
"ts-node": "10.9.1", | ||
"typescript": "~4.9.5" | ||
} | ||
} |
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,9 @@ | ||
import {IExtension} from 'superdesk-api'; | ||
|
||
const extension: IExtension = { | ||
activate: () => { | ||
return Promise.resolve({}); | ||
}, | ||
}; | ||
|
||
export default extension; |
Oops, something went wrong.