Removed "identity proofs" from frontend and api route

• Removed:
- "identity proofs" from frontend, settings
- "identity proofs" api route
This commit is contained in:
mgabdev 2020-06-07 13:47:22 -04:00
parent 967bfaab7e
commit 250e6a4357
7 changed files with 3 additions and 113 deletions

View File

@ -1,30 +0,0 @@
import api from '../api';
export const IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST = 'IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST';
export const IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS = 'IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS';
export const IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL = 'IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL';
export const fetchAccountIdentityProofs = accountId => (dispatch, getState) => {
dispatch(fetchAccountIdentityProofsRequest(accountId));
api(getState).get(`/api/v1/accounts/${accountId}/identity_proofs`)
.then(({ data }) => dispatch(fetchAccountIdentityProofsSuccess(accountId, data)))
.catch(err => dispatch(fetchAccountIdentityProofsFail(accountId, err)));
};
export const fetchAccountIdentityProofsRequest = id => ({
type: IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST,
id,
});
export const fetchAccountIdentityProofsSuccess = (accountId, identity_proofs) => ({
type: IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS,
accountId,
identity_proofs,
});
export const fetchAccountIdentityProofsFail = (accountId, err) => ({
type: IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL,
accountId,
err,
});

View File

@ -18,21 +18,11 @@ const messages = defineMessages({
memberSince: { id: 'account.member_since', defaultMessage: 'Member since {date}' },
})
const mapStateToProps = (state, { account }) => {
const identityProofs = !!account ? state.getIn(['identity_proofs', account.get('id')], ImmutableList()) : ImmutableList()
return {
identityProofs,
domain: state.getIn(['meta', 'domain']),
}
}
export default
@connect(mapStateToProps, null)
@injectIntl
class ProfileInfoPanel extends ImmutablePureComponent {
static propTypes = {
identityProofs: ImmutablePropTypes.list,
account: ImmutablePropTypes.map,
noPanel: PropTypes.bool,
intl: PropTypes.object.isRequired,
@ -42,7 +32,6 @@ class ProfileInfoPanel extends ImmutablePureComponent {
const {
intl,
account,
identityProofs,
noPanel
} = this.props
@ -112,35 +101,9 @@ class ProfileInfoPanel extends ImmutablePureComponent {
</Fragment>
}
{(fields.size > 0 || identityProofs.size > 0) && (
{
fields.size > 0 &&
<div className={[_s.default]}>
{identityProofs.map((proof, i) => (
<Fragment>
<Divider isSmall />
<dl className={[_s.default, _s.flexRow, _s.alignItemsCenter].join(' ')} key={`profile-identity-proof-${i}`}>
<dt
className={_s.dangerousContent}
dangerouslySetInnerHTML={{ __html: proof.get('provider') }}
/>
{ /* : todo : */}
<dd className='verified'>
<a href={proof.get('proof_url')} target='_blank' rel={DEFAULT_REL}>
<span title={intl.formatMessage(messages.linkVerifiedOn, { date: intl.formatDate(proof.get('updated_at'), dateFormatOptions) })}>
<Icon id='check' size='12px' className='verified__mark' />
</span>
</a>
<a href={proof.get('profile_url')} target='_blank' rel={DEFAULT_REL}>
<span
className={_s.dangerousContent}
dangerouslySetInnerHTML={{ __html: ' ' + proof.get('provider_username') }}
/>
</a>
</dd>
</dl>
</Fragment>
))}
{
fields.map((pair, i) => (
<Fragment>
@ -160,9 +123,8 @@ class ProfileInfoPanel extends ImmutablePureComponent {
</Fragment>
))
}
</div>
)}
}
</div>
</Wrapper>

View File

@ -3,7 +3,6 @@ import ImmutablePureComponent from 'react-immutable-pure-component'
import { List as ImmutableList } from 'immutable'
import { injectIntl, defineMessages } from 'react-intl'
import { expandAccountFeaturedTimeline, expandAccountTimeline } from '../actions/timelines'
import { fetchAccountIdentityProofs } from '../actions/identity_proofs'
import StatusList from '../components/status_list'
const messages = defineMessages({
@ -46,8 +45,6 @@ class AccountTimeline extends ImmutablePureComponent {
const { accountId, commentsOnly } = this.props
if (accountId && accountId !== -1) {
this.props.dispatch(fetchAccountIdentityProofs(accountId))
if (!commentsOnly) {
this.props.dispatch(expandAccountFeaturedTimeline(accountId))
}
@ -58,8 +55,6 @@ class AccountTimeline extends ImmutablePureComponent {
componentWillReceiveProps(nextProps) {
if (nextProps.accountId && nextProps.accountId !== -1 && (nextProps.accountId !== this.props.accountId && nextProps.accountId) || nextProps.commentsOnly !== this.props.commentsOnly) {
this.props.dispatch(fetchAccountIdentityProofs(nextProps.accountId))
if (!nextProps.commentsOnly) {
this.props.dispatch(expandAccountFeaturedTimeline(nextProps.accountId))
}

View File

@ -1,25 +0,0 @@
import { Map as ImmutableMap, fromJS } from 'immutable';
import {
IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST,
IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS,
IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL,
} from '../actions/identity_proofs';
const initialState = ImmutableMap();
export default function identityProofsReducer(state = initialState, action) {
switch(action.type) {
case IDENTITY_PROOFS_ACCOUNT_FETCH_REQUEST:
return state.set('isLoading', true);
case IDENTITY_PROOFS_ACCOUNT_FETCH_FAIL:
return state.set('isLoading', false);
case IDENTITY_PROOFS_ACCOUNT_FETCH_SUCCESS:
return state.update(identity_proofs => identity_proofs.withMutations(map => {
map.set('isLoading', false);
map.set('loaded', true);
map.set(action.accountId, fromJS(action.identity_proofs));
}));
default:
return state;
}
};

View File

@ -14,7 +14,6 @@ import group_lists from './group_lists'
import group_relationships from './group_relationships'
import hashtags from './hashtags'
import height_cache from './height_cache'
import identity_proofs from './identity_proofs'
import lists from './lists'
import listAdder from './list_adder'
import listEditor from './list_editor'
@ -54,7 +53,6 @@ const reducers = {
group_relationships,
hashtags,
height_cache,
identity_proofs,
lists,
listAdder,
listEditor,

View File

@ -44,15 +44,6 @@
= fields_f.input :name, placeholder: t('simple_form.labels.account.fields.name'), input_html: { maxlength: 255 }
= fields_f.input :value, placeholder: t('simple_form.labels.account.fields.value'), input_html: { maxlength: 255 }
.fields-row__column.fields-group.fields-row__column-6
%h6= t('verification.verification')
%p.hint= t('verification.explanation_html')
.input-copy
.input-copy__wrapper
%input{ type: :text, maxlength: '999', spellcheck: 'false', readonly: 'true', value: link_to('Gab Social', ActivityPub::TagManager.instance.url_for(@account), rel: 'me').to_str }
%button{ type: :button }= t('generic.copy')
.actions
= f.button :button, t('generic.save_changes'), type: :submit

View File

@ -402,7 +402,6 @@ Rails.application.routes.draw do
resources :followers, only: :index, controller: 'accounts/follower_accounts'
resources :following, only: :index, controller: 'accounts/following_accounts'
resources :lists, only: :index, controller: 'accounts/lists'
resources :identity_proofs, only: :index, controller: 'accounts/identity_proofs'
member do
post :follow