mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-21 15:38:59 +03:00
Merge branch 'mp/metadata/fixes' (#3618)
* origin/mp/metadata/fixes: interface: pass station to groupify button interface: exclude sigs and dots from paths interface: trim unnecessary logic in settings interface: set resource name correctly Signed-off-by: Matilde Park <matilde@tlon.io>
This commit is contained in:
commit
2ac0f5616f
@ -30,7 +30,7 @@ export class GroupifyButton extends Component {
|
|||||||
return this.state.targetGroup ? (
|
return this.state.targetGroup ? (
|
||||||
<div className="mt4">
|
<div className="mt4">
|
||||||
<Toggle
|
<Toggle
|
||||||
boolean={inclusive}
|
boolean={this.state.inclusive}
|
||||||
change={this.changeInclusive.bind(this)}
|
change={this.changeInclusive.bind(this)}
|
||||||
/>
|
/>
|
||||||
<span className="dib f9 white-d inter ml3">
|
<span className="dib f9 white-d inter ml3">
|
||||||
@ -42,7 +42,7 @@ export class GroupifyButton extends Component {
|
|||||||
</div>
|
</div>
|
||||||
) : <div />;
|
) : <div />;
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { inclusive, targetGroup } = this.state;
|
const { inclusive, targetGroup } = this.state;
|
||||||
const {
|
const {
|
||||||
@ -52,7 +52,8 @@ export class GroupifyButton extends Component {
|
|||||||
associations,
|
associations,
|
||||||
contacts,
|
contacts,
|
||||||
groups,
|
groups,
|
||||||
station
|
station,
|
||||||
|
changeLoading
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const groupPath = association['group-path'];
|
const groupPath = association['group-path'];
|
||||||
@ -94,7 +95,7 @@ export class GroupifyButton extends Component {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
className={
|
className={
|
||||||
'dib f9 black gray4-d bg-gray0-d ba pa2 mt4 b--black ' +
|
'dib f9 black gray4-d bg-gray0-d ba pa2 mt4 b--black ' +
|
||||||
'b--gray1-d pointer'
|
'b--gray1-d pointer'
|
||||||
}>Convert to group</a>
|
}>Convert to group</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -52,7 +52,7 @@ export class NewDmScreen extends Component {
|
|||||||
|
|
||||||
titleChange(event) {
|
titleChange(event) {
|
||||||
const asciiSafe = event.target.value.toLowerCase()
|
const asciiSafe = event.target.value.toLowerCase()
|
||||||
.replace(/[^a-z0-9~_.-]/g, '-');
|
.replace(/[^a-z0-9_-]/g, '-');
|
||||||
this.setState({
|
this.setState({
|
||||||
idName: asciiSafe,
|
idName: asciiSafe,
|
||||||
title: event.target.value
|
title: event.target.value
|
||||||
|
@ -38,7 +38,7 @@ export class NewScreen extends Component {
|
|||||||
|
|
||||||
titleChange(event) {
|
titleChange(event) {
|
||||||
const asciiSafe = event.target.value.toLowerCase()
|
const asciiSafe = event.target.value.toLowerCase()
|
||||||
.replace(/[^a-z0-9~_.-]/g, '-');
|
.replace(/[^a-z0-9_-]/g, '-');
|
||||||
this.setState({
|
this.setState({
|
||||||
idName: asciiSafe,
|
idName: asciiSafe,
|
||||||
title: event.target.value
|
title: event.target.value
|
||||||
|
@ -82,6 +82,7 @@ export class SettingsScreen extends Component {
|
|||||||
contacts={contacts}
|
contacts={contacts}
|
||||||
groups={groups}
|
groups={groups}
|
||||||
api={api}
|
api={api}
|
||||||
|
station={station}
|
||||||
changeLoading={this.changeLoading} />
|
changeLoading={this.changeLoading} />
|
||||||
<DeleteButton
|
<DeleteButton
|
||||||
isOwner={isOwner}
|
isOwner={isOwner}
|
||||||
@ -122,13 +123,6 @@ export class SettingsScreen extends Component {
|
|||||||
location
|
location
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const isInPopout = popout ? "popout/" : "";
|
|
||||||
const title =
|
|
||||||
( association &&
|
|
||||||
('metadata' in association) &&
|
|
||||||
(association.metadata.title !== '')
|
|
||||||
) ? association.metadata.title : station.substr(1);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-100 w-100 overflow-x-hidden flex flex-column white-d">
|
<div className="h-100 w-100 overflow-x-hidden flex flex-column white-d">
|
||||||
<ChatHeader
|
<ChatHeader
|
||||||
|
@ -6,10 +6,10 @@ import { Spinner } from '~/views/components/Spinner';
|
|||||||
import { Toggle } from '~/views/components/toggle';
|
import { Toggle } from '~/views/components/toggle';
|
||||||
import { RouteComponentProps } from 'react-router-dom';
|
import { RouteComponentProps } from 'react-router-dom';
|
||||||
|
|
||||||
import { Groups, GroupPolicy, Resource } from '~/types/group-update';
|
import { Groups, GroupPolicy } from '~/types/group-update';
|
||||||
import { Contacts, Rolodex } from '~/types/contact-update';
|
import { Rolodex } from '~/types/contact-update';
|
||||||
import GlobalApi from '~/logic/api/global';
|
import GlobalApi from '~/logic/api/global';
|
||||||
import { Patp, PatpNoSig, Enc } from '~/types/noun';
|
import { Enc } from '~/types/noun';
|
||||||
|
|
||||||
type NewScreenProps = Pick<RouteComponentProps, 'history'> & {
|
type NewScreenProps = Pick<RouteComponentProps, 'history'> & {
|
||||||
groups: Groups;
|
groups: Groups;
|
||||||
@ -20,7 +20,6 @@ type NewScreenProps = Pick<RouteComponentProps, 'history'> & {
|
|||||||
type TextChange = React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>;
|
type TextChange = React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>;
|
||||||
type BooleanChange = React.ChangeEvent<HTMLInputElement>;
|
type BooleanChange = React.ChangeEvent<HTMLInputElement>;
|
||||||
|
|
||||||
|
|
||||||
interface NewScreenState {
|
interface NewScreenState {
|
||||||
groupName: string;
|
groupName: string;
|
||||||
title: string;
|
title: string;
|
||||||
@ -55,7 +54,7 @@ export class NewScreen extends Component<NewScreenProps, NewScreenState> {
|
|||||||
groupNameChange(event: TextChange) {
|
groupNameChange(event: TextChange) {
|
||||||
const asciiSafe = event.target.value
|
const asciiSafe = event.target.value
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replace(/[^a-z0-9~_.-]/g, '-');
|
.replace(/[^a-z0-9_-]/g, '-');
|
||||||
this.setState({
|
this.setState({
|
||||||
groupName: asciiSafe,
|
groupName: asciiSafe,
|
||||||
title: event.target.value,
|
title: event.target.value,
|
||||||
|
@ -42,8 +42,8 @@ export const MetadataSettings = (props) => {
|
|||||||
val,
|
val,
|
||||||
association.metadata.description,
|
association.metadata.description,
|
||||||
association.metadata['date-created'],
|
association.metadata['date-created'],
|
||||||
module,
|
uxToHex(association.metadata.color),
|
||||||
uxToHex(association.metadata.color)
|
module
|
||||||
).then(() => {
|
).then(() => {
|
||||||
changeLoading(false, false, '', () => {});
|
changeLoading(false, false, '', () => {});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user