Skip to content

Modular logistics and supply chain operating system (LSOS)

3.3 KB
Raw Blame
{{#if this.isVisible}}
    <ContentPanel @title={{t "auth.login.oauth.connected-accounts"}} @open={{true}} @wrapperClass="bordered-classic">
        <p class="text-sm text-gray-700 dark:text-gray-300 mb-4">{{t "auth.login.oauth.connected-accounts-help"}}</p>

        {{#if this.identities.length}}
            <h4 class="text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400 mb-2">{{t "auth.login.oauth.linked-heading"}}</h4>
            <div class="space-y-2" data-test-linked-providers>
                {{#each this.identities as |identity|}}
                    <div class="flex items-center justify-between rounded-md border border-gray-200 dark:border-gray-700 px-3 py-2">
                        <div class="flex items-center">
                            <span class="mr-3 inline-flex text-gray-700 dark:text-gray-200">
                                <Auth::OauthProviderLogo @provider={{identity.provider}} @icon={{identity.icon}} />
                            </span>
                            <div>
                                <div class="text-sm font-semibold text-gray-900 dark:text-white">{{identity.label}}</div>
                                {{#if identity.provider_email}}
                                    <div class="text-xs text-gray-500 dark:text-gray-400">{{identity.provider_email}}</div>
                                {{/if}}
                            </div>
                        </div>
                        <Button
                            @size="xs"
                            @type="danger"
                            @icon="link-slash"
                            @text={{t "auth.login.oauth.unlink-button"}}
                            @disabled={{this.isLastCredential identity}}
                            @helpText={{if (this.isLastCredential identity) (t "auth.login.oauth.errors.last-credential")}}
                            @isLoading={{this.unlink.isRunning}}
                            @onClick={{fn this.confirmUnlink identity}}
                        />
                    </div>
                {{/each}}
            </div>
        {{/if}}

        {{#if this.available.length}}
            <h4 class="text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400 mb-2 {{if this.identities.length 'mt-5'}}">
                {{t "auth.login.oauth.available-heading"}}
            </h4>
            <div class="space-y-2" data-test-available-providers>
                {{#each this.available as |provider|}}
                    <div class="flex items-center justify-between rounded-md border border-dashed border-gray-300 dark:border-gray-700 px-3 py-2">
                        <div class="flex items-center">
                            <span class="mr-3 inline-flex text-gray-700 dark:text-gray-200">
                                <Auth::OauthProviderLogo @provider={{provider.id}} @icon={{provider.icon}} />
                            </span>
                            <div class="text-sm text-gray-700 dark:text-gray-300">{{provider.label}}</div>
                        </div>
                        <Button @size="xs" @icon="link" @text={{t "auth.login.oauth.link-button"}} @isLoading={{this.link.isRunning}} @onClick={{perform this.link provider}} />
                    </div>
                {{/each}}
            </div>
        {{/if}}
    </ContentPanel>
{{/if}}