diff --git a/client/scss/_select.scss b/client/scss/_select.scss index 382adf4c..b095c7b3 100644 --- a/client/scss/_select.scss +++ b/client/scss/_select.scss @@ -1,6 +1,7 @@ select { margin: 0; display: inline-block; - background: $base-color; + background: $background-color; border: 0; + color: $text-color; } diff --git a/client/src/components/ChannelSelectDropdown/index.jsx b/client/src/components/ChannelSelectDropdown/index.jsx index 2079c05c..ae4b1211 100644 --- a/client/src/components/ChannelSelectDropdown/index.jsx +++ b/client/src/components/ChannelSelectDropdown/index.jsx @@ -7,9 +7,6 @@ const ChannelSelectDropdown = ({ selectedChannel, handleSelection, loggedInChann id='channel-name-select' value={selectedChannel} onChange={handleSelection}> - { loggedInChannelName && ( - - )} diff --git a/client/src/components/PublishLicenseInput/index.jsx b/client/src/components/PublishLicenseInput/index.jsx index 213e0be9..4ddf4f07 100644 --- a/client/src/components/PublishLicenseInput/index.jsx +++ b/client/src/components/PublishLicenseInput/index.jsx @@ -1,9 +1,9 @@ import React from 'react'; import RowLabeled from '@components/RowLabeled'; import Label from '@components/Label'; -import { LICENSES } from '../../constants/publish_license_urls'; +import { LICENSES } from '@clientConstants/publish_license_urls'; -const PublishLicenseInput = ({ handleSelect }) => { +const PublishLicenseInput = ({ handleSelect, license }) => { return ( { type='text' name='license' id='publish-license' + value={license} onChange={handleSelect} > diff --git a/client/src/components/PublishLicenseUrlInput/index.jsx b/client/src/components/PublishLicenseUrlInput/index.jsx index cfbce431..8b57347e 100644 --- a/client/src/components/PublishLicenseUrlInput/index.jsx +++ b/client/src/components/PublishLicenseUrlInput/index.jsx @@ -1,9 +1,9 @@ import React from 'react'; import RowLabeled from '@components/RowLabeled'; import Label from '@components/Label'; -import { CC_LICENSES } from '../../constants/publish_license_urls'; +import { CC_LICENSES } from '@clientConstants/publish_license_urls'; -const PublishLicenseUrlInput = ({ handleSelect }) => { +const PublishLicenseUrlInput = ({ handleSelect, licenseUrl }) => { return ( { type='text' name='licenseUrl' id='publish-license-url' + value={licenseUrl} onChange={handleSelect} > diff --git a/client/src/containers/AssetInfo/view.jsx b/client/src/containers/AssetInfo/view.jsx index 280a7baa..79fd1436 100644 --- a/client/src/containers/AssetInfo/view.jsx +++ b/client/src/containers/AssetInfo/view.jsx @@ -7,7 +7,7 @@ import AssetShareButtons from '@components/AssetShareButtons'; import ClickToCopy from '@components/ClickToCopy'; import siteConfig from '@config/siteConfig.json'; import createCanonicalLink from '@globalutils/createCanonicalLink'; -import AssetInfoFooter from '../../components/AssetInfoFooter/index'; +import AssetInfoFooter from '@components/AssetInfoFooter/index'; import { createPermanentURI } from '@clientutils/createPermanentURI'; import ReactMarkdown from 'react-markdown'; @@ -18,7 +18,20 @@ class AssetInfo extends React.Component { render () { const { editable, asset } = this.props; const { claimViews, claimData } = asset; - const { channelName, claimId, channelShortId, description, name, fileExt, contentType, host, certificateId, license, licenseUrl, transactionTime } = claimData; + const { + channelName, + claimId, + channelShortId, + description, + name, + fileExt, + contentType, + host, + certificateId, + license, + licenseUrl, + transactionTime + } = claimData; const canonicalUrl = createCanonicalLink({ asset: { ...claimData, shortId: asset.shortId }}); const assetCanonicalUrl = `${host}${canonicalUrl}`; @@ -55,7 +68,7 @@ class AssetInfo extends React.Component { {editable && ( } - content={{name}} + content={{name}} /> )} {channelName && ( @@ -72,22 +85,6 @@ class AssetInfo extends React.Component { /> )} - {license && ( - - } - content={ -
- {licenseUrl ? ( - {license} - ) : ( - {license} )} -
- } - /> - )} - {claimViews ? ( ) : null} + {license && ( + + } + content={ +
+ {licenseUrl ? ( + {license} + ) : ( + {license} )} +
+ } + /> + )}
diff --git a/client/src/containers/PublishMetadataInputs/view.jsx b/client/src/containers/PublishMetadataInputs/view.jsx index bee1228c..07e4d8d1 100644 --- a/client/src/containers/PublishMetadataInputs/view.jsx +++ b/client/src/containers/PublishMetadataInputs/view.jsx @@ -30,25 +30,27 @@ class PublishMetadataInputs extends React.Component { } } render () { - const { showMetadataInputs, description, isUpdate, nsfw } = this.props; + const { showMetadataInputs, description, isUpdate, nsfw, license, licenseUrl } = this.props; return (
{(showMetadataInputs || isUpdate) && ( { (this.props.license === 'Creative Commons') && ( )} diff --git a/server/chainquery/models/ClaimModel.js b/server/chainquery/models/ClaimModel.js index e90713ae..4157ab67 100644 --- a/server/chainquery/models/ClaimModel.js +++ b/server/chainquery/models/ClaimModel.js @@ -6,7 +6,7 @@ const { const getterMethods = { generated_extension() { - logger.info('trying to generate extension', this.content_type); + logger.debug('trying to generate extension', this.content_type); if (customFileExtensions.hasOwnProperty(this.content_type)) { return customFileExtensions[this.content_type]; } else { diff --git a/server/chainquery/queries/claimQueries.js b/server/chainquery/queries/claimQueries.js index fecce12b..6270ea5d 100644 --- a/server/chainquery/queries/claimQueries.js +++ b/server/chainquery/queries/claimQueries.js @@ -51,7 +51,7 @@ export default (db, table, sequelize) => ({ }, getShortClaimIdFromLongClaimId: async (claimId, claimName, pendingClaim) => { - logger.info(`claim.getShortClaimIdFromLongClaimId for ${claimName}#${claimId}`); + logger.debug(`claim.getShortClaimIdFromLongClaimId for ${claimName}#${claimId}`); return await table .findAll({ where: { name: claimName }, diff --git a/server/controllers/api/channel/claims/getChannelClaims.js b/server/controllers/api/channel/claims/getChannelClaims.js index ab1c3f36..8b7eee60 100644 --- a/server/controllers/api/channel/claims/getChannelClaims.js +++ b/server/controllers/api/channel/claims/getChannelClaims.js @@ -4,7 +4,7 @@ const getClaimData = require('server/utils/getClaimData'); const { returnPaginatedChannelClaims } = require('./channelPagination.js'); const getChannelClaims = async (channelName, channelLongId, page) => { - logger.info(`getChannelClaims: ${channelName}, ${channelLongId}, ${page}`); + logger.debug(`getChannelClaims: ${channelName}, ${channelLongId}, ${page}`); let channelShortId = await chainquery.claim.queries.getShortClaimIdFromLongClaimId( channelLongId, channelName diff --git a/server/controllers/api/claim/publish/index.js b/server/controllers/api/claim/publish/index.js index a14f430d..f08bf76b 100644 --- a/server/controllers/api/claim/publish/index.js +++ b/server/controllers/api/claim/publish/index.js @@ -5,7 +5,7 @@ const { publishing: { disabled, disabledMessage }, } = require('@config/siteConfig'); -const { sendGATimingEvent } = require('../../../../utils/googleAnalytics.js'); +const { sendGATimingEvent } = require('server/utils/googleAnalytics.js'); const isApprovedChannel = require('@globalutils/isApprovedChannel'); const { publishing: { publishOnlyApproved, approvedChannels }, diff --git a/server/controllers/api/claim/update/index.js b/server/controllers/api/claim/update/index.js index 73d24750..bca37d6d 100644 --- a/server/controllers/api/claim/update/index.js +++ b/server/controllers/api/claim/update/index.js @@ -129,7 +129,7 @@ const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res) description: claimRecord.description, nsfw: claimRecord.nsfw, license: claimRecord.license, - license_url: claimRecord.license_url, + licenseUrl: claimRecord.license_url, language: 'en', author: details.title, }, @@ -170,12 +170,10 @@ const claimUpdate = ({ body, files, headers, ip, originalUrl, user, tor }, res) } const fp = files && files.file && files.file.path ? files.file.path : undefined; - logger.info(`before updatepublish`); return publish(publishParams, fileName, fileType, fp); }) .then(result => { publishResult = result; - logger.info(`after updatepublish then`, result); if (channelName) { return chainquery.claim.queries.getShortClaimIdFromLongClaimId( diff --git a/server/controllers/assets/utils/serveFile.js b/server/controllers/assets/utils/serveFile.js index dce8f984..5efa9e32 100644 --- a/server/controllers/assets/utils/serveFile.js +++ b/server/controllers/assets/utils/serveFile.js @@ -1,5 +1,6 @@ const logger = require('winston'); const transformImage = require('./transformImage'); + const serveFile = async ({ filePath, fileType }, res, originalUrl) => { const queryObject = {}; // TODO: replace quick/dirty try catch with better practice diff --git a/utils/createModuleAliases.js b/utils/createModuleAliases.js index eea3edb4..47560faa 100644 --- a/utils/createModuleAliases.js +++ b/utils/createModuleAliases.js @@ -39,6 +39,9 @@ module.exports = () => { moduleAliases['@clientutils'] = resolve(`${DEFAULT_ROOT}/utils`); // moduleAliases['@serverutils'] = resolve('server/utils'); + // aliases for constants + moduleAliases['@clientConstants'] = resolve(`${DEFAULT_ROOT}/constants`); + // create specific aliases for locally defined components in the following folders moduleAliases = addAliasesForCustomComponentFolder('containers', moduleAliases); moduleAliases = addAliasesForCustomComponentFolder('components', moduleAliases); @@ -53,7 +56,6 @@ module.exports = () => { moduleAliases['@sagas'] = resolve(`${DEFAULT_ROOT}/sagas`); moduleAliases['@app'] = resolve(`${DEFAULT_ROOT}/app.js`); - // return finished aliases return moduleAliases; };