publish: addressed review, fixed issue with metadata

This commit is contained in:
Isaac Visintainer 2020-04-22 15:14:24 -07:00
parent a29aa2d01a
commit f46bc4b397
2 changed files with 40 additions and 22 deletions

View File

@ -1719,14 +1719,13 @@
(group-poke [%unbundle old-read])
(group-hook-poke [%remove old-write])
(group-hook-poke [%remove old-read])
(perm-group-hook-poke [%dissociate old-write (sy old-write ~)])
(perm-group-hook-poke [%dissociate old-read (sy old-read ~)])
(perm-hook-poke [%remove old-write])
(perm-hook-poke [%remove old-read])
==
::
?~ target.act
:: create new group from subscribers
::
=. writers.u.book (slag 1 writers.u.book)
=. subscribers.u.book writers.u.book
=/ del=notebook-delta [%edit-book our.bol book.act u.book]
@ -1741,33 +1740,53 @@
title.u.book
description.u.book
==
%- metadata-poke
:* %add
writers.u.book
[%publish /(scot %p our.bol)/[book.act]]
title.u.book
description.u.book
0x0
date-created.u.book
our.bol
==
==
::
?> ?=(^ u.target.act)
=. writers.u.book u.target.act
=. subscribers.u.book u.target.act
=/ group-host=@p (slav %p i.u.target.act)
::
=/ scry-pax :(weld /=group-store/(scot %da now.bol) u.target.act /noun)
=/ old-group=(set @p) (need .^((unit (set @p)) %gx scry-pax))
=/ dif-peeps=(set @p) (~(dif in (get-subscribers book.act)) old-group)
?: ?& inclusive.act
=(group-host our.bol)
==
:: add all subscribers to group
::
=/ del=notebook-delta [%edit-book our.bol book.act u.book]
:_ state(books (~(put by books) [our.bol book.act] u.book))
%+ weld
%+ weld destroy-old-groups
^- (list card)
:~ [%give %fact [/notebook/[book.act]]~ %publish-notebook-delta !>(del)]
[%give %fact [/primary]~ %publish-primary-delta !>(del)]
(group-poke [%add dif-peeps u.target.act])
%- metadata-poke
:* %add
writers.u.book
[%publish /(scot %p our.bol)/[book.act]]
title.u.book
description.u.book
0x0
date-created.u.book
our.bol
==
==
?: ?& inclusive.act
=(group-host our.bol)
==
:: add all subscribers to group
::
[(group-poke [%add dif-peeps u.target.act])]~
:: kick subscribers who are not already in group
=/ del=notebook-delta [%edit-book our.bol book.act u.book]
:_ state(books (~(put by books) [our.bol book.act] u.book))
%+ weld destroy-old-groups
^- (list card)
:+ [%give %fact [/notebook/[book.act]]~ %publish-notebook-delta !>(del)]
[%give %fact [/primary]~ %publish-primary-delta !>(del)]
::
%+ turn ~(tap in dif-peeps)
|= who=@p
^- card
@ -1812,6 +1831,11 @@
[%give %fact [/publishtile]~ %json !>(jon)]
==
::
++ metadata-poke
|= act=metadata-action
^- card
[%pass / %agent [our.bol %metadata-hook] %poke %metadata-action !>(act)]
::
++ emit-metadata
|= del=metadata-delta
^- (list card)
@ -1842,11 +1866,6 @@
^- (list card)
[(metadata-poke [%add group-path [%publish app-path] metadata])]~
::
++ metadata-poke
|= act=metadata-action
^- card
[%pass / %agent [our.bol %metadata-hook] %poke %metadata-action !>(act)]
::
++ metadata-scry
|= [group-path=path app-path=path]
^- (unit metadata)

View File

@ -105,7 +105,6 @@ export class Settings extends Component {
const { props, state } = this;
this.setState({
isLoading: true,
disabled: true,
type: 'Converting'
}, (() => {
@ -115,7 +114,7 @@ export class Settings extends Component {
target: state.targetGroup,
inclusive: state.inclusive,
}
}).then(() => this.setState({awaiting: false}));
}).then(() => this.setState({disabled: false}));
}));
}