Просмотр исходного кода

Merge pull request #20062 from overleaf/ab-saas-authentication-module-renaming

[web] Rename overleaf-integration module to saas-authentication

GitOrigin-RevId: 7d69e06a19da9855fa9a0962114ad97b45ad8875
Alexandre Bourdin 2 лет назад
Родитель
Сommit
4997b7f1ee

+ 5 - 5
services/web/README.md

@@ -28,7 +28,7 @@ make test
 
 
 To run both unit and acceptance tests for a module run:
 To run both unit and acceptance tests for a module run:
 ```
 ```
-make test_module MODULE=overleaf-integration
+make test_module MODULE=saas-authentication
 ```
 ```
 
 
 ### Unit Tests
 ### Unit Tests
@@ -51,12 +51,12 @@ make test_unit MOCHA_GREP='AuthorizationManager'
 
 
 To run only the unit tests for a single module do:
 To run only the unit tests for a single module do:
 ```
 ```
-make test_unit_module MODULE=overleaf-integration
+make test_unit_module MODULE=saas-authentication
 ```
 ```
 
 
 Module tests can also use a MOCHA_GREP argument:
 Module tests can also use a MOCHA_GREP argument:
 ```
 ```
-make test_unit_module MODULE=overleaf-integration MOCHA_GREP=SSO
+make test_unit_module MODULE=saas-authentication MOCHA_GREP=SSO
 ```
 ```
 
 
 ### Acceptance Tests
 ### Acceptance Tests
@@ -87,12 +87,12 @@ make test_acceptance_run MOCHA_GREP='AuthorizationManager'
 
 
 To run only the acceptance tests for a single module do:
 To run only the acceptance tests for a single module do:
 ```
 ```
-make test_acceptance_module MODULE=overleaf-integration
+make test_acceptance_module MODULE=saas-authentication
 ```
 ```
 
 
 Module tests can also use a MOCHA_GREP argument:
 Module tests can also use a MOCHA_GREP argument:
 ```
 ```
-make test_acceptance_module MODULE=overleaf-integration MOCHA_GREP=SSO
+make test_acceptance_module MODULE=saas-authentication MOCHA_GREP=SSO
 ```
 ```
 
 
 Routes
 Routes

+ 1 - 1
services/web/app/src/Features/TokenGenerator/TokenGenerator.js

