Removed TermsAccepted in project from satellite console and web. (#1155)
* Removed TermsAccepted from satellite console and web.
This commit is contained in:
parent
0274244f23
commit
b75f06e229
@ -286,7 +286,7 @@ func TestGrapqhlMutation(t *testing.T) {
|
||||
}
|
||||
|
||||
query := fmt.Sprintf(
|
||||
"mutation {createProject(input:{name:\"%s\",description:\"%s\",isTermsAccepted:true}){name,description,id,createdAt}}",
|
||||
"mutation {createProject(input:{name:\"%s\",description:\"%s\"}){name,description,id,createdAt}}",
|
||||
projectInfo.Name,
|
||||
projectInfo.Description,
|
||||
)
|
||||
|
@ -18,9 +18,6 @@ const (
|
||||
FieldName = "name"
|
||||
// FieldDescription is a field name for description
|
||||
FieldDescription = "description"
|
||||
// FieldIsTermsAccepted indicates if user accepted Terms & Conditions during project creation
|
||||
// Used in input model
|
||||
FieldIsTermsAccepted = "isTermsAccepted"
|
||||
// FieldMembers is field name for members
|
||||
FieldMembers = "members"
|
||||
// FieldAPIKeys is a field name for api keys
|
||||
@ -50,9 +47,6 @@ func graphqlProject(service *console.Service, types Types) *graphql.Object {
|
||||
FieldDescription: &graphql.Field{
|
||||
Type: graphql.String,
|
||||
},
|
||||
FieldIsTermsAccepted: &graphql.Field{
|
||||
Type: graphql.Int,
|
||||
},
|
||||
FieldCreatedAt: &graphql.Field{
|
||||
Type: graphql.DateTime,
|
||||
},
|
||||
@ -131,9 +125,6 @@ func graphqlProjectInput() *graphql.InputObject {
|
||||
FieldDescription: &graphql.InputObjectFieldConfig{
|
||||
Type: graphql.String,
|
||||
},
|
||||
FieldIsTermsAccepted: &graphql.InputObjectFieldConfig{
|
||||
Type: graphql.Boolean,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -142,7 +133,6 @@ func graphqlProjectInput() *graphql.InputObject {
|
||||
func fromMapProjectInfo(args map[string]interface{}) (project console.ProjectInfo) {
|
||||
project.Name, _ = args[FieldName].(string)
|
||||
project.Description, _ = args[FieldDescription].(string)
|
||||
project.IsTermsAccepted, _ = args[FieldIsTermsAccepted].(bool)
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -139,7 +139,6 @@ func TestGraphqlQuery(t *testing.T) {
|
||||
|
||||
createdProject, err := service.CreateProject(authCtx, console.ProjectInfo{
|
||||
Name: "TestProject",
|
||||
IsTermsAccepted: true,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
@ -313,7 +312,6 @@ func TestGraphqlQuery(t *testing.T) {
|
||||
project2, err := service.CreateProject(authCtx, console.ProjectInfo{
|
||||
Name: "Project2",
|
||||
Description: "Test desc",
|
||||
IsTermsAccepted: true,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
@ -32,8 +32,6 @@ type Project struct {
|
||||
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
// stores last accepted version of terms of use.
|
||||
TermsAccepted int `json:"termsAccepted"`
|
||||
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
@ -42,8 +40,6 @@ type Project struct {
|
||||
type ProjectInfo struct {
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
// Indicates if user accepted Terms & Conditions during project creation on UI
|
||||
IsTermsAccepted bool `json:"isTermsAccepted"`
|
||||
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
}
|
||||
|
@ -215,14 +215,9 @@ func (s *Service) CreateProject(ctx context.Context, projectInfo ProjectInfo) (p
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !projectInfo.IsTermsAccepted {
|
||||
return nil, errs.New("terms of use should be accepted!")
|
||||
}
|
||||
|
||||
project := &Project{
|
||||
Description: projectInfo.Description,
|
||||
Name: projectInfo.Name,
|
||||
TermsAccepted: 1, //TODO: get lat version of Term of Use
|
||||
}
|
||||
|
||||
transaction, err := s.store.BeginTx(ctx)
|
||||
|
@ -35,7 +35,6 @@ func TestApiKeysRepository(t *testing.T) {
|
||||
|
||||
project, err := projects.Insert(ctx, &console.Project{
|
||||
Name: "ProjectName",
|
||||
TermsAccepted: 1,
|
||||
Description: "projects description",
|
||||
})
|
||||
assert.NotNil(t, project)
|
||||
|
@ -272,8 +272,6 @@ model project (
|
||||
|
||||
field name text
|
||||
field description text ( updatable )
|
||||
// stores last accepted version of terms of use
|
||||
field terms_accepted int ( updatable )
|
||||
|
||||
field created_at timestamp ( autoinsert )
|
||||
)
|
||||
|
@ -356,7 +356,6 @@ CREATE TABLE projects (
|
||||
id bytea NOT NULL,
|
||||
name text NOT NULL,
|
||||
description text NOT NULL,
|
||||
terms_accepted integer NOT NULL,
|
||||
created_at timestamp with time zone NOT NULL,
|
||||
PRIMARY KEY ( id )
|
||||
);
|
||||
@ -538,7 +537,6 @@ CREATE TABLE projects (
|
||||
id BLOB NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
terms_accepted INTEGER NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL,
|
||||
PRIMARY KEY ( id )
|
||||
);
|
||||
@ -1788,7 +1786,6 @@ type Project struct {
|
||||
Id []byte
|
||||
Name string
|
||||
Description string
|
||||
TermsAccepted int
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
@ -1796,7 +1793,6 @@ func (Project) _Table() string { return "projects" }
|
||||
|
||||
type Project_Update_Fields struct {
|
||||
Description Project_Description_Field
|
||||
TermsAccepted Project_TermsAccepted_Field
|
||||
}
|
||||
|
||||
type Project_Id_Field struct {
|
||||
@ -1856,25 +1852,6 @@ func (f Project_Description_Field) value() interface{} {
|
||||
|
||||
func (Project_Description_Field) _Column() string { return "description" }
|
||||
|
||||
type Project_TermsAccepted_Field struct {
|
||||
_set bool
|
||||
_null bool
|
||||
_value int
|
||||
}
|
||||
|
||||
func Project_TermsAccepted(v int) Project_TermsAccepted_Field {
|
||||
return Project_TermsAccepted_Field{_set: true, _value: v}
|
||||
}
|
||||
|
||||
func (f Project_TermsAccepted_Field) value() interface{} {
|
||||
if !f._set || f._null {
|
||||
return nil
|
||||
}
|
||||
return f._value
|
||||
}
|
||||
|
||||
func (Project_TermsAccepted_Field) _Column() string { return "terms_accepted" }
|
||||
|
||||
type Project_CreatedAt_Field struct {
|
||||
_set bool
|
||||
_null bool
|
||||
@ -2735,24 +2712,22 @@ func (obj *postgresImpl) Create_User(ctx context.Context,
|
||||
func (obj *postgresImpl) Create_Project(ctx context.Context,
|
||||
project_id Project_Id_Field,
|
||||
project_name Project_Name_Field,
|
||||
project_description Project_Description_Field,
|
||||
project_terms_accepted Project_TermsAccepted_Field) (
|
||||
project_description Project_Description_Field) (
|
||||
project *Project, err error) {
|
||||
|
||||
__now := obj.db.Hooks.Now().UTC()
|
||||
__id_val := project_id.value()
|
||||
__name_val := project_name.value()
|
||||
__description_val := project_description.value()
|
||||
__terms_accepted_val := project_terms_accepted.value()
|
||||
__created_at_val := __now
|
||||
|
||||
var __embed_stmt = __sqlbundle_Literal("INSERT INTO projects ( id, name, description, terms_accepted, created_at ) VALUES ( ?, ?, ?, ?, ? ) RETURNING projects.id, projects.name, projects.description, projects.terms_accepted, projects.created_at")
|
||||
var __embed_stmt = __sqlbundle_Literal("INSERT INTO projects ( id, name, description, created_at ) VALUES ( ?, ?, ?, ? ) RETURNING projects.id, projects.name, projects.description, projects.created_at")
|
||||
|
||||
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
||||
obj.logStmt(__stmt, __id_val, __name_val, __description_val, __terms_accepted_val, __created_at_val)
|
||||
obj.logStmt(__stmt, __id_val, __name_val, __description_val, __created_at_val)
|
||||
|
||||
project = &Project{}
|
||||
err = obj.driver.QueryRow(__stmt, __id_val, __name_val, __description_val, __terms_accepted_val, __created_at_val).Scan(&project.Id, &project.Name, &project.Description, &project.TermsAccepted, &project.CreatedAt)
|
||||
err = obj.driver.QueryRow(__stmt, __id_val, __name_val, __description_val, __created_at_val).Scan(&project.Id, &project.Name, &project.Description, &project.CreatedAt)
|
||||
if err != nil {
|
||||
return nil, obj.makeErr(err)
|
||||
}
|
||||
@ -3421,7 +3396,7 @@ func (obj *postgresImpl) Get_User_By_Id(ctx context.Context,
|
||||
func (obj *postgresImpl) All_Project(ctx context.Context) (
|
||||
rows []*Project, err error) {
|
||||
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.terms_accepted, projects.created_at FROM projects")
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.created_at FROM projects")
|
||||
|
||||
var __values []interface{}
|
||||
__values = append(__values)
|
||||
@ -3437,7 +3412,7 @@ func (obj *postgresImpl) All_Project(ctx context.Context) (
|
||||
|
||||
for __rows.Next() {
|
||||
project := &Project{}
|
||||
err = __rows.Scan(&project.Id, &project.Name, &project.Description, &project.TermsAccepted, &project.CreatedAt)
|
||||
err = __rows.Scan(&project.Id, &project.Name, &project.Description, &project.CreatedAt)
|
||||
if err != nil {
|
||||
return nil, obj.makeErr(err)
|
||||
}
|
||||
@ -3454,7 +3429,7 @@ func (obj *postgresImpl) Get_Project_By_Id(ctx context.Context,
|
||||
project_id Project_Id_Field) (
|
||||
project *Project, err error) {
|
||||
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.terms_accepted, projects.created_at FROM projects WHERE projects.id = ?")
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.created_at FROM projects WHERE projects.id = ?")
|
||||
|
||||
var __values []interface{}
|
||||
__values = append(__values, project_id.value())
|
||||
@ -3463,7 +3438,7 @@ func (obj *postgresImpl) Get_Project_By_Id(ctx context.Context,
|
||||
obj.logStmt(__stmt, __values...)
|
||||
|
||||
project = &Project{}
|
||||
err = obj.driver.QueryRow(__stmt, __values...).Scan(&project.Id, &project.Name, &project.Description, &project.TermsAccepted, &project.CreatedAt)
|
||||
err = obj.driver.QueryRow(__stmt, __values...).Scan(&project.Id, &project.Name, &project.Description, &project.CreatedAt)
|
||||
if err != nil {
|
||||
return nil, obj.makeErr(err)
|
||||
}
|
||||
@ -3475,7 +3450,7 @@ func (obj *postgresImpl) All_Project_By_ProjectMember_MemberId_OrderBy_Asc_Proje
|
||||
project_member_member_id ProjectMember_MemberId_Field) (
|
||||
rows []*Project, err error) {
|
||||
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.terms_accepted, projects.created_at FROM projects JOIN project_members ON projects.id = project_members.project_id WHERE project_members.member_id = ? ORDER BY projects.name")
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.created_at FROM projects JOIN project_members ON projects.id = project_members.project_id WHERE project_members.member_id = ? ORDER BY projects.name")
|
||||
|
||||
var __values []interface{}
|
||||
__values = append(__values, project_member_member_id.value())
|
||||
@ -3491,7 +3466,7 @@ func (obj *postgresImpl) All_Project_By_ProjectMember_MemberId_OrderBy_Asc_Proje
|
||||
|
||||
for __rows.Next() {
|
||||
project := &Project{}
|
||||
err = __rows.Scan(&project.Id, &project.Name, &project.Description, &project.TermsAccepted, &project.CreatedAt)
|
||||
err = __rows.Scan(&project.Id, &project.Name, &project.Description, &project.CreatedAt)
|
||||
if err != nil {
|
||||
return nil, obj.makeErr(err)
|
||||
}
|
||||
@ -4024,7 +3999,7 @@ func (obj *postgresImpl) Update_Project_By_Id(ctx context.Context,
|
||||
project *Project, err error) {
|
||||
var __sets = &__sqlbundle_Hole{}
|
||||
|
||||
var __embed_stmt = __sqlbundle_Literals{Join: "", SQLs: []__sqlbundle_SQL{__sqlbundle_Literal("UPDATE projects SET "), __sets, __sqlbundle_Literal(" WHERE projects.id = ? RETURNING projects.id, projects.name, projects.description, projects.terms_accepted, projects.created_at")}}
|
||||
var __embed_stmt = __sqlbundle_Literals{Join: "", SQLs: []__sqlbundle_SQL{__sqlbundle_Literal("UPDATE projects SET "), __sets, __sqlbundle_Literal(" WHERE projects.id = ? RETURNING projects.id, projects.name, projects.description, projects.created_at")}}
|
||||
|
||||
__sets_sql := __sqlbundle_Literals{Join: ", "}
|
||||
var __values []interface{}
|
||||
@ -4035,11 +4010,6 @@ func (obj *postgresImpl) Update_Project_By_Id(ctx context.Context,
|
||||
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("description = ?"))
|
||||
}
|
||||
|
||||
if update.TermsAccepted._set {
|
||||
__values = append(__values, update.TermsAccepted.value())
|
||||
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("terms_accepted = ?"))
|
||||
}
|
||||
|
||||
if len(__sets_sql.SQLs) == 0 {
|
||||
return nil, emptyUpdate()
|
||||
}
|
||||
@ -4053,7 +4023,7 @@ func (obj *postgresImpl) Update_Project_By_Id(ctx context.Context,
|
||||
obj.logStmt(__stmt, __values...)
|
||||
|
||||
project = &Project{}
|
||||
err = obj.driver.QueryRow(__stmt, __values...).Scan(&project.Id, &project.Name, &project.Description, &project.TermsAccepted, &project.CreatedAt)
|
||||
err = obj.driver.QueryRow(__stmt, __values...).Scan(&project.Id, &project.Name, &project.Description, &project.CreatedAt)
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, nil
|
||||
}
|
||||
@ -4888,23 +4858,21 @@ func (obj *sqlite3Impl) Create_User(ctx context.Context,
|
||||
func (obj *sqlite3Impl) Create_Project(ctx context.Context,
|
||||
project_id Project_Id_Field,
|
||||
project_name Project_Name_Field,
|
||||
project_description Project_Description_Field,
|
||||
project_terms_accepted Project_TermsAccepted_Field) (
|
||||
project_description Project_Description_Field) (
|
||||
project *Project, err error) {
|
||||
|
||||
__now := obj.db.Hooks.Now().UTC()
|
||||
__id_val := project_id.value()
|
||||
__name_val := project_name.value()
|
||||
__description_val := project_description.value()
|
||||
__terms_accepted_val := project_terms_accepted.value()
|
||||
__created_at_val := __now
|
||||
|
||||
var __embed_stmt = __sqlbundle_Literal("INSERT INTO projects ( id, name, description, terms_accepted, created_at ) VALUES ( ?, ?, ?, ?, ? )")
|
||||
var __embed_stmt = __sqlbundle_Literal("INSERT INTO projects ( id, name, description, created_at ) VALUES ( ?, ?, ?, ? )")
|
||||
|
||||
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
||||
obj.logStmt(__stmt, __id_val, __name_val, __description_val, __terms_accepted_val, __created_at_val)
|
||||
obj.logStmt(__stmt, __id_val, __name_val, __description_val, __created_at_val)
|
||||
|
||||
__res, err := obj.driver.Exec(__stmt, __id_val, __name_val, __description_val, __terms_accepted_val, __created_at_val)
|
||||
__res, err := obj.driver.Exec(__stmt, __id_val, __name_val, __description_val, __created_at_val)
|
||||
if err != nil {
|
||||
return nil, obj.makeErr(err)
|
||||
}
|
||||
@ -5586,7 +5554,7 @@ func (obj *sqlite3Impl) Get_User_By_Id(ctx context.Context,
|
||||
func (obj *sqlite3Impl) All_Project(ctx context.Context) (
|
||||
rows []*Project, err error) {
|
||||
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.terms_accepted, projects.created_at FROM projects")
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.created_at FROM projects")
|
||||
|
||||
var __values []interface{}
|
||||
__values = append(__values)
|
||||
@ -5602,7 +5570,7 @@ func (obj *sqlite3Impl) All_Project(ctx context.Context) (
|
||||
|
||||
for __rows.Next() {
|
||||
project := &Project{}
|
||||
err = __rows.Scan(&project.Id, &project.Name, &project.Description, &project.TermsAccepted, &project.CreatedAt)
|
||||
err = __rows.Scan(&project.Id, &project.Name, &project.Description, &project.CreatedAt)
|
||||
if err != nil {
|
||||
return nil, obj.makeErr(err)
|
||||
}
|
||||
@ -5619,7 +5587,7 @@ func (obj *sqlite3Impl) Get_Project_By_Id(ctx context.Context,
|
||||
project_id Project_Id_Field) (
|
||||
project *Project, err error) {
|
||||
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.terms_accepted, projects.created_at FROM projects WHERE projects.id = ?")
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.created_at FROM projects WHERE projects.id = ?")
|
||||
|
||||
var __values []interface{}
|
||||
__values = append(__values, project_id.value())
|
||||
@ -5628,7 +5596,7 @@ func (obj *sqlite3Impl) Get_Project_By_Id(ctx context.Context,
|
||||
obj.logStmt(__stmt, __values...)
|
||||
|
||||
project = &Project{}
|
||||
err = obj.driver.QueryRow(__stmt, __values...).Scan(&project.Id, &project.Name, &project.Description, &project.TermsAccepted, &project.CreatedAt)
|
||||
err = obj.driver.QueryRow(__stmt, __values...).Scan(&project.Id, &project.Name, &project.Description, &project.CreatedAt)
|
||||
if err != nil {
|
||||
return nil, obj.makeErr(err)
|
||||
}
|
||||
@ -5640,7 +5608,7 @@ func (obj *sqlite3Impl) All_Project_By_ProjectMember_MemberId_OrderBy_Asc_Projec
|
||||
project_member_member_id ProjectMember_MemberId_Field) (
|
||||
rows []*Project, err error) {
|
||||
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.terms_accepted, projects.created_at FROM projects JOIN project_members ON projects.id = project_members.project_id WHERE project_members.member_id = ? ORDER BY projects.name")
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.created_at FROM projects JOIN project_members ON projects.id = project_members.project_id WHERE project_members.member_id = ? ORDER BY projects.name")
|
||||
|
||||
var __values []interface{}
|
||||
__values = append(__values, project_member_member_id.value())
|
||||
@ -5656,7 +5624,7 @@ func (obj *sqlite3Impl) All_Project_By_ProjectMember_MemberId_OrderBy_Asc_Projec
|
||||
|
||||
for __rows.Next() {
|
||||
project := &Project{}
|
||||
err = __rows.Scan(&project.Id, &project.Name, &project.Description, &project.TermsAccepted, &project.CreatedAt)
|
||||
err = __rows.Scan(&project.Id, &project.Name, &project.Description, &project.CreatedAt)
|
||||
if err != nil {
|
||||
return nil, obj.makeErr(err)
|
||||
}
|
||||
@ -6250,11 +6218,6 @@ func (obj *sqlite3Impl) Update_Project_By_Id(ctx context.Context,
|
||||
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("description = ?"))
|
||||
}
|
||||
|
||||
if update.TermsAccepted._set {
|
||||
__values = append(__values, update.TermsAccepted.value())
|
||||
__sets_sql.SQLs = append(__sets_sql.SQLs, __sqlbundle_Literal("terms_accepted = ?"))
|
||||
}
|
||||
|
||||
if len(__sets_sql.SQLs) == 0 {
|
||||
return nil, emptyUpdate()
|
||||
}
|
||||
@ -6273,12 +6236,12 @@ func (obj *sqlite3Impl) Update_Project_By_Id(ctx context.Context,
|
||||
return nil, obj.makeErr(err)
|
||||
}
|
||||
|
||||
var __embed_stmt_get = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.terms_accepted, projects.created_at FROM projects WHERE projects.id = ?")
|
||||
var __embed_stmt_get = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.created_at FROM projects WHERE projects.id = ?")
|
||||
|
||||
var __stmt_get = __sqlbundle_Render(obj.dialect, __embed_stmt_get)
|
||||
obj.logStmt("(IMPLIED) "+__stmt_get, __args...)
|
||||
|
||||
err = obj.driver.QueryRow(__stmt_get, __args...).Scan(&project.Id, &project.Name, &project.Description, &project.TermsAccepted, &project.CreatedAt)
|
||||
err = obj.driver.QueryRow(__stmt_get, __args...).Scan(&project.Id, &project.Name, &project.Description, &project.CreatedAt)
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, nil
|
||||
}
|
||||
@ -6843,13 +6806,13 @@ func (obj *sqlite3Impl) getLastProject(ctx context.Context,
|
||||
pk int64) (
|
||||
project *Project, err error) {
|
||||
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.terms_accepted, projects.created_at FROM projects WHERE _rowid_ = ?")
|
||||
var __embed_stmt = __sqlbundle_Literal("SELECT projects.id, projects.name, projects.description, projects.created_at FROM projects WHERE _rowid_ = ?")
|
||||
|
||||
var __stmt = __sqlbundle_Render(obj.dialect, __embed_stmt)
|
||||
obj.logStmt(__stmt, pk)
|
||||
|
||||
project = &Project{}
|
||||
err = obj.driver.QueryRow(__stmt, pk).Scan(&project.Id, &project.Name, &project.Description, &project.TermsAccepted, &project.CreatedAt)
|
||||
err = obj.driver.QueryRow(__stmt, pk).Scan(&project.Id, &project.Name, &project.Description, &project.CreatedAt)
|
||||
if err != nil {
|
||||
return nil, obj.makeErr(err)
|
||||
}
|
||||
@ -7378,14 +7341,13 @@ func (rx *Rx) Create_OverlayCacheNode(ctx context.Context,
|
||||
func (rx *Rx) Create_Project(ctx context.Context,
|
||||
project_id Project_Id_Field,
|
||||
project_name Project_Name_Field,
|
||||
project_description Project_Description_Field,
|
||||
project_terms_accepted Project_TermsAccepted_Field) (
|
||||
project_description Project_Description_Field) (
|
||||
project *Project, err error) {
|
||||
var tx *Tx
|
||||
if tx, err = rx.getTx(ctx); err != nil {
|
||||
return
|
||||
}
|
||||
return tx.Create_Project(ctx, project_id, project_name, project_description, project_terms_accepted)
|
||||
return tx.Create_Project(ctx, project_id, project_name, project_description)
|
||||
|
||||
}
|
||||
|
||||
@ -7947,8 +7909,7 @@ type Methods interface {
|
||||
Create_Project(ctx context.Context,
|
||||
project_id Project_Id_Field,
|
||||
project_name Project_Name_Field,
|
||||
project_description Project_Description_Field,
|
||||
project_terms_accepted Project_TermsAccepted_Field) (
|
||||
project_description Project_Description_Field) (
|
||||
project *Project, err error)
|
||||
|
||||
Create_ProjectMember(ctx context.Context,
|
||||
|
@ -83,7 +83,6 @@ CREATE TABLE projects (
|
||||
id bytea NOT NULL,
|
||||
name text NOT NULL,
|
||||
description text NOT NULL,
|
||||
terms_accepted integer NOT NULL,
|
||||
created_at timestamp with time zone NOT NULL,
|
||||
PRIMARY KEY ( id )
|
||||
);
|
||||
|
@ -83,7 +83,6 @@ CREATE TABLE projects (
|
||||
id BLOB NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
description TEXT NOT NULL,
|
||||
terms_accepted INTEGER NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL,
|
||||
PRIMARY KEY ( id )
|
||||
);
|
||||
|
@ -208,12 +208,10 @@ func prepareUsersAndProjects(ctx context.Context, t *testing.T, users console.Us
|
||||
projectList := []*console.Project{
|
||||
{
|
||||
Name: "projName1",
|
||||
TermsAccepted: 1,
|
||||
Description: "Test project 1",
|
||||
},
|
||||
{
|
||||
Name: "projName2",
|
||||
TermsAccepted: 1,
|
||||
Description: "Test project 1",
|
||||
},
|
||||
}
|
||||
|
@ -59,8 +59,7 @@ func (projects *projects) Insert(ctx context.Context, project *console.Project)
|
||||
createdProject, err := projects.db.Create_Project(ctx,
|
||||
dbx.Project_Id(projectID[:]),
|
||||
dbx.Project_Name(project.Name),
|
||||
dbx.Project_Description(project.Description),
|
||||
dbx.Project_TermsAccepted(project.TermsAccepted))
|
||||
dbx.Project_Description(project.Description))
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -80,7 +79,6 @@ func (projects *projects) Delete(ctx context.Context, id uuid.UUID) error {
|
||||
func (projects *projects) Update(ctx context.Context, project *console.Project) error {
|
||||
updateFields := dbx.Project_Update_Fields{
|
||||
Description: dbx.Project_Description(project.Description),
|
||||
TermsAccepted: dbx.Project_TermsAccepted(project.TermsAccepted),
|
||||
}
|
||||
|
||||
_, err := projects.db.Update_Project_By_Id(ctx,
|
||||
@ -105,7 +103,6 @@ func projectFromDBX(project *dbx.Project) (*console.Project, error) {
|
||||
ID: id,
|
||||
Name: project.Name,
|
||||
Description: project.Description,
|
||||
TermsAccepted: project.TermsAccepted,
|
||||
CreatedAt: project.CreatedAt,
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,6 @@ func TestProjectsRepository(t *testing.T) {
|
||||
project = &console.Project{
|
||||
Name: name,
|
||||
Description: description,
|
||||
TermsAccepted: 1,
|
||||
}
|
||||
|
||||
project, err = projects.Insert(ctx, project)
|
||||
@ -80,7 +79,6 @@ func TestProjectsRepository(t *testing.T) {
|
||||
assert.Equal(t, projectByID.ID, project.ID)
|
||||
assert.Equal(t, projectByID.Name, name)
|
||||
assert.Equal(t, projectByID.Description, description)
|
||||
assert.Equal(t, projectByID.TermsAccepted, 1)
|
||||
})
|
||||
|
||||
t.Run("Get by projectID success", func(t *testing.T) {
|
||||
@ -89,7 +87,6 @@ func TestProjectsRepository(t *testing.T) {
|
||||
assert.Equal(t, projectByID.ID, project.ID)
|
||||
assert.Equal(t, projectByID.Name, name)
|
||||
assert.Equal(t, projectByID.Description, description)
|
||||
assert.Equal(t, projectByID.TermsAccepted, 1)
|
||||
})
|
||||
|
||||
t.Run("Update project success", func(t *testing.T) {
|
||||
@ -101,7 +98,6 @@ func TestProjectsRepository(t *testing.T) {
|
||||
newProject := &console.Project{
|
||||
ID: oldProject.ID,
|
||||
Description: newDescription,
|
||||
TermsAccepted: 2,
|
||||
}
|
||||
|
||||
err = projects.Update(ctx, newProject)
|
||||
@ -112,7 +108,6 @@ func TestProjectsRepository(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, newProject.ID, oldProject.ID)
|
||||
assert.Equal(t, newProject.Description, newDescription)
|
||||
assert.Equal(t, newProject.TermsAccepted, 2)
|
||||
})
|
||||
|
||||
t.Run("Delete project success", func(t *testing.T) {
|
||||
@ -135,7 +130,6 @@ func TestProjectsRepository(t *testing.T) {
|
||||
newProject := &console.Project{
|
||||
Description: description,
|
||||
Name: name,
|
||||
TermsAccepted: 1,
|
||||
}
|
||||
|
||||
_, err = projects.Insert(ctx, newProject)
|
||||
@ -148,7 +142,6 @@ func TestProjectsRepository(t *testing.T) {
|
||||
newProject2 := &console.Project{
|
||||
Description: description,
|
||||
Name: name,
|
||||
TermsAccepted: 1,
|
||||
}
|
||||
|
||||
_, err = projects.Insert(ctx, newProject2)
|
||||
|
@ -21,7 +21,6 @@ export async function createProjectRequest(project: Project): Promise<RequestRes
|
||||
input: {
|
||||
name: "${project.name}",
|
||||
description: "${project.description}",
|
||||
isTermsAccepted: ${project.isTermsAccepted},
|
||||
}
|
||||
) {id}
|
||||
}`
|
||||
|
@ -27,12 +27,6 @@
|
||||
width="100%"
|
||||
@setData="setProjectDescription">
|
||||
</HeaderedInput>
|
||||
<div class="new-project-popup__form-container__terms-area">
|
||||
<Checkbox class="new-project-popup__form-container__terms-area__checkbox"
|
||||
@setData="setTermsAccepted"
|
||||
:isCheckboxError="termsAcceptedError"/>
|
||||
<h2>I agree to the Storj Bridge Hosting <a>Terms & Conditions</a></h2>
|
||||
</div>
|
||||
<div class="new-project-popup__form-container__button-container">
|
||||
<Button label="Cancel" width="205px" height="48px" :onPress="onCloseClick" isWhite/>
|
||||
<Button label="Create Project" width="205px" height="48px" :onPress="createProject"/>
|
||||
@ -61,8 +55,6 @@ import { validateProjectName } from '@/utils/validation';
|
||||
return {
|
||||
projectName: '',
|
||||
description: '',
|
||||
isTermsAccepted: false,
|
||||
termsAcceptedError: false,
|
||||
nameError: '',
|
||||
};
|
||||
},
|
||||
@ -74,20 +66,12 @@ import { validateProjectName } from '@/utils/validation';
|
||||
setProjectDescription: function (value: string): void {
|
||||
this.$data.description = value;
|
||||
},
|
||||
setTermsAccepted: function (value: boolean): void {
|
||||
this.$data.isTermsAccepted = value;
|
||||
this.$data.termsAcceptedError = false;
|
||||
},
|
||||
onCloseClick: function (): void {
|
||||
this.$store.dispatch(APP_STATE_ACTIONS.TOGGLE_NEW_PROJ);
|
||||
},
|
||||
createProject: async function (): Promise<any> {
|
||||
let projectName = this.$data.projectName.trim();
|
||||
|
||||
if (!this.$data.isTermsAccepted) {
|
||||
this.$data.termsAcceptedError = true;
|
||||
}
|
||||
|
||||
if (!validateProjectName(projectName)) {
|
||||
this.$data.nameError = 'Name for project is invalid!';
|
||||
}
|
||||
@ -96,7 +80,7 @@ import { validateProjectName } from '@/utils/validation';
|
||||
this.$data.nameError = 'Name should be less than 21 character!';
|
||||
}
|
||||
|
||||
if (this.$data.nameError || this.$data.termsAcceptedError) {
|
||||
if (this.$data.nameError) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -147,7 +131,7 @@ export default class NewProjectPopup extends Vue {
|
||||
.new-project-popup {
|
||||
width: 100%;
|
||||
max-width: 845px;
|
||||
height: 440px;
|
||||
height: 400px;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
@ -171,7 +155,7 @@ export default class NewProjectPopup extends Vue {
|
||||
line-height: 39px;
|
||||
color: #384B65;
|
||||
margin-bottom: 60px;
|
||||
margin-top: 0;
|
||||
margin-top: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,29 +163,6 @@ export default class NewProjectPopup extends Vue {
|
||||
width: 100%;
|
||||
max-width: 520px;
|
||||
|
||||
&__terms-area {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
margin-top: 20px;
|
||||
|
||||
&__checkbox {
|
||||
align-self: center;
|
||||
};
|
||||
|
||||
h2 {
|
||||
font-family: 'montserrat_regular';
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
margin-top: 20px;
|
||||
margin-left: 0;
|
||||
};
|
||||
a {
|
||||
color: #2683FF;
|
||||
font-family: 'montserrat_bold';
|
||||
}
|
||||
}
|
||||
|
||||
&__button-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
1
web/satellite/src/types/projects.d.ts
vendored
1
web/satellite/src/types/projects.d.ts
vendored
@ -7,7 +7,6 @@ declare type Project = {
|
||||
|
||||
name: string,
|
||||
description: string,
|
||||
isTermsAccepted: boolean,
|
||||
createdAt: string,
|
||||
|
||||
isSelected: boolean,
|
||||
|
@ -2,7 +2,7 @@
|
||||
// See LICENSE for copying information.
|
||||
|
||||
import { mount, shallowMount } from '@vue/test-utils';
|
||||
import AccountDropdown from '@/components/dashboard/account/AccountDropdown.vue';
|
||||
import AccountDropdown from '@/components/header/AccountDropdown.vue';
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
describe('AccountDropdown.vue', () => {
|
||||
|
@ -199,7 +199,6 @@ describe('actions', () => {
|
||||
name: '',
|
||||
id: '',
|
||||
description: '',
|
||||
isTermsAccepted: false,
|
||||
isSelected: false,
|
||||
createdAt: ''
|
||||
};
|
||||
@ -219,7 +218,6 @@ describe('actions', () => {
|
||||
name: '',
|
||||
id: '',
|
||||
description: '',
|
||||
isTermsAccepted: false,
|
||||
isSelected: false,
|
||||
createdAt: ''
|
||||
};
|
||||
@ -245,7 +243,6 @@ describe('actions', () => {
|
||||
name: '',
|
||||
id: 'id',
|
||||
description: 'desc',
|
||||
isTermsAccepted: false,
|
||||
isSelected: false,
|
||||
createdAt: ''
|
||||
};
|
||||
@ -263,7 +260,6 @@ describe('actions', () => {
|
||||
name: '',
|
||||
id: '',
|
||||
description: '',
|
||||
isTermsAccepted: false,
|
||||
isSelected: false,
|
||||
createdAt: ''
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user