Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] add create label action #4908

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
443541a
add create label action
hchoura Mar 3, 2021
91a8673
add support for DAOCreateView and WizardController.
hchoura Mar 3, 2021
d50547f
typo
hchoura Mar 3, 2021
c422534
add editColumnsEnabled
hchoura Mar 4, 2021
c18a290
Merge branch 'master' into DAOBrowseControllerAddLabelAction
hchoura Mar 4, 2021
2cfa245
add wizardDetailView
hchoura Mar 5, 2021
369226d
migrate to ContactWizardDetailView
hchoura Mar 5, 2021
b48d52e
change the of type
hchoura Mar 6, 2021
8b0455c
use wizardDetailView
hchoura Mar 6, 2021
4c3f98b
Merge branch 'master' into DAOBrowseControllerAddLabelAction
hchoura Mar 8, 2021
9356802
Merge branch 'master' into DAOBrowseControllerAddLabelAction
hchoura Mar 8, 2021
0948e3e
comment the
hchoura Mar 8, 2021
e6db96e
Merge branch 'master' into DAOBrowseControllerAddLabelAction
hchoura Mar 8, 2021
216cbeb
add eval
hchoura Mar 10, 2021
4788396
use class foam.u2.ViewSpec
hchoura Mar 10, 2021
627afea
Merge branch 'master' into DAOBrowseControllerAddLabelAction
hchoura Mar 10, 2021
c673194
add support for detailView and menu
hchoura Mar 15, 2021
ba4b524
add properties
hchoura Mar 15, 2021
074183b
Merge branch 'master' into DAOBrowseControllerAddLabelAction
hchoura Mar 15, 2021
6e88d25
Merge branch 'master' into DAOBrowseControllerAddLabelAction
hchoura Mar 16, 2021
7db61c8
Merge branch 'master' into DAOBrowseControllerAddLabelAction
hchoura Mar 19, 2021
9623379
delete comment
hchoura Mar 19, 2021
9472a63
update menu
hchoura Mar 23, 2021
5cf02c8
Fix FObject property validation is not being run (#5108)
lchanmann Apr 5, 2021
6af2862
add LockDAO as needed on client side (#5110)
jlhughes Apr 6, 2021
af6abd3
Merge branch 'master' into DAOBrowseControllerAddLabelAction
hchoura Apr 6, 2021
12b876b
solve the conflict
hchoura Apr 7, 2021
5b84853
fix context issue
hchoura Apr 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ FOAM_FILES([
{ name: "foam/dao/SQLStatement" },
{ name: "foam/dao/CSVSink" },
{ name: "foam/dao/LimitedDAO" },
{ name: "foam/dao/LockDAO" },
{ name: "foam/dao/SkipDAO" },
{ name: "foam/dao/OrderedDAO", flags: ['web'] },
{ name: "foam/dao/InternalException" },
Expand Down
44 changes: 32 additions & 12 deletions src/foam/comics/v2/DAOBrowseControllerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ foam.CLASS({
],

exports: [
'memento'
'memento',
'config'
],

requires: [
Expand Down Expand Up @@ -125,12 +126,25 @@ foam.CLASS({
},
code: function() {
if ( ! this.stack ) return;
this.stack.push({
class: 'foam.comics.v2.DAOCreateView',
data: ((this.config.factory && this.config.factory$cls) || this.data.of).create({ mode: 'create'}, this),
config$: this.config$,
of: this.data.of
}, this.__subContext__);

if ( this.config.DAOCreateView ){
this.stack.push({
class: 'foam.comics.v2.DAOCreateView',
data: ((this.config.factory && this.config.factory$cls) || this.data.of).create({ mode: 'create'}, this),
config$: this.config$,
of: this.data.of
}, this.__subContext__);
} else {
this.stack.push(
eval(this.config.wizardDetailView.class).create({
model: this.data.of.id || this.config.of.id,
data: this.selection,
detailView: this.config.detailView.class,
menu: this.config.menu,
controllerMode: foam.u2.ControllerMode.CREATE,
isEdit: true
}, this.__subContext__));
}
}
}
],
Expand All @@ -142,7 +156,8 @@ foam.CLASS({
var self = this;
var menuId = this.currentMenu ? this.currentMenu.id : this.config.of.id;
this.addClass(this.myClass())
.add(this.slot(function(data, config, config$of, config$browseBorder, config$browseViews, config$browseTitle, config$browseSubtitle, config$primaryAction) {
//.add(this.slot(function(data, config, config$of, config$browseBorder, config$browseViews, config$browseTitle, config$browseSubtitle, config$primaryAction) {
.add(this.slot(function(data, config, config$browseBorder, config$browseViews, config$browseTitle, config$browseSubtitle, config$primaryAction, config$createTitle, config$of) {
return self.E()
.start(self.Rows)
.addClass(self.myClass('container'))
Expand All @@ -153,7 +168,9 @@ foam.CLASS({
.addClass(self.myClass('browse-title'))
.translate(menuId + ".browseTitle", config$browseTitle)
.end()
.startContext({ data: self }).tag(self.CREATE).endContext()
// .startContext({ data: self })
// .tag(self.CREATE, { label: config$createTitle })
// .endContext()
.callIf(config$primaryAction, function() {
this.startContext({ data: self }).tag(config$primaryAction, { size: 'LARGE' }).endContext();
})
Expand Down Expand Up @@ -186,9 +203,12 @@ foam.CLASS({
.addClass(self.myClass('altview-container'))
.end();
})
.add(self.slot(function(browseView) {
return self.E().tag(browseView, { data: data, config: config });
}))
.call(function(){
var e = this;
this.add(self.slot(function(browseView) {
return self.E().tag(browseView, { config$: e.__subContext__.config$ });
}))
})
.end()
.end()
.end();
Expand Down
21 changes: 21 additions & 0 deletions src/foam/comics/v2/DAOControllerConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ foam.CLASS({
return {
class: 'foam.u2.view.ScrollTableView',
enableDynamicTableHeight: true,
editColumnsEnabled: false,
columns: defaultColumns,
css: {
width: '100%',
Expand Down Expand Up @@ -229,6 +230,26 @@ foam.CLASS({
{
class: 'Boolean',
name: 'hideQueryBar'
},
{
class: 'Boolean',
name: 'DAOCreateView',
documentation: 'True to use the DAOCreateView else it will use the WizardController.'
},
{
class: 'foam.u2.ViewSpec',
name: 'wizardDetailView',
documentation: 'class of WizardDetailView.'
},
{
class: 'foam.u2.ViewSpec',
name: 'detailView',
documentation: 'class of detailView.'
},
{
class: 'foam.u2.ViewSpec',
name: 'menu',
documentation: 'class of detailView.'
}
]
});
9 changes: 8 additions & 1 deletion src/foam/core/AbstractFObjectPropertyInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,14 @@ public boolean hardDiff(FObject o1, FObject o2, FObject diff) {
this.set(diff, d);
return d != null;
}


@Override
public void validateObj(X x, FObject obj) {
if ( isSet(obj) ) {
((FObject) get(obj)).validate(x);
}
}

public String getSQLType() {
return "";
}
Expand Down
32 changes: 32 additions & 0 deletions src/foam/nanos/auth/Address.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ foam.CLASS({
/^[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ -]?\d[ABCEGHJ-NPRSTV-Z]\d$/i)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -258,6 +259,7 @@ foam.CLASS({
/^\d{5}(?:[-\s]\d{4})?$/i)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -278,6 +280,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -298,6 +301,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -318,6 +322,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -340,6 +345,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -360,6 +366,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -380,6 +387,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -400,6 +408,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -420,6 +429,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -440,6 +450,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -460,6 +471,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -480,6 +492,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -500,6 +513,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -520,6 +534,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -540,6 +555,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -560,6 +576,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -580,6 +597,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -600,6 +618,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -620,6 +639,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -640,6 +660,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -660,6 +681,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -680,6 +702,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -700,6 +723,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -720,6 +744,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -740,6 +765,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -760,6 +786,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -780,6 +807,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -800,6 +828,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -820,6 +849,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -840,6 +870,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand All @@ -860,6 +891,7 @@ foam.CLASS({
)
);
},
errorMessage: 'INVALID_POSTAL_CODE',
jsErr: function(X) {
let postalCodeError = X.translationService.getTranslation(foam.locale, `${X.countryId.toLowerCase()}.foam.nanos.auth.Address.POSTAL_CODE.error`);
if ( ! postalCodeError ) {
Expand Down