本文整理汇总了TypeScript中app/core/ui-services/config.service.ConfigService类的典型用法代码示例。如果您正苦于以下问题:TypeScript service.ConfigService类的具体用法?TypeScript service.ConfigService怎么用?TypeScript service.ConfigService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service.ConfigService类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: constructor
/**
* Constructs this component.
*
* @param {Title} titleService set the browser title
* @param {TranslateService} translate the translation service
* @param {ConfigService} configService The configuration provider
* @param {FormBuilder} formBuilder Form builder
* @param {MotionRepositoryService} repo Motion Repository
* @param {ActivatedRoute} route The activated route
* @param {Router} router The router
* @param {MatSnackBar} matSnackBar Material Design SnackBar
*/
public constructor(
titleService: Title,
protected translate: TranslateService, // protected required for ng-translate-extract
private configService: ConfigService,
private formBuilder: FormBuilder,
private repo: MotionRepositoryService,
private route: ActivatedRoute,
private router: Router,
matSnackBar: MatSnackBar
) {
super(titleService, translate, matSnackBar);
this.createForm();
this.configService.get<number>('motions_line_length').subscribe(lineLength => {
this.lineLength = lineLength;
this.getMotionByUrl();
});
this.configService.get<boolean>('motions_reason_required').subscribe(required => {
this.reasonRequired = required;
});
this.configService.get<boolean>('motions_amendments_multiple_paragraphs').subscribe(allowed => {
this.multipleParagraphsAllowed = allowed;
});
}
开发者ID:CatoTH,项目名称:OpenSlides,代码行数:38,代码来源:amendment-create-wizard.component.ts
示例2: constructor
public constructor(
private operator: OperatorService,
private configService: ConfigService,
private constants: ConstantsService
) {
// load config variables
this.configService
.get<number>('motions_min_supporters')
.subscribe(supporters => (this.configMinSupporters = supporters));
this.configService
.get<boolean>('motions_amendments_enabled')
.subscribe(enabled => (this.amendmentEnabled = enabled));
this.constants
.get<OpenSlidesSettings>('OpenSlidesSettings')
.subscribe(settings => (this.amendmentOfAmendment = settings.MOTIONS_ALLOW_AMENDMENTS_OF_AMENDMENTS));
}
开发者ID:jwinzer,项目名称:OpenSlides,代码行数:16,代码来源:local-permissions.service.ts
示例3: constructor
public constructor(
titleService: Title,
translate: TranslateService,
matSnackBar: MatSnackBar,
private repo: CountdownRepositoryService,
private configService: ConfigService
) {
super(titleService, translate, matSnackBar);
this.configService.get<number>('agenda_countdown_warning_time').subscribe(time => (this.warningTime = time));
}
开发者ID:emanuelschuetze,项目名称:OpenSlides,代码行数:11,代码来源:countdown-controls.component.ts
示例4: motionToDocDef
/**
* Converts a motion to PdfMake doc definition
*
* @param motion the motion to convert to pdf
* @param lnMode determine the used line mode
* @param crMode determine the used change Recommendation mode
* @param contentToExport determine which content is to export. If left out, everything will be exported
* @param infoToExport determine which metaInfo to export. If left out, everything will be exported.
* @param commentsToExport comments to chose for export. If 'allcomments' is set in infoToExport, this selection will be ignored and all comments exported
* @returns doc def for the motion
*/
public motionToDocDef(
motion: ViewMotion,
lnMode?: LineNumberingMode,
crMode?: ChangeRecoMode,
contentToExport?: string[],
infoToExport?: InfoToExport[],
commentsToExport?: number[]
): object {
let motionPdfContent = [];
// Enforces that statutes should always have Diff Mode and no line numbers
if (motion.isStatuteAmendment()) {
lnMode = LineNumberingMode.None;
crMode = ChangeRecoMode.Diff;
}
// determine the default lnMode if not explicitly given
if (!lnMode) {
lnMode = this.configService.instant('motions_default_line_numbering');
}
// determine the default crMode if not explicitly given
if (!crMode) {
crMode = this.configService.instant('motions_recommendation_text_mode');
}
const title = this.createTitle(motion);
const sequential = !infoToExport || infoToExport.includes('id');
const subtitle = this.createSubtitle(motion, sequential);
motionPdfContent = [title, subtitle];
if ((infoToExport && infoToExport.length > 0) || !infoToExport) {
const metaInfo = this.createMetaInfoTable(motion, crMode, infoToExport);
motionPdfContent.push(metaInfo);
}
if (!contentToExport || contentToExport.includes('text')) {
const preamble = this.createPreamble(motion);
motionPdfContent.push(preamble);
const text = this.createText(motion, lnMode, crMode);
motionPdfContent.push(text);
}
if (!contentToExport || contentToExport.includes('reason')) {
const reason = this.createReason(motion, lnMode);
motionPdfContent.push(reason);
}
if (infoToExport && infoToExport.includes('allcomments')) {
commentsToExport = this.commentRepo.getSortedViewModelList().map(vm => vm.id);
}
if (commentsToExport) {
motionPdfContent.push(this.createComments(motion, commentsToExport));
}
return motionPdfContent;
}
开发者ID:CatoTH,项目名称:OpenSlides,代码行数:69,代码来源:motion-pdf.service.ts
示例5: createWelcomeText
/**
* Generates a welcone text according to the events' configuration
*
* @returns pdfMake definitions
*/
private createWelcomeText(): object {
return [
{
text: this.translate.instant(this.configService.instant<string>('users_pdf_welcometitle')),
style: 'userDataHeading'
},
{
text: this.translate.instant(this.configService.instant<string>('users_pdf_welcometext')),
style: 'userDataTopic'
}
];
}
开发者ID:emanuelschuetze,项目名称:OpenSlides,代码行数:17,代码来源:user-pdf.service.ts
示例6: ngOnInit
/**
* Init the component.
*
* Sets the welcomeTitle and welcomeText.
*/
public ngOnInit(): void {
super.setTitle('Home');
// set the welcome title
this.configService
.get<string>('general_event_welcome_title')
.subscribe(welcomeTitle => (this.welcomeTitle = welcomeTitle));
// set the welcome text
this.configService
.get<string>('general_event_welcome_text')
.subscribe(welcomeText => (this.welcomeText = welcomeText as string));
}
开发者ID:CatoTH,项目名称:OpenSlides,代码行数:18,代码来源:start.component.ts
示例7: createUserAccessContent
/**
* Creates access information (login name, initial password) for the given user,
* additionally encoded in a qr code
*
* @param user
* @returns pdfMake definitions
*/
private createUserAccessContent(user: ViewUser): object {
const columnOpenSlides: object[] = [
{
text: this.translate.instant('OpenSlides access data'),
style: 'userDataHeading'
},
{
text: this.translate.instant('Username') + ':',
style: 'userDataTopic'
},
{
text: user.username,
style: 'userDataValue'
},
{
text: this.translate.instant('Initial password') + ':',
style: 'userDataTopic'
},
{
text: user.default_password,
style: 'userDataValue'
},
{
text: 'URL:',
style: 'userDataTopic'
},
{
text: this.configService.instant<string>('users_pdf_url') || '-',
link: this.configService.instant<string>('users_pdf_url'),
style: 'userDataValue'
},
{
text: '\n'
}
];
// url qr code
if (this.configService.instant<string>('users_pdf_url')) {
columnOpenSlides.push(
{
qr: this.configService.instant<string>('users_pdf_url'),
fit: 120,
margin: [0, 0, 0, 8]
},
{
text: this.translate.instant('Scan this QR code to open URL.'),
style: 'small'
}
);
}
return columnOpenSlides;
}
开发者ID:emanuelschuetze,项目名称:OpenSlides,代码行数:58,代码来源:user-pdf.service.ts
示例8: createWifiAccessContent
/**
* Creates the wifi access data, including qr code, for the configured event wlan parameters
*
* @returns pdfMake definitions
*/
private createWifiAccessContent(): object {
const wifiColumn: object[] = [
{
text: this.translate.instant('WLAN access data'),
style: 'userDataHeading'
},
{
text: this.translate.instant('WLAN name (SSID)') + ':',
style: 'userDataTopic'
},
{
text: this.configService.instant<string>('users_pdf_wlan_ssid') || '-',
style: 'userDataValue'
},
{
text: this.translate.instant('WLAN password') + ':',
style: 'userDataTopic'
},
{
text: this.configService.instant<string>('users_pdf_wlan_password') || '-',
style: 'userDataValue'
},
{
text: this.translate.instant('WLAN encryption') + ':',
style: 'userDataTopic'
},
{
text: this.configService.instant<string>('users_pdf_wlan_encryption') || '-',
style: 'userDataValue'
},
{
text: '\n'
}
];
if (
this.configService.instant<string>('users_pdf_wlan_ssid') &&
this.configService.instant<string>('users_pdf_wlan_encryption')
) {
const wifiQrCode =
'WIFI:S:' +
this.configService.instant<string>('users_pdf_wlan_ssid') +
';T:' +
this.configService.instant<string>('users_pdf_wlan_encryption') +
';P:' +
this.configService.instant<string>('users_pdf_wlan_password') +
';;';
wifiColumn.push(
{
qr: wifiQrCode,
fit: 120,
margin: [0, 0, 0, 8]
},
{
text: this.translate.instant('Scan this QR code to connect to WLAN.'),
style: 'small'
}
);
}
return wifiColumn;
}
开发者ID:emanuelschuetze,项目名称:OpenSlides,代码行数:65,代码来源:user-pdf.service.ts
示例9: if
this.operator.getViewUserObservable().subscribe(user => {
if (user) {
this.username = user.short_name;
} else if (!user && configService.instant<boolean>('general_system_enable_anonymous')) {
this.username = translate.instant('Guest');
}
this.isLoggedIn = !!user;
});
开发者ID:CatoTH,项目名称:OpenSlides,代码行数:8,代码来源:site.component.ts
示例10: createText
/**
* Creates the motion text - uses HTML to PDF
*
* @param motion the motion to convert to pdf
* @param lnMode determine the used line mode
* @param crMode determine the used change Recommendation mode
* @returns doc def for the "the assembly may decide" preamble
*/
private createText(motion: ViewMotion, lnMode: LineNumberingMode, crMode: ChangeRecoMode): object {
let motionText: string;
// get the line length from the config
const lineLength = this.configService.instant<number>('motions_line_length');
if (motion.isParagraphBasedAmendment()) {
motionText = '';
// this is logically redundant with the formation of amendments in the motion-detail html.
// Should be refactored in a way that a service returns the correct html for both cases
for (const paragraph of this.motionRepo.getAmendedParagraphs(motion, lineLength)) {
if (paragraph.diffLineTo === paragraph.diffLineFrom + 1) {
motionText += `<h3>
${this.translate.instant('Line')} ${paragraph.diffLineFrom}:
</h3>`;
} else {
motionText += `<h3>
${this.translate.instant('Line')} ${paragraph.diffLineFrom} - ${paragraph.diffLineTo - 1}:
</h3>`;
}
motionText += `<div class="paragraphcontext">${paragraph.textPre}</div>`;
motionText += paragraph.text;
motionText += `<div class="paragraphcontext">${paragraph.textPost}</div>`;
}
} else if (motion.isStatuteAmendment()) {
// statute amendments
const statutes = this.statuteRepo.getViewModelList();
motionText = this.motionRepo.formatStatuteAmendment(statutes, motion, lineLength);
} else {
// lead motion or normal amendments
// TODO: Consider tile change recommendation
const changes: ViewUnifiedChange[] = Object.assign(
[],
this.changeRecoRepo.getChangeRecoOfMotion(motion.id)
);
// TODO: Cleanup, everything change reco and amendment based needs a unified structure.
const amendments = this.motionRepo.getAmendmentsInstantly(motion.id);
if (amendments) {
for (const amendment of amendments) {
const changedParagraphs = this.motionRepo.getAmendmentAmendedParagraphs(amendment, lineLength);
for (const change of changedParagraphs) {
changes.push(change as ViewUnifiedChange);
}
}
}
// changes need to be sorted, by "line from".
// otherwise, formatMotion will make unexpected results by messing up the
// order of changes applied to the motion
changes.sort((a, b) => a.getLineFrom() - b.getLineFrom());
motionText = this.motionRepo.formatMotion(motion.id, crMode, changes, lineLength);
// reformat motion text to split long HTML elements to easier convert into PDF
motionText = this.linenumberingService.splitInlineElementsAtLineBreaks(motionText);
}
return this.htmlToPdfService.convertHtml(motionText, lnMode);
}
开发者ID:tsiegleauq,项目名称:OpenSlides,代码行数:66,代码来源:motion-pdf.service.ts
注:本文中的app/core/ui-services/config.service.ConfigService类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论