Compare commits
1 Commits
pkg/dev/ub
...
workgroup-
Author | SHA1 | Date | |
---|---|---|---|
523fcee03b |
@ -14,6 +14,7 @@ export function InfoForm({ workgroup, onChange }: InfoFormProps) {
|
|||||||
workgroup: {
|
workgroup: {
|
||||||
id: workgroup && workgroup.id ? workgroup.id : '',
|
id: workgroup && workgroup.id ? workgroup.id : '',
|
||||||
name: workgroup && workgroup.name ? workgroup.name : '',
|
name: workgroup && workgroup.name ? workgroup.name : '',
|
||||||
|
description: workgroup && workgroup.description ? workgroup.description : '',
|
||||||
createdAt: workgroup && workgroup.createdAt ? workgroup.createdAt : null,
|
createdAt: workgroup && workgroup.createdAt ? workgroup.createdAt : null,
|
||||||
closedAt: workgroup && workgroup.closedAt ? workgroup.closedAt : null,
|
closedAt: workgroup && workgroup.closedAt ? workgroup.closedAt : null,
|
||||||
}
|
}
|
||||||
@ -34,6 +35,7 @@ export function InfoForm({ workgroup, onChange }: InfoFormProps) {
|
|||||||
workgroup: {
|
workgroup: {
|
||||||
id: workgroup && workgroup.id ? workgroup.id : '',
|
id: workgroup && workgroup.id ? workgroup.id : '',
|
||||||
name: workgroup && workgroup.name ? workgroup.name : '',
|
name: workgroup && workgroup.name ? workgroup.name : '',
|
||||||
|
description: workgroup && workgroup.description ? workgroup.description : '',
|
||||||
createdAt: workgroup && workgroup.createdAt ? workgroup.createdAt : null,
|
createdAt: workgroup && workgroup.createdAt ? workgroup.createdAt : null,
|
||||||
closedAt: workgroup && workgroup.closedAt ? workgroup.closedAt : null,
|
closedAt: workgroup && workgroup.closedAt ? workgroup.closedAt : null,
|
||||||
}
|
}
|
||||||
@ -76,6 +78,14 @@ export function InfoForm({ workgroup, onChange }: InfoFormProps) {
|
|||||||
onChange={onWorkgroupAttrChange.bind(null, "name")} />
|
onChange={onWorkgroupAttrChange.bind(null, "name")} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="field">
|
||||||
|
<label className="label">Nom du groupe</label>
|
||||||
|
<div className="control">
|
||||||
|
<textarea className="input" value={state.workgroup.description}
|
||||||
|
disabled={!isAuthorized}
|
||||||
|
onChange={onWorkgroupAttrChange.bind(null, "description")}></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{
|
{
|
||||||
state.workgroup.createdAt ?
|
state.workgroup.createdAt ?
|
||||||
<div className="field">
|
<div className="field">
|
||||||
|
@ -7,6 +7,7 @@ mutation updateWorkgroup($workgroupId: ID!, $changes: WorkgroupChanges!) {
|
|||||||
updateWorkgroup(workgroupId: $workgroupId, changes: $changes) {
|
updateWorkgroup(workgroupId: $workgroupId, changes: $changes) {
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
|
description,
|
||||||
createdAt,
|
createdAt,
|
||||||
closedAt,
|
closedAt,
|
||||||
members {
|
members {
|
||||||
@ -26,6 +27,7 @@ mutation createWorkgroup($changes: WorkgroupChanges!) {
|
|||||||
createWorkgroup(changes: $changes) {
|
createWorkgroup(changes: $changes) {
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
|
description,
|
||||||
createdAt,
|
createdAt,
|
||||||
closedAt,
|
closedAt,
|
||||||
members {
|
members {
|
||||||
@ -47,6 +49,7 @@ mutation joinWorkgroup($workgroupId: ID!) {
|
|||||||
joinWorkgroup(workgroupId: $workgroupId) {
|
joinWorkgroup(workgroupId: $workgroupId) {
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
|
description,
|
||||||
createdAt,
|
createdAt,
|
||||||
closedAt,
|
closedAt,
|
||||||
members {
|
members {
|
||||||
@ -78,6 +81,7 @@ mutation leaveWorkgroup($workgroupId: ID!) {
|
|||||||
leaveWorkgroup(workgroupId: $workgroupId) {
|
leaveWorkgroup(workgroupId: $workgroupId) {
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
|
description,
|
||||||
createdAt,
|
createdAt,
|
||||||
closedAt,
|
closedAt,
|
||||||
members {
|
members {
|
||||||
@ -117,6 +121,7 @@ mutation closeWorkgroup($workgroupId: ID!) {
|
|||||||
closeWorkgroup(workgroupId: $workgroupId) {
|
closeWorkgroup(workgroupId: $workgroupId) {
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
|
description,
|
||||||
createdAt,
|
createdAt,
|
||||||
closedAt,
|
closedAt,
|
||||||
members {
|
members {
|
||||||
|
@ -7,6 +7,7 @@ export const QUERY_WORKGROUP = gql`
|
|||||||
workgroups(filter: $filter) {
|
workgroups(filter: $filter) {
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
|
description,
|
||||||
createdAt,
|
createdAt,
|
||||||
closedAt,
|
closedAt,
|
||||||
members {
|
members {
|
||||||
|
@ -2,6 +2,7 @@ import { User } from "./user";
|
|||||||
export interface Workgroup {
|
export interface Workgroup {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
|
description: string
|
||||||
createdAt: Date
|
createdAt: Date
|
||||||
closedAt: Date
|
closedAt: Date
|
||||||
members: User[]
|
members: User[]
|
||||||
|
@ -27,7 +27,8 @@ func applyMigration(ctx context.Context, ctn *service.Container) error {
|
|||||||
|
|
||||||
// Register available migrations
|
// Register available migrations
|
||||||
migr.Register(
|
migr.Register(
|
||||||
m000initialSchema(),
|
m000InitialSchema(),
|
||||||
|
m001WorkgroupDescription(),
|
||||||
)
|
)
|
||||||
|
|
||||||
currentVersion, err := migr.CurrentVersion(ctx)
|
currentVersion, err := migr.CurrentVersion(ctx)
|
||||||
@ -84,7 +85,7 @@ var initialModels = []interface{}{
|
|||||||
&model.Event{},
|
&model.Event{},
|
||||||
}
|
}
|
||||||
|
|
||||||
func m000initialSchema() orm.Migration {
|
func m000InitialSchema() orm.Migration {
|
||||||
return orm.NewDBMigration(
|
return orm.NewDBMigration(
|
||||||
"00_initial_schema",
|
"00_initial_schema",
|
||||||
func(ctx context.Context, tx *gorm.DB) error {
|
func(ctx context.Context, tx *gorm.DB) error {
|
||||||
@ -107,3 +108,23 @@ func m000initialSchema() orm.Migration {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func m001WorkgroupDescription() orm.Migration {
|
||||||
|
return orm.NewDBMigration(
|
||||||
|
"01_workgroup_description",
|
||||||
|
func(ctx context.Context, tx *gorm.DB) error {
|
||||||
|
if err := tx.AutoMigrate(&model.Workgroup{}).Error; err != nil {
|
||||||
|
return errors.WithStack(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
func(ctx context.Context, tx *gorm.DB) error {
|
||||||
|
if err := tx.Model(&model.Workgroup{}).DropColumn("description").Error; err != nil {
|
||||||
|
return errors.WithStack(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
1
debian/compat
vendored
1
debian/compat
vendored
@ -1 +0,0 @@
|
|||||||
9
|
|
14
debian/control
vendored
14
debian/control
vendored
@ -1,14 +0,0 @@
|
|||||||
Source: daddy
|
|
||||||
Section: unknown
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: Cadoles <contact@cadoles.com>
|
|
||||||
Build-Depends: debhelper (>= 8.0.0), wget, ca-certificates, tar
|
|
||||||
Standards-Version: 3.9.4
|
|
||||||
Homepage: http://forge.cadoles.com/Cadoles/daddy
|
|
||||||
Vcs-Git: http://forge.cadoles.com/Cadoles/daddy.git
|
|
||||||
Vcs-Browser: http://forge.cadoles.com/Cadoles/daddy
|
|
||||||
|
|
||||||
Package: daddy
|
|
||||||
Architecture: amd64
|
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
|
||||||
Description: Daddy app
|
|
1
debian/daddy.links
vendored
1
debian/daddy.links
vendored
@ -1 +0,0 @@
|
|||||||
/etc/daddy/client-config.js /usr/share/daddy/public/config.js
|
|
11
debian/daddy.service
vendored
11
debian/daddy.service
vendored
@ -1,11 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Daddy app
|
|
||||||
After=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=/usr/bin/daddy -workdir /usr/share/daddy -config /etc/daddy/config.yml
|
|
||||||
Restart=on-failure
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
56
debian/rules
vendored
56
debian/rules
vendored
@ -1,56 +0,0 @@
|
|||||||
#!/usr/bin/make -f
|
|
||||||
# -*- makefile -*-
|
|
||||||
|
|
||||||
# Uncomment this to turn on verbose mode.
|
|
||||||
export DH_VERBOSE=1
|
|
||||||
|
|
||||||
GO_VERSION := 1.13.5
|
|
||||||
OS := linux
|
|
||||||
ARCH := amd64
|
|
||||||
GOPATH=$(HOME)/go
|
|
||||||
|
|
||||||
ifeq (, $(shell which go 2>/dev/null))
|
|
||||||
override_dh_auto_build: install-go
|
|
||||||
|
|
||||||
override_dh_auto_clean: install-go
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq (, $(shell which node 2>/dev/null))
|
|
||||||
override_dh_auto_build: install-nodejs
|
|
||||||
endif
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@ --with systemd
|
|
||||||
|
|
||||||
override_dh_auto_build: $(GOPATH)
|
|
||||||
GOPATH=$(GOPATH) PATH="$(PATH):/usr/local/go/bin:$(GOPATH)/bin" make deps
|
|
||||||
GOPATH=$(GOPATH) PATH="$(PATH):/usr/local/go/bin:$(GOPATH)/bin" ARCH_TARGETS=$(ARCH) make release
|
|
||||||
|
|
||||||
$(GOPATH):
|
|
||||||
mkdir -p $(GOPATH)
|
|
||||||
|
|
||||||
install-go:
|
|
||||||
wget -nc https://dl.google.com/go/go$(GO_VERSION).$(OS)-$(ARCH).tar.gz
|
|
||||||
tar -C /usr/local -xzf go$(GO_VERSION).$(OS)-$(ARCH).tar.gz
|
|
||||||
|
|
||||||
install-nodejs:
|
|
||||||
wget -O- https://deb.nodesource.com/setup_12.x | bash -
|
|
||||||
apt-get install -y nodejs
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
|
||||||
|
|
||||||
mkdir -p debian/daddy/usr/share/daddy
|
|
||||||
mkdir -p debian/daddy/etc/daddy
|
|
||||||
mkdir -p debian/daddy/usr/bin
|
|
||||||
|
|
||||||
cp -r release/server-$(OS)-$(ARCH)/* debian/daddy/usr/share/daddy/
|
|
||||||
|
|
||||||
mv debian/daddy/usr/share/daddy/bin/server debian/daddy/usr/bin/daddy
|
|
||||||
mv debian/daddy/usr/share/daddy/server.conf debian/daddy/etc/daddy/config.yml
|
|
||||||
mv debian/daddy/usr/share/daddy/public/config.js debian/daddy/etc/daddy/client-config.js
|
|
||||||
|
|
||||||
install -d debian/daddy
|
|
||||||
|
|
||||||
override_dh_strip:
|
|
||||||
|
|
||||||
override_dh_auto_test:
|
|
1
debian/source/format
vendored
1
debian/source/format
vendored
@ -1 +0,0 @@
|
|||||||
3.0 (native)
|
|
@ -11,6 +11,7 @@ const ObjectTypeWorkgroup = "workgroup"
|
|||||||
type Workgroup struct {
|
type Workgroup struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
Name *string `json:"name"`
|
Name *string `json:"name"`
|
||||||
|
Workgroup *string `json:"workgroup"`
|
||||||
ClosedAt time.Time `json:"closedAt"`
|
ClosedAt time.Time `json:"closedAt"`
|
||||||
Members []*User `gorm:"many2many:users_workgroups;association_autoupdate:false"`
|
Members []*User `gorm:"many2many:users_workgroups;association_autoupdate:false"`
|
||||||
}
|
}
|
||||||
|
@ -68,9 +68,8 @@ func handleLoginCallback(w http.ResponseWriter, r *http.Request) {
|
|||||||
db := orm.Must(ctn).DB()
|
db := orm.Must(ctn).DB()
|
||||||
repo := model.NewUserRepository(db)
|
repo := model.NewUserRepository(db)
|
||||||
|
|
||||||
user, err := repo.CreateOrConnectUser(ctx, claims.Email)
|
user := &model.User{
|
||||||
if err != nil {
|
Email: claims.Email,
|
||||||
panic(errors.Wrap(err, "could not upsert user"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
authorized, err := auth.Authorize(user)
|
authorized, err := auth.Authorize(user)
|
||||||
@ -85,6 +84,11 @@ func handleLoginCallback(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user, err = repo.CreateOrConnectUser(ctx, claims.Email)
|
||||||
|
if err != nil {
|
||||||
|
panic(errors.Wrap(err, "could not upsert user"))
|
||||||
|
}
|
||||||
|
|
||||||
if err := session.SaveUserEmail(w, r, claims.Email); err != nil {
|
if err := session.SaveUserEmail(w, r, claims.Email); err != nil {
|
||||||
panic(errors.WithStack(err))
|
panic(errors.WithStack(err))
|
||||||
}
|
}
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80 default_server;
|
|
||||||
server_name daddy.local;
|
|
||||||
|
|
||||||
root /usr/share/daddy/client/public;
|
|
||||||
index index.html;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files $uri /index.html =404;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/v1/graphql {
|
|
||||||
proxy_pass http://127.0.0.1:8080/api/v1/graphql;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
GO_ENV=prod
|
|
Reference in New Issue
Block a user