mirror of
https://github.com/bitwarden/web
synced 2025-12-15 07:43:16 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e3d45da6c | ||
|
|
8892553e30 | ||
|
|
95ff586a47 | ||
|
|
342e09da9e | ||
|
|
32cecf6086 | ||
|
|
b122d24350 | ||
|
|
a620a3f84c | ||
|
|
3d30495ffb | ||
|
|
bb03595d02 | ||
|
|
ff11d0468c | ||
|
|
825b174007 | ||
|
|
39690a01ac | ||
|
|
905e39d060 | ||
|
|
9f83899480 | ||
|
|
a99d38a2f3 | ||
|
|
5dccf54611 | ||
|
|
ad872f4d15 | ||
|
|
247429ef37 |
32
.github/PULL_REQUEST_TEMPLATE.md
vendored
32
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,32 +0,0 @@
|
||||
## Type of change
|
||||
- [ ] Bug fix
|
||||
- [ ] New feature development
|
||||
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
|
||||
- [ ] Build/deploy pipeline (DevOps)
|
||||
- [ ] Other
|
||||
|
||||
## Objective
|
||||
<!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding-->
|
||||
|
||||
|
||||
|
||||
## Code changes
|
||||
<!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes-->
|
||||
<!--Also refer to any related changes or PRs in other repositories-->
|
||||
|
||||
* **file.ext:** Description of what was changed and why
|
||||
|
||||
## Screenshots
|
||||
<!--Required for any UI changes. Delete if not applicable-->
|
||||
|
||||
|
||||
|
||||
## Testing requirements
|
||||
<!--What functionality requires testing by QA? This includes testing new behavior and regression testing-->
|
||||
|
||||
|
||||
|
||||
## Before you submit
|
||||
- [ ] I have checked for **linting** errors (`npm run lint`) (required)
|
||||
- [ ] This change requires a **documentation update** (notify the documentation team)
|
||||
- [ ] This change has particular **deployment requirements** (notify the DevOps team)
|
||||
106
.github/workflows/build.yml
vendored
106
.github/workflows/build.yml
vendored
@@ -414,109 +414,3 @@ jobs:
|
||||
|
||||
- name: NPM build
|
||||
run: npm run build:bit:cloud
|
||||
|
||||
|
||||
crowdin-push:
|
||||
name: Crowdin Push
|
||||
if: github.ref == 'refs/heads/master'
|
||||
needs:
|
||||
- build-oss-selfhost
|
||||
- build-cloud
|
||||
- build-commercial-selfhost
|
||||
- build-qa
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
_CROWDIN_PROJECT_ID: "308189"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
||||
|
||||
- name: Login to Azure
|
||||
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
||||
|
||||
- name: Retrieve secrets
|
||||
id: retrieve-secrets
|
||||
uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
|
||||
with:
|
||||
keyvault: "bitwarden-prod-kv"
|
||||
secrets: "crowdin-api-token"
|
||||
|
||||
- name: Upload Sources
|
||||
uses: crowdin/github-action@e39093fd75daae7859c68eded4b43d42ec78d8ea # v1.3.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }}
|
||||
with:
|
||||
config: crowdin.yml
|
||||
crowdin_branch_name: master
|
||||
upload_sources: true
|
||||
upload_translations: false
|
||||
|
||||
|
||||
check-failures:
|
||||
name: Check for failures
|
||||
if: always()
|
||||
runs-on: ubuntu-20.04
|
||||
needs:
|
||||
- cloc
|
||||
- setup
|
||||
- build-oss-selfhost
|
||||
- build-cloud
|
||||
- build-commercial-selfhost
|
||||
- build-qa
|
||||
- crowdin-push
|
||||
- windows
|
||||
steps:
|
||||
- name: Check if any job failed
|
||||
if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') }}
|
||||
env:
|
||||
CLOC_STATUS: ${{ needs.cloc.result }}
|
||||
SETUP_STATUS: ${{ needs.setup.result }}
|
||||
BUILD_OSS_SELFHOST_STATUS: ${{ needs.build-oss-selfhost.result }}
|
||||
BUILD_CLOUD_STATUS: ${{ needs.build-cloud.result }}
|
||||
BUILD_COMMERCIAL_SELFHOST_STATUS: ${{ needs.build-commercial-selfhost.result }}
|
||||
BUILD_QA_STATUS: ${{ needs.build-qa.result }}
|
||||
CROWDIN_PUSH_STATUS: ${{ needs.crowdin-push.result }}
|
||||
WINDOWS_STATUS: ${{ needs.windows.result }}
|
||||
run: |
|
||||
if [ "$CLOC_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$SETUP_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$BUILD_OSS_SELFHOST_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$BUILD_CLOUD_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$BUILD_COMMERCIAL_SELFHOST_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$BUILD_QA_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$CROWDIN_PUSH_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
elif [ "$WINDOWS_STATUS" = "failure" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Login to Azure - Prod Subscription
|
||||
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
|
||||
if: failure()
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
||||
|
||||
- name: Retrieve secrets
|
||||
id: retrieve-secrets
|
||||
uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
|
||||
if: failure()
|
||||
with:
|
||||
keyvault: "bitwarden-prod-kv"
|
||||
secrets: "devops-alerts-slack-webhook-url"
|
||||
|
||||
- name: Notify Slack on failure
|
||||
uses: act10ns/slack@e4e71685b9b239384b0f676a63c32367f59c2522 # v1.2.2
|
||||
if: failure()
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }}
|
||||
with:
|
||||
status: ${{ job.status }}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
---
|
||||
name: Crowdin Pull
|
||||
name: Crowdin Sync
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs: {}
|
||||
schedule:
|
||||
- cron: '0 0 * * 5'
|
||||
# schedule:
|
||||
# - cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
crowdin-pull:
|
||||
name: Pull
|
||||
crowdin-sync:
|
||||
name: Autosync
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
_CROWDIN_PROJECT_ID: "308189"
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
secrets: "crowdin-api-token"
|
||||
|
||||
- name: Download translations
|
||||
uses: crowdin/github-action@e39093fd75daae7859c68eded4b43d42ec78d8ea # v1.3.2
|
||||
uses: crowdin/github-action@e39093fd75daae7859c68eded4b43d42ec78d8ea
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }}
|
||||
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@@ -12,13 +12,12 @@ jobs:
|
||||
outputs:
|
||||
release_version: ${{ steps.version.outputs.package }}
|
||||
tag_version: ${{ steps.version.outputs.tag }}
|
||||
branch-name: ${{ steps.branch.outputs.branch-name }}
|
||||
steps:
|
||||
- name: Branch check
|
||||
run: |
|
||||
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix" ]]; then
|
||||
if [[ "$GITHUB_REF" != "refs/heads/release" ]]; then
|
||||
echo "==================================="
|
||||
echo "[!] Can only release from the 'rc' or 'hotfix' branches"
|
||||
echo "[!] Can only release from the 'release' branch"
|
||||
echo "==================================="
|
||||
exit 1
|
||||
fi
|
||||
@@ -42,12 +41,6 @@ jobs:
|
||||
echo "::set-output name=package::$version"
|
||||
echo "::set-output name=tag::v$version"
|
||||
|
||||
- name: Get branch name
|
||||
id: branch
|
||||
run: |
|
||||
BRANCH_NAME=$(basename ${{ github.ref }})
|
||||
echo "::set-output name=branch-name::$BRANCH_NAME"
|
||||
|
||||
|
||||
self-host:
|
||||
name: Release self-host docker
|
||||
@@ -116,6 +109,8 @@ jobs:
|
||||
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
||||
with:
|
||||
ref: release
|
||||
|
||||
- name: Setup git config
|
||||
run: |
|
||||
@@ -129,7 +124,7 @@ jobs:
|
||||
with:
|
||||
workflow: build.yml
|
||||
workflow_conclusion: success
|
||||
branch: ${{ needs.setup.outputs.branch-name }}
|
||||
branch: release
|
||||
artifacts: web-*-cloud-COMMERCIAL.zip
|
||||
|
||||
# This should result in a build directory in the current working directory
|
||||
@@ -170,7 +165,7 @@ jobs:
|
||||
with:
|
||||
workflow: build.yml
|
||||
workflow_conclusion: success
|
||||
branch: ${{ needs.setup.outputs.branch-name }}
|
||||
branch: release
|
||||
artifacts: "web-*-selfhosted-COMMERCIAL.zip,
|
||||
web-*-selfhosted-open-source.zip"
|
||||
|
||||
@@ -189,4 +184,3 @@ jobs:
|
||||
artifacts: "web-${{ needs.setup.outputs.release_version }}-selfhosted-COMMERCIAL.zip,
|
||||
web-${{ needs.setup.outputs.release_version }}-selfhosted-open-source.zip"
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
draft: true
|
||||
|
||||
14
README.md
14
README.md
@@ -41,20 +41,18 @@ If you want to point the development web vault to the production APIs, you can r
|
||||
|
||||
```
|
||||
npm install
|
||||
ENV=cloud npm run build:oss:watch
|
||||
ENV=production npm run build:oss:watch
|
||||
```
|
||||
|
||||
You can also manually adjusting your API endpoint settings by adding `config/local.json` overriding any of the following values:
|
||||
|
||||
```json
|
||||
{
|
||||
"dev": {
|
||||
"proxyApi": "http://your-api-url",
|
||||
"proxyIdentity": "http://your-identity-url",
|
||||
"proxyEvents": "http://your-events-url",
|
||||
"proxyNotifications": "http://your-notifications-url",
|
||||
"allowedHosts": ["hostnames-to-allow-in-webpack"],
|
||||
},
|
||||
"proxyApi": "http://your-api-url",
|
||||
"proxyIdentity": "http://your-identity-url",
|
||||
"proxyEvents": "http://your-events-url",
|
||||
"proxyNotifications": "http://your-notifications-url",
|
||||
"allowedHosts": ["hostnames-to-allow-in-webpack"],
|
||||
"urls": {
|
||||
|
||||
}
|
||||
|
||||
@@ -7,79 +7,14 @@
|
||||
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||
</ng-container>
|
||||
|
||||
<form #form (ngSubmit)="submit()" [formGroup]="data" [appApiAction]="formPromise" *ngIf="!loading" ngNativeValidate>
|
||||
<p>
|
||||
{{'ssoPolicyHelpStart' | i18n}}
|
||||
<a routerLink="../policies">{{'ssoPolicyHelpLink' | i18n}}</a>
|
||||
{{'ssoPolicyHelpEnd' | i18n}}
|
||||
<br>
|
||||
{{'ssoPolicyHelpKeyConnector' | i18n}}
|
||||
</p>
|
||||
|
||||
<form #form (ngSubmit)="submit()" [formGroup]="data" [appApiAction]="formPromise" *ngIf="!loading">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="enabled" [formControl]="enabled" name="Enabled">
|
||||
<label class="form-check-label" for="enabled">{{'allowSso' | i18n}}</label>
|
||||
</div>
|
||||
<small class="form-text text-muted">{{'allowSsoDesc' | i18n}}</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>{{'memberDecryptionOption' | i18n}}</label>
|
||||
<div class="form-check form-check-block">
|
||||
<input class="form-check-input" type="radio" id="memberDecryptionPass" [value]="false" formControlName="keyConnectorEnabled">
|
||||
<label class="form-check-label" for="memberDecryptionPass">
|
||||
{{'masterPass' | i18n}}
|
||||
<small>{{'memberDecryptionPassDesc' | i18n}}</small>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check mt-2 form-check-block">
|
||||
<input class="form-check-input" type="radio" id="memberDecryptionKey" [value]="true" formControlName="keyConnectorEnabled"
|
||||
[attr.disabled]="!organization.useKeyConnector || null">
|
||||
<label class="form-check-label" for="memberDecryptionKey">
|
||||
{{'keyConnector' | i18n}}
|
||||
<a target="_blank" rel="noopener" appA11yTitle="{{'learnMore' | i18n}}"
|
||||
href="https://bitwarden.com/help/article/about-key-connector/">
|
||||
<i class="fa fa-question-circle-o" aria-hidden="true"></i>
|
||||
</a>
|
||||
<small>{{'memberDecryptionKeyConnectorDesc' | i18n}}</small>
|
||||
</label>
|
||||
<label class="form-check-label" for="enabled">{{'enabled' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="data.value.keyConnectorEnabled">
|
||||
<app-callout type="warning" [useAlertRole]="true">
|
||||
{{'keyConnectorWarning' | i18n}}
|
||||
</app-callout>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="keyConnectorUrl">{{'keyConnectorUrl' | i18n}}</label>
|
||||
<div class="input-group">
|
||||
<input class="form-control" formControlName="keyConnectorUrl" id="keyConnectorUrl" required>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-outline-secondary" (click)="validateKeyConnectorUrl()"
|
||||
[disabled]="!enableTestKeyConnector">
|
||||
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"
|
||||
*ngIf="keyConnectorUrl.pending"></i>
|
||||
<span *ngIf="!keyConnectorUrl.pending">
|
||||
{{'keyConnectorTest' | i18n}}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<ng-container *ngIf="keyConnectorUrl.pristine && !keyConnectorUrl.pending">
|
||||
<div class="text-danger" *ngIf="keyConnectorUrl.hasError('invalidUrl')" role="alert">
|
||||
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
|
||||
{{'keyConnectorTestFail' | i18n}}
|
||||
</div>
|
||||
<div class="text-success" *ngIf="!keyConnectorUrl.hasError('invalidUrl')" role="alert">
|
||||
<i class="fa fa-check-circle-o" aria-hidden="true"></i>
|
||||
{{'keyConnectorTestSuccess' | i18n}}
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="type">{{'type' | i18n}}</label>
|
||||
<select class="form-control" id="type" formControlName="configType">
|
||||
@@ -120,24 +55,24 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="authority">{{'authority' | i18n}}</label>
|
||||
<input class="form-control" formControlName="authority" id="authority">
|
||||
<label>{{'authority' | i18n}}</label>
|
||||
<input class="form-control" formControlName="authority">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="clientId">{{'clientId' | i18n}}</label>
|
||||
<input class="form-control" formControlName="clientId" id="clientId">
|
||||
<label>{{'clientId' | i18n}}</label>
|
||||
<input class="form-control" formControlName="clientId">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="clientSecret">{{'clientSecret' | i18n}}</label>
|
||||
<input class="form-control" formControlName="clientSecret" id="clientSecret">
|
||||
<label>{{'clientSecret' | i18n}}</label>
|
||||
<input class="form-control" formControlName="clientSecret">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="metadataAddress">{{'metadataAddress' | i18n}}</label>
|
||||
<input class="form-control" formControlName="metadataAddress" id="metadataAddress">
|
||||
<label>{{'metadataAddress' | i18n}}</label>
|
||||
<input class="form-control" formControlName="metadataAddress">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="redirectBehavior">{{'oidcRedirectBehavior' | i18n}}</label>
|
||||
<select class="form-control" formControlName="redirectBehavior" id="redirectBehavior">
|
||||
<label>{{'oidcRedirectBehavior' | i18n}}</label>
|
||||
<select class="form-control" formControlName="redirectBehavior">
|
||||
<option value="0">Redirect GET</option>
|
||||
<option value="1">Form POST</option>
|
||||
</select>
|
||||
@@ -152,31 +87,28 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="additionalScopes">{{'additionalScopes' | i18n}}</label>
|
||||
<input class="form-control" formControlName="additionalScopes" id="additionalScopes">
|
||||
<label>{{'additionalScopes' | i18n}}</label>
|
||||
<input class="form-control" formControlName="additionalScopes">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="additionalUserIdClaimTypes">{{'additionalUserIdClaimTypes' | i18n}}</label>
|
||||
<input class="form-control" formControlName="additionalUserIdClaimTypes"
|
||||
id="additionalUserIdClaimTypes">
|
||||
<label>{{'additionalUserIdClaimTypes' | i18n}}</label>
|
||||
<input class="form-control" formControlName="additionalUserIdClaimTypes">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="additionalEmailClaimTypes">{{'additionalEmailClaimTypes' | i18n}}</label>
|
||||
<input class="form-control" formControlName="additionalEmailClaimTypes"
|
||||
id="additionalEmailClaimTypes">
|
||||
<label>{{'additionalEmailClaimTypes' | i18n}}</label>
|
||||
<input class="form-control" formControlName="additionalEmailClaimTypes">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="additionalNameClaimTypes">{{'additionalNameClaimTypes' | i18n}}</label>
|
||||
<input class="form-control" formControlName="additionalNameClaimTypes"
|
||||
id="additionalNameClaimTypes">
|
||||
<label>{{'additionalNameClaimTypes' | i18n}}</label>
|
||||
<input class="form-control" formControlName="additionalNameClaimTypes">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="acrValues">{{'acrValues' | i18n}}</label>
|
||||
<input class="form-control" formControlName="acrValues" id="acrValues">
|
||||
<label>{{'acrValues' | i18n}}</label>
|
||||
<input class="form-control" formControlName="acrValues">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="expectedReturnAcrValue">{{'expectedReturnAcrValue' | i18n}}</label>
|
||||
<input class="form-control" formControlName="expectedReturnAcrValue" id="expectedReturnAcrValue">
|
||||
<label>{{'expectedReturnAcrValue' | i18n}}</label>
|
||||
<input class="form-control" formControlName="expectedReturnAcrValue">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -230,8 +162,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="spNameIdFormat">{{'spNameIdFormat' | i18n}}</label>
|
||||
<select class="form-control" formControlName="spNameIdFormat" id="spNameIdFormat">
|
||||
<label>{{'spNameIdFormat' | i18n}}</label>
|
||||
<select class="form-control" formControlName="spNameIdFormat">
|
||||
<option value="0">Not Configured</option>
|
||||
<option value="1">Unspecified</option>
|
||||
<option value="2">Email Address</option>
|
||||
@@ -244,43 +176,35 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="spOutboundSigningAlgorithm">{{'spOutboundSigningAlgorithm' | i18n}}</label>
|
||||
<select class="form-control" formControlName="spOutboundSigningAlgorithm"
|
||||
id="spOutboundSigningAlgorithm">
|
||||
<label>{{'spOutboundSigningAlgorithm' | i18n}}</label>
|
||||
<select class="form-control" formControlName="spOutboundSigningAlgorithm">
|
||||
<option *ngFor="let o of samlSigningAlgorithms" [ngValue]="o">{{o}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="spSigningBehavior">{{'spSigningBehavior' | i18n}}</label>
|
||||
<select class="form-control" formControlName="spSigningBehavior" id="spSigningBehavior">
|
||||
<label>{{'spSigningBehavior' | i18n}}</label>
|
||||
<select class="form-control" formControlName="spSigningBehavior">
|
||||
<option value="0">If IdP Wants Authn Requests Signed</option>
|
||||
<option value="1">Always</option>
|
||||
<option value="3">Never</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="spMinIncomingSigningAlgorithm">{{'spMinIncomingSigningAlgorithm' | i18n}}</label>
|
||||
<select class="form-control" formControlName="spMinIncomingSigningAlgorithm"
|
||||
id="spMinIncomingSigningAlgorithm">
|
||||
<label>{{'spMinIncomingSigningAlgorithm' | i18n}}</label>
|
||||
<select class="form-control" formControlName="spMinIncomingSigningAlgorithm">
|
||||
<option *ngFor="let o of samlSigningAlgorithms" [ngValue]="o">{{o}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="spWantAssertionsSigned"
|
||||
formControlName="spWantAssertionsSigned">
|
||||
<label class="form-check-label" for="spWantAssertionsSigned">
|
||||
{{'spWantAssertionsSigned' | i18n}}
|
||||
</label>
|
||||
<input class="form-check-input" type="checkbox" id="spWantAssertionsSigned" formControlName="spWantAssertionsSigned">
|
||||
<label class="form-check-label" for="spWantAssertionsSigned">{{'spWantAssertionsSigned' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="spValidateCertificates"
|
||||
formControlName="spValidateCertificates">
|
||||
<label class="form-check-label" for="spValidateCertificates">
|
||||
{{'spValidateCertificates' | i18n}}
|
||||
</label>
|
||||
<input class="form-check-input" type="checkbox" id="spValidateCertificates" formControlName="spValidateCertificates">
|
||||
<label class="form-check-label" for="spValidateCertificates">{{'spValidateCertificates' | i18n}}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -290,39 +214,36 @@
|
||||
<h2>{{'samlIdpConfig' | i18n}}</h2>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="idpEntityId">{{'idpEntityId' | i18n}}</label>
|
||||
<input class="form-control" formControlName="idpEntityId" id="idpEntityId">
|
||||
<label>{{'idpEntityId' | i18n}}</label>
|
||||
<input class="form-control" formControlName="idpEntityId">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="idpBindingType">{{'idpBindingType' | i18n}}</label>
|
||||
<select class="form-control" formControlName="idpBindingType" id="idpBindingType">
|
||||
<label>{{'idpBindingType' | i18n}}</label>
|
||||
<select class="form-control" formControlName="idpBindingType">
|
||||
<option value="1">Redirect</option>
|
||||
<option value="2">HTTP POST</option>
|
||||
<option value="4">Artifact</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="idpSingleSignOnServiceUrl">{{'idpSingleSignOnServiceUrl' | i18n}}</label>
|
||||
<input class="form-control" formControlName="idpSingleSignOnServiceUrl" id="idpSingleSignOnServiceUrl">
|
||||
<label>{{'idpSingleSignOnServiceUrl' | i18n}}</label>
|
||||
<input class="form-control" formControlName="idpSingleSignOnServiceUrl">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="idpSingleLogoutServiceUrl">{{'idpSingleLogoutServiceUrl' | i18n}}</label>
|
||||
<input class="form-control" formControlName="idpSingleLogoutServiceUrl" id="idpSingleLogoutServiceUrl">
|
||||
<label>{{'idpSingleLogoutServiceUrl' | i18n}}</label>
|
||||
<input class="form-control" formControlName="idpSingleLogoutServiceUrl">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="idpArtifactResolutionServiceUrl">{{'idpArtifactResolutionServiceUrl' | i18n}}</label>
|
||||
<input class="form-control" formControlName="idpArtifactResolutionServiceUrl"
|
||||
id="idpArtifactResolutionServiceUrl">
|
||||
<label>{{'idpArtifactResolutionServiceUrl' | i18n}}</label>
|
||||
<input class="form-control" formControlName="idpArtifactResolutionServiceUrl">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="idpX509PublicCert">{{'idpX509PublicCert' | i18n}}</label>
|
||||
<textarea formControlName="idpX509PublicCert" class="form-control form-control-sm text-monospace"
|
||||
rows="6" id="idpX509PublicCert"></textarea>
|
||||
<label>{{'idpX509PublicCert' | i18n}}</label>
|
||||
<textarea formControlName="idpX509PublicCert" class="form-control form-control-sm text-monospace" rows="6"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="idpOutboundSigningAlgorithm">{{'idpOutboundSigningAlgorithm' | i18n}}</label>
|
||||
<select class="form-control" formControlName="idpOutboundSigningAlgorithm"
|
||||
id="idpOutboundSigningAlgorithm">
|
||||
<label>{{'idpOutboundSigningAlgorithm' | i18n}}</label>
|
||||
<select class="form-control" formControlName="idpOutboundSigningAlgorithm">
|
||||
<option *ngFor="let o of samlSigningAlgorithms" [ngValue]="o">{{o}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -8,10 +8,6 @@ import { ActivatedRoute } from '@angular/router';
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
import { Organization } from 'jslib-common/models/domain/organization';
|
||||
|
||||
import { OrganizationSsoRequest } from 'jslib-common/models/request/organization/organizationSsoRequest';
|
||||
|
||||
@Component({
|
||||
@@ -29,7 +25,6 @@ export class SsoComponent implements OnInit {
|
||||
|
||||
loading = true;
|
||||
organizationId: string;
|
||||
organization: Organization;
|
||||
formPromise: Promise<any>;
|
||||
|
||||
callbackPath: string;
|
||||
@@ -42,9 +37,6 @@ export class SsoComponent implements OnInit {
|
||||
data = this.fb.group({
|
||||
configType: [],
|
||||
|
||||
keyConnectorEnabled: [],
|
||||
keyConnectorUrl: [],
|
||||
|
||||
// OpenId
|
||||
authority: [],
|
||||
clientId: [],
|
||||
@@ -80,8 +72,7 @@ export class SsoComponent implements OnInit {
|
||||
});
|
||||
|
||||
constructor(private fb: FormBuilder, private route: ActivatedRoute, private apiService: ApiService,
|
||||
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
|
||||
private userService: UserService) { }
|
||||
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.route.parent.parent.params.subscribe(async params => {
|
||||
@@ -91,7 +82,6 @@ export class SsoComponent implements OnInit {
|
||||
}
|
||||
|
||||
async load() {
|
||||
this.organization = await this.userService.getOrganization(this.organizationId);
|
||||
const ssoSettings = await this.apiService.getOrganizationSso(this.organizationId);
|
||||
|
||||
this.data.patchValue(ssoSettings.data);
|
||||
@@ -103,8 +93,6 @@ export class SsoComponent implements OnInit {
|
||||
this.spMetadataUrl = ssoSettings.urls.spMetadataUrl;
|
||||
this.spAcsUrl = ssoSettings.urls.spAcsUrl;
|
||||
|
||||
this.keyConnectorUrl.markAsDirty();
|
||||
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
@@ -117,64 +105,17 @@ export class SsoComponent implements OnInit {
|
||||
}
|
||||
|
||||
async submit() {
|
||||
this.formPromise = this.postData();
|
||||
|
||||
try {
|
||||
const response = await this.formPromise;
|
||||
|
||||
this.data.patchValue(response.data);
|
||||
this.enabled.setValue(response.enabled);
|
||||
|
||||
this.platformUtilsService.showToast('success', null, this.i18nService.t('ssoSettingsSaved'));
|
||||
} catch {
|
||||
// Logged by appApiAction, do nothing
|
||||
}
|
||||
|
||||
this.formPromise = null;
|
||||
}
|
||||
|
||||
async postData() {
|
||||
if (this.data.get('keyConnectorEnabled').value) {
|
||||
await this.validateKeyConnectorUrl();
|
||||
|
||||
if (this.keyConnectorUrl.hasError('invalidUrl')) {
|
||||
throw new Error(this.i18nService.t('keyConnectorTestFail'));
|
||||
}
|
||||
}
|
||||
|
||||
const request = new OrganizationSsoRequest();
|
||||
request.enabled = this.enabled.value;
|
||||
request.data = this.data.value;
|
||||
|
||||
return this.apiService.postOrganizationSso(this.organizationId, request);
|
||||
}
|
||||
this.formPromise = this.apiService.postOrganizationSso(this.organizationId, request);
|
||||
|
||||
async validateKeyConnectorUrl() {
|
||||
if (this.keyConnectorUrl.pristine) {
|
||||
return;
|
||||
}
|
||||
const response = await this.formPromise;
|
||||
this.data.patchValue(response.data);
|
||||
this.enabled.setValue(response.enabled);
|
||||
|
||||
this.keyConnectorUrl.markAsPending();
|
||||
|
||||
try {
|
||||
await this.apiService.getKeyConnectorAlive(this.keyConnectorUrl.value);
|
||||
this.keyConnectorUrl.updateValueAndValidity();
|
||||
} catch {
|
||||
this.keyConnectorUrl.setErrors({
|
||||
invalidUrl: true,
|
||||
});
|
||||
}
|
||||
|
||||
this.keyConnectorUrl.markAsPristine();
|
||||
}
|
||||
|
||||
get enableTestKeyConnector() {
|
||||
return this.data.get('keyConnectorEnabled').value &&
|
||||
this.keyConnectorUrl != null &&
|
||||
this.keyConnectorUrl.value !== '';
|
||||
}
|
||||
|
||||
get keyConnectorUrl() {
|
||||
return this.data.get('keyConnectorUrl');
|
||||
this.formPromise = null;
|
||||
this.platformUtilsService.showToast('success', null, this.i18nService.t('ssoSettingsSaved'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="addTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="addTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -7,8 +7,6 @@ import {
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
@@ -68,8 +66,11 @@ export class ClientsComponent implements OnInit {
|
||||
|
||||
await this.load();
|
||||
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
this.searchText = qParams.search;
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@ import {
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
@@ -83,7 +81,7 @@ export class PeopleComponent extends BasePeopleComponent<ProviderUserUserDetails
|
||||
|
||||
await this.load();
|
||||
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
this.searchText = qParams.search;
|
||||
if (qParams.viewEvents != null) {
|
||||
const user = this.users.filter(u => u.id === qParams.viewEvents);
|
||||
@@ -91,6 +89,9 @@ export class PeopleComponent extends BasePeopleComponent<ProviderUserUserDetails
|
||||
this.events(user[0]);
|
||||
}
|
||||
}
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="userAddEditTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="userAddEditTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -10,7 +10,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
|
||||
import { ProviderUserInviteRequest } from 'jslib-common/models/request/provider/providerUserInviteRequest';
|
||||
@@ -44,8 +43,7 @@ export class UserAddEditComponent implements OnInit {
|
||||
userType = ProviderUserType;
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService,
|
||||
private logService: LogService) { }
|
||||
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.editMode = this.loading = this.providerUserId != null;
|
||||
@@ -56,9 +54,7 @@ export class UserAddEditComponent implements OnInit {
|
||||
try {
|
||||
const user = await this.apiService.getProviderUser(this.providerId, this.providerUserId);
|
||||
this.type = user.type;
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
} else {
|
||||
this.title = this.i18nService.t('inviteUser');
|
||||
}
|
||||
@@ -82,9 +78,7 @@ export class UserAddEditComponent implements OnInit {
|
||||
this.toasterService.popAsync('success', null,
|
||||
this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name));
|
||||
this.onSavedUser.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
async delete() {
|
||||
@@ -104,9 +98,7 @@ export class UserAddEditComponent implements OnInit {
|
||||
await this.deletePromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name));
|
||||
this.onDeletedUser.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ import {
|
||||
ToasterService,
|
||||
} from 'angular2-toaster';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
|
||||
@@ -43,7 +41,12 @@ export class SetupComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
document.body.classList.remove('layout_frontend');
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
let fired = false;
|
||||
this.route.queryParams.subscribe(async qParams => {
|
||||
if (fired) {
|
||||
return;
|
||||
}
|
||||
fired = true;
|
||||
const error = qParams.providerId == null || qParams.email == null || qParams.token == null;
|
||||
|
||||
if (error) {
|
||||
|
||||
@@ -3,11 +3,6 @@ function load(envName) {
|
||||
...require('./config/base.json'),
|
||||
...loadConfig(envName),
|
||||
...loadConfig('local'),
|
||||
dev: {
|
||||
...require('./config/base.json').dev,
|
||||
...loadConfig(envName).dev,
|
||||
...loadConfig('local').dev,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,5 @@
|
||||
"paypal": {
|
||||
"businessId": "AD3LAUZSNVPJY",
|
||||
"buttonAction": "https://www.sandbox.paypal.com/cgi-bin/webscr"
|
||||
},
|
||||
"dev": {
|
||||
"allowedHosts": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,5 @@
|
||||
"paypal": {
|
||||
"businessId": "4ZDA7DLUUJGMN",
|
||||
"buttonAction": "https://www.paypal.com/cgi-bin/webscr"
|
||||
},
|
||||
"dev": {
|
||||
"proxyApi": "https://api.bitwarden.com",
|
||||
"proxyIdentity": "https://identity.bitwarden.com",
|
||||
"proxyEvents": "https://events.bitwarden.com"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"proxyApi": "http://localhost:4000",
|
||||
"proxyIdentity": "http://localhost:33656",
|
||||
"proxyEvents": "http://localhost:46273",
|
||||
"proxyNotifications": "http://localhost:61840",
|
||||
"allowedHosts": [],
|
||||
"urls": {
|
||||
"notifications": "http://localhost:61840"
|
||||
},
|
||||
"dev": {
|
||||
"proxyApi": "http://localhost:4000",
|
||||
"proxyIdentity": "http://localhost:33656",
|
||||
"proxyEvents": "http://localhost:46273",
|
||||
"proxyNotifications": "http://localhost:61840"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,5 @@
|
||||
"urls": {
|
||||
"icons": "https://icons.qa.bitwarden.pw",
|
||||
"notifications": "https://notifications.qa.bitwarden.pw"
|
||||
},
|
||||
"dev": {
|
||||
"proxyApi": "https://api.qa.bitwarden.pw",
|
||||
"proxyIdentity": "https://identity.qa.bitwarden.pw",
|
||||
"proxyEvents": "https://events.qa.bitwarden.pw"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
project_id_env: _CROWDIN_PROJECT_ID
|
||||
api_token_env: CROWDIN_API_TOKEN
|
||||
preserve_hierarchy: true
|
||||
files:
|
||||
- source: /src/locales/en/messages.json
|
||||
dest: /src/locales/en/%file_name%.%file_extension%
|
||||
translation: /src/locales/%two_letters_code%/%original_file_name%
|
||||
update_option: update_as_unapproved
|
||||
languages_mapping:
|
||||
|
||||
2
jslib
2
jslib
Submodule jslib updated: c65e7db6e0...c7a9a89e0a
6
package-lock.json
generated
6
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "bitwarden-web",
|
||||
"version": "2.25.0",
|
||||
"version": "2.24.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bitwarden-web",
|
||||
"version": "2.25.0",
|
||||
"version": "2.24.0",
|
||||
"hasInstallScript": true,
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
@@ -20626,4 +20626,4 @@
|
||||
"integrity": "sha1-KOwXzwl0PtyrBW3dixsGJizHPDA="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bitwarden-web",
|
||||
"version": "2.25.0",
|
||||
"version": "2.24.0",
|
||||
"license": "GPL-3.0",
|
||||
"repository": "https://github.com/bitwarden/web",
|
||||
"scripts": {
|
||||
@@ -85,4 +85,4 @@
|
||||
"node": "~14",
|
||||
"npm": "~7"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
@@ -37,7 +36,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
||||
i18nService: I18nService, route: ActivatedRoute,
|
||||
private apiService: ApiService, userService: UserService,
|
||||
stateService: StateService, private cryptoService: CryptoService,
|
||||
private policyService: PolicyService, private logService: LogService) {
|
||||
private policyService: PolicyService) {
|
||||
super(router, toasterService, i18nService, route, userService, stateService);
|
||||
}
|
||||
|
||||
@@ -102,9 +101,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
||||
const policies = await this.apiService.getPoliciesByToken(qParams.organizationId, qParams.token,
|
||||
qParams.email, qParams.organizationUserId);
|
||||
policyList = this.policyService.mapPoliciesFromToken(policies);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
|
||||
if (policyList != null) {
|
||||
const result = this.policyService.getResetPasswordPolicyOptions(policyList, qParams.organizationId);
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Router } from '@angular/router';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
|
||||
import { HintComponent as BaseHintComponent } from 'jslib-angular/components/hint.component';
|
||||
@@ -14,8 +13,7 @@ import { HintComponent as BaseHintComponent } from 'jslib-angular/components/hin
|
||||
})
|
||||
export class HintComponent extends BaseHintComponent {
|
||||
constructor(router: Router, i18nService: I18nService,
|
||||
apiService: ApiService, platformUtilsService: PlatformUtilsService,
|
||||
logService: LogService) {
|
||||
super(router, i18nService, apiService, platformUtilsService, logService);
|
||||
apiService: ApiService, platformUtilsService: PlatformUtilsService) {
|
||||
super(router, i18nService, apiService, platformUtilsService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { KeyConnectorService } from 'jslib-common/abstractions/keyConnector.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||
@@ -28,11 +26,9 @@ export class LockComponent extends BaseLockComponent {
|
||||
userService: UserService, cryptoService: CryptoService,
|
||||
storageService: StorageService, vaultTimeoutService: VaultTimeoutService,
|
||||
environmentService: EnvironmentService, private routerService: RouterService,
|
||||
stateService: StateService, apiService: ApiService, logService: LogService,
|
||||
keyConnectorService: KeyConnectorService) {
|
||||
stateService: StateService, apiService: ApiService) {
|
||||
super(router, i18nService, platformUtilsService, messagingService, userService, cryptoService,
|
||||
storageService, vaultTimeoutService, environmentService, stateService, apiService, logService,
|
||||
keyConnectorService);
|
||||
storageService, vaultTimeoutService, environmentService, stateService, apiService);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
@@ -4,14 +4,11 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
||||
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
@@ -35,17 +32,17 @@ export class LoginComponent extends BaseLoginComponent {
|
||||
storageService: StorageService, stateService: StateService,
|
||||
platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService,
|
||||
passwordGenerationService: PasswordGenerationService, cryptoFunctionService: CryptoFunctionService,
|
||||
private apiService: ApiService, private policyService: PolicyService, logService: LogService) {
|
||||
private apiService: ApiService, private policyService: PolicyService) {
|
||||
super(authService, router,
|
||||
platformUtilsService, i18nService,
|
||||
stateService, environmentService,
|
||||
passwordGenerationService, cryptoFunctionService,
|
||||
storageService, logService);
|
||||
storageService);
|
||||
this.onSuccessfulLoginNavigate = this.goAfterLogIn;
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
if (qParams.email != null && qParams.email.indexOf('@') > -1) {
|
||||
this.email = qParams.email;
|
||||
}
|
||||
@@ -55,16 +52,10 @@ export class LoginComponent extends BaseLoginComponent {
|
||||
this.stateService.save('loginRedirect',
|
||||
{ route: '/settings/create-organization', qParams: { plan: qParams.org } });
|
||||
}
|
||||
|
||||
// Are they coming from an email for sponsoring a families organization
|
||||
if (qParams.sponsorshipToken != null) {
|
||||
// After logging in redirect them to setup the families sponsorship
|
||||
this.stateService.save('loginRedirect', {
|
||||
route: '/setup/families-for-enterprise',
|
||||
qParams: { token: qParams.sponsorshipToken },
|
||||
});
|
||||
}
|
||||
await super.ngOnInit();
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
|
||||
const invite = await this.stateService.get<any>('orgInvitation');
|
||||
@@ -74,9 +65,7 @@ export class LoginComponent extends BaseLoginComponent {
|
||||
const policies = await this.apiService.getPoliciesByToken(invite.organizationId, invite.token,
|
||||
invite.email, invite.organizationUserId);
|
||||
policyList = this.policyService.mapPoliciesFromToken(policies);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
|
||||
if (policyList != null) {
|
||||
const result = this.policyService.getResetPasswordPolicyOptions(policyList, invite.organizationId);
|
||||
|
||||
@@ -5,7 +5,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
|
||||
import { DeleteRecoverRequest } from 'jslib-common/models/request/deleteRecoverRequest';
|
||||
|
||||
@@ -18,8 +17,7 @@ export class RecoverDeleteComponent {
|
||||
formPromise: Promise<any>;
|
||||
|
||||
constructor(private router: Router, private apiService: ApiService,
|
||||
private toasterService: ToasterService, private i18nService: I18nService,
|
||||
private logService: LogService) {
|
||||
private toasterService: ToasterService, private i18nService: I18nService) {
|
||||
}
|
||||
|
||||
async submit() {
|
||||
@@ -30,8 +28,6 @@ export class RecoverDeleteComponent {
|
||||
await this.formPromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('deleteRecoverEmailSent'));
|
||||
this.router.navigate(['/']);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
|
||||
import { TwoFactorRecoveryRequest } from 'jslib-common/models/request/twoFactorRecoveryRequest';
|
||||
|
||||
@@ -23,8 +22,7 @@ export class RecoverTwoFactorComponent {
|
||||
|
||||
constructor(private router: Router, private apiService: ApiService,
|
||||
private toasterService: ToasterService, private i18nService: I18nService,
|
||||
private cryptoService: CryptoService, private authService: AuthService,
|
||||
private logService: LogService) { }
|
||||
private cryptoService: CryptoService, private authService: AuthService) { }
|
||||
|
||||
async submit() {
|
||||
try {
|
||||
@@ -37,8 +35,6 @@ export class RecoverTwoFactorComponent {
|
||||
await this.formPromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('twoStepRecoverDisabled'));
|
||||
this.router.navigate(['/']);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,11 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
@@ -41,13 +38,13 @@ export class RegisterComponent extends BaseRegisterComponent {
|
||||
apiService: ApiService, private route: ActivatedRoute,
|
||||
stateService: StateService, platformUtilsService: PlatformUtilsService,
|
||||
passwordGenerationService: PasswordGenerationService, private policyService: PolicyService,
|
||||
environmentService: EnvironmentService, logService: LogService) {
|
||||
environmentService: EnvironmentService) {
|
||||
super(authService, router, i18nService, cryptoService, apiService, stateService, platformUtilsService,
|
||||
passwordGenerationService, environmentService, logService);
|
||||
passwordGenerationService, environmentService);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.route.queryParams.pipe(first()).subscribe(qParams => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(qParams => {
|
||||
this.referenceData = new ReferenceEventRequest();
|
||||
if (qParams.email != null && qParams.email.indexOf('@') > -1) {
|
||||
this.email = qParams.email;
|
||||
@@ -68,17 +65,12 @@ export class RegisterComponent extends BaseRegisterComponent {
|
||||
} else {
|
||||
this.referenceData.id = ('; ' + document.cookie).split('; reference=').pop().split(';').shift();
|
||||
}
|
||||
// Are they coming from an email for sponsoring a families organization
|
||||
if (qParams.sponsorshipToken != null) {
|
||||
// After logging in redirect them to setup the families sponsorship
|
||||
this.stateService.save('loginRedirect', {
|
||||
route: '/setup/families-for-enterprise',
|
||||
qParams: { token: qParams.sponsorshipToken },
|
||||
});
|
||||
}
|
||||
if (this.referenceData.id === '') {
|
||||
this.referenceData.id = null;
|
||||
}
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
const invite = await this.stateService.get<any>('orgInvitation');
|
||||
if (invite != null) {
|
||||
@@ -89,9 +81,7 @@ export class RegisterComponent extends BaseRegisterComponent {
|
||||
const policiesData = policies.data.map(p => new PolicyData(p));
|
||||
this.policies = policiesData.map(p => new Policy(p));
|
||||
}
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
if (this.policies != null) {
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<div class="mt-5 d-flex justify-content-center" *ngIf="loading">
|
||||
<div>
|
||||
<img class="mb-4 logo logo-themed" alt="Bitwarden">
|
||||
<p class="text-center">
|
||||
<i class="fa fa-spinner fa-spin fa-2x text-muted" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container" *ngIf="!loading">
|
||||
<div class="row justify-content-md-center mt-5">
|
||||
<div class="col-5">
|
||||
<p class="lead text-center mb-4">{{'removeMasterPassword' | i18n}}</p>
|
||||
<hr>
|
||||
<div class="card d-block">
|
||||
<div class="card-body">
|
||||
<p>{{'convertOrganizationEncryptionDesc' | i18n : organization.name}}</p>
|
||||
|
||||
<button type="button" class="btn btn-primary btn-block" (click)="convert()" [disabled]="actionPromise">
|
||||
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true" *ngIf="continuing"></i>
|
||||
{{'removeMasterPassword' | i18n}}
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-block" (click)="leave()" [disabled]="actionPromise">
|
||||
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true" *ngIf="leaving"></i>
|
||||
{{'leaveOrganization' | i18n}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,10 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
import { RemovePasswordComponent as BaseRemovePasswordComponent } from 'jslib-angular/components/remove-password.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-remove-password',
|
||||
templateUrl: 'remove-password.component.html',
|
||||
})
|
||||
export class RemovePasswordComponent extends BaseRemovePasswordComponent {
|
||||
}
|
||||
@@ -4,14 +4,11 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { AuthService } from 'jslib-common/abstractions/auth.service';
|
||||
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
||||
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||
@@ -31,16 +28,16 @@ export class SsoComponent extends BaseSsoComponent {
|
||||
storageService: StorageService, stateService: StateService,
|
||||
platformUtilsService: PlatformUtilsService, apiService: ApiService,
|
||||
cryptoFunctionService: CryptoFunctionService, environmentService: EnvironmentService,
|
||||
passwordGenerationService: PasswordGenerationService, logService: LogService) {
|
||||
passwordGenerationService: PasswordGenerationService) {
|
||||
super(authService, router, i18nService, route, storageService, stateService, platformUtilsService,
|
||||
apiService, cryptoFunctionService, environmentService, passwordGenerationService, logService);
|
||||
apiService, cryptoFunctionService, environmentService, passwordGenerationService);
|
||||
this.redirectUri = window.location.origin + '/sso-connector.html';
|
||||
this.clientId = 'web';
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
super.ngOnInit();
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
if (qParams.identifier != null) {
|
||||
this.identifier = qParams.identifier;
|
||||
} else {
|
||||
@@ -49,6 +46,9 @@ export class SsoComponent extends BaseSsoComponent {
|
||||
this.identifier = storedIdentifier;
|
||||
}
|
||||
}
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="twoStepOptionsTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="twoStepOptionsTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h2 class="modal-title" id="twoStepOptionsTitle">{{'twoStepOptions' | i18n}}</h2>
|
||||
@@ -8,46 +8,21 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="list-group list-group-flush-2fa">
|
||||
<div *ngFor="let p of providers" class="list-group-item list-group-item-action">
|
||||
<div class="two-factor-content">
|
||||
<div class="logo-col">
|
||||
<img [class]="'mfaType' + p.type" [alt]="p.name + ' logo'">
|
||||
</div>
|
||||
<div class="text-col">
|
||||
<h3>{{p.name}}</h3>
|
||||
{{p.description}}
|
||||
</div>
|
||||
<div class="btn-col">
|
||||
<button [attr.aria-describedby]="p.name" type="button"
|
||||
class="btn btn-outline-secondary btn-sm" (click)="choose(p)">
|
||||
{{'select' | i18n}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group-item list-group-item-action" (click)="recover()">
|
||||
<div class="two-factor-content">
|
||||
<div class="logo-col">
|
||||
<img class="recovery-code-img" alt="rc logo">
|
||||
</div>
|
||||
<div class="text-col">
|
||||
<h3>{{'recoveryCodeTitle' | i18n}}</h3>
|
||||
{{'recoveryCodeDesc' | i18n}}
|
||||
</div>
|
||||
<div class="btn-col">
|
||||
<button [attr.aria-descibedby]="'recoveryCodeTitle' | i18n" type="button"
|
||||
class="btn btn-outline-secondary btn-sm" (click)="recover()">
|
||||
{{'select' | i18n}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a href="#" appStopClick *ngFor="let p of providers" (click)="choose(p)"
|
||||
class="list-group-item list-group-item-action">
|
||||
<img [src]="'images/two-factor/' + p.type + '.png'" alt="" class="pull-right">
|
||||
<h3>{{p.name}}</h3>
|
||||
{{p.description}}
|
||||
</a>
|
||||
<a href="#" appStopClick class="list-group-item list-group-item-action" (click)="recover()">
|
||||
<h3>{{'recoveryCodeTitle' | i18n}}</h3>
|
||||
{{'recoveryCodeDesc' | i18n}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">{{'close' |
|
||||
i18n}}</button>
|
||||
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal">{{'close' | i18n}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,7 +23,6 @@ import { TwoFactorProviderType } from 'jslib-common/enums/twoFactorProviderType'
|
||||
|
||||
import { TwoFactorComponent as BaseTwoFactorComponent } from 'jslib-angular/components/two-factor.component';
|
||||
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { TwoFactorOptionsComponent } from './two-factor-options.component';
|
||||
|
||||
@Component({
|
||||
@@ -37,9 +36,9 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
||||
i18nService: I18nService, apiService: ApiService,
|
||||
platformUtilsService: PlatformUtilsService, stateService: StateService,
|
||||
environmentService: EnvironmentService, private modalService: ModalService,
|
||||
storageService: StorageService, route: ActivatedRoute, logService: LogService) {
|
||||
storageService: StorageService, route: ActivatedRoute) {
|
||||
super(authService, router, i18nService, apiService, platformUtilsService, window, environmentService,
|
||||
stateService, storageService, route, logService);
|
||||
stateService, storageService, route);
|
||||
this.onSuccessfulLoginNavigate = this.goAfterLogIn;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { Component } from '@angular/core';
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
@@ -23,8 +22,8 @@ export class UpdateTempPasswordComponent extends BaseUpdateTempPasswordComponent
|
||||
passwordGenerationService: PasswordGenerationService, policyService: PolicyService,
|
||||
cryptoService: CryptoService, userService: UserService,
|
||||
messagingService: MessagingService, apiService: ApiService,
|
||||
syncService: SyncService, logService: LogService) {
|
||||
syncService: SyncService) {
|
||||
super(i18nService, platformUtilsService, passwordGenerationService, policyService, cryptoService,
|
||||
userService, messagingService, apiService, syncService, logService);
|
||||
userService, messagingService, apiService, syncService);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,10 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
import { VerifyEmailRequest } from 'jslib-common/models/request/verifyEmailRequest';
|
||||
@@ -25,11 +22,15 @@ import { VerifyEmailRequest } from 'jslib-common/models/request/verifyEmailReque
|
||||
export class VerifyEmailTokenComponent implements OnInit {
|
||||
constructor(private router: Router, private toasterService: ToasterService,
|
||||
private i18nService: I18nService, private route: ActivatedRoute,
|
||||
private apiService: ApiService, private userService: UserService,
|
||||
private logService: LogService) { }
|
||||
private apiService: ApiService, private userService: UserService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
let fired = false;
|
||||
this.route.queryParams.subscribe(async qParams => {
|
||||
if (fired) {
|
||||
return;
|
||||
}
|
||||
fired = true;
|
||||
if (qParams.userId != null && qParams.token != null) {
|
||||
try {
|
||||
await this.apiService.postAccountVerifyEmailToken(
|
||||
@@ -41,9 +42,7 @@ export class VerifyEmailTokenComponent implements OnInit {
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('emailVerified'));
|
||||
this.router.navigate(['/']);
|
||||
return;
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
this.toasterService.popAsync('error', null, this.i18nService.t('emailVerifiedFailed'));
|
||||
this.router.navigate(['/']);
|
||||
|
||||
@@ -7,13 +7,10 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
|
||||
import { VerifyDeleteRecoverRequest } from 'jslib-common/models/request/verifyDeleteRecoverRequest';
|
||||
|
||||
@@ -30,11 +27,16 @@ export class VerifyRecoverDeleteComponent implements OnInit {
|
||||
|
||||
constructor(private router: Router, private apiService: ApiService,
|
||||
private toasterService: ToasterService, private i18nService: I18nService,
|
||||
private route: ActivatedRoute, private logService: LogService) {
|
||||
private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
let fired = false;
|
||||
this.route.queryParams.subscribe(async qParams => {
|
||||
if (fired) {
|
||||
return;
|
||||
}
|
||||
fired = true;
|
||||
if (qParams.userId != null && qParams.token != null && qParams.email != null) {
|
||||
this.userId = qParams.userId;
|
||||
this.token = qParams.token;
|
||||
@@ -53,8 +55,6 @@ export class VerifyRecoverDeleteComponent implements OnInit {
|
||||
this.toasterService.popAsync('success', this.i18nService.t('accountDeleted'),
|
||||
this.i18nService.t('accountDeletedDesc'));
|
||||
this.router.navigate(['/']);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { EventService } from 'jslib-common/abstractions/event.service';
|
||||
import { FolderService } from 'jslib-common/abstractions/folder.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { KeyConnectorService } from 'jslib-common/abstractions/keyConnector.service';
|
||||
import { NotificationsService } from 'jslib-common/abstractions/notifications.service';
|
||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
@@ -93,8 +92,7 @@ export class AppComponent implements OnDestroy, OnInit {
|
||||
private sanitizer: DomSanitizer, private searchService: SearchService,
|
||||
private notificationsService: NotificationsService, private routerService: RouterService,
|
||||
private stateService: StateService, private eventService: EventService,
|
||||
private policyService: PolicyService, protected policyListService: PolicyListService,
|
||||
private keyConnectorService: KeyConnectorService) { }
|
||||
private policyService: PolicyService, protected policyListService: PolicyListService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.ngZone.runOutsideAngular(() => {
|
||||
@@ -165,10 +163,6 @@ export class AppComponent implements OnDestroy, OnInit {
|
||||
case 'setFullWidth':
|
||||
this.setFullWidth();
|
||||
break;
|
||||
case 'convertAccountToKeyConnector':
|
||||
this.keyConnectorService.setConvertAccountRequired(true);
|
||||
this.router.navigate(['/remove-password']);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -224,7 +218,6 @@ export class AppComponent implements OnDestroy, OnInit {
|
||||
this.policyService.clear(userId),
|
||||
this.passwordGenerationService.clear(),
|
||||
this.stateService.purge(),
|
||||
this.keyConnectorService.clear(),
|
||||
]);
|
||||
|
||||
this.searchService.clearIndex();
|
||||
|
||||
@@ -12,8 +12,6 @@ import {
|
||||
ToasterService,
|
||||
} from 'angular2-toaster';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
@@ -37,7 +35,12 @@ export abstract class BaseAcceptComponent implements OnInit {
|
||||
abstract unauthedHandler(qParams: any): Promise<void>;
|
||||
|
||||
ngOnInit() {
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
let fired = false;
|
||||
this.route.queryParams.subscribe(async qParams => {
|
||||
if (fired) {
|
||||
return;
|
||||
}
|
||||
fired = true;
|
||||
await this.stateService.remove('loginRedirect');
|
||||
|
||||
let error = this.requiredParameters.some(e => qParams?.[e] == null || qParams[e] === '');
|
||||
|
||||
@@ -94,7 +94,7 @@ export abstract class BasePeopleComponent<UserType extends ProviderUserUserDetai
|
||||
protected toasterService: ToasterService, protected cryptoService: CryptoService,
|
||||
private storageService: StorageService, protected validationService: ValidationService,
|
||||
protected modalService: ModalService, private logService: LogService,
|
||||
private searchPipe: SearchPipe, protected userNamePipe: UserNamePipe ) { }
|
||||
private searchPipe: SearchPipe, protected userNamePipe: UserNamePipe) { }
|
||||
|
||||
abstract edit(user: UserType): void;
|
||||
abstract getUsers(): Promise<ListResponse<UserType>>;
|
||||
@@ -180,7 +180,7 @@ export abstract class BasePeopleComponent<UserType extends ProviderUserUserDetai
|
||||
|
||||
async remove(user: UserType) {
|
||||
const confirmed = await this.platformUtilsService.showDialog(
|
||||
this.deleteWarningMessage(user), this.userNamePipe.transform(user),
|
||||
this.i18nService.t('removeUserConfirmation'), this.userNamePipe.transform(user),
|
||||
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
|
||||
|
||||
if (!confirmed) {
|
||||
@@ -256,9 +256,7 @@ export abstract class BasePeopleComponent<UserType extends ProviderUserUserDetai
|
||||
comp.formPromise = confirmUser(publicKey);
|
||||
await comp.formPromise;
|
||||
modal.close();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
});
|
||||
});
|
||||
return;
|
||||
@@ -267,9 +265,7 @@ export abstract class BasePeopleComponent<UserType extends ProviderUserUserDetai
|
||||
try {
|
||||
const fingerprint = await this.cryptoService.getFingerprint(user.userId, publicKey.buffer);
|
||||
this.logService.info(`User's fingerprint: ${fingerprint.join('-')}`);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
await confirmUser(publicKey);
|
||||
} catch (e) {
|
||||
this.logService.error(`Handled exception: ${e}`);
|
||||
@@ -288,10 +284,6 @@ export abstract class BasePeopleComponent<UserType extends ProviderUserUserDetai
|
||||
return !searching && this.users && this.users.length > this.pageSize;
|
||||
}
|
||||
|
||||
protected deleteWarningMessage(user: UserType): string {
|
||||
return this.i18nService.t('removeUserConfirmation');
|
||||
}
|
||||
|
||||
protected getCheckedUsers() {
|
||||
return this.users.filter(u => (u as any).checked);
|
||||
}
|
||||
|
||||
138
src/app/components/avatar.component.ts
Normal file
138
src/app/components/avatar.component.ts
Normal file
@@ -0,0 +1,138 @@
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
OnChanges,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
|
||||
import { CryptoFunctionService } from 'jslib-common/abstractions/cryptoFunction.service';
|
||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||
|
||||
import { Utils } from 'jslib-common/misc/utils';
|
||||
|
||||
@Component({
|
||||
selector: 'app-avatar',
|
||||
template: '<img [src]="sanitizer.bypassSecurityTrustResourceUrl(src)" title="{{data}}" ' +
|
||||
'[ngClass]="{\'rounded-circle\': circle}">',
|
||||
})
|
||||
export class AvatarComponent implements OnChanges, OnInit {
|
||||
@Input() data: string;
|
||||
@Input() email: string;
|
||||
@Input() size = 45;
|
||||
@Input() charCount = 2;
|
||||
@Input() textColor = '#ffffff';
|
||||
@Input() fontSize = 20;
|
||||
@Input() fontWeight = 300;
|
||||
@Input() dynamic = false;
|
||||
@Input() circle = false;
|
||||
|
||||
src: string;
|
||||
|
||||
constructor(public sanitizer: DomSanitizer, private cryptoFunctionService: CryptoFunctionService,
|
||||
private stateService: StateService) { }
|
||||
|
||||
ngOnInit() {
|
||||
if (!this.dynamic) {
|
||||
this.generate();
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
if (this.dynamic) {
|
||||
this.generate();
|
||||
}
|
||||
}
|
||||
|
||||
private async generate() {
|
||||
const enableGravatars = await this.stateService.get<boolean>('enableGravatars');
|
||||
if (enableGravatars && this.email != null) {
|
||||
const hashBytes = await this.cryptoFunctionService.hash(this.email.toLowerCase().trim(), 'md5');
|
||||
const hash = Utils.fromBufferToHex(hashBytes).toLowerCase();
|
||||
this.src = 'https://www.gravatar.com/avatar/' + hash + '?s=' + this.size + '&r=pg&d=retro';
|
||||
} else {
|
||||
let chars: string = null;
|
||||
const upperData = this.data.toUpperCase();
|
||||
|
||||
if (this.charCount > 1) {
|
||||
chars = this.getFirstLetters(upperData, this.charCount);
|
||||
}
|
||||
if (chars == null) {
|
||||
chars = this.unicodeSafeSubstring(upperData, this.charCount);
|
||||
}
|
||||
|
||||
// If the chars contain an emoji, only show it.
|
||||
if (chars.match(Utils.regexpEmojiPresentation)) {
|
||||
chars = chars.match(Utils.regexpEmojiPresentation)[0];
|
||||
}
|
||||
|
||||
const charObj = this.getCharText(chars);
|
||||
const color = this.stringToColor(upperData);
|
||||
const svg = this.getSvg(this.size, color);
|
||||
svg.appendChild(charObj);
|
||||
const html = window.document.createElement('div').appendChild(svg).outerHTML;
|
||||
const svgHtml = window.btoa(unescape(encodeURIComponent(html)));
|
||||
this.src = 'data:image/svg+xml;base64,' + svgHtml;
|
||||
}
|
||||
}
|
||||
|
||||
private stringToColor(str: string): string {
|
||||
let hash = 0;
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
// tslint:disable-next-line
|
||||
hash = str.charCodeAt(i) + ((hash << 5) - hash);
|
||||
}
|
||||
let color = '#';
|
||||
for (let i = 0; i < 3; i++) {
|
||||
// tslint:disable-next-line
|
||||
const value = (hash >> (i * 8)) & 0xFF;
|
||||
color += ('00' + value.toString(16)).substr(-2);
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
private getFirstLetters(data: string, count: number): string {
|
||||
const parts = data.split(' ');
|
||||
if (parts.length > 1) {
|
||||
let text = '';
|
||||
for (let i = 0; i < count; i++) {
|
||||
text += this.unicodeSafeSubstring(parts[i], 1);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private getSvg(size: number, color: string): HTMLElement {
|
||||
const svgTag = window.document.createElement('svg');
|
||||
svgTag.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
|
||||
svgTag.setAttribute('pointer-events', 'none');
|
||||
svgTag.setAttribute('width', size.toString());
|
||||
svgTag.setAttribute('height', size.toString());
|
||||
svgTag.style.backgroundColor = color;
|
||||
svgTag.style.width = size + 'px';
|
||||
svgTag.style.height = size + 'px';
|
||||
return svgTag;
|
||||
}
|
||||
|
||||
private getCharText(character: string): HTMLElement {
|
||||
const textTag = window.document.createElement('text');
|
||||
textTag.setAttribute('text-anchor', 'middle');
|
||||
textTag.setAttribute('y', '50%');
|
||||
textTag.setAttribute('x', '50%');
|
||||
textTag.setAttribute('dy', '0.35em');
|
||||
textTag.setAttribute('pointer-events', 'auto');
|
||||
textTag.setAttribute('fill', this.textColor);
|
||||
textTag.setAttribute('font-family', '"Open Sans","Helvetica Neue",Helvetica,Arial,' +
|
||||
'sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"');
|
||||
textTag.textContent = character;
|
||||
textTag.style.fontWeight = this.fontWeight.toString();
|
||||
textTag.style.fontSize = this.fontSize + 'px';
|
||||
return textTag;
|
||||
}
|
||||
|
||||
private unicodeSafeSubstring(str: string, count: number) {
|
||||
const characters = str.match(/./ug);
|
||||
return characters != null ? characters.slice(0, count).join('') : '';
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="confirmUserTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="confirmUserTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="bulkTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="bulkTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="bulkTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="bulkTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="bulkTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="bulkTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="collectionAddEditTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="collectionAddEditTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -11,7 +11,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
@@ -49,8 +48,7 @@ export class CollectionAddEditComponent implements OnInit {
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService,
|
||||
private cryptoService: CryptoService, private userService: UserService,
|
||||
private logService: LogService) { }
|
||||
private cryptoService: CryptoService, private userService: UserService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
const organization = await this.userService.getOrganization(this.organizationId);
|
||||
@@ -79,9 +77,7 @@ export class CollectionAddEditComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
} else {
|
||||
this.title = this.i18nService.t('addCollection');
|
||||
}
|
||||
@@ -131,9 +127,7 @@ export class CollectionAddEditComponent implements OnInit {
|
||||
this.toasterService.popAsync('success', null,
|
||||
this.i18nService.t(this.editMode ? 'editedCollectionId' : 'createdCollectionId', this.name));
|
||||
this.onSavedCollection.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
async delete() {
|
||||
@@ -153,8 +147,6 @@ export class CollectionAddEditComponent implements OnInit {
|
||||
await this.deletePromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', this.name));
|
||||
this.onDeletedCollection.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,9 @@ import {
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CollectionService } from 'jslib-common/abstractions/collection.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { SearchService } from 'jslib-common/abstractions/search.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
@@ -58,14 +55,17 @@ export class CollectionsComponent implements OnInit {
|
||||
private collectionService: CollectionService, private modalService: ModalService,
|
||||
private toasterService: ToasterService, private i18nService: I18nService,
|
||||
private platformUtilsService: PlatformUtilsService, private userService: UserService,
|
||||
private searchService: SearchService, private logService: LogService) { }
|
||||
private searchService: SearchService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.route.parent.parent.params.subscribe(async params => {
|
||||
this.organizationId = params.organizationId;
|
||||
await this.load();
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
this.searchText = qParams.search;
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -155,8 +155,7 @@ export class CollectionsComponent implements OnInit {
|
||||
await this.apiService.deleteCollection(this.organizationId, collection.id);
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('deletedCollectionId', collection.name));
|
||||
this.removeCollection(collection);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
} catch {
|
||||
this.toasterService.popAsync('error', null, this.i18nService.t('missingPermissions'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="eventLogsTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="eventLogsTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -8,7 +8,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
|
||||
import { EventService } from '../../services/event.service';
|
||||
|
||||
@@ -43,7 +42,7 @@ export class EntityEventsComponent implements OnInit {
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private eventService: EventService, private toasterService: ToasterService,
|
||||
private userNamePipe: UserNamePipe, private logService: LogService) { }
|
||||
private userNamePipe: UserNamePipe) { }
|
||||
|
||||
async ngOnInit() {
|
||||
const defaultDates = this.eventService.getDefaultDateFilters();
|
||||
@@ -99,9 +98,7 @@ export class EntityEventsComponent implements OnInit {
|
||||
this.morePromise = promise;
|
||||
}
|
||||
response = await promise;
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
|
||||
this.continuationToken = response.continuationToken;
|
||||
const events = await Promise.all(response.data.map(async r => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="userAccessTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="userAccessTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -10,7 +10,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
|
||||
import { OrganizationUserStatusType } from 'jslib-common/enums/organizationUserStatusType';
|
||||
import { OrganizationUserType } from 'jslib-common/enums/organizationUserType';
|
||||
@@ -42,7 +41,7 @@ export class EntityUsersComponent implements OnInit {
|
||||
private allUsers: OrganizationUserUserDetailsResponse[] = [];
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private toasterService: ToasterService, private logService: LogService) { }
|
||||
private toasterService: ToasterService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
await this.loadUsers();
|
||||
@@ -131,8 +130,6 @@ export class EntityUsersComponent implements OnInit {
|
||||
await this.formPromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('updatedUsers'));
|
||||
this.onEditedUsers.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="groupAddEditTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="groupAddEditTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -11,7 +11,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CollectionService } from 'jslib-common/abstractions/collection.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
|
||||
import { CollectionData } from 'jslib-common/models/data/collectionData';
|
||||
@@ -43,7 +42,7 @@ export class GroupAddEditComponent implements OnInit {
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private toasterService: ToasterService, private collectionService: CollectionService,
|
||||
private platformUtilsService: PlatformUtilsService, private logService: LogService) { }
|
||||
private platformUtilsService: PlatformUtilsService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.editMode = this.loading = this.groupId != null;
|
||||
@@ -67,9 +66,7 @@ export class GroupAddEditComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
} else {
|
||||
this.title = this.i18nService.t('addGroup');
|
||||
}
|
||||
@@ -115,9 +112,7 @@ export class GroupAddEditComponent implements OnInit {
|
||||
this.toasterService.popAsync('success', null,
|
||||
this.i18nService.t(this.editMode ? 'editedGroupId' : 'createdGroupId', this.name));
|
||||
this.onSavedGroup.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
async delete() {
|
||||
@@ -137,8 +132,6 @@ export class GroupAddEditComponent implements OnInit {
|
||||
await this.deletePromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', this.name));
|
||||
this.onDeletedGroup.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,10 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { SearchService } from 'jslib-common/abstractions/search.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
@@ -52,7 +49,7 @@ export class GroupsComponent implements OnInit {
|
||||
private i18nService: I18nService, private modalService: ModalService,
|
||||
private toasterService: ToasterService, private platformUtilsService: PlatformUtilsService,
|
||||
private userService: UserService, private router: Router,
|
||||
private searchService: SearchService, private logService: LogService) { }
|
||||
private searchService: SearchService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.route.parent.parent.params.subscribe(async params => {
|
||||
@@ -63,8 +60,11 @@ export class GroupsComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
await this.load();
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
this.searchText = qParams.search;
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -125,9 +125,7 @@ export class GroupsComponent implements OnInit {
|
||||
await this.apiService.deleteGroup(this.organizationId, group.id);
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('deletedGroupId', group.name));
|
||||
this.removeGroup(group);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
async users(group: GroupResponse) {
|
||||
|
||||
@@ -5,8 +5,6 @@ import {
|
||||
ViewContainerRef,
|
||||
} from '@angular/core';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import {
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
@@ -122,7 +120,7 @@ export class PeopleComponent extends BasePeopleComponent<OrganizationUserUserDet
|
||||
|
||||
await this.load();
|
||||
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
this.searchText = qParams.search;
|
||||
if (qParams.viewEvents != null) {
|
||||
const user = this.users.filter(u => u.id === qParams.viewEvents);
|
||||
@@ -130,6 +128,9 @@ export class PeopleComponent extends BasePeopleComponent<OrganizationUserUserDet
|
||||
this.events(user[0]);
|
||||
}
|
||||
}
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -193,7 +194,6 @@ export class PeopleComponent extends BasePeopleComponent<OrganizationUserUserDet
|
||||
comp.name = this.userNamePipe.transform(user);
|
||||
comp.organizationId = this.organizationId;
|
||||
comp.organizationUserId = user != null ? user.id : null;
|
||||
comp.usesKeyConnector = user?.usesKeyConnector;
|
||||
comp.onSavedUser.subscribe(() => {
|
||||
modal.close();
|
||||
this.load();
|
||||
@@ -292,14 +292,6 @@ export class PeopleComponent extends BasePeopleComponent<OrganizationUserUserDet
|
||||
});
|
||||
}
|
||||
|
||||
protected deleteWarningMessage(user: OrganizationUserUserDetailsResponse): string {
|
||||
if (user.usesKeyConnector) {
|
||||
return this.i18nService.t('removeUserConfirmationKeyConnector');
|
||||
}
|
||||
|
||||
return super.deleteWarningMessage(user);
|
||||
}
|
||||
|
||||
private async showBulkStatus(users: OrganizationUserUserDetailsResponse[], filteredUsers: OrganizationUserUserDetailsResponse[],
|
||||
request: Promise<ListResponse<OrganizationUserBulkResponse>>, successfullMessage: string) {
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { PolicyType } from 'jslib-common/enums/policyType';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
@@ -60,7 +58,7 @@ export class PoliciesComponent implements OnInit {
|
||||
await this.load();
|
||||
|
||||
// Handle policies component launch from Event message
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
if (qParams.policyId != null) {
|
||||
const policyIdFromEvents: string = qParams.policyId;
|
||||
for (const orgPolicy of this.orgPolicies) {
|
||||
@@ -75,6 +73,10 @@ export class PoliciesComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="policiesEditTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="policiesEditTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -13,7 +13,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
|
||||
import { PolicyType } from 'jslib-common/enums/policyType';
|
||||
|
||||
@@ -46,7 +45,7 @@ export class PolicyEditComponent {
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private toasterService: ToasterService, private componentFactoryResolver: ComponentFactoryResolver,
|
||||
private cdr: ChangeDetectorRef, private logService: LogService) {
|
||||
private cdr: ChangeDetectorRef) {
|
||||
}
|
||||
|
||||
async ngAfterViewInit() {
|
||||
@@ -87,8 +86,6 @@ export class PolicyEditComponent {
|
||||
await this.formPromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('editedPolicyId', this.i18nService.t(this.policy.name)));
|
||||
this.onSavedPolicy.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="resetPasswordTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="resetPasswordTitle">
|
||||
<div class="modal-dialog" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
@@ -40,7 +39,7 @@ export class ResetPasswordComponent implements OnInit {
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private platformUtilsService: PlatformUtilsService, private passwordGenerationService: PasswordGenerationService,
|
||||
private policyService: PolicyService, private cryptoService: CryptoService, private logService: LogService) { }
|
||||
private policyService: PolicyService, private cryptoService: CryptoService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
// Get Enforced Policy Options
|
||||
@@ -144,9 +143,7 @@ export class ResetPasswordComponent implements OnInit {
|
||||
await this.formPromise;
|
||||
this.platformUtilsService.showToast('success', null, this.i18nService.t('resetPasswordSuccess'));
|
||||
this.onPasswordReset.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
updatePasswordStrength() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="userAddEditTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="userAddEditTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -11,7 +11,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CollectionService } from 'jslib-common/abstractions/collection.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
|
||||
import { CollectionData } from 'jslib-common/models/data/collectionData';
|
||||
@@ -33,7 +32,6 @@ export class UserAddEditComponent implements OnInit {
|
||||
@Input() name: string;
|
||||
@Input() organizationUserId: string;
|
||||
@Input() organizationId: string;
|
||||
@Input() usesKeyConnector: boolean = false;
|
||||
@Output() onSavedUser = new EventEmitter();
|
||||
@Output() onDeletedUser = new EventEmitter();
|
||||
|
||||
@@ -87,7 +85,7 @@ export class UserAddEditComponent implements OnInit {
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private toasterService: ToasterService, private collectionService: CollectionService,
|
||||
private platformUtilsService: PlatformUtilsService, private logService: LogService) { }
|
||||
private platformUtilsService: PlatformUtilsService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.editMode = this.loading = this.organizationUserId != null;
|
||||
@@ -113,9 +111,7 @@ export class UserAddEditComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
} else {
|
||||
this.title = this.i18nService.t('inviteUser');
|
||||
}
|
||||
@@ -184,9 +180,7 @@ export class UserAddEditComponent implements OnInit {
|
||||
this.toasterService.popAsync('success', null,
|
||||
this.i18nService.t(this.editMode ? 'editedUserId' : 'invitedUsers', this.name));
|
||||
this.onSavedUser.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
async delete() {
|
||||
@@ -194,10 +188,9 @@ export class UserAddEditComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
|
||||
const message = this.usesKeyConnector ? 'removeUserConfirmationKeyConnector' : 'removeUserConfirmation';
|
||||
const confirmed = await this.platformUtilsService.showDialog(
|
||||
this.i18nService.t(message), this.name, this.i18nService.t('yes'), this.i18nService.t('no'), 'warning'
|
||||
);
|
||||
this.i18nService.t('removeUserConfirmation'), this.name,
|
||||
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
|
||||
if (!confirmed) {
|
||||
return false;
|
||||
}
|
||||
@@ -207,8 +200,6 @@ export class UserAddEditComponent implements OnInit {
|
||||
await this.deletePromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('removedUserId', this.name));
|
||||
this.onDeletedUser.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="confirmUserTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="confirmUserTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
import { ConstantsService } from 'jslib-common/services/constants.service';
|
||||
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { StorageService } from 'jslib-common/abstractions/storage.service';
|
||||
|
||||
@Component({
|
||||
@@ -27,8 +26,7 @@ export class UserConfirmComponent implements OnInit {
|
||||
fingerprint: string;
|
||||
formPromise: Promise<any>;
|
||||
|
||||
constructor(private cryptoService: CryptoService, private storageService: StorageService,
|
||||
private logService: LogService) { }
|
||||
constructor(private cryptoService: CryptoService, private storageService: StorageService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
try {
|
||||
@@ -38,9 +36,7 @@ export class UserConfirmComponent implements OnInit {
|
||||
this.fingerprint = fingerprint.join('-');
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="groupAccessTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="groupAccessTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -10,7 +10,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
|
||||
import { OrganizationUserUpdateGroupsRequest } from 'jslib-common/models/request/organizationUserUpdateGroupsRequest';
|
||||
import { GroupResponse } from 'jslib-common/models/response/groupResponse';
|
||||
@@ -32,7 +31,7 @@ export class UserGroupsComponent implements OnInit {
|
||||
formPromise: Promise<any>;
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private toasterService: ToasterService, private logService: LogService) { }
|
||||
private toasterService: ToasterService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
const groupsResponse = await this.apiService.getGroups(this.organizationId);
|
||||
@@ -51,9 +50,7 @@ export class UserGroupsComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
|
||||
this.loading = false;
|
||||
}
|
||||
@@ -79,8 +76,6 @@ export class UserGroupsComponent implements OnInit {
|
||||
await this.formPromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('editedGroupsForUser', this.name));
|
||||
this.onSavedUser.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<app-callout type="info" *ngIf="showKeyConnectorInfo">
|
||||
{{'keyConnectorPolicyRestriction' | i18n}}
|
||||
</app-callout>
|
||||
|
||||
<div [formGroup]="data">
|
||||
<div class="form-group">
|
||||
<div class="form-check">
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
import { PolicyType } from 'jslib-common/enums/policyType';
|
||||
|
||||
@@ -31,9 +30,8 @@ export class MasterPasswordPolicyComponent extends BasePolicyComponent {
|
||||
});
|
||||
|
||||
passwordScores: { name: string; value: number; }[];
|
||||
showKeyConnectorInfo: boolean = false;
|
||||
|
||||
constructor(private fb: FormBuilder, i18nService: I18nService, private userService: UserService) {
|
||||
constructor(private fb: FormBuilder, i18nService: I18nService) {
|
||||
super();
|
||||
|
||||
this.passwordScores = [
|
||||
@@ -45,10 +43,4 @@ export class MasterPasswordPolicyComponent extends BasePolicyComponent {
|
||||
{ name: i18nService.t('strong') + ' (4)', value: 4 },
|
||||
];
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
super.ngOnInit();
|
||||
const organization = await this.userService.getOrganization(this.policyResponse.organizationId);
|
||||
this.showKeyConnectorInfo = organization.keyConnectorEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<app-callout type="info" *ngIf="showKeyConnectorInfo">
|
||||
{{'keyConnectorPolicyRestriction' | i18n}}
|
||||
</app-callout>
|
||||
|
||||
<app-callout type="warning">
|
||||
{{'resetPasswordPolicyWarning' | i18n}}
|
||||
</app-callout>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
import { PolicyType } from 'jslib-common/enums/policyType';
|
||||
|
||||
@@ -30,15 +29,8 @@ export class ResetPasswordPolicyComponent extends BasePolicyComponent {
|
||||
});
|
||||
|
||||
defaultTypes: { name: string; value: string; }[];
|
||||
showKeyConnectorInfo: boolean = false;
|
||||
|
||||
constructor(private fb: FormBuilder, private userService: UserService) {
|
||||
constructor(private fb: FormBuilder) {
|
||||
super();
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
super.ngOnInit();
|
||||
const organization = await this.userService.getOrganization(this.policyResponse.organizationId);
|
||||
this.showKeyConnectorInfo = organization.keyConnectorEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,10 +4,7 @@ import {
|
||||
ViewContainerRef,
|
||||
} from '@angular/core';
|
||||
|
||||
import {
|
||||
ActivatedRoute,
|
||||
Router
|
||||
} from '@angular/router';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
import { ModalService } from 'jslib-angular/services/modal.service';
|
||||
@@ -15,7 +12,6 @@ import { ModalService } from 'jslib-angular/services/modal.service';
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||
|
||||
@@ -54,8 +50,7 @@ export class AccountComponent {
|
||||
private apiService: ApiService, private i18nService: I18nService,
|
||||
private toasterService: ToasterService, private route: ActivatedRoute,
|
||||
private syncService: SyncService, private platformUtilsService: PlatformUtilsService,
|
||||
private cryptoService: CryptoService, private logService: LogService,
|
||||
private router: Router) { }
|
||||
private cryptoService: CryptoService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.selfHosted = this.platformUtilsService.isSelfHost();
|
||||
@@ -64,9 +59,7 @@ export class AccountComponent {
|
||||
try {
|
||||
this.org = await this.apiService.getOrganization(this.organizationId);
|
||||
this.canUseApi = this.org.useApi;
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
});
|
||||
this.loading = false;
|
||||
}
|
||||
@@ -91,9 +84,7 @@ export class AccountComponent {
|
||||
});
|
||||
await this.formPromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('organizationUpdated'));
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
async submitTaxInfo() {
|
||||
@@ -105,9 +96,6 @@ export class AccountComponent {
|
||||
async deleteOrganization() {
|
||||
await this.modalService.openViewRef(DeleteOrganizationComponent, this.deleteModalRef, comp => {
|
||||
comp.organizationId = this.organizationId;
|
||||
comp.onSuccess.subscribe(() => {
|
||||
this.router.navigate(['/']);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ import {
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
|
||||
import { OrganizationSubscriptionUpdateRequest } from 'jslib-common/models/request/organizationSubscriptionUpdateRequest';
|
||||
|
||||
@Component({
|
||||
@@ -31,7 +31,7 @@ export class AdjustSubscription {
|
||||
newMaxSeats: number;
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private toasterService: ToasterService, private logService: LogService) { }
|
||||
private toasterService: ToasterService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.limitSubscription = this.maxAutoscaleSeats != null;
|
||||
@@ -48,9 +48,7 @@ export class AdjustSubscription {
|
||||
await this.formPromise;
|
||||
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('subscriptionUpdated'));
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
this.onAdjusted.emit();
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ import {
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
|
||||
import { PlanType } from 'jslib-common/enums/planType';
|
||||
import { ProductType } from 'jslib-common/enums/productType';
|
||||
@@ -23,14 +24,12 @@ export class ChangePlanComponent {
|
||||
defaultUpgradePlan: PlanType = PlanType.FamiliesAnnually;
|
||||
defaultUpgradeProduct: ProductType = ProductType.Families;
|
||||
|
||||
constructor(private logService: LogService) { }
|
||||
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService) { }
|
||||
|
||||
async submit() {
|
||||
try {
|
||||
this.onChanged.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
cancel() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="deleteOrganizationTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="deleteOrganizationTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||
<div class="modal-header">
|
||||
@@ -8,10 +8,11 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>{{descriptionKey | i18n}}</p>
|
||||
<p>{{'deleteOrganizationDesc' | i18n}}</p>
|
||||
<app-callout type="warning">{{'deleteOrganizationWarning' | i18n}}</app-callout>
|
||||
<app-verify-master-password [(ngModel)]="masterPassword" ngDefaultControl name="secret">
|
||||
</app-verify-master-password>
|
||||
<label for="masterPassword">{{'masterPass' | i18n}}</label>
|
||||
<input id="masterPassword" type="password" name="MasterPasswordHash" class="form-control"
|
||||
[(ngModel)]="masterPassword" required appAutofocus appInputVerbatim>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-danger btn-submit" [disabled]="form.loading">
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
Output,
|
||||
} from '@angular/core';
|
||||
import { Component } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { Verification } from 'jslib-common/types/verification';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { UserVerificationService } from 'jslib-common/abstractions/userVerification.service';
|
||||
|
||||
import { PasswordVerificationRequest } from 'jslib-common/models/request/passwordVerificationRequest';
|
||||
|
||||
@Component({
|
||||
selector: 'app-delete-organization',
|
||||
@@ -19,26 +15,29 @@ import { UserVerificationService } from 'jslib-common/abstractions/userVerificat
|
||||
})
|
||||
export class DeleteOrganizationComponent {
|
||||
organizationId: string;
|
||||
descriptionKey = 'deleteOrganizationDesc';
|
||||
@Output() onSuccess: EventEmitter<any> = new EventEmitter();
|
||||
|
||||
masterPassword: Verification;
|
||||
masterPassword: string;
|
||||
formPromise: Promise<any>;
|
||||
|
||||
constructor(private apiService: ApiService, private i18nService: I18nService,
|
||||
private toasterService: ToasterService, private userVerificationService: UserVerificationService,
|
||||
private logService: LogService) { }
|
||||
private toasterService: ToasterService, private cryptoService: CryptoService,
|
||||
private router: Router) { }
|
||||
|
||||
async submit() {
|
||||
if (this.masterPassword == null || this.masterPassword === '') {
|
||||
this.toasterService.popAsync('error', this.i18nService.t('errorOccurred'),
|
||||
this.i18nService.t('masterPassRequired'));
|
||||
return;
|
||||
}
|
||||
|
||||
const request = new PasswordVerificationRequest();
|
||||
request.masterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, null);
|
||||
try {
|
||||
this.formPromise = this.userVerificationService.buildRequest(this.masterPassword)
|
||||
.then(request => this.apiService.deleteOrganization(this.organizationId, request));
|
||||
this.formPromise = this.apiService.deleteOrganization(this.organizationId, request);
|
||||
await this.formPromise;
|
||||
this.toasterService.popAsync('success', this.i18nService.t('organizationDeleted'),
|
||||
this.i18nService.t('organizationDeletedDesc'));
|
||||
this.onSuccess.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
this.router.navigate(['/']);
|
||||
} catch { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
} from '@angular/core';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
|
||||
@Component({
|
||||
@@ -21,8 +20,7 @@ export class DownloadLicenseComponent {
|
||||
installationId: string;
|
||||
formPromise: Promise<any>;
|
||||
|
||||
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService,
|
||||
private logService: LogService) { }
|
||||
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService) { }
|
||||
|
||||
async submit() {
|
||||
if (this.installationId == null || this.installationId === '') {
|
||||
@@ -35,9 +33,7 @@ export class DownloadLicenseComponent {
|
||||
const licenseString = JSON.stringify(license, null, 2);
|
||||
this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json');
|
||||
this.onDownloaded.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
cancel() {
|
||||
|
||||
@@ -8,7 +8,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
|
||||
import { UserBillingComponent } from '../../settings/user-billing.component';
|
||||
@@ -19,9 +18,8 @@ import { UserBillingComponent } from '../../settings/user-billing.component';
|
||||
})
|
||||
export class OrganizationBillingComponent extends UserBillingComponent implements OnInit {
|
||||
constructor(apiService: ApiService, i18nService: I18nService, toasterService: ToasterService,
|
||||
private route: ActivatedRoute, platformUtilsService: PlatformUtilsService,
|
||||
logService: LogService) {
|
||||
super(apiService, i18nService, toasterService, platformUtilsService, logService);
|
||||
private route: ActivatedRoute, platformUtilsService: PlatformUtilsService) {
|
||||
super(apiService, i18nService, toasterService, platformUtilsService);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<ng-container *ngIf="subscription">
|
||||
<dt>{{'status' | i18n}}</dt>
|
||||
<dd>
|
||||
<span class="text-capitalize">{{isSponsoredSubscription ? 'sponsored' : subscription.status || '-'}}</span>
|
||||
<span class="text-capitalize">{{subscription.status || '-'}}</span>
|
||||
<span class="badge badge-warning"
|
||||
*ngIf="subscriptionMarkedForCancel">{{'pendingCancellation' |
|
||||
i18n}}</span>
|
||||
@@ -45,7 +45,7 @@
|
||||
</ng-container>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="col-8" *ngIf="subscription">
|
||||
<div class="col-8">
|
||||
<strong class="d-block mb-1">{{'details' | i18n}}</strong>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
@@ -70,13 +70,6 @@
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
<ng-container>
|
||||
<button type="button" class="btn btn-outline-secondary" (click)="changePlan()" *ngIf="showChangePlanButton">
|
||||
{{'changeBillingPlan' | i18n}}
|
||||
</button>
|
||||
<app-change-plan [organizationId]="organizationId" (onChanged)="closeChangePlan(true)"
|
||||
(onCanceled)="closeChangePlan(false)" *ngIf="showChangePlan"></app-change-plan>
|
||||
</ng-container>
|
||||
<h2 class="spaced-header">{{'manageSubscription' | i18n}}</h2>
|
||||
<p class="mb-4">{{subscriptionDesc}}</p>
|
||||
<ng-container *ngIf="subscription && canAdjustSeats && !subscription.cancelled && !subscriptionMarkedForCancel">
|
||||
@@ -86,12 +79,6 @@
|
||||
</app-adjust-subscription>
|
||||
</div>
|
||||
</ng-container>
|
||||
<button #removeSponsorshipBtn type="button" class="btn btn-outline-danger btn-submit" (click)="removeSponsorship()"
|
||||
[appApiAction]="removeSponsorshipPromise" [disabled]="removeSponsorshipBtn.loading"
|
||||
*ngIf="isSponsoredSubscription">
|
||||
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||
<span>{{'removeSponsorship' | i18n}}</span>
|
||||
</button>
|
||||
<h2 class="spaced-header">{{'storage' | i18n}}</h2>
|
||||
<p>{{'subscriptionStorage' | i18n : sub.maxStorageGb || 0 : sub.storageName || '0 MB'}}</p>
|
||||
<div class="progress">
|
||||
@@ -131,6 +118,8 @@
|
||||
<span>{{'cancelSubscription' | i18n}}</span>
|
||||
</button>
|
||||
</div>
|
||||
<app-change-plan [organizationId]="organizationId" (onChanged)="closeChangePlan(true)"
|
||||
(onCanceled)="closeChangePlan(false)" *ngIf="showChangePlan"></app-change-plan>
|
||||
<div class="mt-3" *ngIf="showDownloadLicense">
|
||||
<app-download-license [organizationId]="organizationId" (onDownloaded)="closeDownloadLicense()"
|
||||
(onCanceled)="closeDownloadLicense()"></app-download-license>
|
||||
|
||||
@@ -10,7 +10,6 @@ import { OrganizationSubscriptionResponse } from 'jslib-common/models/response/o
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
@@ -38,14 +37,13 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
||||
|
||||
userOrg: Organization;
|
||||
|
||||
removeSponsorshipPromise: Promise<any>;
|
||||
cancelPromise: Promise<any>;
|
||||
reinstatePromise: Promise<any>;
|
||||
|
||||
constructor(private apiService: ApiService, private platformUtilsService: PlatformUtilsService,
|
||||
private i18nService: I18nService, private toasterService: ToasterService,
|
||||
private messagingService: MessagingService, private route: ActivatedRoute,
|
||||
private userService: UserService, private logService: LogService) {
|
||||
private userService: UserService) {
|
||||
this.selfHosted = platformUtilsService.isSelfHost();
|
||||
}
|
||||
|
||||
@@ -84,9 +82,7 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
||||
await this.reinstatePromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('reinstated'));
|
||||
this.load();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
async cancel() {
|
||||
@@ -105,13 +101,19 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
||||
await this.cancelPromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('canceledSubscription'));
|
||||
this.load();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
async changePlan() {
|
||||
this.showChangePlan = !this.showChangePlan;
|
||||
if (this.subscription == null && this.sub.planType === PlanType.Free) {
|
||||
this.showChangePlan = !this.showChangePlan;
|
||||
return;
|
||||
}
|
||||
const contactSupport = await this.platformUtilsService.showDialog(this.i18nService.t('changeBillingPlanDesc'),
|
||||
this.i18nService.t('changeBillingPlan'), this.i18nService.t('contactSupport'), this.i18nService.t('close'));
|
||||
if (contactSupport) {
|
||||
this.platformUtilsService.launchUri('https://bitwarden.com/contact');
|
||||
}
|
||||
}
|
||||
|
||||
closeChangePlan(changed: boolean) {
|
||||
@@ -157,26 +159,6 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async removeSponsorship() {
|
||||
const isConfirmed = await this.platformUtilsService.showDialog(
|
||||
this.i18nService.t('removeSponsorshipConfirmation'),
|
||||
this.i18nService.t('removeSponsorship'),
|
||||
this.i18nService.t('remove'), this.i18nService.t('cancel'), 'warning');
|
||||
|
||||
if (!isConfirmed) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
this.removeSponsorshipPromise = this.apiService.deleteRemoveSponsorship(this.organizationId);
|
||||
await this.removeSponsorshipPromise;
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('removeSponsorshipSuccess'));
|
||||
await this.load();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
get isExpired() {
|
||||
return this.sub != null && this.sub.expiration != null &&
|
||||
new Date(this.sub.expiration) < new Date();
|
||||
@@ -228,25 +210,13 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
||||
return this.sub.plan.hasAdditionalSeatsOption;
|
||||
}
|
||||
|
||||
get isSponsoredSubscription(): boolean {
|
||||
return this.sub.subscription?.items.some(i => i.sponsoredSubscriptionItem);
|
||||
}
|
||||
|
||||
get canDownloadLicense() {
|
||||
return (this.sub.planType !== PlanType.Free && this.subscription == null) ||
|
||||
(this.subscription != null && !this.subscription.cancelled);
|
||||
}
|
||||
|
||||
get subscriptionDesc() {
|
||||
if (this.sub.planType === PlanType.Free) {
|
||||
return this.i18nService.t('subscriptionFreePlan', this.sub.seats.toString());
|
||||
} else if (this.sub.planType === PlanType.FamiliesAnnually || this.sub.planType === PlanType.FamiliesAnnually2019) {
|
||||
if (this.isSponsoredSubscription) {
|
||||
return this.i18nService.t('subscriptionSponsoredFamiliesPlan', this.sub.seats.toString());
|
||||
} else {
|
||||
return this.i18nService.t('subscriptionFamiliesPlan', this.sub.seats.toString());
|
||||
}
|
||||
} else if (this.sub.maxAutoscaleSeats === this.sub.seats && this.sub.seats != null) {
|
||||
if (this.sub.maxAutoscaleSeats === this.sub.seats && this.sub.seats != null) {
|
||||
return this.i18nService.t('subscriptionMaxReached', this.sub.seats.toString());
|
||||
} else if (this.sub.maxAutoscaleSeats == null) {
|
||||
return this.i18nService.t('subscriptionUserSeatsUnlimitedAutoscale');
|
||||
@@ -254,8 +224,4 @@ export class OrganizationSubscriptionComponent implements OnInit {
|
||||
return this.i18nService.t('subscriptionUserSeatsLimitedAutoscale', this.sub.maxAutoscaleSeats.toString());
|
||||
}
|
||||
}
|
||||
|
||||
get showChangePlanButton() {
|
||||
return this.subscription == null && this.sub.planType === PlanType.Free && !this.showChangePlan;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<div class="container page-content">
|
||||
<div class="page-header">
|
||||
<h1>{{'sponsoredFamiliesOffer' | i18n}}</h1>
|
||||
</div>
|
||||
<div *ngIf="loading" class="mt-5 d-flex justify-content-center">
|
||||
<i class="fa fa-spinner fa-spin fa-2x text-muted" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{'loading' | i18n}}</span>
|
||||
</div>
|
||||
<div *ngIf="!loading && badToken" class="mt-5 d-flex justify-content-center">
|
||||
<span>{{'badToken' | i18n}}</span>
|
||||
</div>
|
||||
<form #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate *ngIf="!loading && !badToken">
|
||||
<p>
|
||||
<span>{{'acceptBitwardenFamiliesHelp' | i18n}}</span>
|
||||
</p>
|
||||
<div class="form-group col-6">
|
||||
<label for="availableSponsorshipOrg">{{ 'sponsoredFamiliesSelectOffer' | i18n}}</label>
|
||||
<select id="availableSponsorshipOrg" name="Available Sponsorship Organization"
|
||||
[(ngModel)]="selectedFamilyOrganizationId" class="form-control" required>
|
||||
<option value="" disabled>-- {{'select' | i18n}} --</option>
|
||||
<option value="createNew">{{'newFamiliesOrganization' | i18n}}</option>
|
||||
<option *ngFor="let o of existingFamilyOrganizations" [ngValue]="o.id">{{o.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div *ngIf="showNewOrganization" class="col-12">
|
||||
<app-organization-plans></app-organization-plans>
|
||||
</div>
|
||||
<div class="form-group col-6" *ngIf="!showNewOrganization">
|
||||
<button class="btn btn-primary mt-2 btn-submit" [disabled]="form.loading" type="submit">
|
||||
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
|
||||
<span>{{'acceptOffer' | i18n}}</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<ng-template #deleteOrganizationTemplate></ng-template>
|
||||
@@ -1,149 +0,0 @@
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
ViewChild,
|
||||
ViewContainerRef,
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ActivatedRoute,
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
import {
|
||||
Toast,
|
||||
ToasterService,
|
||||
} from 'angular2-toaster';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { ModalService } from 'jslib-angular/services/modal.service';
|
||||
import { ValidationService } from 'jslib-angular/services/validation.service';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { SyncService } from 'jslib-common/abstractions/sync.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
import { PlanSponsorshipType } from 'jslib-common/enums/planSponsorshipType';
|
||||
import { PlanType } from 'jslib-common/enums/planType';
|
||||
import { ProductType } from 'jslib-common/enums/productType';
|
||||
|
||||
import { Organization } from 'jslib-common/models/domain/organization';
|
||||
|
||||
import { OrganizationSponsorshipRedeemRequest } from 'jslib-common/models/request/organization/organizationSponsorshipRedeemRequest';
|
||||
|
||||
import { DeleteOrganizationComponent } from 'src/app/organizations/settings/delete-organization.component';
|
||||
|
||||
import { OrganizationPlansComponent } from 'src/app/settings/organization-plans.component';
|
||||
|
||||
@Component({
|
||||
selector: 'families-for-enterprise-setup',
|
||||
templateUrl: 'families-for-enterprise-setup.component.html',
|
||||
})
|
||||
export class FamiliesForEnterpriseSetupComponent implements OnInit {
|
||||
@ViewChild(OrganizationPlansComponent, { static: false })
|
||||
set organizationPlansComponent(value: OrganizationPlansComponent) {
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
|
||||
value.plan = PlanType.FamiliesAnnually;
|
||||
value.product = ProductType.Families;
|
||||
value.acceptingSponsorship = true;
|
||||
value.onSuccess.subscribe(this.onOrganizationCreateSuccess.bind(this));
|
||||
}
|
||||
|
||||
@ViewChild('deleteOrganizationTemplate', { read: ViewContainerRef, static: true }) deleteModalRef: ViewContainerRef;
|
||||
|
||||
loading = true;
|
||||
badToken = false;
|
||||
formPromise: Promise<any>;
|
||||
|
||||
token: string;
|
||||
existingFamilyOrganizations: Organization[];
|
||||
|
||||
showNewOrganization: boolean = false;
|
||||
_organizationPlansComponent: OrganizationPlansComponent;
|
||||
_selectedFamilyOrganizationId: string = '';
|
||||
|
||||
constructor(private router: Router, private toasterService: ToasterService,
|
||||
private i18nService: I18nService, private route: ActivatedRoute,
|
||||
private apiService: ApiService, private syncService: SyncService,
|
||||
private validationService: ValidationService, private userService: UserService,
|
||||
private modalService: ModalService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
document.body.classList.remove('layout_frontend');
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
const error = qParams.token == null;
|
||||
if (error) {
|
||||
const toast: Toast = {
|
||||
type: 'error',
|
||||
title: null,
|
||||
body: this.i18nService.t('sponsoredFamiliesAcceptFailed'),
|
||||
timeout: 10000,
|
||||
};
|
||||
this.toasterService.popAsync(toast);
|
||||
this.router.navigate(['/']);
|
||||
return;
|
||||
}
|
||||
|
||||
this.token = qParams.token;
|
||||
|
||||
await this.syncService.fullSync(true);
|
||||
this.badToken = !await this.apiService.postPreValidateSponsorshipToken(this.token);
|
||||
this.loading = false;
|
||||
|
||||
this.existingFamilyOrganizations = (await this.userService.getAllOrganizations())
|
||||
.filter(o => o.planProductType === ProductType.Families);
|
||||
|
||||
if (this.existingFamilyOrganizations.length === 0) {
|
||||
this.selectedFamilyOrganizationId = 'createNew';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async submit() {
|
||||
this.formPromise = this.doSubmit(this._selectedFamilyOrganizationId);
|
||||
await this.formPromise;
|
||||
this.formPromise = null;
|
||||
}
|
||||
|
||||
get selectedFamilyOrganizationId() {
|
||||
return this._selectedFamilyOrganizationId;
|
||||
}
|
||||
|
||||
set selectedFamilyOrganizationId(value: string) {
|
||||
this._selectedFamilyOrganizationId = value;
|
||||
this.showNewOrganization = value === 'createNew';
|
||||
}
|
||||
|
||||
private async doSubmit(organizationId: string) {
|
||||
try {
|
||||
const request = new OrganizationSponsorshipRedeemRequest();
|
||||
request.planSponsorshipType = PlanSponsorshipType.FamiliesForEnterprise;
|
||||
request.sponsoredOrganizationId = organizationId;
|
||||
|
||||
await this.apiService.postRedeemSponsorship(this.token, request);
|
||||
this.toasterService.popAsync('success', null, this.i18nService.t('sponsoredFamiliesOfferRedeemed'));
|
||||
await this.syncService.fullSync(true);
|
||||
|
||||
this.router.navigate(['/']);
|
||||
} catch (e) {
|
||||
if (this.showNewOrganization) {
|
||||
await this.modalService.openViewRef(DeleteOrganizationComponent, this.deleteModalRef, comp => {
|
||||
comp.organizationId = organizationId;
|
||||
comp.descriptionKey = 'orgCreatedSponsorshipInvalid';
|
||||
comp.onSuccess.subscribe(() => {
|
||||
this.router.navigate(['/']);
|
||||
});
|
||||
});
|
||||
}
|
||||
this.validationService.showError(this.i18nService.t('sponsorshipTokenHasExpired'));
|
||||
}
|
||||
}
|
||||
|
||||
private async onOrganizationCreateSuccess(value: any) {
|
||||
// Use newly created organization id
|
||||
await this.doSubmit(value.organizationId);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { FormBuilder } from '@angular/forms';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { EventService } from 'jslib-common/abstractions/event.service';
|
||||
import { ExportService } from 'jslib-common/abstractions/export.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
import { UserVerificationService } from 'jslib-common/abstractions/userVerification.service';
|
||||
|
||||
import { ExportComponent as BaseExportComponent } from '../../tools/export.component';
|
||||
|
||||
@@ -20,10 +17,8 @@ import { ExportComponent as BaseExportComponent } from '../../tools/export.compo
|
||||
export class ExportComponent extends BaseExportComponent {
|
||||
constructor(cryptoService: CryptoService, i18nService: I18nService,
|
||||
platformUtilsService: PlatformUtilsService, exportService: ExportService,
|
||||
eventService: EventService, private route: ActivatedRoute, policyService: PolicyService,
|
||||
logService: LogService, userVerificationService: UserVerificationService, fb: FormBuilder) {
|
||||
super(cryptoService, i18nService, platformUtilsService, exportService, eventService, policyService,
|
||||
logService, userVerificationService, fb);
|
||||
eventService: EventService, private route: ActivatedRoute, policyService: PolicyService) {
|
||||
super(cryptoService, i18nService, platformUtilsService, exportService, eventService, policyService);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
@@ -8,7 +8,6 @@ import { ToasterService } from 'angular2-toaster';
|
||||
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { ImportService } from 'jslib-common/abstractions/import.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
@@ -25,8 +24,8 @@ export class ImportComponent extends BaseImportComponent {
|
||||
constructor(i18nService: I18nService, toasterService: ToasterService,
|
||||
importService: ImportService, router: Router, private route: ActivatedRoute,
|
||||
platformUtilsService: PlatformUtilsService, policyService: PolicyService,
|
||||
private userService: UserService, logService: LogService) {
|
||||
super(i18nService, toasterService, importService, router, platformUtilsService, policyService, logService);
|
||||
private userService: UserService) {
|
||||
super(i18nService, toasterService, importService, router, platformUtilsService, policyService);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Component } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { CipherService } from 'jslib-common/abstractions/cipher.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||
import { PasswordRepromptService } from 'jslib-common/abstractions/passwordReprompt.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
@@ -21,9 +20,9 @@ import { CipherView } from 'jslib-common/models/view/cipherView';
|
||||
})
|
||||
export class InactiveTwoFactorReportComponent extends BaseInactiveTwoFactorReportComponent {
|
||||
constructor(cipherService: CipherService, modalService: ModalService,
|
||||
messagingService: MessagingService, userService: UserService,
|
||||
private route: ActivatedRoute, logService: LogService, passwordRepromptService: PasswordRepromptService) {
|
||||
super(cipherService, modalService, messagingService, userService, logService, passwordRepromptService);
|
||||
messagingService: MessagingService, userService: UserService, passwordRepromptService: PasswordRepromptService,
|
||||
private route: ActivatedRoute) {
|
||||
super(cipherService, modalService, messagingService, userService, passwordRepromptService);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
@@ -7,10 +7,8 @@ import { CollectionService } from 'jslib-common/abstractions/collection.service'
|
||||
import { EventService } from 'jslib-common/abstractions/event.service';
|
||||
import { FolderService } from 'jslib-common/abstractions/folder.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||
import { PasswordGenerationService } from 'jslib-common/abstractions/passwordGeneration.service';
|
||||
import { PasswordRepromptService } from 'jslib-common/abstractions/passwordReprompt.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
import { StateService } from 'jslib-common/abstractions/state.service';
|
||||
@@ -39,11 +37,10 @@ export class AddEditComponent extends BaseAddEditComponent {
|
||||
userService: UserService, collectionService: CollectionService,
|
||||
totpService: TotpService, passwordGenerationService: PasswordGenerationService,
|
||||
private apiService: ApiService, messagingService: MessagingService,
|
||||
eventService: EventService, policyService: PolicyService, logService: LogService,
|
||||
passwordRepromptService: PasswordRepromptService) {
|
||||
eventService: EventService, policyService: PolicyService) {
|
||||
super(cipherService, folderService, i18nService, platformUtilsService, auditService, stateService,
|
||||
userService, collectionService, totpService, passwordGenerationService, messagingService,
|
||||
eventService, policyService, passwordRepromptService, logService);
|
||||
eventService, policyService);
|
||||
}
|
||||
|
||||
protected allowOwnershipAssignment() {
|
||||
|
||||
@@ -4,7 +4,6 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CipherService } from 'jslib-common/abstractions/cipher.service';
|
||||
import { CryptoService } from 'jslib-common/abstractions/crypto.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
@@ -26,10 +25,8 @@ export class AttachmentsComponent extends BaseAttachmentsComponent {
|
||||
|
||||
constructor(cipherService: CipherService, i18nService: I18nService,
|
||||
cryptoService: CryptoService, userService: UserService,
|
||||
platformUtilsService: PlatformUtilsService, apiService: ApiService,
|
||||
logService: LogService) {
|
||||
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService,
|
||||
logService);
|
||||
platformUtilsService: PlatformUtilsService, apiService: ApiService) {
|
||||
super(cipherService, i18nService, cryptoService, userService, platformUtilsService, apiService);
|
||||
}
|
||||
|
||||
protected async reupload(attachment: AttachmentView) {
|
||||
|
||||
@@ -10,7 +10,6 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CipherService } from 'jslib-common/abstractions/cipher.service';
|
||||
import { EventService } from 'jslib-common/abstractions/event.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PasswordRepromptService } from 'jslib-common/abstractions/passwordReprompt.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { SearchService } from 'jslib-common/abstractions/search.service';
|
||||
@@ -37,10 +36,9 @@ export class CiphersComponent extends BaseCiphersComponent {
|
||||
constructor(searchService: SearchService, toasterService: ToasterService, i18nService: I18nService,
|
||||
platformUtilsService: PlatformUtilsService, cipherService: CipherService,
|
||||
private apiService: ApiService, eventService: EventService, totpService: TotpService,
|
||||
userService: UserService, passwordRepromptService: PasswordRepromptService,
|
||||
logService: LogService) {
|
||||
userService: UserService, passwordRepromptService: PasswordRepromptService) {
|
||||
super(searchService, toasterService, i18nService, platformUtilsService, cipherService,
|
||||
eventService, totpService, userService, passwordRepromptService, logService);
|
||||
eventService, totpService, userService, passwordRepromptService);
|
||||
}
|
||||
|
||||
async load(filter: (cipher: CipherView) => boolean = null) {
|
||||
|
||||
@@ -4,7 +4,6 @@ import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { CipherService } from 'jslib-common/abstractions/cipher.service';
|
||||
import { CollectionService } from 'jslib-common/abstractions/collection.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
|
||||
import { CipherData } from 'jslib-common/models/data/cipherData';
|
||||
@@ -23,8 +22,8 @@ export class CollectionsComponent extends BaseCollectionsComponent {
|
||||
|
||||
constructor(collectionService: CollectionService, platformUtilsService: PlatformUtilsService,
|
||||
i18nService: I18nService, cipherService: CipherService,
|
||||
private apiService: ApiService, logService: LogService) {
|
||||
super(collectionService, platformUtilsService, i18nService, cipherService, logService);
|
||||
private apiService: ApiService) {
|
||||
super(collectionService, platformUtilsService, i18nService, cipherService);
|
||||
this.allowSelectNone = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@ import {
|
||||
Router,
|
||||
} from '@angular/router';
|
||||
|
||||
import { first } from 'rxjs/operators';
|
||||
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { MessagingService } from 'jslib-common/abstractions/messaging.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
@@ -67,12 +65,12 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
this.platformUtilsService.isSelfHost() ? 'trashCleanupWarningSelfHosted' : 'trashCleanupWarning'
|
||||
);
|
||||
|
||||
this.route.parent.params.pipe(first()).subscribe(async params => {
|
||||
const queryParams = this.route.parent.params.subscribe(async params => {
|
||||
this.organization = await this.userService.getOrganization(params.organizationId);
|
||||
this.groupingsComponent.organization = this.organization;
|
||||
this.ciphersComponent.organization = this.organization;
|
||||
|
||||
this.route.queryParams.pipe(first()).subscribe(async qParams => {
|
||||
const queryParamsSub = this.route.queryParams.subscribe(async qParams => {
|
||||
this.ciphersComponent.searchText = this.groupingsComponent.searchText = qParams.search;
|
||||
if (!this.organization.canViewAllCollections) {
|
||||
await this.syncService.fullSync(false);
|
||||
@@ -120,7 +118,15 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
this.viewEvents(cipher[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (queryParamsSub != null) {
|
||||
queryParamsSub.unsubscribe();
|
||||
}
|
||||
});
|
||||
|
||||
if (queryParams != null) {
|
||||
queryParams.unsubscribe();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import { LoginComponent } from './accounts/login.component';
|
||||
import { RecoverDeleteComponent } from './accounts/recover-delete.component';
|
||||
import { RecoverTwoFactorComponent } from './accounts/recover-two-factor.component';
|
||||
import { RegisterComponent } from './accounts/register.component';
|
||||
import { RemovePasswordComponent } from './accounts/remove-password.component';
|
||||
import { SetPasswordComponent } from './accounts/set-password.component';
|
||||
import { SsoComponent } from './accounts/sso.component';
|
||||
import { TwoFactorComponent } from './accounts/two-factor.component';
|
||||
@@ -39,7 +38,6 @@ import {
|
||||
TwoFactorSetupComponent as OrgTwoFactorSetupComponent,
|
||||
} from './organizations/settings/two-factor-setup.component';
|
||||
|
||||
import { FamiliesForEnterpriseSetupComponent } from './organizations/sponsorships/families-for-enterprise-setup.component';
|
||||
import { ExportComponent as OrgExportComponent } from './organizations/tools/export.component';
|
||||
import {
|
||||
ExposedPasswordsReportComponent as OrgExposedPasswordsReportComponent,
|
||||
@@ -99,7 +97,6 @@ import { Permissions } from 'jslib-common/enums/permissions';
|
||||
|
||||
import { EmergencyAccessViewComponent } from './settings/emergency-access-view.component';
|
||||
import { EmergencyAccessComponent } from './settings/emergency-access.component';
|
||||
import { SponsoredFamiliesComponent } from './settings/sponsored-families.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
@@ -173,12 +170,6 @@ const routes: Routes = [
|
||||
canActivate: [AuthGuardService],
|
||||
data: { titleId: 'updateTempPassword' },
|
||||
},
|
||||
{
|
||||
path: 'remove-password',
|
||||
component: RemovePasswordComponent,
|
||||
canActivate: [AuthGuardService],
|
||||
data: { titleId: 'removeMasterPassword' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -225,11 +216,6 @@ const routes: Routes = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'sponsored-families',
|
||||
component: SponsoredFamiliesComponent,
|
||||
data: { titleId: 'sponsoredFamilies' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -273,7 +259,6 @@ const routes: Routes = [
|
||||
},
|
||||
],
|
||||
},
|
||||
{ path: 'setup/families-for-enterprise', component: FamiliesForEnterpriseSetupComponent },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ import { RouterModule } from '@angular/router';
|
||||
import { ToasterModule } from 'angular2-toaster';
|
||||
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
||||
|
||||
import { AvatarComponent } from './components/avatar.component';
|
||||
import { NestedCheckboxComponent } from './components/nested-checkbox.component';
|
||||
import { PasswordRepromptComponent } from './components/password-reprompt.component';
|
||||
import { PasswordStrengthComponent } from './components/password-strength.component';
|
||||
@@ -29,7 +30,6 @@ import { LoginComponent } from './accounts/login.component';
|
||||
import { RecoverDeleteComponent } from './accounts/recover-delete.component';
|
||||
import { RecoverTwoFactorComponent } from './accounts/recover-two-factor.component';
|
||||
import { RegisterComponent } from './accounts/register.component';
|
||||
import { RemovePasswordComponent } from './accounts/remove-password.component';
|
||||
import { SetPasswordComponent } from './accounts/set-password.component';
|
||||
import { SsoComponent } from './accounts/sso.component';
|
||||
import { TwoFactorOptionsComponent } from './accounts/two-factor-options.component';
|
||||
@@ -90,7 +90,6 @@ import {
|
||||
WeakPasswordsReportComponent as OrgWeakPasswordsReportComponent,
|
||||
} from './organizations/tools/weak-passwords-report.component';
|
||||
|
||||
import { FamiliesForEnterpriseSetupComponent } from './organizations/sponsorships/families-for-enterprise-setup.component';
|
||||
import { AddEditComponent as OrgAddEditComponent } from './organizations/vault/add-edit.component';
|
||||
import { AttachmentsComponent as OrgAttachmentsComponent } from './organizations/vault/attachments.component';
|
||||
import { CiphersComponent as OrgCiphersComponent } from './organizations/vault/ciphers.component';
|
||||
@@ -131,8 +130,6 @@ import { PremiumComponent } from './settings/premium.component';
|
||||
import { ProfileComponent } from './settings/profile.component';
|
||||
import { PurgeVaultComponent } from './settings/purge-vault.component';
|
||||
import { SettingsComponent } from './settings/settings.component';
|
||||
import { SponsoredFamiliesComponent } from './settings/sponsored-families.component';
|
||||
import { SponsoringOrgRowComponent } from './settings/sponsoring-org-row.component';
|
||||
import { TaxInfoComponent } from './settings/tax-info.component';
|
||||
import { TwoFactorAuthenticatorComponent } from './settings/two-factor-authenticator.component';
|
||||
import { TwoFactorDuoComponent } from './settings/two-factor-duo.component';
|
||||
@@ -178,10 +175,8 @@ import { VaultComponent } from './vault/vault.component';
|
||||
|
||||
import { ProvidersComponent } from './providers/providers.component';
|
||||
|
||||
import { AvatarComponent } from 'jslib-angular/components/avatar.component';
|
||||
import { CalloutComponent } from 'jslib-angular/components/callout.component';
|
||||
import { IconComponent } from 'jslib-angular/components/icon.component';
|
||||
import { VerifyMasterPasswordComponent } from 'jslib-angular/components/verify-master-password.component';
|
||||
|
||||
import { A11yTitleDirective } from 'jslib-angular/directives/a11y-title.directive';
|
||||
import { ApiActionDirective } from 'jslib-angular/directives/api-action.directive';
|
||||
@@ -308,7 +303,6 @@ registerLocaleData(localeZhTw, 'zh-TW');
|
||||
SetPasswordComponent,
|
||||
AddCreditComponent,
|
||||
AddEditComponent,
|
||||
AddEditCustomFieldsComponent,
|
||||
AdjustPaymentComponent,
|
||||
AdjustSubscription,
|
||||
AdjustStorageComponent,
|
||||
@@ -349,7 +343,6 @@ registerLocaleData(localeZhTw, 'zh-TW');
|
||||
ExportComponent,
|
||||
ExposedPasswordsReportComponent,
|
||||
FallbackSrcDirective,
|
||||
FamiliesForEnterpriseSetupComponent,
|
||||
FolderAddEditComponent,
|
||||
FooterComponent,
|
||||
FrontendLayoutComponent,
|
||||
@@ -426,8 +419,6 @@ registerLocaleData(localeZhTw, 'zh-TW');
|
||||
SendComponent,
|
||||
SettingsComponent,
|
||||
ShareComponent,
|
||||
SponsoredFamiliesComponent,
|
||||
SponsoringOrgRowComponent,
|
||||
SsoComponent,
|
||||
StopClickDirective,
|
||||
StopPropDirective,
|
||||
@@ -469,8 +460,6 @@ registerLocaleData(localeZhTw, 'zh-TW');
|
||||
ResetPasswordPolicyComponent,
|
||||
VaultTimeoutInputComponent,
|
||||
AddEditCustomFieldsComponent,
|
||||
VerifyMasterPasswordComponent,
|
||||
RemovePasswordComponent,
|
||||
],
|
||||
exports: [
|
||||
A11yTitleDirective,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="modal fade" role="dialog" aria-modal="true" aria-labelledby="sendAddEditTitle">
|
||||
<div class="modal fade" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="sendAddEditTitle">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
|
||||
<form class="modal-content" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate
|
||||
autocomplete="off">
|
||||
|
||||
@@ -11,7 +11,6 @@ import { SendService } from 'jslib-common/abstractions/send.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
import { AddEditComponent as BaseAddEditComponent } from 'jslib-angular/components/send/add-edit.component';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-send-add-edit',
|
||||
@@ -21,10 +20,9 @@ export class AddEditComponent extends BaseAddEditComponent {
|
||||
constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService,
|
||||
environmentService: EnvironmentService, datePipe: DatePipe,
|
||||
sendService: SendService, userService: UserService,
|
||||
messagingService: MessagingService, policyService: PolicyService,
|
||||
logService: LogService) {
|
||||
messagingService: MessagingService, policyService: PolicyService) {
|
||||
super(i18nService, platformUtilsService, environmentService, datePipe, sendService, userService,
|
||||
messagingService, policyService, logService);
|
||||
messagingService, policyService);
|
||||
}
|
||||
|
||||
async copyLinkToClipboard(link: string): Promise<void | boolean> {
|
||||
|
||||
@@ -13,7 +13,6 @@ import { AddEditComponent } from './add-edit.component';
|
||||
|
||||
import { EnvironmentService } from 'jslib-common/abstractions/environment.service';
|
||||
import { I18nService } from 'jslib-common/abstractions/i18n.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { PolicyService } from 'jslib-common/abstractions/policy.service';
|
||||
import { SearchService } from 'jslib-common/abstractions/search.service';
|
||||
@@ -35,10 +34,9 @@ export class SendComponent extends BaseSendComponent {
|
||||
constructor(sendService: SendService, i18nService: I18nService,
|
||||
platformUtilsService: PlatformUtilsService, environmentService: EnvironmentService,
|
||||
ngZone: NgZone, searchService: SearchService, policyService: PolicyService, userService: UserService,
|
||||
private modalService: ModalService, private broadcasterService: BroadcasterService,
|
||||
logService: LogService) {
|
||||
private modalService: ModalService, private broadcasterService: BroadcasterService) {
|
||||
super(sendService, i18nService, platformUtilsService, environmentService, ngZone, searchService,
|
||||
policyService, userService, logService);
|
||||
policyService, userService);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
@@ -74,9 +74,6 @@ export class EventService {
|
||||
case EventType.User_UpdatedTempPassword:
|
||||
msg = humanReadableMsg = this.i18nService.t('updatedMasterPassword');
|
||||
break;
|
||||
case EventType.User_MigratedKeyToKeyConnector:
|
||||
msg = humanReadableMsg = this.i18nService.t('migratedKeyConnector');
|
||||
break;
|
||||
// Cipher
|
||||
case EventType.Cipher_Created:
|
||||
msg = this.i18nService.t('createdItemId', this.formatCipherId(ev, options));
|
||||
@@ -213,10 +210,6 @@ export class EventService {
|
||||
msg = this.i18nService.t('eventResetSsoLink', this.formatOrgUserId(ev));
|
||||
humanReadableMsg = this.i18nService.t('eventResetSsoLink', this.getShortId(ev.organizationUserId));
|
||||
break;
|
||||
case EventType.OrganizationUser_FirstSsoLogin:
|
||||
msg = this.i18nService.t('firstSsoLogin', this.formatOrgUserId(ev));
|
||||
humanReadableMsg = this.i18nService.t('firstSsoLogin', this.getShortId(ev.organizationUserId));
|
||||
break;
|
||||
// Org
|
||||
case EventType.Organization_Updated:
|
||||
msg = humanReadableMsg = this.i18nService.t('editedOrgSettings');
|
||||
@@ -232,18 +225,6 @@ export class EventService {
|
||||
case EventType.Organization_VaultAccessed:
|
||||
msg = humanReadableMsg = this.i18nService.t('vaultAccessedByProvider');
|
||||
break;
|
||||
case EventType.Organization_EnabledSso:
|
||||
msg = humanReadableMsg = this.i18nService.t('enabledSso');
|
||||
break;
|
||||
case EventType.Organization_DisabledSso:
|
||||
msg = humanReadableMsg = this.i18nService.t('disabledSso');
|
||||
break;
|
||||
case EventType.Organization_EnabledKeyConnector:
|
||||
msg = humanReadableMsg = this.i18nService.t('enabledKeyConnector');
|
||||
break;
|
||||
case EventType.Organization_DisabledKeyConnector:
|
||||
msg = humanReadableMsg = this.i18nService.t('disabledKeyConnector');
|
||||
break;
|
||||
// Policies
|
||||
case EventType.Policy_Updated:
|
||||
msg = this.i18nService.t('modifiedPolicyId', this.formatPolicyId(ev));
|
||||
|
||||
@@ -42,7 +42,6 @@ import { ExportService } from 'jslib-common/services/export.service';
|
||||
import { FileUploadService } from 'jslib-common/services/fileUpload.service';
|
||||
import { FolderService } from 'jslib-common/services/folder.service';
|
||||
import { ImportService } from 'jslib-common/services/import.service';
|
||||
import { KeyConnectorService } from 'jslib-common/services/keyConnector.service';
|
||||
import { NotificationsService } from 'jslib-common/services/notifications.service';
|
||||
import { PasswordGenerationService } from 'jslib-common/services/passwordGeneration.service';
|
||||
import { PolicyService } from 'jslib-common/services/policy.service';
|
||||
@@ -54,7 +53,6 @@ import { SyncService } from 'jslib-common/services/sync.service';
|
||||
import { TokenService } from 'jslib-common/services/token.service';
|
||||
import { TotpService } from 'jslib-common/services/totp.service';
|
||||
import { UserService } from 'jslib-common/services/user.service';
|
||||
import { UserVerificationService } from 'jslib-common/services/userVerification.service';
|
||||
import { VaultTimeoutService } from 'jslib-common/services/vaultTimeout.service';
|
||||
import { WebCryptoFunctionService } from 'jslib-common/services/webCryptoFunction.service';
|
||||
|
||||
@@ -72,7 +70,6 @@ import { FileUploadService as FileUploadServiceAbstraction } from 'jslib-common
|
||||
import { FolderService as FolderServiceAbstraction } from 'jslib-common/abstractions/folder.service';
|
||||
import { I18nService as I18nServiceAbstraction } from 'jslib-common/abstractions/i18n.service';
|
||||
import { ImportService as ImportServiceAbstraction } from 'jslib-common/abstractions/import.service';
|
||||
import { KeyConnectorService as KeyConnectorServiceAbstraction } from 'jslib-common/abstractions/keyConnector.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { MessagingService as MessagingServiceAbstraction } from 'jslib-common/abstractions/messaging.service';
|
||||
import { NotificationsService as NotificationsServiceAbstraction } from 'jslib-common/abstractions/notifications.service';
|
||||
@@ -91,7 +88,6 @@ import { SyncService as SyncServiceAbstraction } from 'jslib-common/abstractions
|
||||
import { TokenService as TokenServiceAbstraction } from 'jslib-common/abstractions/token.service';
|
||||
import { TotpService as TotpServiceAbstraction } from 'jslib-common/abstractions/totp.service';
|
||||
import { UserService as UserServiceAbstraction } from 'jslib-common/abstractions/user.service';
|
||||
import { UserVerificationService as UserVerificationServiceAbstraction } from 'jslib-common/abstractions/userVerification.service';
|
||||
import { VaultTimeoutService as VaultTimeoutServiceAbstraction } from 'jslib-common/abstractions/vaultTimeout.service';
|
||||
import { ModalService } from './modal.service';
|
||||
|
||||
@@ -120,7 +116,7 @@ const settingsService = new SettingsService(userService, storageService);
|
||||
export let searchService: SearchService = null;
|
||||
const fileUploadService = new FileUploadService(consoleLogService, apiService);
|
||||
const cipherService = new CipherService(cryptoService, userService, settingsService,
|
||||
apiService, fileUploadService, storageService, i18nService, () => searchService, consoleLogService);
|
||||
apiService, fileUploadService, storageService, i18nService, () => searchService);
|
||||
const folderService = new FolderService(cryptoService, userService, apiService, storageService,
|
||||
i18nService, cipherService);
|
||||
const collectionService = new CollectionService(cryptoService, userService, storageService, i18nService);
|
||||
@@ -128,29 +124,25 @@ searchService = new SearchService(cipherService, consoleLogService, i18nService)
|
||||
const policyService = new PolicyService(userService, storageService, apiService);
|
||||
const sendService = new SendService(cryptoService, userService, apiService, fileUploadService, storageService,
|
||||
i18nService, cryptoFunctionService);
|
||||
const keyConnectorService = new KeyConnectorService(storageService, userService, cryptoService, apiService,
|
||||
tokenService, consoleLogService);
|
||||
const vaultTimeoutService = new VaultTimeoutService(cipherService, folderService, collectionService,
|
||||
cryptoService, platformUtilsService, storageService, messagingService, searchService, userService, tokenService,
|
||||
policyService, keyConnectorService, null, async () => messagingService.send('logout', { expired: false }));
|
||||
policyService, null, async () => messagingService.send('logout', { expired: false }));
|
||||
const syncService = new SyncService(userService, apiService, settingsService,
|
||||
folderService, cipherService, cryptoService, collectionService, storageService, messagingService, policyService,
|
||||
sendService, consoleLogService, tokenService, keyConnectorService,
|
||||
async (expired: boolean) => messagingService.send('logout', { expired: expired }));
|
||||
sendService, async (expired: boolean) => messagingService.send('logout', { expired: expired }));
|
||||
const passwordGenerationService = new PasswordGenerationService(cryptoService, storageService, policyService);
|
||||
const totpService = new TotpService(storageService, cryptoFunctionService, consoleLogService);
|
||||
const totpService = new TotpService(storageService, cryptoFunctionService);
|
||||
const containerService = new ContainerService(cryptoService);
|
||||
const authService = new AuthService(cryptoService, apiService,
|
||||
userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService, vaultTimeoutService,
|
||||
consoleLogService, cryptoFunctionService, environmentService, keyConnectorService);
|
||||
consoleLogService);
|
||||
const exportService = new ExportService(folderService, cipherService, apiService, cryptoService);
|
||||
const importService = new ImportService(cipherService, folderService, apiService, i18nService, collectionService,
|
||||
platformUtilsService, cryptoService);
|
||||
const notificationsService = new NotificationsService(userService, syncService, appIdService, apiService, vaultTimeoutService,
|
||||
environmentService, async () => messagingService.send('logout', { expired: true }), consoleLogService);
|
||||
const auditService = new AuditService(cryptoFunctionService, apiService);
|
||||
const eventLoggingService = new EventLoggingService(storageService, apiService, userService, cipherService, consoleLogService);
|
||||
const userVerificationService = new UserVerificationService(cryptoService, i18nService, apiService);
|
||||
const eventLoggingService = new EventLoggingService(storageService, apiService, userService, cipherService);
|
||||
|
||||
containerService.attachToWindow(window);
|
||||
|
||||
@@ -234,8 +226,6 @@ export function initFactory(): Function {
|
||||
{ provide: EventLoggingServiceAbstraction, useValue: eventLoggingService },
|
||||
{ provide: PolicyServiceAbstraction, useValue: policyService },
|
||||
{ provide: SendServiceAbstraction, useValue: sendService },
|
||||
{ provide: KeyConnectorServiceAbstraction, useValue: keyConnectorService },
|
||||
{ provide: UserVerificationServiceAbstraction, useValue: userVerificationService },
|
||||
{ provide: PasswordRepromptServiceAbstraction, useClass: PasswordRepromptService },
|
||||
{ provide: LogService, useValue: consoleLogService },
|
||||
{
|
||||
|
||||
@@ -2,24 +2,18 @@
|
||||
<h1>{{'myAccount' | i18n}}</h1>
|
||||
</div>
|
||||
<app-profile></app-profile>
|
||||
<ng-container *ngIf="showChangeEmail">
|
||||
<div class="secondary-header">
|
||||
<h1>{{'changeEmail' | i18n}}</h1>
|
||||
</div>
|
||||
<app-change-email></app-change-email>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="showChangePassword">
|
||||
<div class="secondary-header">
|
||||
<h1>{{'changeMasterPassword' | i18n}}</h1>
|
||||
</div>
|
||||
<app-change-password></app-change-password>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="showChangeKdf">
|
||||
<div class="secondary-header">
|
||||
<h1>{{'encKeySettings' | i18n}}</h1>
|
||||
</div>
|
||||
<app-change-kdf></app-change-kdf>
|
||||
</ng-container>
|
||||
<div class="secondary-header">
|
||||
<h1>{{'changeEmail' | i18n}}</h1>
|
||||
</div>
|
||||
<app-change-email></app-change-email>
|
||||
<div class="secondary-header">
|
||||
<h1>{{'changeMasterPassword' | i18n}}</h1>
|
||||
</div>
|
||||
<app-change-password></app-change-password>
|
||||
<div class="secondary-header">
|
||||
<h1>{{'encKeySettings' | i18n}}</h1>
|
||||
</div>
|
||||
<app-change-kdf></app-change-kdf>
|
||||
<div class="secondary-header border-0 mb-0">
|
||||
<h1>{{'apiKey' | i18n}}</h1>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,6 @@ import { DeleteAccountComponent } from './delete-account.component';
|
||||
import { PurgeVaultComponent } from './purge-vault.component';
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { KeyConnectorService } from 'jslib-common/abstractions/keyConnector.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
import { ModalService } from 'jslib-angular/services/modal.service';
|
||||
@@ -26,17 +25,8 @@ export class AccountComponent {
|
||||
@ViewChild('viewUserApiKeyTemplate', { read: ViewContainerRef, static: true }) viewUserApiKeyModalRef: ViewContainerRef;
|
||||
@ViewChild('rotateUserApiKeyTemplate', { read: ViewContainerRef, static: true }) rotateUserApiKeyModalRef: ViewContainerRef;
|
||||
|
||||
showChangePassword = true;
|
||||
showChangeKdf = true;
|
||||
showChangeEmail = true;
|
||||
|
||||
constructor(private modalService: ModalService, private apiService: ApiService,
|
||||
private userService: UserService, private keyConnectorService: KeyConnectorService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.showChangeEmail = this.showChangeKdf = this.showChangePassword =
|
||||
!await this.keyConnectorService.getUsesKeyConnector();
|
||||
}
|
||||
private userService: UserService) { }
|
||||
|
||||
async deauthorizeSessions() {
|
||||
await this.modalService.openViewRef(DeauthorizeSessionsComponent, this.deauthModalRef);
|
||||
|
||||
@@ -10,7 +10,6 @@ import {
|
||||
|
||||
import { ApiService } from 'jslib-common/abstractions/api.service';
|
||||
import { PayPalConfig } from 'jslib-common/abstractions/environment.service';
|
||||
import { LogService } from 'jslib-common/abstractions/log.service';
|
||||
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
|
||||
import { UserService } from 'jslib-common/abstractions/user.service';
|
||||
|
||||
@@ -46,7 +45,7 @@ export class AddCreditComponent implements OnInit {
|
||||
private email: string;
|
||||
|
||||
constructor(private userService: UserService, private apiService: ApiService,
|
||||
private platformUtilsService: PlatformUtilsService, private logService: LogService) {
|
||||
private platformUtilsService: PlatformUtilsService) {
|
||||
const payPalConfig = process.env.PAYPAL_CONFIG as PayPalConfig;
|
||||
this.ppButtonFormAction = payPalConfig.buttonAction;
|
||||
this.ppButtonBusinessId = payPalConfig.businessId;
|
||||
@@ -99,16 +98,12 @@ export class AddCreditComponent implements OnInit {
|
||||
this.formPromise = this.apiService.postBitPayInvoice(req);
|
||||
const bitPayUrl: string = await this.formPromise;
|
||||
this.platformUtilsService.launchUri(bitPayUrl);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.onAdded.emit();
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
|
||||
cancel() {
|
||||
@@ -125,9 +120,7 @@ export class AddCreditComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
this.creditAmount = '';
|
||||
}
|
||||
|
||||
@@ -135,9 +128,7 @@ export class AddCreditComponent implements OnInit {
|
||||
if (this.creditAmount != null && this.creditAmount !== '') {
|
||||
try {
|
||||
return parseFloat(this.creditAmount);
|
||||
} catch (e) {
|
||||
this.logService.error(e);
|
||||
}
|
||||
} catch { }
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user