@@ -68,7 +68,7 @@ const TokenGenerator = {
       function (cb) {
       function (cb) {
         const token = TokenGenerator.readOnlyToken()
         const token = TokenGenerator.readOnlyToken()
 
 
-        if (!Features.hasFeature('overleaf-integration')) {
+        if (!Features.hasFeature('saas')) {
           return cb(null, token)
           return cb(null, token)
         }
         }
 
 

+ 0 - 2
services/web/app/src/infrastructure/Features.js

@@ -69,8 +69,6 @@ const Features = {
       case 'affiliations':
       case 'affiliations':
       case 'analytics':
       case 'analytics':
         return Boolean(_.get(Settings, ['apis', 'v1', 'url']))
         return Boolean(_.get(Settings, ['apis', 'v1', 'url']))
-      case 'overleaf-integration':
-        return Boolean(Settings.overleaf)
       case 'references':
       case 'references':
         return Boolean(_.get(Settings, ['apis', 'references', 'url']))
         return Boolean(_.get(Settings, ['apis', 'references', 'url']))
       case 'saml':
       case 'saml':

+ 1 - 1
services/web/frontend/stylesheets/main-style.less

@@ -156,7 +156,7 @@
 @import 'modules/admin-panel.less';
 @import 'modules/admin-panel.less';
 @import 'modules/git-bridge-modal.less';
 @import 'modules/git-bridge-modal.less';
 @import 'modules/group-settings.less';
 @import 'modules/group-settings.less';
-@import 'modules/overleaf-integration.less';
+@import 'modules/onboarding.less';
 @import 'modules/writefull.less';
 @import 'modules/writefull.less';
 @import 'modules/third-party-references.less';
 @import 'modules/third-party-references.less';
 @import 'modules/labs.less';
 @import 'modules/labs.less';

+ 0 - 0
services/web/frontend/stylesheets/modules/overleaf-integration.less → services/web/frontend/stylesheets/modules/onboarding.less


+ 1 - 1
services/web/scripts/backfill_users_sso_attribute.js

@@ -1,4 +1,4 @@
-const SAMLUserIdAttributeBatchHandler = require('../modules/overleaf-integration/app/src/SAML/SAMLUserIdAttributeBatchHandler')
+const SAMLUserIdAttributeBatchHandler = require('../modules/saas-authentication/app/src/SAML/SAMLUserIdAttributeBatchHandler')
 
 
 const startInstitutionId = parseInt(process.argv[2])
 const startInstitutionId = parseInt(process.argv[2])
 const endInstitutionId = parseInt(process.argv[3])
 const endInstitutionId = parseInt(process.argv[3])

+ 1 - 1
services/web/scripts/check_saml_emails.js

@@ -2,7 +2,7 @@ process.env.MONGO_SOCKET_TIMEOUT = '300000'
 // Run all the mongo queries on secondaries
 // Run all the mongo queries on secondaries
 process.env.MONGO_CONNECTION_STRING =
 process.env.MONGO_CONNECTION_STRING =
   process.env.READ_ONLY_MONGO_CONNECTION_STRING
   process.env.READ_ONLY_MONGO_CONNECTION_STRING
-const SAMLEmailBatchCheck = require('../modules/overleaf-integration/app/src/SAML/SAMLEmailBatchCheck')
+const SAMLEmailBatchCheck = require('../modules/saas-authentication/app/src/SAML/SAMLEmailBatchCheck')
 
 
 const startInstitutionId = parseInt(process.argv[2])
 const startInstitutionId = parseInt(process.argv[2])
 const emitDetailedData = process.argv.includes('--detailed-data')
 const emitDetailedData = process.argv.includes('--detailed-data')

+ 1 - 1
services/web/scripts/sso_id_migration_check.js

@@ -3,7 +3,7 @@ process.env.MONGO_CONNECTION_STRING =
   process.env.READ_ONLY_MONGO_CONNECTION_STRING
   process.env.READ_ONLY_MONGO_CONNECTION_STRING
 
 
 const { waitForDb } = require('../app/src/infrastructure/mongodb')
 const { waitForDb } = require('../app/src/infrastructure/mongodb')
-const SAMLUserIdMigrationHandler = require('../modules/overleaf-integration/app/src/SAML/SAMLUserIdMigrationHandler')
+const SAMLUserIdMigrationHandler = require('../modules/saas-authentication/app/src/SAML/SAMLUserIdMigrationHandler')
 
 
 const institutionId = parseInt(process.argv[2])
 const institutionId = parseInt(process.argv[2])
 if (isNaN(institutionId)) throw new Error('No institution id')
 if (isNaN(institutionId)) throw new Error('No institution id')

+ 1 - 1
services/web/scripts/sso_id_remove_not_migrated.js

@@ -1,6 +1,6 @@
 process.env.MONGO_SOCKET_TIMEOUT = '300000'
 process.env.MONGO_SOCKET_TIMEOUT = '300000'
 const { waitForDb } = require('../app/src/infrastructure/mongodb')
 const { waitForDb } = require('../app/src/infrastructure/mongodb')
-const SAMLUserIdMigrationHandler = require('../modules/overleaf-integration/app/src/SAML/SAMLUserIdMigrationHandler')
+const SAMLUserIdMigrationHandler = require('../modules/saas-authentication/app/src/SAML/SAMLUserIdMigrationHandler')
 
 
 const institutionId = parseInt(process.argv[2])
 const institutionId = parseInt(process.argv[2])
 if (isNaN(institutionId)) throw new Error('No institution id')
 if (isNaN(institutionId)) throw new Error('No institution id')

+ 1 - 1
services/web/test/unit/src/Project/ProjectListControllerTests.js

@@ -362,7 +362,7 @@ describe('ProjectListController', function () {
         this.institutionName = 'Overleaf'
         this.institutionName = 'Overleaf'
         this.Features.hasFeature.withArgs('saml').returns(true)
         this.Features.hasFeature.withArgs('saml').returns(true)
         this.Features.hasFeature.withArgs('affiliations').returns(true)
         this.Features.hasFeature.withArgs('affiliations').returns(true)
-        this.Features.hasFeature.withArgs('overleaf-integration').returns(true)
+        this.Features.hasFeature.withArgs('saas').returns(true)
         done()
         done()
       })
       })
       it('should show institution SSO available notification for confirmed domains', function () {
       it('should show institution SSO available notification for confirmed domains', function () {

+ 4 - 5
services/web/test/unit/src/infrastructure/FeaturesTests.js

@@ -59,7 +59,7 @@ describe('Features', function () {
         expect(this.Features.hasFeature('homepage')).to.be.false
         expect(this.Features.hasFeature('homepage')).to.be.false
         expect(this.Features.hasFeature('link-url')).to.be.false
         expect(this.Features.hasFeature('link-url')).to.be.false
         expect(this.Features.hasFeature('oauth')).to.be.false
         expect(this.Features.hasFeature('oauth')).to.be.false
-        expect(this.Features.hasFeature('overleaf-integration')).to.be.false
+        expect(this.Features.hasFeature('saas')).to.be.false
         expect(this.Features.hasFeature('references')).to.be.false
         expect(this.Features.hasFeature('references')).to.be.false
         expect(this.Features.hasFeature('saml')).to.be.false
         expect(this.Features.hasFeature('saml')).to.be.false
         expect(this.Features.hasFeature('templates-server-pro')).to.be.false
         expect(this.Features.hasFeature('templates-server-pro')).to.be.false
@@ -72,7 +72,7 @@ describe('Features', function () {
           this.settings.apis = {}
           this.settings.apis = {}
         })
         })
         it('should return true', function () {
         it('should return true', function () {
-          expect(this.Features.hasFeature('overleaf-integration')).to.be.true
+          expect(this.Features.hasFeature('saas')).to.be.true
           expect(this.Features.hasFeature('registration')).to.be.true
           expect(this.Features.hasFeature('registration')).to.be.true
         })
         })
         it('should return false', function () {
         it('should return false', function () {
@@ -104,7 +104,7 @@ describe('Features', function () {
           it('should return true', function () {
           it('should return true', function () {
             expect(this.Features.hasFeature('affiliations')).to.be.true
             expect(this.Features.hasFeature('affiliations')).to.be.true
             expect(this.Features.hasFeature('analytics')).to.be.true
             expect(this.Features.hasFeature('analytics')).to.be.true
-            expect(this.Features.hasFeature('overleaf-integration')).to.be.true
+            expect(this.Features.hasFeature('saas')).to.be.true
             expect(this.Features.hasFeature('references')).to.be.true
             expect(this.Features.hasFeature('references')).to.be.true
             expect(this.Features.hasFeature('registration')).to.be.true
             expect(this.Features.hasFeature('registration')).to.be.true
           })
           })
@@ -135,8 +135,7 @@ describe('Features', function () {
               expect(this.Features.hasFeature('homepage')).to.be.true
               expect(this.Features.hasFeature('homepage')).to.be.true
               expect(this.Features.hasFeature('link-url')).to.be.true
               expect(this.Features.hasFeature('link-url')).to.be.true
               expect(this.Features.hasFeature('oauth')).to.be.true
               expect(this.Features.hasFeature('oauth')).to.be.true
-              expect(this.Features.hasFeature('overleaf-integration')).to.be
-                .true
+              expect(this.Features.hasFeature('saas')).to.be.true
               expect(this.Features.hasFeature('references')).to.be.true
               expect(this.Features.hasFeature('references')).to.be.true
               expect(this.Features.hasFeature('registration')).to.be.true
               expect(this.Features.hasFeature('registration')).to.be.true
               expect(this.Features.hasFeature('saml')).to.be.true
               expect(this.Features.hasFeature('saml')).to.be.true