mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
When user logins, "Automatically add user with the domain name" (at Admin Panel / Organizations) to Organization. Part 1.
Thanks to xet7 !
This commit is contained in:
parent
f512047ac6
commit
6e2f84673e
4 changed files with 48 additions and 0 deletions
|
|
@ -78,6 +78,7 @@ template(name="orgGeneral")
|
||||||
th {{_ 'displayName'}}
|
th {{_ 'displayName'}}
|
||||||
th {{_ 'description'}}
|
th {{_ 'description'}}
|
||||||
th {{_ 'shortName'}}
|
th {{_ 'shortName'}}
|
||||||
|
th {{_ 'autoAddUsersWithDomainName'}}
|
||||||
th {{_ 'website'}}
|
th {{_ 'website'}}
|
||||||
th {{_ 'createdAt'}}
|
th {{_ 'createdAt'}}
|
||||||
th {{_ 'active'}}
|
th {{_ 'active'}}
|
||||||
|
|
@ -159,6 +160,10 @@ template(name="orgRow")
|
||||||
td {{ orgData.orgShortName }}
|
td {{ orgData.orgShortName }}
|
||||||
else
|
else
|
||||||
td <s>{{ orgData.orgShortName }}</s>
|
td <s>{{ orgData.orgShortName }}</s>
|
||||||
|
if orgData.orgIsActive
|
||||||
|
td {{ orgData.orgAutoAddUsersWithDomainName }}
|
||||||
|
else
|
||||||
|
td <s>{{ orgData.orgAutoAddUsersWithDomainName }}</s>
|
||||||
if orgData.orgIsActive
|
if orgData.orgIsActive
|
||||||
td {{ orgData.orgWebsite }}
|
td {{ orgData.orgWebsite }}
|
||||||
else
|
else
|
||||||
|
|
@ -307,6 +312,9 @@ template(name="editOrgPopup")
|
||||||
label
|
label
|
||||||
| {{_ 'shortName'}}
|
| {{_ 'shortName'}}
|
||||||
input.js-orgShortName(type="text" value=org.orgShortName required)
|
input.js-orgShortName(type="text" value=org.orgShortName required)
|
||||||
|
label
|
||||||
|
| {{_ 'autoAddUsersWithDomainName'}}
|
||||||
|
input.js-orgAutoAddUsersWithDomainName(type="text" value=org.orgAutoAddUsersWithDomainName)
|
||||||
label
|
label
|
||||||
| {{_ 'website'}}
|
| {{_ 'website'}}
|
||||||
input.js-orgWebsite(type="text" value=org.orgWebsite required)
|
input.js-orgWebsite(type="text" value=org.orgWebsite required)
|
||||||
|
|
@ -436,6 +444,9 @@ template(name="newOrgPopup")
|
||||||
label
|
label
|
||||||
| {{_ 'shortName'}}
|
| {{_ 'shortName'}}
|
||||||
input.js-orgShortName(type="text" value="" required)
|
input.js-orgShortName(type="text" value="" required)
|
||||||
|
label
|
||||||
|
| {{_ 'autoAddUsersWithDomainName'}}
|
||||||
|
input.js-orgAutoAddUsersWithDomainName(type="text" value="")
|
||||||
label
|
label
|
||||||
| {{_ 'website'}}
|
| {{_ 'website'}}
|
||||||
input.js-orgWebsite(type="text" value="" required)
|
input.js-orgWebsite(type="text" value="" required)
|
||||||
|
|
|
||||||
|
|
@ -576,12 +576,14 @@ Template.editOrgPopup.events({
|
||||||
.value.trim();
|
.value.trim();
|
||||||
const orgDesc = templateInstance.find('.js-orgDesc').value.trim();
|
const orgDesc = templateInstance.find('.js-orgDesc').value.trim();
|
||||||
const orgShortName = templateInstance.find('.js-orgShortName').value.trim();
|
const orgShortName = templateInstance.find('.js-orgShortName').value.trim();
|
||||||
|
const orgAutoAddUsersWithDomainName = templateInstance.find('.js-orgAutoAddUsersWithDomainName').value.trim();
|
||||||
const orgWebsite = templateInstance.find('.js-orgWebsite').value.trim();
|
const orgWebsite = templateInstance.find('.js-orgWebsite').value.trim();
|
||||||
const orgIsActive = templateInstance.find('.js-org-isactive').value.trim() == 'true';
|
const orgIsActive = templateInstance.find('.js-org-isactive').value.trim() == 'true';
|
||||||
|
|
||||||
const isChangeOrgDisplayName = orgDisplayName !== org.orgDisplayName;
|
const isChangeOrgDisplayName = orgDisplayName !== org.orgDisplayName;
|
||||||
const isChangeOrgDesc = orgDesc !== org.orgDesc;
|
const isChangeOrgDesc = orgDesc !== org.orgDesc;
|
||||||
const isChangeOrgShortName = orgShortName !== org.orgShortName;
|
const isChangeOrgShortName = orgShortName !== org.orgShortName;
|
||||||
|
const isChangeOrgAutoAddUsersWithDomainName = orgAutoAddUsersWithDomainName !== org.orgAutoAddUsersWithDomainName;
|
||||||
const isChangeOrgWebsite = orgWebsite !== org.orgWebsite;
|
const isChangeOrgWebsite = orgWebsite !== org.orgWebsite;
|
||||||
const isChangeOrgIsActive = orgIsActive !== org.orgIsActive;
|
const isChangeOrgIsActive = orgIsActive !== org.orgIsActive;
|
||||||
|
|
||||||
|
|
@ -589,6 +591,7 @@ Template.editOrgPopup.events({
|
||||||
isChangeOrgDisplayName ||
|
isChangeOrgDisplayName ||
|
||||||
isChangeOrgDesc ||
|
isChangeOrgDesc ||
|
||||||
isChangeOrgShortName ||
|
isChangeOrgShortName ||
|
||||||
|
isChangeOrgAutoAddUsersWithDomainName ||
|
||||||
isChangeOrgWebsite ||
|
isChangeOrgWebsite ||
|
||||||
isChangeOrgIsActive
|
isChangeOrgIsActive
|
||||||
) {
|
) {
|
||||||
|
|
@ -598,6 +601,7 @@ Template.editOrgPopup.events({
|
||||||
orgDisplayName,
|
orgDisplayName,
|
||||||
orgDesc,
|
orgDesc,
|
||||||
orgShortName,
|
orgShortName,
|
||||||
|
orgAutoAddUsersWithDomainName,
|
||||||
orgWebsite,
|
orgWebsite,
|
||||||
orgIsActive,
|
orgIsActive,
|
||||||
);
|
);
|
||||||
|
|
@ -920,6 +924,7 @@ Template.newOrgPopup.events({
|
||||||
.value.trim();
|
.value.trim();
|
||||||
const orgDesc = templateInstance.find('.js-orgDesc').value.trim();
|
const orgDesc = templateInstance.find('.js-orgDesc').value.trim();
|
||||||
const orgShortName = templateInstance.find('.js-orgShortName').value.trim();
|
const orgShortName = templateInstance.find('.js-orgShortName').value.trim();
|
||||||
|
const orgAutoAddUsersWithDomainName = templateInstance.find('.js-orgAutoAddUsersWithDomainName').value.trim();
|
||||||
const orgWebsite = templateInstance.find('.js-orgWebsite').value.trim();
|
const orgWebsite = templateInstance.find('.js-orgWebsite').value.trim();
|
||||||
const orgIsActive =
|
const orgIsActive =
|
||||||
templateInstance.find('.js-org-isactive').value.trim() == 'true';
|
templateInstance.find('.js-org-isactive').value.trim() == 'true';
|
||||||
|
|
@ -929,6 +934,7 @@ Template.newOrgPopup.events({
|
||||||
orgDisplayName,
|
orgDisplayName,
|
||||||
orgDesc,
|
orgDesc,
|
||||||
orgShortName,
|
orgShortName,
|
||||||
|
orgAutoAddUsersWithDomainName,
|
||||||
orgWebsite,
|
orgWebsite,
|
||||||
orgIsActive,
|
orgIsActive,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -962,6 +962,7 @@
|
||||||
"teams": "Teams",
|
"teams": "Teams",
|
||||||
"displayName": "Display Name",
|
"displayName": "Display Name",
|
||||||
"shortName": "Short Name",
|
"shortName": "Short Name",
|
||||||
|
"autoAddUsersWithDomainName": "Automatically add users with the domain name",
|
||||||
"website": "Website",
|
"website": "Website",
|
||||||
"person": "Person",
|
"person": "Person",
|
||||||
"my-cards": "My Cards",
|
"my-cards": "My Cards",
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,14 @@ Org.attachSchema(
|
||||||
optional: true,
|
optional: true,
|
||||||
max: 255,
|
max: 255,
|
||||||
},
|
},
|
||||||
|
orgAutoAddUsersWithDomainName: {
|
||||||
|
/**
|
||||||
|
* automatically add users with domain name
|
||||||
|
*/
|
||||||
|
type: String,
|
||||||
|
optional: true,
|
||||||
|
max: 255,
|
||||||
|
},
|
||||||
orgWebsite: {
|
orgWebsite: {
|
||||||
/**
|
/**
|
||||||
* website of the organization
|
* website of the organization
|
||||||
|
|
@ -115,6 +123,7 @@ if (Meteor.isServer) {
|
||||||
orgDisplayName,
|
orgDisplayName,
|
||||||
orgDesc,
|
orgDesc,
|
||||||
orgShortName,
|
orgShortName,
|
||||||
|
orgAutoAddUsersWithDomainName,
|
||||||
orgWebsite,
|
orgWebsite,
|
||||||
orgIsActive,
|
orgIsActive,
|
||||||
) {
|
) {
|
||||||
|
|
@ -122,6 +131,7 @@ if (Meteor.isServer) {
|
||||||
check(orgDisplayName, String);
|
check(orgDisplayName, String);
|
||||||
check(orgDesc, String);
|
check(orgDesc, String);
|
||||||
check(orgShortName, String);
|
check(orgShortName, String);
|
||||||
|
check(orgAutoAddUsersWithDomainName, String);
|
||||||
check(orgWebsite, String);
|
check(orgWebsite, String);
|
||||||
check(orgIsActive, Boolean);
|
check(orgIsActive, Boolean);
|
||||||
|
|
||||||
|
|
@ -133,6 +143,7 @@ if (Meteor.isServer) {
|
||||||
orgDisplayName,
|
orgDisplayName,
|
||||||
orgDesc,
|
orgDesc,
|
||||||
orgShortName,
|
orgShortName,
|
||||||
|
orgAutoAddUsersWithDomainName,
|
||||||
orgWebsite,
|
orgWebsite,
|
||||||
orgIsActive,
|
orgIsActive,
|
||||||
});
|
});
|
||||||
|
|
@ -143,12 +154,14 @@ if (Meteor.isServer) {
|
||||||
orgDisplayName,
|
orgDisplayName,
|
||||||
orgDesc,
|
orgDesc,
|
||||||
orgShortName,
|
orgShortName,
|
||||||
|
orgAutoAddUsersWithDomainName,
|
||||||
orgWebsite,
|
orgWebsite,
|
||||||
orgIsActive,
|
orgIsActive,
|
||||||
) {
|
) {
|
||||||
check(orgDisplayName, String);
|
check(orgDisplayName, String);
|
||||||
check(orgDesc, String);
|
check(orgDesc, String);
|
||||||
check(orgShortName, String);
|
check(orgShortName, String);
|
||||||
|
check(orgAutoAddUsersWithDomainName, String);
|
||||||
check(orgWebsite, String);
|
check(orgWebsite, String);
|
||||||
check(orgIsActive, Boolean);
|
check(orgIsActive, Boolean);
|
||||||
|
|
||||||
|
|
@ -160,6 +173,7 @@ if (Meteor.isServer) {
|
||||||
orgDisplayName,
|
orgDisplayName,
|
||||||
orgDesc,
|
orgDesc,
|
||||||
orgShortName,
|
orgShortName,
|
||||||
|
orgAutoAddUsersWithDomainName,
|
||||||
orgWebsite,
|
orgWebsite,
|
||||||
orgIsActive,
|
orgIsActive,
|
||||||
});
|
});
|
||||||
|
|
@ -196,6 +210,16 @@ if (Meteor.isServer) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setAutoAddUsersWithDomainName(org, orgAutoAddUsersWithDomainName) {
|
||||||
|
if (ReactiveCache.getCurrentUser()?.isAdmin) {
|
||||||
|
check(org, Object);
|
||||||
|
check(orgAutoAddUsersWithDomainName, String);
|
||||||
|
Org.update(org, {
|
||||||
|
$set: { orgAutoAddUsersWithDomainName: orgAutoAddUsersWithDomainName },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
setOrgIsActive(org, orgIsActive) {
|
setOrgIsActive(org, orgIsActive) {
|
||||||
if (ReactiveCache.getCurrentUser()?.isAdmin) {
|
if (ReactiveCache.getCurrentUser()?.isAdmin) {
|
||||||
check(org, Object);
|
check(org, Object);
|
||||||
|
|
@ -210,6 +234,7 @@ if (Meteor.isServer) {
|
||||||
orgDisplayName,
|
orgDisplayName,
|
||||||
orgDesc,
|
orgDesc,
|
||||||
orgShortName,
|
orgShortName,
|
||||||
|
orgAutoAddUsersWithDomainName,
|
||||||
orgWebsite,
|
orgWebsite,
|
||||||
orgIsActive,
|
orgIsActive,
|
||||||
) {
|
) {
|
||||||
|
|
@ -217,6 +242,7 @@ if (Meteor.isServer) {
|
||||||
check(orgDisplayName, String);
|
check(orgDisplayName, String);
|
||||||
check(orgDesc, String);
|
check(orgDesc, String);
|
||||||
check(orgShortName, String);
|
check(orgShortName, String);
|
||||||
|
check(orgAutoAddUsersWithDomainName, String);
|
||||||
check(orgWebsite, String);
|
check(orgWebsite, String);
|
||||||
check(orgIsActive, Boolean);
|
check(orgIsActive, Boolean);
|
||||||
Org.update(org, {
|
Org.update(org, {
|
||||||
|
|
@ -224,6 +250,7 @@ if (Meteor.isServer) {
|
||||||
orgDisplayName: orgDisplayName,
|
orgDisplayName: orgDisplayName,
|
||||||
orgDesc: orgDesc,
|
orgDesc: orgDesc,
|
||||||
orgShortName: orgShortName,
|
orgShortName: orgShortName,
|
||||||
|
orgAutoAddUsersWithDomainName: orgAutoAddUsersWithDomainName,
|
||||||
orgWebsite: orgWebsite,
|
orgWebsite: orgWebsite,
|
||||||
orgIsActive: orgIsActive,
|
orgIsActive: orgIsActive,
|
||||||
},
|
},
|
||||||
|
|
@ -235,6 +262,7 @@ if (Meteor.isServer) {
|
||||||
orgDisplayName,
|
orgDisplayName,
|
||||||
orgDesc,
|
orgDesc,
|
||||||
orgShortName,
|
orgShortName,
|
||||||
|
orgAutoAddUsersWithDomainName,
|
||||||
orgWebsite,
|
orgWebsite,
|
||||||
orgIsActive,
|
orgIsActive,
|
||||||
) {
|
) {
|
||||||
|
|
@ -243,6 +271,7 @@ if (Meteor.isServer) {
|
||||||
check(orgDisplayName, String);
|
check(orgDisplayName, String);
|
||||||
check(orgDesc, String);
|
check(orgDesc, String);
|
||||||
check(orgShortName, String);
|
check(orgShortName, String);
|
||||||
|
check(orgAutoAddUsersWithDomainName, String);
|
||||||
check(orgWebsite, String);
|
check(orgWebsite, String);
|
||||||
check(orgIsActive, Boolean);
|
check(orgIsActive, Boolean);
|
||||||
Org.update(org, {
|
Org.update(org, {
|
||||||
|
|
@ -250,6 +279,7 @@ if (Meteor.isServer) {
|
||||||
orgDisplayName: orgDisplayName,
|
orgDisplayName: orgDisplayName,
|
||||||
orgDesc: orgDesc,
|
orgDesc: orgDesc,
|
||||||
orgShortName: orgShortName,
|
orgShortName: orgShortName,
|
||||||
|
orgAutoAddUsersWithDomainName: orgAutoAddUsersWithDomainName,
|
||||||
orgWebsite: orgWebsite,
|
orgWebsite: orgWebsite,
|
||||||
orgIsActive: orgIsActive,
|
orgIsActive: orgIsActive,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue