aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--client/src/app/shared/shared-instance/instance-features-table.component.html7
-rw-r--r--client/src/app/shared/shared-instance/instance-features-table.component.ts9
-rw-r--r--server/tests/helpers/version.ts5
3 files changed, 17 insertions, 4 deletions
diff --git a/client/src/app/shared/shared-instance/instance-features-table.component.html b/client/src/app/shared/shared-instance/instance-features-table.component.html
index 6c05764df..205f2bc97 100644
--- a/client/src/app/shared/shared-instance/instance-features-table.component.html
+++ b/client/src/app/shared/shared-instance/instance-features-table.component.html
@@ -18,10 +18,9 @@
18 </tr> 18 </tr>
19 19
20 <tr> 20 <tr>
21 <th i18n class="label" scope="row">User registration allowed</th> 21 <th i18n class="label" scope="row">User registration</th>
22 <td> 22
23 <my-feature-boolean [value]="serverConfig.signup.allowed"></my-feature-boolean> 23 <td class="value">{{ buildRegistrationLabel() }}</td>
24 </td>
25 </tr> 24 </tr>
26 25
27 <tr> 26 <tr>
diff --git a/client/src/app/shared/shared-instance/instance-features-table.component.ts b/client/src/app/shared/shared-instance/instance-features-table.component.ts
index e405c5790..c3df7c594 100644
--- a/client/src/app/shared/shared-instance/instance-features-table.component.ts
+++ b/client/src/app/shared/shared-instance/instance-features-table.component.ts
@@ -56,6 +56,15 @@ export class InstanceFeaturesTableComponent implements OnInit {
56 if (policy === 'display') return $localize`Displayed` 56 if (policy === 'display') return $localize`Displayed`
57 } 57 }
58 58
59 buildRegistrationLabel () {
60 const config = this.serverConfig.signup
61
62 if (config.allowed !== true) return $localize`Disabled`
63 if (config.requiresApproval === true) return $localize`Requires approval by moderators`
64
65 return $localize`Enabled`
66 }
67
59 getServerVersionAndCommit () { 68 getServerVersionAndCommit () {
60 return this.serverService.getServerVersionAndCommit() 69 return this.serverService.getServerVersionAndCommit()
61 } 70 }
diff --git a/server/tests/helpers/version.ts b/server/tests/helpers/version.ts
index 7d5600715..2a90efba3 100644
--- a/server/tests/helpers/version.ts
+++ b/server/tests/helpers/version.ts
@@ -21,11 +21,16 @@ describe('Version', function () {
21 expect(compareSemVer('3.4.0-alpha.1', '3.4.0-beta.1')).to.be.below(0) 21 expect(compareSemVer('3.4.0-alpha.1', '3.4.0-beta.1')).to.be.below(0)
22 expect(compareSemVer('3.4.0-beta.1', '3.4.0-beta.2')).to.be.below(0) 22 expect(compareSemVer('3.4.0-beta.1', '3.4.0-beta.2')).to.be.below(0)
23 expect(compareSemVer('3.4.0-beta.1', '3.5.0-alpha.1')).to.be.below(0) 23 expect(compareSemVer('3.4.0-beta.1', '3.5.0-alpha.1')).to.be.below(0)
24
25 expect(compareSemVer('3.4.0-alpha.1', '3.4.0-nightly.4')).to.be.below(0)
26 expect(compareSemVer('3.4.0-nightly.3', '3.4.0-nightly.4')).to.be.below(0)
27 expect(compareSemVer('3.3.0-nightly.5', '3.4.0-nightly.4')).to.be.below(0)
24 }) 28 })
25 29
26 it('Should correctly compare a stable and unstable versions', async function () { 30 it('Should correctly compare a stable and unstable versions', async function () {
27 expect(compareSemVer('3.4.0', '3.4.1-beta.1')).to.be.below(0) 31 expect(compareSemVer('3.4.0', '3.4.1-beta.1')).to.be.below(0)
28 expect(compareSemVer('3.4.0-beta.1', '3.4.0-beta.2')).to.be.below(0) 32 expect(compareSemVer('3.4.0-beta.1', '3.4.0-beta.2')).to.be.below(0)
29 expect(compareSemVer('3.4.0-beta.1', '3.4.0')).to.be.below(0) 33 expect(compareSemVer('3.4.0-beta.1', '3.4.0')).to.be.below(0)
34 expect(compareSemVer('3.4.0-nightly.4', '3.4.0')).to.be.below(0)
30 }) 35 })
31}) 36})